Skip to content

Commit

Permalink
Update SA tools (#577)
Browse files Browse the repository at this point in the history
  • Loading branch information
GrahamCampbell authored Aug 27, 2023
1 parent 8bd7c33 commit 467d01c
Show file tree
Hide file tree
Showing 15 changed files with 15 additions and 41 deletions.
12 changes: 1 addition & 11 deletions phpstan-baseline.neon
Original file line number Diff line number Diff line change
Expand Up @@ -205,16 +205,6 @@ parameters:
count: 1
path: src/NoSeekStream.php

-
message: "#^Parameter \\#1 \\$string of function strlen expects string, mixed given\\.$#"
count: 1
path: src/PumpStream.php

-
message: "#^Parameter \\#1 \\$string of method GuzzleHttp\\\\Psr7\\\\BufferStream\\:\\:write\\(\\) expects string, mixed given\\.$#"
count: 1
path: src/PumpStream.php

-
message: "#^Unreachable statement \\- code above always terminates\\.$#"
count: 1
Expand Down Expand Up @@ -311,7 +301,7 @@ parameters:
path: src/Utils.php

-
message: "#^Parameter \\#1 \\$source of class GuzzleHttp\\\\Psr7\\\\PumpStream constructor expects callable\\(int\\)\\: string\\|false\\|null, Closure\\(\\)\\: mixed given\\.$#"
message: "#^Parameter \\#1 \\$source of class GuzzleHttp\\\\Psr7\\\\PumpStream constructor expects callable\\(int\\)\\: \\(string\\|false\\|null\\), Closure\\(\\)\\: mixed given\\.$#"
count: 1
path: src/Utils.php

Expand Down
2 changes: 1 addition & 1 deletion psalm-baseline.xml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
<files psalm-version="5.9.0@8b9ad1eb9e8b7d3101f949291da2b9f7767cd163">
<files psalm-version="5.15.0@5c774aca4746caf3d239d9c8cadb9f882ca29352">
<file src="src/FnStream.php">
<InvalidFunctionCall>
<code><![CDATA[call_user_func($this->_fn___toString)]]></code>
Expand Down
8 changes: 3 additions & 5 deletions src/AppendStream.php
Original file line number Diff line number Diff line change
Expand Up @@ -140,9 +140,9 @@ public function getSize(): ?int

public function eof(): bool
{
return !$this->streams ||
($this->current >= count($this->streams) - 1 &&
$this->streams[$this->current]->eof());
return !$this->streams
|| ($this->current >= count($this->streams) - 1
&& $this->streams[$this->current]->eof());
}

public function rewind(): void
Expand Down Expand Up @@ -239,8 +239,6 @@ public function write($string): int
}

/**
* {@inheritdoc}
*
* @return mixed
*/
public function getMetadata($key = null)
Expand Down
2 changes: 0 additions & 2 deletions src/BufferStream.php
Original file line number Diff line number Diff line change
Expand Up @@ -134,8 +134,6 @@ public function write($string): int
}

/**
* {@inheritdoc}
*
* @return mixed
*/
public function getMetadata($key = null)
Expand Down
2 changes: 0 additions & 2 deletions src/FnStream.php
Original file line number Diff line number Diff line change
Expand Up @@ -170,8 +170,6 @@ public function getContents(): string
}

/**
* {@inheritdoc}
*
* @return mixed
*/
public function getMetadata($key = null)
Expand Down
4 changes: 1 addition & 3 deletions src/PumpStream.php
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ final class PumpStream implements StreamInterface
private $buffer;

/**
* @param callable(int): (string|null|false) $source Source of the stream data. The callable MAY
* @param callable(int): (string|false|null) $source Source of the stream data. The callable MAY
* accept an integer argument used to control the
* amount of data to return. The callable MUST
* return a string when called, or false|null on error
Expand Down Expand Up @@ -150,8 +150,6 @@ public function getContents(): string
}

/**
* {@inheritdoc}
*
* @return mixed
*/
public function getMetadata($key = null)
Expand Down
4 changes: 0 additions & 4 deletions src/ServerRequest.php
Original file line number Diff line number Diff line change
Expand Up @@ -286,8 +286,6 @@ public function withQueryParams(array $query): ServerRequestInterface
}

/**
* {@inheritdoc}
*
* @return array|object|null
*/
public function getParsedBody()
Expand All @@ -309,8 +307,6 @@ public function getAttributes(): array
}

/**
* {@inheritdoc}
*
* @return mixed
*/
public function getAttribute($attribute, $default = null)
Expand Down
2 changes: 0 additions & 2 deletions src/Stream.php
Original file line number Diff line number Diff line change
Expand Up @@ -264,8 +264,6 @@ public function write($string): int
}

/**
* {@inheritdoc}
*
* @return mixed
*/
public function getMetadata($key = null)
Expand Down
2 changes: 0 additions & 2 deletions src/StreamDecoratorTrait.php
Original file line number Diff line number Diff line change
Expand Up @@ -82,8 +82,6 @@ public function close(): void
}

/**
* {@inheritdoc}
*
* @return mixed
*/
public function getMetadata($key = null)
Expand Down
4 changes: 2 additions & 2 deletions src/UriNormalizer.php
Original file line number Diff line number Diff line change
Expand Up @@ -131,8 +131,8 @@ public static function normalize(UriInterface $uri, int $flags = self::PRESERVIN
$uri = self::decodeUnreservedCharacters($uri);
}

if ($flags & self::CONVERT_EMPTY_PATH && $uri->getPath() === '' &&
($uri->getScheme() === 'http' || $uri->getScheme() === 'https')
if ($flags & self::CONVERT_EMPTY_PATH && $uri->getPath() === ''
&& ($uri->getScheme() === 'http' || $uri->getScheme() === 'https')
) {
$uri = $uri->withPath('/');
}
Expand Down
4 changes: 2 additions & 2 deletions src/UriResolver.php
Original file line number Diff line number Diff line change
Expand Up @@ -127,8 +127,8 @@ public static function resolve(UriInterface $base, UriInterface $rel): UriInterf
*/
public static function relativize(UriInterface $base, UriInterface $target): UriInterface
{
if ($target->getScheme() !== '' &&
($base->getScheme() !== $target->getScheme() || $target->getAuthority() === '' && $base->getAuthority() !== '')
if ($target->getScheme() !== ''
&& ($base->getScheme() !== $target->getScheme() || $target->getAuthority() === '' && $base->getAuthority() !== '')
) {
return $target;
}
Expand Down
2 changes: 1 addition & 1 deletion src/Utils.php
Original file line number Diff line number Diff line change
Expand Up @@ -231,7 +231,7 @@ public static function modifyRequest(RequestInterface $request, array $changes):
* @param StreamInterface $stream Stream to read from
* @param int|null $maxLength Maximum buffer length
*/
public static function readLine(StreamInterface $stream, ?int $maxLength = null): string
public static function readLine(StreamInterface $stream, int $maxLength = null): string
{
$buffer = '';
$size = 0;
Expand Down
2 changes: 1 addition & 1 deletion vendor-bin/php-cs-fixer/composer.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"require": {
"php": "^7.4 || ^8.0",
"friendsofphp/php-cs-fixer": "3.16.0"
"friendsofphp/php-cs-fixer": "3.23.0"
},
"config": {
"preferred-install": "dist"
Expand Down
4 changes: 2 additions & 2 deletions vendor-bin/phpstan/composer.json
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
{
"require": {
"php": "^7.4 || ^8.0",
"phpstan/phpstan": "1.10.11",
"phpstan/phpstan-deprecation-rules": "1.1.3"
"phpstan/phpstan": "1.10.32",
"phpstan/phpstan-deprecation-rules": "1.1.4"
},
"config": {
"preferred-install": "dist"
Expand Down
2 changes: 1 addition & 1 deletion vendor-bin/psalm/composer.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"require": {
"php": "^7.4 || ^8.0",
"psalm/phar": "5.9.0"
"psalm/phar": "5.15.0"
},
"config": {
"preferred-install": "dist"
Expand Down

0 comments on commit 467d01c

Please sign in to comment.