Skip to content
This repository was archived by the owner on Dec 31, 2022. It is now read-only.

Commit 39c20a7

Browse files
authored
Merge pull request #8 from sunrise-php/release/v1.1.0
v1.1.0
2 parents 8698484 + d30bcdb commit 39c20a7

File tree

9 files changed

+90
-56
lines changed

9 files changed

+90
-56
lines changed

.editorconfig

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,5 @@ insert_final_newline = true
1414
[*.md]
1515
trim_trailing_whitespace = false
1616

17-
[*.php]
18-
indent_style = tab
19-
2017
[*.yml]
2118
indent_size = 2

.gitignore

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
.php_cs.cache
2+
.phpunit.result.cache
13
composer.lock
24
coverage.xml
5+
phpcs.xml
6+
phpunit.xml
37
vendor/

.travis.yml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,8 @@ matrix:
55
- php: 7.1
66
- php: 7.2
77
- php: 7.3
8+
- php: 7.4
9+
- php: nightly
810
fast_finish: true
911

1012
before_install:
@@ -13,4 +15,4 @@ before_install:
1315
install:
1416
- travis_retry composer install --no-interaction --prefer-source --no-suggest
1517

16-
script: vendor/bin/phpunit --colors=always --coverage-text
18+
script: php vendor/bin/phpunit --colors=always --coverage-text

LICENSE

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
MIT License
22

3-
Copyright (c) 2018 Anatoly Fenric
3+
Copyright (c) 2018 Sunrise // PHP
44

55
Permission is hereby granted, free of charge, to any person obtaining a copy
66
of this software and associated documentation files (the "Software"), to deal

README.md

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
1-
## HTTP factory for PHP 7.1+ based on PSR-17
1+
## HTTP factory for PHP 7.1+ (incl. PHP 8) based on PSR-17
22

33
[![Gitter](https://badges.gitter.im/sunrise-php/support.png)](https://gitter.im/sunrise-php/support)
4-
[![Build Status](https://api.travis-ci.com/sunrise-php/http-factory.svg?branch=master)](https://travis-ci.com/sunrise-php/http-factory)
4+
[![Build Status](https://scrutinizer-ci.com/g/sunrise-php/http-factory/badges/build.png?b=master)](https://scrutinizer-ci.com/g/sunrise-php/http-factory/build-status/master)
55
[![Latest Stable Version](https://poser.pugx.org/sunrise/http-factory/v/stable)](https://packagist.org/packages/sunrise/http-factory)
66
[![Total Downloads](https://poser.pugx.org/sunrise/http-factory/downloads)](https://packagist.org/packages/sunrise/http-factory)
77
[![License](https://poser.pugx.org/sunrise/http-factory/license)](https://packagist.org/packages/sunrise/http-factory)
@@ -38,10 +38,6 @@ use Sunrise\Http\Factory\UriFactory;
3838
php vendor/bin/phpunit
3939
```
4040

41-
## Api documentation
42-
43-
https://phpdoc.fenric.ru/
44-
4541
## Useful links
4642

47-
https://www.php-fig.org/psr/psr-17/
43+
* https://www.php-fig.org/psr/psr-17/

composer.json

Lines changed: 19 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,17 @@
11
{
22
"name": "sunrise/http-factory",
3-
"description": "Sunrise HTTP factory for PHP 7.1+ based on PSR-17",
4-
"keywords": ["fenric", "sunrise", "http", "http-factory", "psr-17"],
53
"homepage": "https://github.com/sunrise-php/http-factory",
4+
"description": "Sunrise HTTP factory for PHP 7.1+ based on PSR-17",
65
"license": "MIT",
6+
"keywords": [
7+
"fenric",
8+
"sunrise",
9+
"http",
10+
"http-factory",
11+
"psr-17",
12+
"php7",
13+
"php8"
14+
],
715
"authors": [
816
{
917
"name": "Anatoly Fenric",
@@ -12,15 +20,15 @@
1220
}
1321
],
1422
"require": {
15-
"php": "^7.1",
16-
"sunrise/http-message": "^1.0.9",
17-
"sunrise/http-server-request": "^1.0.5",
18-
"sunrise/stream": "^1.0.15",
19-
"sunrise/uri": "^1.0.19"
23+
"php": "^7.1|^8.0",
24+
"sunrise/http-message": "^1.4",
25+
"sunrise/http-server-request": "^1.1",
26+
"sunrise/stream": "^1.2",
27+
"sunrise/uri": "^1.2"
2028
},
2129
"require-dev": {
22-
"phpunit/phpunit": "7.5.6",
23-
"http-interop/http-factory-tests": "0.5.0"
30+
"phpunit/phpunit": "7.5.20|9.5.0",
31+
"sunrise/coding-standard": "1.0.0"
2432
},
2533
"provide": {
2634
"psr/http-factory-implementation": "1.0"
@@ -32,7 +40,8 @@
3240
},
3341
"scripts": {
3442
"test": [
35-
"phpunit --colors=always --coverage-text"
43+
"phpunit --colors=always --coverage-text",
44+
"phpcs"
3645
]
3746
}
3847
}

phpcs.xml.dist

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
<?xml version="1.0"?>
2+
<ruleset name="Sunrise Coding Standard">
3+
<rule ref="./vendor/sunrise/coding-standard/ruleset.xml"/>
4+
5+
<file>src</file>
6+
<file>tests</file>
7+
</ruleset>

phpunit.xml.dist

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,6 @@
44
<testsuite name="Sunrise HTTP Factory Test Suite">
55
<directory>./tests/</directory>
66
</testsuite>
7-
<testsuite name="Integration tests">
8-
<directory>./vendor/http-interop/http-factory-tests/test</directory>
9-
</testsuite>
107
</testsuites>
118
<filter>
129
<whitelist>

tests/FactoryTest.php

Lines changed: 53 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,10 @@
1-
<?php
1+
<?php declare(strict_types=1);
22

33
namespace Sunrise\Http\Factory\Tests;
44

5+
/**
6+
* Import classes
7+
*/
58
use PHPUnit\Framework\TestCase;
69
use Psr\Http\Message\RequestFactoryInterface;
710
use Psr\Http\Message\ResponseFactoryInterface;
@@ -16,47 +19,66 @@
1619
use Sunrise\Http\Factory\UploadedFileFactory;
1720
use Sunrise\Http\Factory\UriFactory;
1821

22+
/**
23+
* FactoryTest
24+
*/
1925
class FactoryTest extends TestCase
2026
{
21-
public function testRequestFactory()
22-
{
23-
$factory = new RequestFactory();
2427

25-
$this->assertInstanceOf(RequestFactoryInterface::class, $factory);
26-
}
28+
/**
29+
* @return void
30+
*/
31+
public function testRequestFactory() : void
32+
{
33+
$factory = new RequestFactory();
2734

28-
public function testResponseFactory()
29-
{
30-
$factory = new ResponseFactory();
35+
$this->assertInstanceOf(RequestFactoryInterface::class, $factory);
36+
}
3137

32-
$this->assertInstanceOf(ResponseFactoryInterface::class, $factory);
33-
}
38+
/**
39+
* @return void
40+
*/
41+
public function testResponseFactory() : void
42+
{
43+
$factory = new ResponseFactory();
3444

35-
public function testServerRequestFactory()
36-
{
37-
$factory = new ServerRequestFactory();
45+
$this->assertInstanceOf(ResponseFactoryInterface::class, $factory);
46+
}
3847

39-
$this->assertInstanceOf(ServerRequestFactoryInterface::class, $factory);
40-
}
48+
public function testServerRequestFactory() : void
49+
{
50+
$factory = new ServerRequestFactory();
4151

42-
public function testStreamFactory()
43-
{
44-
$factory = new StreamFactory();
52+
$this->assertInstanceOf(ServerRequestFactoryInterface::class, $factory);
53+
}
4554

46-
$this->assertInstanceOf(StreamFactoryInterface::class, $factory);
47-
}
55+
/**
56+
* @return void
57+
*/
58+
public function testStreamFactory() : void
59+
{
60+
$factory = new StreamFactory();
4861

49-
public function testUploadedFileFactory()
50-
{
51-
$factory = new UploadedFileFactory();
62+
$this->assertInstanceOf(StreamFactoryInterface::class, $factory);
63+
}
5264

53-
$this->assertInstanceOf(UploadedFileFactoryInterface::class, $factory);
54-
}
65+
/**
66+
* @return void
67+
*/
68+
public function testUploadedFileFactory() : void
69+
{
70+
$factory = new UploadedFileFactory();
5571

56-
public function testUriFactory()
57-
{
58-
$factory = new UriFactory();
72+
$this->assertInstanceOf(UploadedFileFactoryInterface::class, $factory);
73+
}
5974

60-
$this->assertInstanceOf(UriFactoryInterface::class, $factory);
61-
}
75+
/**
76+
* @return void
77+
*/
78+
public function testUriFactory() : void
79+
{
80+
$factory = new UriFactory();
81+
82+
$this->assertInstanceOf(UriFactoryInterface::class, $factory);
83+
}
6284
}

0 commit comments

Comments
 (0)