diff --git a/.gitattributes b/.gitattributes index 1a0dbd9e..71ea87ab 100644 --- a/.gitattributes +++ b/.gitattributes @@ -1,13 +1,11 @@ .github/ export-ignore -.phan/ export-ignore docs/ export-ignore Tests/ export-ignore -.drone.jsonnet export-ignore -.drone.yml export-ignore .editorconfig export-ignore .gitattributes export-ignore .gitignore export-ignore .phpunit.cache export-ignore phpunit.xml.dist export-ignore -rector.php export-ignore ruleset.xml export-ignore +phpstan.neon export-ignore +phpstan-baseline.neon export-ignore diff --git a/phpstan-baseline.neon b/phpstan-baseline.neon new file mode 100644 index 00000000..7b1994c3 --- /dev/null +++ b/phpstan-baseline.neon @@ -0,0 +1,19 @@ +parameters: + ignoreErrors: + - + message: '#^Call to function is_int\(\) with int will always evaluate to true\.$#' + identifier: function.alreadyNarrowedType + count: 1 + path: src/AbstractWebApplication.php + + - + message: '#^Instanceof between DateTime and DateTime will always evaluate to true\.$#' + identifier: instanceof.alwaysTrue + count: 1 + path: src/AbstractWebApplication.php + + - + message: '#^Result of && is always false\.$#' + identifier: booleanAnd.alwaysFalse + count: 1 + path: src/AbstractWebApplication.php diff --git a/phpstan.neon b/phpstan.neon index 07d82270..305d72f1 100644 --- a/phpstan.neon +++ b/phpstan.neon @@ -1,6 +1,7 @@ includes: - vendor/phpstan/phpstan-deprecation-rules/rules.neon + - phpstan-baseline.neon parameters: level: 5 diff --git a/src/AbstractWebApplication.php b/src/AbstractWebApplication.php index 23464c00..0f325601 100644 --- a/src/AbstractWebApplication.php +++ b/src/AbstractWebApplication.php @@ -321,7 +321,7 @@ protected function compress() // Iterate through the encodings and attempt to compress the data using any found supported encodings. foreach ($encodings as $encoding) { - if (($supported[$encoding] == 'gz') || ($supported[$encoding] == 'deflate')) { + if (in_array($supported[$encoding], ['gz', 'deflate'])) { // Verify that the server supports gzip compression before we attempt to gzip encode the data. // @codeCoverageIgnoreStart if (!\extension_loaded('zlib') || \ini_get('zlib.output_compression')) {