From ac76ea8752bd8d8a16dea446172e2979d60d0b9f Mon Sep 17 00:00:00 2001 From: Anatoly Nekhay Date: Sat, 26 Dec 2020 12:23:15 +0500 Subject: [PATCH 1/7] cs --- .editorconfig | 3 --- phpcs.xml.dist | 7 +++++++ 2 files changed, 7 insertions(+), 3 deletions(-) create mode 100644 phpcs.xml.dist 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/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 + From c508b02f4b383b2c645fdb4153d727824cbc75ad Mon Sep 17 00:00:00 2001 From: Anatoly Nekhay Date: Sat, 26 Dec 2020 12:23:28 +0500 Subject: [PATCH 2/7] csf --- tests/FactoryTest.php | 84 +++++++++++++++++++++++++++---------------- 1 file changed, 53 insertions(+), 31 deletions(-) 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); + } } From 6a46ee580106d86b33c78e0194411896f5cf30ab Mon Sep 17 00:00:00 2001 From: Anatoly Nekhay Date: Sat, 26 Dec 2020 12:23:46 +0500 Subject: [PATCH 3/7] php8 support --- .travis.yml | 4 +++- composer.json | 29 +++++++++++++++++++---------- 2 files changed, 22 insertions(+), 11 deletions(-) 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/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" ] } } From b9095aac90c29210e29a6de540d7c0fbb23895b0 Mon Sep 17 00:00:00 2001 From: Anatoly Nekhay Date: Sat, 26 Dec 2020 12:23:58 +0500 Subject: [PATCH 4/7] minor changes --- phpunit.xml.dist | 3 --- 1 file changed, 3 deletions(-) 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 - From e4e4b9fc3f60365e513a6e96ee5ac2dc202dad42 Mon Sep 17 00:00:00 2001 From: Anatoly Nekhay Date: Sat, 26 Dec 2020 12:24:08 +0500 Subject: [PATCH 5/7] update LICENSE --- LICENSE | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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 From 60ec7b4e63719d997e755f7c64534ded661c3f7e Mon Sep 17 00:00:00 2001 From: Anatoly Nekhay Date: Sat, 26 Dec 2020 12:24:23 +0500 Subject: [PATCH 6/7] update README.md --- README.md | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) 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/ From d30bcdb1440dd9e273f01a7e08f226a339f3cf80 Mon Sep 17 00:00:00 2001 From: Anatoly Nekhay Date: Sat, 26 Dec 2020 12:24:35 +0500 Subject: [PATCH 7/7] update .gitignore --- .gitignore | 4 ++++ 1 file changed, 4 insertions(+) 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/