diff --git a/config/phpstan-baseline.neon b/config/phpstan-baseline.neon index 9be2ebd7..8b9d2fb4 100644 --- a/config/phpstan-baseline.neon +++ b/config/phpstan-baseline.neon @@ -6,6 +6,12 @@ parameters: count: 1 path: ../src/CSSList/AtRuleBlockList.php + - + message: '#^Call to function is_string\(\) with Sabberworm\\CSS\\Parsing\\ParserState will always evaluate to false\.$#' + identifier: function.impossibleType + count: 1 + path: ../src/CSSList/CSSList.php + - message: '#^Loose comparison via "\!\=" is not allowed\.$#' identifier: notEqual.notAllowed @@ -36,6 +42,18 @@ parameters: count: 1 path: ../src/CSSList/Document.php + - + message: '#^Call to function in_array\(\) with arguments null, list\ and true will always evaluate to false\.$#' + identifier: function.impossibleType + count: 1 + path: ../src/Parsing/ParserState.php + + - + message: '#^Negated boolean expression is always true\.$#' + identifier: booleanNot.alwaysTrue + count: 1 + path: ../src/Parsing/ParserState.php + - message: '#^Only booleans are allowed in an if condition, Sabberworm\\CSS\\Value\\RuleValueList\|string\|null given\.$#' identifier: if.condNotBoolean @@ -83,3 +101,15 @@ parameters: identifier: typePerfect.narrowPublicClassMethodParamType count: 1 path: ../src/Value/Size.php + + - + message: '#^Strict comparison using \!\=\= between non\-empty\-string and null will always evaluate to true\.$#' + identifier: notIdentical.alwaysTrue + count: 1 + path: ../src/Value/Size.php + + - + message: '#^Call to static method PHPUnit\\Framework\\Assert\:\:assertSame\(\) with ''red'' and Sabberworm\\CSS\\Value\\Value will always evaluate to false\.$#' + identifier: staticMethod.impossibleType + count: 1 + path: ../tests/ParserTest.php diff --git a/config/phpstan.neon b/config/phpstan.neon index 6a410ac2..9eee8659 100644 --- a/config/phpstan.neon +++ b/config/phpstan.neon @@ -8,7 +8,7 @@ parameters: phpVersion: 70200 - level: 3 + level: 4 paths: - %currentWorkingDirectory%/bin/ @@ -21,3 +21,8 @@ parameters: null_over_false: true narrow_param: true narrow_return: true + + ignoreErrors: + - + message: '#^Call to static method PHPUnit\\Framework\\Assert\:\:assertInstanceOf\(\) .* will always evaluate to#' + path: '../tests/'