| Subject |
Details |
| Rector version |
0.6.10 |
| PHP version |
PHP 7.2 |
Current Behaviour
*
* @ORM\Embeddable
*/
-class Address implements AddressInterface
+final class Address implements AddressInterface
{
use ComplexValueObjectTrait {
__construct as traitConstruct;
----------- end diff -----------
Applied rules:
* Rector\SOLID\Rector\Class_\FinalizeClassesWithoutChildrenRector
* Rector\CodingStyle\Rector\Namespace_\ImportFullyQualifiedNamesRector
Rector makes the class final also if it shouldn't.
I have no idea of how to create a test case about this as it seems it is covered by https://github.com/rectorphp/rector/blob/master/packages/SOLID/tests/Rector/Class_/FinalizeClassesWithoutChildrenRector/Fixture/fixture.php.inc
But actually it doesn't work.
How to reproduce the issue
As I'm not able to create a failing test case, to verify the bug it way simpler use the source code that cause the issue.
- Clone the repo https://github.com/Aerendir/PHPValueObjects
composer install
- Open the file `rector.yaml``
- Uncomment the line 65 (the one that excludes the rector
Rector\SOLID\Rector\Class_\FinalizeClassesWithoutChildrenRector)
- Run the command
vendor/bin/rector process src/Address/Address.php
The bug appears.
Current Behaviour
Rector makes the class
finalalso if it shouldn't.I have no idea of how to create a test case about this as it seems it is covered by https://github.com/rectorphp/rector/blob/master/packages/SOLID/tests/Rector/Class_/FinalizeClassesWithoutChildrenRector/Fixture/fixture.php.inc
But actually it doesn't work.
How to reproduce the issue
As I'm not able to create a failing test case, to verify the bug it way simpler use the source code that cause the issue.
composer installRector\SOLID\Rector\Class_\FinalizeClassesWithoutChildrenRector)vendor/bin/rector process src/Address/Address.phpThe bug appears.