Skip to content
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
168 changes: 168 additions & 0 deletions config/phpstan-baseline.neon
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,30 @@ parameters:
count: 1
path: ../src/CSSList/CSSList.php

-
message: '#^Only booleans are allowed in an if condition, Sabberworm\\CSS\\CSSList\\CSSListItem\|false given\.$#'
identifier: if.condNotBoolean
count: 1
path: ../src/CSSList/CSSList.php

-
message: '#^Parameter \#1 \$animationName of method Sabberworm\\CSS\\CSSList\\KeyFrame\:\:setAnimationName\(\) expects non\-empty\-string, string given\.$#'
identifier: argument.type
count: 1
path: ../src/CSSList/CSSList.php

-
message: '#^Parameter \#2 \$found of class Sabberworm\\CSS\\Parsing\\UnexpectedTokenException constructor expects string, Sabberworm\\CSS\\Value\\CSSFunction\|Sabberworm\\CSS\\Value\\CSSString\|Sabberworm\\CSS\\Value\\LineName\|Sabberworm\\CSS\\Value\\Size\|Sabberworm\\CSS\\Value\\URL given\.$#'
identifier: argument.type
count: 1
path: ../src/CSSList/CSSList.php

-
message: '#^Parameter \#2 \$found of class Sabberworm\\CSS\\Parsing\\UnexpectedTokenException constructor expects string, Sabberworm\\CSS\\Value\\CSSFunction\|Sabberworm\\CSS\\Value\\LineName\|Sabberworm\\CSS\\Value\\Size\|string given\.$#'
identifier: argument.type
count: 1
path: ../src/CSSList/CSSList.php

-
message: '#^Parameters should have "Sabberworm\\CSS\\CSSList\\CSSListItem\|array" types as the only types passed to this method$#'
identifier: typePerfect.narrowPublicClassMethodParamType
Expand All @@ -24,18 +42,72 @@ parameters:
count: 1
path: ../src/CSSList/Document.php

-
message: '#^Method Sabberworm\\CSS\\Parsing\\ParserState\:\:parseIdentifier\(\) should return non\-empty\-string but returns string\.$#'
identifier: return.type
count: 1
path: ../src/Parsing/ParserState.php

-
message: '#^Method Sabberworm\\CSS\\Parsing\\ParserState\:\:strlen\(\) should return int\<0, max\> but returns int\<0, max\>\|false\.$#'
identifier: return.type
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: '#^Property Sabberworm\\CSS\\Parsing\\ParserState\:\:\$currentPosition \(int\<0, max\>\) does not accept int\.$#'
identifier: assign.propertyType
count: 2
path: ../src/Parsing/ParserState.php

-
message: '#^Parameter \#1 \$separator of class Sabberworm\\CSS\\Value\\RuleValueList constructor expects non\-empty\-string, string given\.$#'
identifier: argument.type
count: 1
path: ../src/Rule/Rule.php

-
message: '#^Parameter \#1 \$value of method Sabberworm\\CSS\\Rule\\Rule\:\:setValue\(\) expects Sabberworm\\CSS\\Value\\RuleValueList\|string\|null, Sabberworm\\CSS\\Value\\Value\|string given\.$#'
identifier: argument.type
count: 1
path: ../src/Rule/Rule.php

-
message: '#^Cannot call method getSelector\(\) on Sabberworm\\CSS\\Property\\Selector\|string\.$#'
identifier: method.nonObject
count: 1
path: ../src/RuleSet/DeclarationBlock.php

-
message: '#^Method Sabberworm\\CSS\\RuleSet\\DeclarationBlock\:\:getSelectors\(\) should return array\<Sabberworm\\CSS\\Property\\Selector\> but returns array\<Sabberworm\\CSS\\Property\\Selector\|string\>\.$#'
identifier: return.type
count: 1
path: ../src/RuleSet/DeclarationBlock.php

-
message: '#^Parameter \#1 \$comments of method Sabberworm\\CSS\\RuleSet\\DeclarationBlock\:\:setComments\(\) expects list\<Sabberworm\\CSS\\Comment\\Comment\>, array\<int, Sabberworm\\CSS\\Comment\\Comment\> given\.$#'
identifier: argument.type
count: 1
path: ../src/RuleSet/DeclarationBlock.php

-
message: '#^Parameters should have "string" types as the only types passed to this method$#'
identifier: typePerfect.narrowPublicClassMethodParamType
count: 1
path: ../src/RuleSet/DeclarationBlock.php

-
message: '#^Parameter \#1 \$name of class Sabberworm\\CSS\\Value\\CSSFunction constructor expects non\-empty\-string, string given\.$#'
identifier: argument.type
count: 1
path: ../src/Value/CSSFunction.php

-
message: '#^Parameter \#2 \$arguments of class Sabberworm\\CSS\\Value\\CSSFunction constructor expects array\<Sabberworm\\CSS\\Value\\Value\|string\>\|Sabberworm\\CSS\\Value\\RuleValueList, Sabberworm\\CSS\\Value\\Value\|string given\.$#'
identifier: argument.type
Expand All @@ -54,6 +126,24 @@ parameters:
count: 3
path: ../src/Value/Color.php

-
message: '#^Parameter \#1 \$name of method Sabberworm\\CSS\\Value\\CSSFunction\:\:__construct\(\) expects non\-empty\-string, string given\.$#'
identifier: argument.type
count: 1
path: ../src/Value/Color.php

-
message: '#^Parameter \#1 \$name of method Sabberworm\\CSS\\Value\\CSSFunction\:\:setName\(\) expects non\-empty\-string, string given\.$#'
identifier: argument.type
count: 1
path: ../src/Value/Color.php

-
message: '#^Method Sabberworm\\CSS\\Value\\Size\:\:render\(\) should return non\-empty\-string but returns string\.$#'
identifier: return.type
count: 1
path: ../src/Value/Size.php

-
message: '#^Parameters should have "float" types as the only types passed to this method$#'
identifier: typePerfect.narrowPublicClassMethodParamType
Expand All @@ -66,6 +156,18 @@ parameters:
count: 1
path: ../src/Value/Size.php

-
message: '#^Method Sabberworm\\CSS\\Value\\Value\:\:parseIdentifierOrFunction\(\) should return Sabberworm\\CSS\\Value\\CSSFunction\|string but returns Sabberworm\\CSS\\Value\\CSSFunction\|Sabberworm\\CSS\\Value\\URL\|string\.$#'
identifier: return.type
count: 1
path: ../src/Value/Value.php

-
message: '#^Parameter \#1 \$name of class Sabberworm\\CSS\\Value\\CSSFunction constructor expects non\-empty\-string, string given\.$#'
identifier: argument.type
count: 1
path: ../src/Value/Value.php

-
message: '#^Parameter \#2 \$arguments of class Sabberworm\\CSS\\Value\\CSSFunction constructor expects array\<Sabberworm\\CSS\\Value\\Value\|string\>\|Sabberworm\\CSS\\Value\\RuleValueList, Sabberworm\\CSS\\Value\\Value\|string given\.$#'
identifier: argument.type
Expand All @@ -78,12 +180,36 @@ parameters:
count: 1
path: ../src/Value/Value.php

-
message: '#^Parameter \#1 \$rule of class Sabberworm\\CSS\\Rule\\Rule constructor expects non\-empty\-string, string given\.$#'
identifier: argument.type
count: 1
path: ../tests/Functional/RuleSet/RuleSetTest.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

-
message: '#^Cannot call method getListComponents\(\) on Sabberworm\\CSS\\Value\\RuleValueList\|string\.$#'
identifier: method.nonObject
count: 2
path: ../tests/ParserTest.php

-
message: '#^Cannot call method getListSeparator\(\) on Sabberworm\\CSS\\Value\\RuleValueList\|string\.$#'
identifier: method.nonObject
count: 2
path: ../tests/ParserTest.php

-
message: '#^Cannot call method render\(\) on Sabberworm\\CSS\\Value\\RuleValueList\|string\.$#'
identifier: method.nonObject
count: 1
path: ../tests/ParserTest.php

-
message: '#^Parameter \#1 \$value of method Sabberworm\\CSS\\Rule\\Rule\:\:setValue\(\) expects Sabberworm\\CSS\\Value\\RuleValueList\|string\|null, Sabberworm\\CSS\\Value\\Size given\.$#'
identifier: argument.type
Expand Down Expand Up @@ -113,3 +239,45 @@ parameters:
identifier: argument.type
count: 2
path: ../tests/Unit/CSSList/CSSListTest.php

-
message: '#^Method Sabberworm\\CSS\\Tests\\Unit\\Comment\\CommentContainerTest\:\:provideAlternativeNonemptyCommentArray\(\) should return array\<non\-empty\-string, array\{non\-empty\-list\<Sabberworm\\CSS\\Comment\\Comment\>\}\> but returns array\<non\-empty\-string, array\{list\<Sabberworm\\CSS\\Comment\\Comment\>\}\>\.$#'
identifier: return.type
count: 1
path: ../tests/Unit/Comment/CommentContainerTest.php

-
message: '#^Parameter \#1 \$numberOfSpaces of method Sabberworm\\CSS\\OutputFormat\:\:indentWithSpaces\(\) expects int\<1, max\>, int given\.$#'
identifier: argument.type
count: 1
path: ../tests/Unit/OutputFormatTest.php

-
message: '#^Parameter \#1 \$numberOfTabs of method Sabberworm\\CSS\\OutputFormat\:\:indentWithTabs\(\) expects int\<1, max\>, int given\.$#'
identifier: argument.type
count: 1
path: ../tests/Unit/OutputFormatTest.php

-
message: '#^Parameter \#1 \$lineNumber of method Sabberworm\\CSS\\Tests\\Unit\\Position\\Fixtures\\ConcretePosition\:\:setPosition\(\) expects int\<1, max\>\|null, int given\.$#'
identifier: argument.type
count: 2
path: ../tests/Unit/Position/PositionTest.php

-
message: '#^Parameter \#2 \$columnNumber of method Sabberworm\\CSS\\Tests\\Unit\\Position\\Fixtures\\ConcretePosition\:\:setPosition\(\) expects int\<0, max\>\|null, int given\.$#'
identifier: argument.type
count: 3
path: ../tests/Unit/Position/PositionTest.php

-
message: '#^Parameter \#1 \$rule of class Sabberworm\\CSS\\Rule\\Rule constructor expects non\-empty\-string, string given\.$#'
identifier: argument.type
count: 19
path: ../tests/Unit/RuleSet/DeclarationBlockTest.php

-
message: '#^Parameter \#1 \$rule of class Sabberworm\\CSS\\Rule\\Rule constructor expects non\-empty\-string, string given\.$#'
identifier: argument.type
count: 19
path: ../tests/Unit/RuleSet/RuleSetTest.php
2 changes: 1 addition & 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: 6
level: 7

paths:
- %currentWorkingDirectory%/bin/
Expand Down