From c664896c1c16733b52e640f63102a064210287e0 Mon Sep 17 00:00:00 2001 From: Ivan Enderlin Date: Tue, 19 Feb 2019 12:03:12 +0100 Subject: [PATCH 1/4] chore(php) Require PHP 7.1. --- composer.json | 1 + 1 file changed, 1 insertion(+) diff --git a/composer.json b/composer.json index 0112ba1..b8985d5 100644 --- a/composer.json +++ b/composer.json @@ -23,6 +23,7 @@ "source": "https://central.hoa-project.net/Resource/Library/Fastcgi" }, "require": { + "php" : ">=7.1", "hoa/consistency": "~1.0", "hoa/exception" : "~1.0", "hoa/socket" : "~1.0" From e5f82fce194e761931caae9e366a86f8b32d8a85 Mon Sep 17 00:00:00 2001 From: Ivan Enderlin Date: Tue, 19 Feb 2019 12:05:19 +0100 Subject: [PATCH 2/4] chore(php) Move code into the `Source` directory. --- .State | 1 - Connection.php => Source/Connection.php | 0 {Exception => Source/Exception}/CannotMultiplex.php | 0 {Exception => Source/Exception}/Exception.php | 0 {Exception => Source/Exception}/Overloaded.php | 0 {Exception => Source/Exception}/UnknownRole.php | 0 {Exception => Source/Exception}/UnknownStatus.php | 0 Responder.php => Source/Responder.php | 0 composer.json | 2 +- 9 files changed, 1 insertion(+), 2 deletions(-) delete mode 100644 .State rename Connection.php => Source/Connection.php (100%) rename {Exception => Source/Exception}/CannotMultiplex.php (100%) rename {Exception => Source/Exception}/Exception.php (100%) rename {Exception => Source/Exception}/Overloaded.php (100%) rename {Exception => Source/Exception}/UnknownRole.php (100%) rename {Exception => Source/Exception}/UnknownStatus.php (100%) rename Responder.php => Source/Responder.php (100%) diff --git a/.State b/.State deleted file mode 100644 index a604de4..0000000 --- a/.State +++ /dev/null @@ -1 +0,0 @@ -finalized diff --git a/Connection.php b/Source/Connection.php similarity index 100% rename from Connection.php rename to Source/Connection.php diff --git a/Exception/CannotMultiplex.php b/Source/Exception/CannotMultiplex.php similarity index 100% rename from Exception/CannotMultiplex.php rename to Source/Exception/CannotMultiplex.php diff --git a/Exception/Exception.php b/Source/Exception/Exception.php similarity index 100% rename from Exception/Exception.php rename to Source/Exception/Exception.php diff --git a/Exception/Overloaded.php b/Source/Exception/Overloaded.php similarity index 100% rename from Exception/Overloaded.php rename to Source/Exception/Overloaded.php diff --git a/Exception/UnknownRole.php b/Source/Exception/UnknownRole.php similarity index 100% rename from Exception/UnknownRole.php rename to Source/Exception/UnknownRole.php diff --git a/Exception/UnknownStatus.php b/Source/Exception/UnknownStatus.php similarity index 100% rename from Exception/UnknownStatus.php rename to Source/Exception/UnknownStatus.php diff --git a/Responder.php b/Source/Responder.php similarity index 100% rename from Responder.php rename to Source/Responder.php diff --git a/composer.json b/composer.json index b8985d5..4acb257 100644 --- a/composer.json +++ b/composer.json @@ -33,7 +33,7 @@ }, "autoload": { "psr-4": { - "Hoa\\Fastcgi\\": "." + "Hoa\\Fastcgi\\": "Source" } }, "extra": { From f006144859708bbee4ddbb8eab1d3d255aa3397f Mon Sep 17 00:00:00 2001 From: Ivan Enderlin Date: Tue, 19 Feb 2019 12:30:18 +0100 Subject: [PATCH 3/4] chore(php) Update to PHP 7. --- Source/Connection.php | 29 ++++------------ Source/Exception/CannotMultiplex.php | 7 ++-- Source/Exception/Exception.php | 9 +++-- Source/Exception/Overloaded.php | 7 ++-- Source/Exception/UnknownRole.php | 7 ++-- Source/Exception/UnknownStatus.php | 7 ++-- Source/Responder.php | 51 +++++++--------------------- 7 files changed, 34 insertions(+), 83 deletions(-) diff --git a/Source/Connection.php b/Source/Connection.php index 1f2dd59..4077941 100644 --- a/Source/Connection.php +++ b/Source/Connection.php @@ -1,5 +1,7 @@ _responseOutput = null; $this->_responseError = null; @@ -304,52 +291,40 @@ public function send(array $headers, $content = null) /** * Get response content. - * - * @return ?string */ - public function getResponseContent() + public function getResponseContent(): ?string { return $this->_responseOutput; } /** * Get response error if any. - * - * @return ?string */ - public function getResponseError() + public function getResponseError(): ?string { return $this->_responseError; } /** * Get response headers. - * - * @return array */ - public function getResponseHeaders() + public function getResponseHeaders(): array { return $this->_responseHeaders; } /** * Read data. - * - * @param int $length Length of data to read. - * @return string */ - protected function read($length) + protected function read(int $length): ?string { return $this->getClient()->read($length); } /** * Set client. - * - * @param \Hoa\Socket\Client $client Client. - * @return \Hoa\Socket\Client */ - public function setClient(Socket\Client $client) + public function setClient(Socket\Client $client): ?Socket\Client { $old = $this->_client; $this->_client = $client; @@ -359,10 +334,8 @@ public function setClient(Socket\Client $client) /** * Get client. - * - * @return \Hoa\Socket\Client */ - public function getClient() + public function getClient(): Socket\Client { return $this->_client; } From 0e2846b74ae2e19e10b10ca96441e3163d99a051 Mon Sep 17 00:00:00 2001 From: Ivan Enderlin Date: Tue, 19 Feb 2019 12:31:13 +0100 Subject: [PATCH 4/4] chore(composer) Use `dev-master` dependencies. --- composer.json | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/composer.json b/composer.json index 4acb257..5c842fe 100644 --- a/composer.json +++ b/composer.json @@ -24,12 +24,12 @@ }, "require": { "php" : ">=7.1", - "hoa/consistency": "~1.0", - "hoa/exception" : "~1.0", - "hoa/socket" : "~1.0" + "hoa/consistency": "dev-master", + "hoa/exception" : "dev-master", + "hoa/socket" : "dev-master" }, "require-dev": { - "hoa/test": "~2.0" + "hoa/test": "dev-master" }, "autoload": { "psr-4": {