diff --git a/.editorconfig b/.editorconfig
index 2da7375..27e2667 100644
--- a/.editorconfig
+++ b/.editorconfig
@@ -14,8 +14,5 @@ insert_final_newline = true
[*.md]
trim_trailing_whitespace = false
-[*.php]
-indent_style = tab
-
[*.yml]
indent_size = 2
diff --git a/.gitignore b/.gitignore
index c331141..41cf726 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1,3 +1,7 @@
+.php_cs.cache
+.phpunit.result.cache
composer.lock
coverage.xml
+phpcs.xml
+phpunit.xml
vendor/
diff --git a/.travis.yml b/.travis.yml
index 7b697c1..b0e5e8d 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -5,6 +5,8 @@ matrix:
- php: 7.1
- php: 7.2
- php: 7.3
+ - php: 7.4
+ - php: nightly
fast_finish: true
before_install:
@@ -13,4 +15,4 @@ before_install:
install:
- travis_retry composer install --no-interaction --prefer-source --no-suggest
-script: vendor/bin/phpunit --colors=always --coverage-text
+script: php vendor/bin/phpunit --colors=always --coverage-text
diff --git a/LICENSE b/LICENSE
index 4c67e86..19aa2e3 100644
--- a/LICENSE
+++ b/LICENSE
@@ -1,6 +1,6 @@
MIT License
-Copyright (c) 2018 Anatoly Fenric
+Copyright (c) 2018 Sunrise // PHP
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
diff --git a/README.md b/README.md
index 5a5ff6c..46c0bf6 100644
--- a/README.md
+++ b/README.md
@@ -1,7 +1,7 @@
-## HTTP factory for PHP 7.1+ based on PSR-17
+## HTTP factory for PHP 7.1+ (incl. PHP 8) based on PSR-17
[![Gitter](https://badges.gitter.im/sunrise-php/support.png)](https://gitter.im/sunrise-php/support)
-[![Build Status](https://api.travis-ci.com/sunrise-php/http-factory.svg?branch=master)](https://travis-ci.com/sunrise-php/http-factory)
+[![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)
[![Latest Stable Version](https://poser.pugx.org/sunrise/http-factory/v/stable)](https://packagist.org/packages/sunrise/http-factory)
[![Total Downloads](https://poser.pugx.org/sunrise/http-factory/downloads)](https://packagist.org/packages/sunrise/http-factory)
[![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;
php vendor/bin/phpunit
```
-## Api documentation
-
-https://phpdoc.fenric.ru/
-
## Useful links
-https://www.php-fig.org/psr/psr-17/
+* https://www.php-fig.org/psr/psr-17/
diff --git a/composer.json b/composer.json
index ab45805..cd4439b 100644
--- a/composer.json
+++ b/composer.json
@@ -1,9 +1,17 @@
{
"name": "sunrise/http-factory",
- "description": "Sunrise HTTP factory for PHP 7.1+ based on PSR-17",
- "keywords": ["fenric", "sunrise", "http", "http-factory", "psr-17"],
"homepage": "https://github.com/sunrise-php/http-factory",
+ "description": "Sunrise HTTP factory for PHP 7.1+ based on PSR-17",
"license": "MIT",
+ "keywords": [
+ "fenric",
+ "sunrise",
+ "http",
+ "http-factory",
+ "psr-17",
+ "php7",
+ "php8"
+ ],
"authors": [
{
"name": "Anatoly Fenric",
@@ -12,15 +20,15 @@
}
],
"require": {
- "php": "^7.1",
- "sunrise/http-message": "^1.0.9",
- "sunrise/http-server-request": "^1.0.5",
- "sunrise/stream": "^1.0.15",
- "sunrise/uri": "^1.0.19"
+ "php": "^7.1|^8.0",
+ "sunrise/http-message": "^1.4",
+ "sunrise/http-server-request": "^1.1",
+ "sunrise/stream": "^1.2",
+ "sunrise/uri": "^1.2"
},
"require-dev": {
- "phpunit/phpunit": "7.5.6",
- "http-interop/http-factory-tests": "0.5.0"
+ "phpunit/phpunit": "7.5.20|9.5.0",
+ "sunrise/coding-standard": "1.0.0"
},
"provide": {
"psr/http-factory-implementation": "1.0"
@@ -32,7 +40,8 @@
},
"scripts": {
"test": [
- "phpunit --colors=always --coverage-text"
+ "phpunit --colors=always --coverage-text",
+ "phpcs"
]
}
}
diff --git a/phpcs.xml.dist b/phpcs.xml.dist
new file mode 100644
index 0000000..be45cac
--- /dev/null
+++ b/phpcs.xml.dist
@@ -0,0 +1,7 @@
+
+
+
+
+ src
+ tests
+
diff --git a/phpunit.xml.dist b/phpunit.xml.dist
index 171b558..bf1b36c 100644
--- a/phpunit.xml.dist
+++ b/phpunit.xml.dist
@@ -4,9 +4,6 @@
./tests/
-
- ./vendor/http-interop/http-factory-tests/test
-
diff --git a/tests/FactoryTest.php b/tests/FactoryTest.php
index c4fc63b..a3be99c 100644
--- a/tests/FactoryTest.php
+++ b/tests/FactoryTest.php
@@ -1,7 +1,10 @@
-assertInstanceOf(RequestFactoryInterface::class, $factory);
- }
+ /**
+ * @return void
+ */
+ public function testRequestFactory() : void
+ {
+ $factory = new RequestFactory();
- public function testResponseFactory()
- {
- $factory = new ResponseFactory();
+ $this->assertInstanceOf(RequestFactoryInterface::class, $factory);
+ }
- $this->assertInstanceOf(ResponseFactoryInterface::class, $factory);
- }
+ /**
+ * @return void
+ */
+ public function testResponseFactory() : void
+ {
+ $factory = new ResponseFactory();
- public function testServerRequestFactory()
- {
- $factory = new ServerRequestFactory();
+ $this->assertInstanceOf(ResponseFactoryInterface::class, $factory);
+ }
- $this->assertInstanceOf(ServerRequestFactoryInterface::class, $factory);
- }
+ public function testServerRequestFactory() : void
+ {
+ $factory = new ServerRequestFactory();
- public function testStreamFactory()
- {
- $factory = new StreamFactory();
+ $this->assertInstanceOf(ServerRequestFactoryInterface::class, $factory);
+ }
- $this->assertInstanceOf(StreamFactoryInterface::class, $factory);
- }
+ /**
+ * @return void
+ */
+ public function testStreamFactory() : void
+ {
+ $factory = new StreamFactory();
- public function testUploadedFileFactory()
- {
- $factory = new UploadedFileFactory();
+ $this->assertInstanceOf(StreamFactoryInterface::class, $factory);
+ }
- $this->assertInstanceOf(UploadedFileFactoryInterface::class, $factory);
- }
+ /**
+ * @return void
+ */
+ public function testUploadedFileFactory() : void
+ {
+ $factory = new UploadedFileFactory();
- public function testUriFactory()
- {
- $factory = new UriFactory();
+ $this->assertInstanceOf(UploadedFileFactoryInterface::class, $factory);
+ }
- $this->assertInstanceOf(UriFactoryInterface::class, $factory);
- }
+ /**
+ * @return void
+ */
+ public function testUriFactory() : void
+ {
+ $factory = new UriFactory();
+
+ $this->assertInstanceOf(UriFactoryInterface::class, $factory);
+ }
}