Skip to content

[TASK] Raise PHPStan to level 4 #1201

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
30 changes: 30 additions & 0 deletions config/phpstan-baseline.neon
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -36,6 +42,18 @@ parameters:
count: 1
path: ../src/CSSList/Document.php

-
message: '#^Call to function in_array\(\) with arguments null, list\<string\> 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
Expand Down Expand Up @@ -89,3 +107,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
7 changes: 6 additions & 1 deletion config/phpstan.neon
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ parameters:

phpVersion: 70200

level: 3
level: 4

paths:
- %currentWorkingDirectory%/bin/
Expand All @@ -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/'