Skip to content

Bump to PHPStan 1.10.26#4546

Merged
TomasVotruba merged 8 commits intomainfrom
bump-phpstan-26
Jul 20, 2023
Merged

Bump to PHPStan 1.10.26#4546
TomasVotruba merged 8 commits intomainfrom
bump-phpstan-26

Conversation

@samsonasik
Copy link
Copy Markdown
Member

@samsonasik samsonasik commented Jul 19, 2023

@TomasVotruba new PHPStan release 1.10.26 https://github.com/phpstan/phpstan/releases/tag/1.10.26 cause error in unit test:

➜  rector-phpunit git:(main) vendor/bin/phpunit tests/Rector/ClassMethod/CreateMockToAnonymousClassRector 
PHPUnit 10.2.6 by Sebastian Bergmann and contributors.

Runtime:       PHP 8.2.5
Configuration: /Users/samsonasik/www/rector-phpunit/phpunit.xml

E.E                                                                 3 / 3 (100%)

Time: 00:01.379, Memory: 90.50 MB

There were 2 errors:

1) Rector\PHPUnit\Tests\Rector\ClassMethod\CreateMockToAnonymousClassRector\CreateMockToAnonymousClassRectorTest::test with data set #0
TypeError: PHPStan\Node\MethodReturnStatementsNode::__construct(): Argument #6 ($classReflection) must be of type PHPStan\Reflection\ClassReflection, null given, called in phar:///Users/samsonasik/www/rector-phpunit/vendor/phpstan/phpstan/phpstan.phar/src/Analyser/NodeScopeResolver.php on line 563

Ref https://github.com/rectorphp/rector-src/actions/runs/5600187475/jobs/10242212477

@samsonasik samsonasik requested a review from TomasVotruba as a code owner July 19, 2023 14:07
@samsonasik
Copy link
Copy Markdown
Member Author

@samsonasik
Copy link
Copy Markdown
Member Author

Let's try remove context null fill check now 44f2a6a

@samsonasik
Copy link
Copy Markdown
Member Author

Remove context null cause error on e2e test:

Error: R] Could not process
-         "./applied-rule-removed-node-
-         with-cache/src/DeadConstructor.php" file, due to:
-         "System error: "Internal error."

https://github.com/rectorphp/rector-src/actions/runs/5600277050/jobs/10242432950?pr=4546

@samsonasik
Copy link
Copy Markdown
Member Author

Let's try using try catch: fill classReflection property when possible 084a667

@samsonasik
Copy link
Copy Markdown
Member Author

@TomasVotruba it works 🎉🎉🎉

@samsonasik
Copy link
Copy Markdown
Member Author

All checks have passed 🎉 @TomasVotruba I think it is ready.

@TomasVotruba
Copy link
Copy Markdown
Member

Thank you 🙏

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants