Skip to content

Commit 968a2d3

Browse files
committed
update
1 parent 6e56bdf commit 968a2d3

File tree

2 files changed

+44
-44
lines changed

2 files changed

+44
-44
lines changed

api.include.php

Lines changed: 22 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -977,7 +977,7 @@ public function getContents();
977977
* provided. Returns a specific key value if a key is provided and the
978978
* value is found, or null if the key is not found.
979979
*/
980-
public function getMetadata( /*?string*/ $key = null);
980+
public function getMetadata(?string $key = null);
981981
}
982982
}
983983

@@ -1311,7 +1311,7 @@ public function withScheme(string $scheme);
13111311
* @param null|string $password The password associated with $user.
13121312
* @return static A new instance with the specified user information.
13131313
*/
1314-
public function withUserInfo(string $user, /*?string*/ $password = null);
1314+
public function withUserInfo(string $user, ?string $password = null);
13151315

13161316
/**
13171317
* Return an instance with the specified host.
@@ -1344,7 +1344,7 @@ public function withHost(string $host);
13441344
* @return static A new instance with the specified port.
13451345
* @throws \InvalidArgumentException for invalid ports.
13461346
*/
1347-
public function withPort( /*?int*/ $port);
1347+
public function withPort(?int $port);
13481348

13491349
/**
13501350
* Return an instance with the specified path.
@@ -1718,7 +1718,7 @@ public function withBody(StreamInterface $body): MessageInterface
17181718
return $new;
17191719
}
17201720

1721-
private function setHeaders(array $headers) /*:void*/
1721+
private function setHeaders(array $headers): void
17221722
{
17231723
foreach ($headers as $header => $value) {
17241724
if (\is_int($header)) {
@@ -1939,7 +1939,7 @@ public function withUri(UriInterface $uri, $preserveHost = false): RequestInterf
19391939
return $new;
19401940
}
19411941

1942-
private function updateHostFromUri() /*:void*/
1942+
private function updateHostFromUri(): void
19431943
{
19441944
if ('' === $host = $this->uri->getHost()) {
19451945
return;
@@ -1979,7 +1979,7 @@ class Response implements ResponseInterface
19791979
use MessageTrait;
19801980

19811981
/** @var array Map of standard HTTP status code/reason phrases */
1982-
/*private*/ const PHRASES = [
1982+
private const PHRASES = [
19831983
100 => 'Continue', 101 => 'Switching Protocols', 102 => 'Processing',
19841984
200 => 'OK', 201 => 'Created', 202 => 'Accepted', 203 => 'Non-Authoritative Information', 204 => 'No Content', 205 => 'Reset Content', 206 => 'Partial Content', 207 => 'Multi-status', 208 => 'Already Reported',
19851985
300 => 'Multiple Choices', 301 => 'Moved Permanently', 302 => 'Found', 303 => 'See Other', 304 => 'Not Modified', 305 => 'Use Proxy', 306 => 'Switch Proxy', 307 => 'Temporary Redirect',
@@ -2289,7 +2289,7 @@ function __toString() {}
22892289
private $size;
22902290

22912291
/** @var array Hash of readable and writable stream types */
2292-
/*private*/ const READ_WRITE_HASH = [
2292+
private const READ_WRITE_HASH = [
22932293
'read' => [
22942294
'r' => true, 'w+' => true, 'r+' => true, 'x+' => true, 'c+' => true,
22952295
'rb' => true, 'w+b' => true, 'r+b' => true, 'x+b' => true,
@@ -2359,7 +2359,7 @@ public function __destruct()
23592359
$this->close();
23602360
}
23612361

2362-
public function close() /*:void*/
2362+
public function close(): void
23632363
{
23642364
if (isset($this->stream)) {
23652365
if (\is_resource($this->stream)) {
@@ -2392,7 +2392,7 @@ private function getUri()
23922392
return $this->uri;
23932393
}
23942394

2395-
public function getSize() /*:?int*/
2395+
public function getSize(): ?int
23962396
{
23972397
if (null !== $this->size) {
23982398
return $this->size;
@@ -2440,7 +2440,7 @@ public function isSeekable(): bool
24402440
return $this->seekable;
24412441
}
24422442

2443-
public function seek($offset, $whence = \SEEK_SET) /*:void*/
2443+
public function seek($offset, $whence = \SEEK_SET): void
24442444
{
24452445
if (!isset($this->stream)) {
24462446
throw new \RuntimeException('Stream is detached');
@@ -2455,7 +2455,7 @@ public function seek($offset, $whence = \SEEK_SET) /*:void*/
24552455
}
24562456
}
24572457

2458-
public function rewind() /*:void*/
2458+
public function rewind(): void
24592459
{
24602460
$this->seek(0);
24612461
}
@@ -2715,7 +2715,7 @@ public function __toString()
27152715
class UploadedFile implements UploadedFileInterface
27162716
{
27172717
/** @var array */
2718-
/*private*/ const ERRORS = [
2718+
private const ERRORS = [
27192719
\UPLOAD_ERR_OK => 1,
27202720
\UPLOAD_ERR_INI_SIZE => 1,
27212721
\UPLOAD_ERR_FORM_SIZE => 1,
@@ -2794,7 +2794,7 @@ public function __construct($streamOrFile, $size, $errorStatus, $clientFilename
27942794
/**
27952795
* @throws \RuntimeException if is moved or not ok
27962796
*/
2797-
private function validateActive() /*:void*/
2797+
private function validateActive(): void
27982798
{
27992799
if (\UPLOAD_ERR_OK !== $this->error) {
28002800
throw new \RuntimeException('Cannot retrieve stream due to upload error');
@@ -2820,7 +2820,7 @@ public function getStream(): StreamInterface
28202820
return Stream::create($resource);
28212821
}
28222822

2823-
public function moveTo($targetPath) /*:void*/
2823+
public function moveTo($targetPath): void
28242824
{
28252825
$this->validateActive();
28262826

@@ -2866,12 +2866,12 @@ public function getError(): int
28662866
return $this->error;
28672867
}
28682868

2869-
public function getClientFilename() /*:?string*/
2869+
public function getClientFilename(): ?string
28702870
{
28712871
return $this->clientFilename;
28722872
}
28732873

2874-
public function getClientMediaType() /*:?string*/
2874+
public function getClientMediaType(): ?string
28752875
{
28762876
return $this->clientMediaType;
28772877
}
@@ -2896,13 +2896,13 @@ public function getClientMediaType() /*:?string*/
28962896
*/
28972897
class Uri implements UriInterface
28982898
{
2899-
/*private*/ const SCHEMES = ['http' => 80, 'https' => 443];
2899+
private const SCHEMES = ['http' => 80, 'https' => 443];
29002900

2901-
/*private*/ const CHAR_UNRESERVED = 'a-zA-Z0-9_\-\.~';
2901+
private const CHAR_UNRESERVED = 'a-zA-Z0-9_\-\.~';
29022902

2903-
/*private*/ const CHAR_SUB_DELIMS = '!\$&\'\(\)\*\+,;=';
2903+
private const CHAR_SUB_DELIMS = '!\$&\'\(\)\*\+,;=';
29042904

2905-
/*private*/ const CHAR_GEN_DELIMS = ':\/\?#\[\]@';
2905+
private const CHAR_GEN_DELIMS = ':\/\?#\[\]@';
29062906

29072907
/** @var string Uri scheme. */
29082908
private $scheme = '';
@@ -2984,7 +2984,7 @@ public function getHost(): string
29842984
return $this->host;
29852985
}
29862986

2987-
public function getPort() /*:?int*/
2987+
public function getPort(): ?int
29882988
{
29892989
return $this->port;
29902990
}
@@ -3194,7 +3194,7 @@ private static function isNonStandardPort(string $scheme, int $port): bool
31943194
return !isset(self::SCHEMES[$scheme]) || $port !== self::SCHEMES[$scheme];
31953195
}
31963196

3197-
private function filterPort($port) /*:?int*/
3197+
private function filterPort($port): ?int
31983198
{
31993199
if (null === $port) {
32003200
return null;

api.php

Lines changed: 22 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -977,7 +977,7 @@ public function getContents();
977977
* provided. Returns a specific key value if a key is provided and the
978978
* value is found, or null if the key is not found.
979979
*/
980-
public function getMetadata( /*?string*/ $key = null);
980+
public function getMetadata(?string $key = null);
981981
}
982982
}
983983

@@ -1311,7 +1311,7 @@ public function withScheme(string $scheme);
13111311
* @param null|string $password The password associated with $user.
13121312
* @return static A new instance with the specified user information.
13131313
*/
1314-
public function withUserInfo(string $user, /*?string*/ $password = null);
1314+
public function withUserInfo(string $user, ?string $password = null);
13151315

13161316
/**
13171317
* Return an instance with the specified host.
@@ -1344,7 +1344,7 @@ public function withHost(string $host);
13441344
* @return static A new instance with the specified port.
13451345
* @throws \InvalidArgumentException for invalid ports.
13461346
*/
1347-
public function withPort( /*?int*/ $port);
1347+
public function withPort(?int $port);
13481348

13491349
/**
13501350
* Return an instance with the specified path.
@@ -1718,7 +1718,7 @@ public function withBody(StreamInterface $body): MessageInterface
17181718
return $new;
17191719
}
17201720

1721-
private function setHeaders(array $headers) /*:void*/
1721+
private function setHeaders(array $headers): void
17221722
{
17231723
foreach ($headers as $header => $value) {
17241724
if (\is_int($header)) {
@@ -1939,7 +1939,7 @@ public function withUri(UriInterface $uri, $preserveHost = false): RequestInterf
19391939
return $new;
19401940
}
19411941

1942-
private function updateHostFromUri() /*:void*/
1942+
private function updateHostFromUri(): void
19431943
{
19441944
if ('' === $host = $this->uri->getHost()) {
19451945
return;
@@ -1979,7 +1979,7 @@ class Response implements ResponseInterface
19791979
use MessageTrait;
19801980

19811981
/** @var array Map of standard HTTP status code/reason phrases */
1982-
/*private*/ const PHRASES = [
1982+
private const PHRASES = [
19831983
100 => 'Continue', 101 => 'Switching Protocols', 102 => 'Processing',
19841984
200 => 'OK', 201 => 'Created', 202 => 'Accepted', 203 => 'Non-Authoritative Information', 204 => 'No Content', 205 => 'Reset Content', 206 => 'Partial Content', 207 => 'Multi-status', 208 => 'Already Reported',
19851985
300 => 'Multiple Choices', 301 => 'Moved Permanently', 302 => 'Found', 303 => 'See Other', 304 => 'Not Modified', 305 => 'Use Proxy', 306 => 'Switch Proxy', 307 => 'Temporary Redirect',
@@ -2289,7 +2289,7 @@ function __toString() {}
22892289
private $size;
22902290

22912291
/** @var array Hash of readable and writable stream types */
2292-
/*private*/ const READ_WRITE_HASH = [
2292+
private const READ_WRITE_HASH = [
22932293
'read' => [
22942294
'r' => true, 'w+' => true, 'r+' => true, 'x+' => true, 'c+' => true,
22952295
'rb' => true, 'w+b' => true, 'r+b' => true, 'x+b' => true,
@@ -2359,7 +2359,7 @@ public function __destruct()
23592359
$this->close();
23602360
}
23612361

2362-
public function close() /*:void*/
2362+
public function close(): void
23632363
{
23642364
if (isset($this->stream)) {
23652365
if (\is_resource($this->stream)) {
@@ -2392,7 +2392,7 @@ private function getUri()
23922392
return $this->uri;
23932393
}
23942394

2395-
public function getSize() /*:?int*/
2395+
public function getSize(): ?int
23962396
{
23972397
if (null !== $this->size) {
23982398
return $this->size;
@@ -2440,7 +2440,7 @@ public function isSeekable(): bool
24402440
return $this->seekable;
24412441
}
24422442

2443-
public function seek($offset, $whence = \SEEK_SET) /*:void*/
2443+
public function seek($offset, $whence = \SEEK_SET): void
24442444
{
24452445
if (!isset($this->stream)) {
24462446
throw new \RuntimeException('Stream is detached');
@@ -2455,7 +2455,7 @@ public function seek($offset, $whence = \SEEK_SET) /*:void*/
24552455
}
24562456
}
24572457

2458-
public function rewind() /*:void*/
2458+
public function rewind(): void
24592459
{
24602460
$this->seek(0);
24612461
}
@@ -2715,7 +2715,7 @@ public function __toString()
27152715
class UploadedFile implements UploadedFileInterface
27162716
{
27172717
/** @var array */
2718-
/*private*/ const ERRORS = [
2718+
private const ERRORS = [
27192719
\UPLOAD_ERR_OK => 1,
27202720
\UPLOAD_ERR_INI_SIZE => 1,
27212721
\UPLOAD_ERR_FORM_SIZE => 1,
@@ -2794,7 +2794,7 @@ public function __construct($streamOrFile, $size, $errorStatus, $clientFilename
27942794
/**
27952795
* @throws \RuntimeException if is moved or not ok
27962796
*/
2797-
private function validateActive() /*:void*/
2797+
private function validateActive(): void
27982798
{
27992799
if (\UPLOAD_ERR_OK !== $this->error) {
28002800
throw new \RuntimeException('Cannot retrieve stream due to upload error');
@@ -2820,7 +2820,7 @@ public function getStream(): StreamInterface
28202820
return Stream::create($resource);
28212821
}
28222822

2823-
public function moveTo($targetPath) /*:void*/
2823+
public function moveTo($targetPath): void
28242824
{
28252825
$this->validateActive();
28262826

@@ -2866,12 +2866,12 @@ public function getError(): int
28662866
return $this->error;
28672867
}
28682868

2869-
public function getClientFilename() /*:?string*/
2869+
public function getClientFilename(): ?string
28702870
{
28712871
return $this->clientFilename;
28722872
}
28732873

2874-
public function getClientMediaType() /*:?string*/
2874+
public function getClientMediaType(): ?string
28752875
{
28762876
return $this->clientMediaType;
28772877
}
@@ -2896,13 +2896,13 @@ public function getClientMediaType() /*:?string*/
28962896
*/
28972897
class Uri implements UriInterface
28982898
{
2899-
/*private*/ const SCHEMES = ['http' => 80, 'https' => 443];
2899+
private const SCHEMES = ['http' => 80, 'https' => 443];
29002900

2901-
/*private*/ const CHAR_UNRESERVED = 'a-zA-Z0-9_\-\.~';
2901+
private const CHAR_UNRESERVED = 'a-zA-Z0-9_\-\.~';
29022902

2903-
/*private*/ const CHAR_SUB_DELIMS = '!\$&\'\(\)\*\+,;=';
2903+
private const CHAR_SUB_DELIMS = '!\$&\'\(\)\*\+,;=';
29042904

2905-
/*private*/ const CHAR_GEN_DELIMS = ':\/\?#\[\]@';
2905+
private const CHAR_GEN_DELIMS = ':\/\?#\[\]@';
29062906

29072907
/** @var string Uri scheme. */
29082908
private $scheme = '';
@@ -2984,7 +2984,7 @@ public function getHost(): string
29842984
return $this->host;
29852985
}
29862986

2987-
public function getPort() /*:?int*/
2987+
public function getPort(): ?int
29882988
{
29892989
return $this->port;
29902990
}
@@ -3194,7 +3194,7 @@ private static function isNonStandardPort(string $scheme, int $port): bool
31943194
return !isset(self::SCHEMES[$scheme]) || $port !== self::SCHEMES[$scheme];
31953195
}
31963196

3197-
private function filterPort($port) /*:?int*/
3197+
private function filterPort($port): ?int
31983198
{
31993199
if (null === $port) {
32003200
return null;

0 commit comments

Comments
 (0)