-
-
Notifications
You must be signed in to change notification settings - Fork 687
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
Add failing test fixture for DowngradeParameterTypeWideningRector #5995
Conversation
# Failing Test for DowngradeParameterTypeWideningRector Based on https://getrector.org/demo/1b8ee6a0-7d50-4fae-8e15-f19d19591fc5
Issue: #5994 |
Alright, bug fixed! Traits must be skipped for this rule, so I added: if ($ancestorClassReflection->isTrait()) {
continue;
} Please check and merge 🙏 |
Thank you Leo |
@leoloso it possibly cause issue on rector prefixed build which so make error: PHP Fatal error: Declaration of RectorPrefix20210420\Symfony\Component\DependencyInjection\ServiceLocator::has(string $id) must be compatible with RectorPrefix20210420\Psr\Container\ContainerInterface::has($id) in /home/runner/work/rector-prefixed/rector-prefixed/vendor/symfony/dependency-injection/ServiceLocator.php on line 25
Fatal error: Declaration of RectorPrefix20210420\Symfony\Component\DependencyInjection\ServiceLocator::has(string $id) must be compatible with RectorPrefix20210420\Psr\Container\ContainerInterface::has($id) in /home/runner/work/rector-prefixed/rector-prefixed/vendor/symfony/dependency-injection/ServiceLocator.php on line 25
Error: Process completed with exit code 255. |
I don't think this code I added is the one causing the issue. I explained in #6176 but also, this rule was originally modifying code in the class, if it implemented a trait: foreach ($classReflection->getAncestors() as $ancestorClassReflection) { But that's an error, because the same method defined in the class will override the one from the trait (check the fixture I added). And in any case, the offending code is in the trait So these are related, but different issues. |
@leoloso thank you for verify 👍 |
rectorphp/rector-src@2e36fff [Bc Break] [Alternative] Drop children class detection (#5995)
Failing Test for DowngradeParameterTypeWideningRector
Based on https://getrector.org/demo/1b8ee6a0-7d50-4fae-8e15-f19d19591fc5
Fixes #5994