Skip to content

Commit bdb95ea

Browse files
authored
[TASK] Do not treat PHPDoc type information as certain (#1583)
This is a library. This means that we have no control over how other software calls our methods, and whether they adher to the types required via `@param` annotations. Hence, we shouldn't rely on those types being certain.
1 parent 8ad8565 commit bdb95ea

2 files changed

Lines changed: 2 additions & 6 deletions

File tree

Build/phpstan/phpstan-baseline.neon

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -48,12 +48,6 @@ parameters:
4848
count: 1
4949
path: ../../src/Value/Value.php
5050

51-
-
52-
message: '#^Call to static method PHPUnit\\Framework\\Assert\:\:assertSame\(\) with ''red'' and Sabberworm\\CSS\\Value\\Value will always evaluate to false\.$#'
53-
identifier: staticMethod.impossibleType
54-
count: 1
55-
path: ../../tests/ParserTest.php
56-
5751
-
5852
message: '#^Parameter \#1 \$value of method Sabberworm\\CSS\\Property\\Declaration\:\:setValue\(\) expects Sabberworm\\CSS\\Value\\RuleValueList\|string\|null, Sabberworm\\CSS\\Value\\Size given\.$#'
5953
identifier: argument.type

Build/phpstan/phpstan.neon

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,8 @@ parameters:
1111
- %currentWorkingDirectory%/src/
1212
- %currentWorkingDirectory%/tests/
1313

14+
treatPhpDocTypesAsCertain: false
15+
1416
type_perfect:
1517
no_mixed_property: true
1618
no_mixed_caller: true

0 commit comments

Comments
 (0)