summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorparamtamtam <[email protected]>2020-12-08 16:36:50 +0500
committerparamtamtam <[email protected]>2020-12-08 17:18:24 +0500
commit9e583a601e393c4dccdddc2fd6e24e40397bd641 (patch)
treeddbd2354222a476a34350a59dff103f7a97b083a /src
parenta60d0523c1afb6c1983b522d1477b8ef319d5b99 (diff)
GitHub actions updated, some PHP errors fixed
This PR contains: - Ci actions (build) refactoring - Little `Makefile` fix (my mistake in previous PR) - Updated minimal required versions of composer packages: - `psr/http-factory` (`^1.0` &rarr; `^1.0.1`) - `psr/http-message` (`^1.0` &rarr; `^1.0.1`) - `laminas/laminas-diactoros` (`^1.3` &rarr; `^1.3.6`) - Tests using minimal and maximal composer package versions - Disabling `checkMissingIterableValueType` in `phpstan.neon.dist` - Some typos (wrong class namespaces and annotations) in PHP files :warning: - One improvement in `HttpClient::respond` method (variable type hint overriding fixed) - Added packages testing on CI: - `./service/gzip` - `./service/reload`
Diffstat (limited to 'src')
-rw-r--r--src/Diactoros/ServerRequestFactory.php4
-rw-r--r--src/Diactoros/StreamFactory.php2
-rw-r--r--src/Diactoros/UploadedFileFactory.php2
-rw-r--r--src/HttpClient.php9
4 files changed, 9 insertions, 8 deletions
diff --git a/src/Diactoros/ServerRequestFactory.php b/src/Diactoros/ServerRequestFactory.php
index 3fcf8e29..6a42f207 100644
--- a/src/Diactoros/ServerRequestFactory.php
+++ b/src/Diactoros/ServerRequestFactory.php
@@ -11,12 +11,14 @@ namespace Spiral\RoadRunner\Diactoros;
use Psr\Http\Message\ServerRequestFactoryInterface;
use Psr\Http\Message\ServerRequestInterface;
-use Zend\Diactoros\ServerRequest;
+use Laminas\Diactoros\ServerRequest;
final class ServerRequestFactory implements ServerRequestFactoryInterface
{
/**
* @inheritdoc
+ *
+ * @param array<mixed> $serverParams Array of SAPI parameters with which to seed the generated request instance.
*/
public function createServerRequest(string $method, $uri, array $serverParams = []): ServerRequestInterface
{
diff --git a/src/Diactoros/StreamFactory.php b/src/Diactoros/StreamFactory.php
index cc0a5306..68a77e92 100644
--- a/src/Diactoros/StreamFactory.php
+++ b/src/Diactoros/StreamFactory.php
@@ -12,7 +12,7 @@ namespace Spiral\RoadRunner\Diactoros;
use RuntimeException;
use Psr\Http\Message\StreamFactoryInterface;
use Psr\Http\Message\StreamInterface;
-use Zend\Diactoros\Stream;
+use Laminas\Diactoros\Stream;
final class StreamFactory implements StreamFactoryInterface
{
diff --git a/src/Diactoros/UploadedFileFactory.php b/src/Diactoros/UploadedFileFactory.php
index 45773287..daa475c1 100644
--- a/src/Diactoros/UploadedFileFactory.php
+++ b/src/Diactoros/UploadedFileFactory.php
@@ -12,7 +12,7 @@ namespace Spiral\RoadRunner\Diactoros;
use Psr\Http\Message\StreamInterface;
use Psr\Http\Message\UploadedFileFactoryInterface;
use Psr\Http\Message\UploadedFileInterface;
-use Zend\Diactoros\UploadedFile;
+use Laminas\Diactoros\UploadedFile;
final class UploadedFileFactory implements UploadedFileFactoryInterface
{
diff --git a/src/HttpClient.php b/src/HttpClient.php
index 4ca152c8..9b9048ca 100644
--- a/src/HttpClient.php
+++ b/src/HttpClient.php
@@ -62,14 +62,13 @@ final class HttpClient
*/
public function respond(int $status, string $body, array $headers = []): void
{
- if (empty($headers)) {
- // this is required to represent empty header set as map and not as array
- $headers = new \stdClass();
- }
+ $sendHeaders = empty($headers)
+ ? new \stdClass() // this is required to represent empty header set as map and not as array
+ : $headers;
$this->getWorker()->send(
$body,
- (string) json_encode(['status' => $status, 'headers' => $headers])
+ (string) json_encode(['status' => $status, 'headers' => $sendHeaders])
);
}
}