Skip to content
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

[Php70][Visibility] Avoid error Argument #1 ($scope) must be of type PHPStan\Analyser\Scope, null given #1120

Merged
merged 11 commits into from
Nov 1, 2021

Conversation

samsonasik
Copy link
Member

I tried to apply latest "rector/rector": "dev-main" for use PHPStan 1.0, and got error into CodeIgniter project to test compatibilty early codeigniter4/CodeIgniter4#5269 and got error:

Error: ] Could not process "system/CodeIgniter.php" file, due to:               
         "Rector\NodeCollector\ScopeResolver\ParentClassScopeResolver::resolvePa
         rentClassName(): Argument #1 ($scope) must be of type                  
         PHPStan\Analyser\Scope, null given, called in                          
         vendor/rector/rector/rules/Php70/Rector/StaticCall/StaticCallOnNonStati
         cToInstanceCallRector.php:152". On line: 10    

this patch fix it.

@samsonasik
Copy link
Member Author

CI error seems unrelated.

@samsonasik
Copy link
Member Author

@TomasVotruba it seems ready for merge, CI error is unrelated.

@TomasVotruba
Copy link
Member

TomasVotruba commented Nov 1, 2021

Thank you 👍

I've fixed the CI to comply with Symplify removal of symfony/http-kernel - see deprecated-packages/symplify#3726
Should be ✔️ now

@TomasVotruba TomasVotruba enabled auto-merge (squash) November 1, 2021 15:28
@samsonasik
Copy link
Member Author

@TomasVotruba there is still 1 test error:

 There was 1 error:

1) Rector\Tests\TypeDeclaration\Rector\ClassMethod\AddArrayReturnDocTypeRector\AddArrayReturnDocTypeRectorTest::test with data set #23 (Symplify\SmartFileSystem\SmartFileInfo Object (...))
PHPStan\Broker\ClassAutoloadingException: Class Symfony\Component\HttpKernel\Bundle\BundleInterface not found.

Do you think we need to create stub for BundleInterface or we can require --dev symfony/http-kernel?

@samsonasik
Copy link
Member Author

I added stub for BundleInterface d4ffaf1

@samsonasik
Copy link
Member Author

it seems define empty interface BundleInterface is make it works

@TomasVotruba TomasVotruba merged commit 539f70a into main Nov 1, 2021
@TomasVotruba TomasVotruba deleted the avoid-error-scope branch November 1, 2021 16:00
@TomasVotruba
Copy link
Member

it seems define empty interface BundleInterface is make it works

That's exactly the right solution 👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
3 participants