File tree Expand file tree Collapse file tree 7 files changed +18
-19
lines changed
tests/Type/WebMozartAssert Expand file tree Collapse file tree 7 files changed +18
-19
lines changed Original file line number Diff line number Diff line change @@ -12,6 +12,3 @@ before_script:
1212 - if [ "$dependencies" = "highest" ]; then composer update --no-interaction; fi;
1313script :
1414 - vendor/bin/phing
15- - >
16- wget https://github.com/maglnet/ComposerRequireChecker/releases/download/0.2.1/composer-require-checker.phar
17- && php composer-require-checker.phar check composer.json
Original file line number Diff line number Diff line change 8686 >
8787 <arg value =" analyse" />
8888 <arg value =" -l" />
89- <arg value =" 7 " />
89+ <arg value =" 8 " />
9090 <arg value =" -c" />
9191 <arg path =" phpstan.neon" />
9292 <arg path =" src" />
Original file line number Diff line number Diff line change 77 "prefer-stable" : true ,
88 "extra" : {
99 "branch-alias" : {
10- "dev-master" : " 0.11 -dev"
10+ "dev-master" : " 0.12 -dev"
1111 },
1212 "phpstan" : {
1313 "includes" : [
1717 },
1818 "require" : {
1919 "php" : " ~7.1" ,
20- "phpstan/phpstan" : " ^0.11.6 " ,
21- "nikic/php-parser" : " ^4.0 "
20+ "phpstan/phpstan" : " ^0.12 " ,
21+ "nikic/php-parser" : " ^4.3 "
2222 },
2323 "require-dev" : {
2424 "consistence/coding-standard" : " ^3.7" ,
2525 "dealerdirect/phpcodesniffer-composer-installer" : " ^0.4.4" ,
2626 "jakub-onderka/php-parallel-lint" : " ^1.0" ,
2727 "phing/phing" : " ^2.16.0" ,
28- "phpstan/phpstan-strict-rules" : " ^0.11 " ,
29- "phpstan/phpstan-phpunit" : " ^0.11 " ,
28+ "phpstan/phpstan-strict-rules" : " ^0.12 " ,
29+ "phpstan/phpstan-phpunit" : " ^0.12 " ,
3030 "phpunit/phpunit" : " ^7.1.3" ,
3131 "slevomat/coding-standard" : " ^4.5.2" ,
3232 "webmozart/assert" : " ^1.3.0"
Original file line number Diff line number Diff line change 2323 @dataProvider,
2424 @requires
2525 " />
26+ <property name =" enableObjectTypeHint" value =" false" />
2627 </properties >
28+ <exclude name =" SlevomatCodingStandard.TypeHints.TypeHintDeclaration.MissingTraversableParameterTypeHintSpecification" />
29+ <exclude name =" SlevomatCodingStandard.TypeHints.TypeHintDeclaration.MissingTraversableReturnTypeHintSpecification" />
2730 </rule >
2831 <rule ref =" SlevomatCodingStandard.ControlStructures.AssignmentInCondition" />
2932 <rule ref =" SlevomatCodingStandard.ControlStructures.DisallowEqualOperators" />
Original file line number Diff line number Diff line change @@ -7,6 +7,4 @@ includes:
77
88parameters :
99 excludes_analyse :
10- - */tests/*/data/*
11- ignoreErrors :
12- - '~^Parameter \#1 \$node \ (.*\ ) of method .*Rule::processNode\ (\ ) should be contravariant with parameter \$node \ (PhpParser\\Node\ ) of method PHPStan\\Rules\\Rule::processNode\ (\ )$~'
10+ - tests/*/data/*
Original file line number Diff line number Diff line change 44
55use PHPStan \Rules \Rule ;
66
7+ /**
8+ * @extends \PHPStan\Testing\RuleTestCase<VariableTypeReportingRule>
9+ */
710class AssertTypeSpecifyingExtensionTest extends \PHPStan \Testing \RuleTestCase
811{
912
@@ -138,11 +141,11 @@ public function testExtension(): void
138141 107 ,
139142 ],
140143 [
141- 'Variable $aa is: PHPStan\Type\WebMozartAssert\Foo|string ' ,
144+ 'Variable $aa is: class-string< PHPStan\Type\WebMozartAssert\Foo>|PHPStan\Type\WebMozartAssert\Foo ' ,
142145 110 ,
143146 ],
144147 [
145- 'Variable $ab is: array<PHPStan\Type\WebMozartAssert\Foo> ' ,
148+ 'Variable $ab is: array ' , // should array <PHPStan\Type\WebMozartAssert\Foo>
146149 113 ,
147150 ],
148151 [
Original file line number Diff line number Diff line change 55use PhpParser \Node ;
66use PHPStan \Analyser \Scope ;
77
8+ /**
9+ * @implements \PHPStan\Rules\Rule<Node\Expr\Variable>
10+ */
811class VariableTypeReportingRule implements \PHPStan \Rules \Rule
912{
1013
@@ -13,11 +16,6 @@ public function getNodeType(): string
1316 return Node \Expr \Variable::class;
1417 }
1518
16- /**
17- * @param \PhpParser\Node\Expr\Variable $node
18- * @param \PHPStan\Analyser\Scope $scope
19- * @return string[] errors
20- */
2119 public function processNode (Node $ node , Scope $ scope ): array
2220 {
2321 if (!is_string ($ node ->name )) {
You can’t perform that action at this time.
0 commit comments