diff --git a/phpstan-baseline.neon b/phpstan-baseline.neon new file mode 100644 index 00000000..a61b54b2 --- /dev/null +++ b/phpstan-baseline.neon @@ -0,0 +1,43 @@ +parameters: + ignoreErrors: + - + message: '#^Instanceof between ArrayAccess and ArrayAccess will always evaluate to true\.$#' + identifier: instanceof.alwaysTrue + count: 1 + path: src/AbstractTransport.php + + - + message: '#^Result of && is always false\.$#' + identifier: booleanAnd.alwaysFalse + count: 1 + path: src/AbstractTransport.php + + - + message: '#^Instanceof between ArrayAccess and ArrayAccess will always evaluate to true\.$#' + identifier: instanceof.alwaysTrue + count: 1 + path: src/Http.php + + - + message: '#^Instanceof between Joomla\\Uri\\UriInterface and Joomla\\Uri\\UriInterface will always evaluate to true\.$#' + identifier: instanceof.alwaysTrue + count: 1 + path: src/Http.php + + - + message: '#^Result of && is always false\.$#' + identifier: booleanAnd.alwaysFalse + count: 1 + path: src/Http.php + + - + message: '#^Instanceof between ArrayAccess and ArrayAccess will always evaluate to true\.$#' + identifier: instanceof.alwaysTrue + count: 2 + path: src/HttpFactory.php + + - + message: '#^Result of && is always false\.$#' + identifier: booleanAnd.alwaysFalse + count: 2 + path: src/HttpFactory.php diff --git a/phpstan.neon b/phpstan.neon index 07d82270..2197bd8f 100644 --- a/phpstan.neon +++ b/phpstan.neon @@ -1,5 +1,6 @@ includes: + - phpstan-baseline.neon - vendor/phpstan/phpstan-deprecation-rules/rules.neon parameters: diff --git a/src/Transport/Socket.php b/src/Transport/Socket.php index 94d12432..9aedd4c8 100644 --- a/src/Transport/Socket.php +++ b/src/Transport/Socket.php @@ -286,6 +286,6 @@ protected function connect(UriInterface $uri, $timeout = null) */ public static function isSupported() { - return \function_exists('fsockopen') && \is_callable('fsockopen'); + return \function_exists('fsockopen'); } } diff --git a/src/Transport/Stream.php b/src/Transport/Stream.php index 076abcd6..ef468ba0 100644 --- a/src/Transport/Stream.php +++ b/src/Transport/Stream.php @@ -258,6 +258,6 @@ protected function getResponse(array $headers, $body) */ public static function isSupported() { - return \function_exists('fopen') && \is_callable('fopen') && ini_get('allow_url_fopen'); + return \function_exists('fopen') && ini_get('allow_url_fopen'); } }