Skip to content

Commit c298c46

Browse files
committed
Update dependencies
1 parent 52ea4aa commit c298c46

File tree

2 files changed

+15
-9
lines changed

2 files changed

+15
-9
lines changed

api.php

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1498,6 +1498,11 @@ public function createRequest(string $method, $uri): RequestInterface
14981498

14991499
public function createResponse(int $code = 200, string $reasonPhrase = ''): ResponseInterface
15001500
{
1501+
if (2 > \func_num_args()) {
1502+
// This will make the Response class to use a custom reasonPhrase
1503+
$reasonPhrase = null;
1504+
}
1505+
15011506
return new Response($code, [], null, '1.1', $reasonPhrase);
15021507
}
15031508

@@ -1951,7 +1956,7 @@ public function __construct(int $status = 200, array $headers = [], $body = null
19511956
if (null === $reason && isset(self::PHRASES[$this->statusCode])) {
19521957
$this->reasonPhrase = self::PHRASES[$status];
19531958
} else {
1954-
$this->reasonPhrase = $reason;
1959+
$this->reasonPhrase = $reason ?? '';
19551960
}
19561961

19571962
$this->protocol = $version;
@@ -2226,7 +2231,7 @@ public static function create($body = ''): StreamInterface
22262231
$new = new self();
22272232
$new->stream = $body;
22282233
$meta = \stream_get_meta_data($new->stream);
2229-
$new->seekable = $meta['seekable'];
2234+
$new->seekable = $meta['seekable'] && 0 === \fseek($new->stream, 0, \SEEK_CUR);
22302235
$new->readable = isset(self::READ_WRITE_HASH['read'][$meta['mode']]);
22312236
$new->writable = isset(self::READ_WRITE_HASH['write'][$meta['mode']]);
22322237
$new->uri = $new->getMetadata('uri');
@@ -2854,8 +2859,8 @@ private function filterPort($port) /*:?int*/
28542859
}
28552860

28562861
$port = (int) $port;
2857-
if (1 > $port || 0xffff < $port) {
2858-
throw new \InvalidArgumentException(\sprintf('Invalid port: %d. Must be between 1 and 65535', $port));
2862+
if (0 > $port || 0xffff < $port) {
2863+
throw new \InvalidArgumentException(\sprintf('Invalid port: %d. Must be between 0 and 65535', $port));
28592864
}
28602865

28612866
return self::isNonStandardPort($this->scheme, $port) ? $port : null;
@@ -10618,6 +10623,7 @@ public static function toString(ResponseInterface $response): string
1061810623
'username' => 'php-crud-api',
1061910624
'password' => 'php-crud-api',
1062010625
'database' => 'php-crud-api',
10626+
'controllers' => 'records,columns'
1062110627
]);
1062210628
$request = RequestFactory::fromGlobals();
1062310629
$api = new Api($config);

composer.lock

Lines changed: 5 additions & 5 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)