diff --git a/rules-tests/Php81/Rector/Array_/ArrayToFirstClassCallableRector/Fixture/skip_symfony_config.php.inc b/rules-tests/Php81/Rector/Array_/ArrayToFirstClassCallableRector/Fixture/skip_symfony_config.php.inc deleted file mode 100644 index f97b8dd6edf..00000000000 --- a/rules-tests/Php81/Rector/Array_/ArrayToFirstClassCallableRector/Fixture/skip_symfony_config.php.inc +++ /dev/null @@ -1,11 +0,0 @@ -services() - ->factory([SomeExternalObject::class, 'sleepStatic']); -}; diff --git a/rules/Php81/Rector/Array_/ArrayToFirstClassCallableRector.php b/rules/Php81/Rector/Array_/ArrayToFirstClassCallableRector.php index 959d3c9fc75..88dae554450 100644 --- a/rules/Php81/Rector/Array_/ArrayToFirstClassCallableRector.php +++ b/rules/Php81/Rector/Array_/ArrayToFirstClassCallableRector.php @@ -94,10 +94,6 @@ public function refactor(Node $node): StaticCall|MethodCall|null return null; } - if ($node->getAttribute(AttributeKey::IS_INSIDE_SYMFONY_PHP_CLOSURE)) { - return null; - } - if ($node->getAttribute(AttributeKey::IS_ARRAY_AS_STRING_CALLABLE)) { return null; } diff --git a/src/DependencyInjection/LazyContainerFactory.php b/src/DependencyInjection/LazyContainerFactory.php index b45275fcf17..308baf431f5 100644 --- a/src/DependencyInjection/LazyContainerFactory.php +++ b/src/DependencyInjection/LazyContainerFactory.php @@ -131,7 +131,6 @@ use Rector\PhpParser\NodeVisitor\PhpVersionConditionNodeVisitor; use Rector\PhpParser\NodeVisitor\PropertyOrClassConstDefaultNodeVisitor; use Rector\PhpParser\NodeVisitor\StaticVariableNodeVisitor; -use Rector\PhpParser\NodeVisitor\SymfonyClosureNodeVisitor; use Rector\PHPStanStaticTypeMapper\Contract\TypeMapperInterface; use Rector\PHPStanStaticTypeMapper\PHPStanStaticTypeMapper; use Rector\PHPStanStaticTypeMapper\TypeMapper\AccessoryArrayTypeMapper; @@ -240,7 +239,6 @@ final class LazyContainerFactory ClosureWithVariadicParametersNodeVisitor::class, PhpVersionConditionNodeVisitor::class, AssignedToNodeVisitor::class, - SymfonyClosureNodeVisitor::class, ByRefReturnNodeVisitor::class, ByRefVariableNodeVisitor::class, ContextNodeVisitor::class, diff --git a/src/NodeTypeResolver/Node/AttributeKey.php b/src/NodeTypeResolver/Node/AttributeKey.php index 6be90a114d5..482b8856091 100644 --- a/src/NodeTypeResolver/Node/AttributeKey.php +++ b/src/NodeTypeResolver/Node/AttributeKey.php @@ -155,8 +155,6 @@ final class AttributeKey public const string IS_CLASS_CONST_VALUE = 'is_default_class_const_value'; - public const string IS_INSIDE_SYMFONY_PHP_CLOSURE = 'is_inside_symfony_php_closure'; - /** * Array callable kept as data, not converted to first class callable, * e.g. 'callback'/'factory' keyed array item, or Definition::setFactory() argument diff --git a/src/PhpParser/NodeVisitor/SymfonyClosureNodeVisitor.php b/src/PhpParser/NodeVisitor/SymfonyClosureNodeVisitor.php deleted file mode 100644 index d6df91cb96c..00000000000 --- a/src/PhpParser/NodeVisitor/SymfonyClosureNodeVisitor.php +++ /dev/null @@ -1,40 +0,0 @@ -symfonyPhpClosureDetector->detect($node)) { - return null; - } - - SimpleNodeTraverser::decorateWithAttributeValue( - $node->stmts, - AttributeKey::IS_INSIDE_SYMFONY_PHP_CLOSURE, - true - ); - - return null; - } -}