[Symfony] RemoveDefaultGetBlockPrefixRector remove block even is extending another class
Bug Report
| Subject | Details |
|---|---|
| Rector version | Rector 0.13.10 |
Minimal PHP Code Causing Issue
https://getrector.org/demo/845e536a-09f7-4566-9d10-194e33ab447c
I don't know why the demo does't fix the code, but in my project it does
Expected Behaviour
It must not remove the block prefix
I guess the issue is here
Because a type always extends AbstractType.
Thank you for your report and demo link!
Could you send a failing test fixture in a pull-request to RemoveDefaultGetBlockPrefixRectorTest, so we have it covered in Rector?
I added this fixtures, but it works (I means the test is OK)
But In my project, the method is removed
<?php
namespace Rector\Symfony\Tests\Rector\ClassMethod\RemoveDefaultGetBlockPrefixRector\Fixture;
use Symfony\Component\Form\ChoiceType;
class IconType extends ChoiceType
{
public function getBlockPrefix()
{
return 'icon';
}
}
?>
-----
<?php
namespace Rector\Symfony\Tests\Rector\ClassMethod\RemoveDefaultGetBlockPrefixRector\Fixture;
use Symfony\Component\Form\ChoiceType;
class IconType extends ChoiceType
{
public function getBlockPrefix()
{
return 'icon';
}
}
?>
Found: https://github.com/rectorphp/rector-symfony/pull/212
Thank you for the test fixture :+1: I'm looking into it