diff --git a/rules-tests/CodeQuality/Rector/Class_/ControllerMethodInjectionToConstructorRector/Fixture/with_entity_manager.php.inc b/rules-tests/CodeQuality/Rector/Class_/ControllerMethodInjectionToConstructorRector/Fixture/with_entity_manager.php.inc new file mode 100644 index 00000000..ecc54719 --- /dev/null +++ b/rules-tests/CodeQuality/Rector/Class_/ControllerMethodInjectionToConstructorRector/Fixture/with_entity_manager.php.inc @@ -0,0 +1,44 @@ +flush(); + } +} + +?> +----- +entityManager->flush(); + } +} + +?> diff --git a/rules/CodeQuality/Rector/Class_/ControllerMethodInjectionToConstructorRector.php b/rules/CodeQuality/Rector/Class_/ControllerMethodInjectionToConstructorRector.php index 9598e182..20d5cc7f 100644 --- a/rules/CodeQuality/Rector/Class_/ControllerMethodInjectionToConstructorRector.php +++ b/rules/CodeQuality/Rector/Class_/ControllerMethodInjectionToConstructorRector.php @@ -37,7 +37,7 @@ final class ControllerMethodInjectionToConstructorRector extends AbstractRector /** * @var string[] */ - private const array COMMON_ENTITY_CONTAINS_SUBNAMESPACES = ["\\Entity", "\\Document", "\\Model"]; + private const array COMMON_ENTITY_CONTAINS_SUBNAMESPACES = ["\\Entity\\", "\\Document", "\\Model"]; public function __construct( private readonly ControllerAnalyzer $controllerAnalyzer,