From 45e198f2284b6ea0eab81a733995b1192e94515f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=90=D0=BD=D0=B0=D1=82=D0=BE=D0=BB=D0=B8=D0=B9=20=D0=9D?= =?UTF-8?q?=D0=B5=D1=85=D0=B0=D0=B9?= Date: Mon, 18 Apr 2022 04:34:55 +0500 Subject: [PATCH 1/7] update .circleci/config.yml --- .circleci/config.yml | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 0441507..880abdc 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -10,7 +10,7 @@ jobs: steps: - checkout - run: php -v - - run: composer install --no-interaction --no-suggest --prefer-source + - run: composer install --no-interaction - run: XDEBUG_MODE=coverage php vendor/bin/phpunit --coverage-text php72: docker: @@ -18,7 +18,7 @@ jobs: steps: - checkout - run: php -v - - run: composer install --no-interaction --no-suggest --prefer-source + - run: composer install --no-interaction - run: XDEBUG_MODE=coverage php vendor/bin/phpunit --coverage-text php73: docker: @@ -26,7 +26,7 @@ jobs: steps: - checkout - run: php -v - - run: composer install --no-interaction --no-suggest --prefer-source + - run: composer install --no-interaction - run: XDEBUG_MODE=coverage php vendor/bin/phpunit --coverage-text php74: docker: @@ -34,7 +34,7 @@ jobs: steps: - checkout - run: php -v - - run: composer install --no-interaction --no-suggest --prefer-source + - run: composer install --no-interaction - run: XDEBUG_MODE=coverage php vendor/bin/phpunit --coverage-text php80: docker: @@ -42,7 +42,7 @@ jobs: steps: - checkout - run: php -v - - run: composer install --no-interaction --no-suggest --prefer-source + - run: composer install --no-interaction - run: XDEBUG_MODE=coverage php vendor/bin/phpunit --coverage-text workflows: version: 2 From c3b9756ad9a6355f0655a674d022630dac912e42 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=90=D0=BD=D0=B0=D1=82=D0=BE=D0=BB=D0=B8=D0=B9=20=D0=9D?= =?UTF-8?q?=D0=B5=D1=85=D0=B0=D0=B9?= Date: Mon, 18 Apr 2022 04:35:05 +0500 Subject: [PATCH 2/7] update .gitignore --- .gitignore | 1 + 1 file changed, 1 insertion(+) diff --git a/.gitignore b/.gitignore index ac89ebd..a6bde41 100644 --- a/.gitignore +++ b/.gitignore @@ -5,4 +5,5 @@ /phpbench.json /phpcs.xml /phpunit.xml +/psalm.xml /vendor/ From 932455f91d5cd57796c638c073875b848df221a6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=90=D0=BD=D0=B0=D1=82=D0=BE=D0=BB=D0=B8=D0=B9=20=D0=9D?= =?UTF-8?q?=D0=B5=D1=85=D0=B0=D0=B9?= Date: Mon, 18 Apr 2022 04:35:14 +0500 Subject: [PATCH 3/7] update README.md --- README.md | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/README.md b/README.md index 7eb0219..d4ebf6a 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,4 @@ -## HTTP factory for PHP 7.1+ based on PSR-17 +# HTTP factory for PHP 7.1+ based on PSR-17 [![Build Status](https://circleci.com/gh/sunrise-php/http-factory.svg?style=shield)](https://circleci.com/gh/sunrise-php/http-factory) [![Code Coverage](https://scrutinizer-ci.com/g/sunrise-php/http-factory/badges/coverage.png?b=master)](https://scrutinizer-ci.com/g/sunrise-php/http-factory/?branch=master) @@ -28,11 +28,7 @@ use Sunrise\Http\Factory\UriFactory; // just use PSR-17 methods... ``` -#### HTTP headers as objects - -* https://github.com/sunrise-php/http-header-kit - -#### Based on the following packages +## Based on the following packages * https://github.com/sunrise-php/http-message * https://github.com/sunrise-php/http-server-request From 87d9a1e15f09cecc5a84d5b8e6b2b17be522fe32 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=90=D0=BD=D0=B0=D1=82=D0=BE=D0=BB=D0=B8=D0=B9=20=D0=9D?= =?UTF-8?q?=D0=B5=D1=85=D0=B0=D0=B9?= Date: Mon, 18 Apr 2022 04:35:22 +0500 Subject: [PATCH 4/7] update composer.json --- composer.json | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/composer.json b/composer.json index 933390c..c052d3e 100644 --- a/composer.json +++ b/composer.json @@ -1,13 +1,14 @@ { "name": "sunrise/http-factory", "homepage": "https://github.com/sunrise-php/http-factory", - "description": "Sunrise // HTTP factory for PHP 7.1+ based on PSR-17", + "description": "HTTP factory for PHP 7.1+ based on PSR-17", "license": "MIT", "keywords": [ "fenric", "sunrise", "http", - "http-factory", + "factory", + "psr-7", "psr-17", "php7", "php8" @@ -15,10 +16,13 @@ "authors": [ { "name": "Anatoly Fenric", - "email": "anatoly@fenric.ru", - "homepage": "https://anatoly.fenric.ru/" + "email": "afenric@gmail.com", + "homepage": "https://github.com/fenric" } ], + "provide": { + "psr/http-factory-implementation": "1.0" + }, "require": { "php": "^7.1|^8.0", "sunrise/http-message": "^2.0", @@ -30,9 +34,6 @@ "phpunit/phpunit": "7.5.20|9.5.0", "sunrise/coding-standard": "1.0.0" }, - "provide": { - "psr/http-factory-implementation": "1.0" - }, "autoload": { "psr-4": { "Sunrise\\Http\\Factory\\": "src/" @@ -41,6 +42,7 @@ "scripts": { "test": [ "phpcs", + "psalm", "XDEBUG_MODE=coverage phpunit --coverage-text --colors=always" ], "build": [ From 7032886a8d247f4692d90e477814ec39725f971c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=90=D0=BD=D0=B0=D1=82=D0=BE=D0=BB=D0=B8=D0=B9=20=D0=9D?= =?UTF-8?q?=D0=B5=D1=85=D0=B0=D0=B9?= Date: Mon, 18 Apr 2022 04:35:33 +0500 Subject: [PATCH 5/7] update phpunit.xml.dist --- phpunit.xml.dist | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/phpunit.xml.dist b/phpunit.xml.dist index d97e720..e0dc5dc 100644 --- a/phpunit.xml.dist +++ b/phpunit.xml.dist @@ -1,12 +1,15 @@ - + ./src - + ./tests/ From 21722d6206781ac632cd95cfa0517ed1ef67b688 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=90=D0=BD=D0=B0=D1=82=D0=BE=D0=BB=D0=B8=D0=B9=20=D0=9D?= =?UTF-8?q?=D0=B5=D1=85=D0=B0=D0=B9?= Date: Mon, 18 Apr 2022 04:35:44 +0500 Subject: [PATCH 6/7] add psalm.xml.dist --- psalm.xml.dist | 14 ++++++++++++++ 1 file changed, 14 insertions(+) create mode 100644 psalm.xml.dist diff --git a/psalm.xml.dist b/psalm.xml.dist new file mode 100644 index 0000000..38cce4c --- /dev/null +++ b/psalm.xml.dist @@ -0,0 +1,14 @@ + + + + + + + + + From ac983773e1ec10bbfd2354e548b6fa96c09ac587 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=90=D0=BD=D0=B0=D1=82=D0=BE=D0=BB=D0=B8=D0=B9=20=D0=9D?= =?UTF-8?q?=D0=B5=D1=85=D0=B0=D0=B9?= Date: Mon, 18 Apr 2022 04:35:56 +0500 Subject: [PATCH 7/7] minor changes --- tests/FactoryTest.php | 24 ++++++------------------ 1 file changed, 6 insertions(+), 18 deletions(-) diff --git a/tests/FactoryTest.php b/tests/FactoryTest.php index 70f30a9..47d2b26 100644 --- a/tests/FactoryTest.php +++ b/tests/FactoryTest.php @@ -30,9 +30,7 @@ class FactoryTest extends TestCase */ public function testRequestFactory() : void { - $factory = new RequestFactory(); - - $this->assertInstanceOf(RequestFactoryInterface::class, $factory); + $this->assertInstanceOf(RequestFactoryInterface::class, new RequestFactory()); } /** @@ -40,9 +38,7 @@ public function testRequestFactory() : void */ public function testResponseFactory() : void { - $factory = new ResponseFactory(); - - $this->assertInstanceOf(ResponseFactoryInterface::class, $factory); + $this->assertInstanceOf(ResponseFactoryInterface::class, new ResponseFactory()); } /** @@ -50,9 +46,7 @@ public function testResponseFactory() : void */ public function testServerRequestFactory() : void { - $factory = new ServerRequestFactory(); - - $this->assertInstanceOf(ServerRequestFactoryInterface::class, $factory); + $this->assertInstanceOf(ServerRequestFactoryInterface::class, new ServerRequestFactory()); } /** @@ -60,9 +54,7 @@ public function testServerRequestFactory() : void */ public function testStreamFactory() : void { - $factory = new StreamFactory(); - - $this->assertInstanceOf(StreamFactoryInterface::class, $factory); + $this->assertInstanceOf(StreamFactoryInterface::class, new StreamFactory()); } /** @@ -70,9 +62,7 @@ public function testStreamFactory() : void */ public function testUploadedFileFactory() : void { - $factory = new UploadedFileFactory(); - - $this->assertInstanceOf(UploadedFileFactoryInterface::class, $factory); + $this->assertInstanceOf(UploadedFileFactoryInterface::class, new UploadedFileFactory()); } /** @@ -80,8 +70,6 @@ public function testUploadedFileFactory() : void */ public function testUriFactory() : void { - $factory = new UriFactory(); - - $this->assertInstanceOf(UriFactoryInterface::class, $factory); + $this->assertInstanceOf(UriFactoryInterface::class, new UriFactory()); } }