From 7f3f6bb0af000ba08f67410ce72918531cc1f8c5 Mon Sep 17 00:00:00 2001 From: Joseph Bielawski Date: Wed, 3 Jul 2019 16:31:37 +0200 Subject: [PATCH] [MakeCommandLazyRector] Remove duplicated check --- .../Rector/Class_/MakeCommandLazyRector.php | 20 ------------------- 1 file changed, 20 deletions(-) diff --git a/packages/Symfony/src/Rector/Class_/MakeCommandLazyRector.php b/packages/Symfony/src/Rector/Class_/MakeCommandLazyRector.php index 538c83ff5108..fd0a57fb5865 100644 --- a/packages/Symfony/src/Rector/Class_/MakeCommandLazyRector.php +++ b/packages/Symfony/src/Rector/Class_/MakeCommandLazyRector.php @@ -136,26 +136,6 @@ private function resolveCommandNameAndRemove(Class_ $class): ?Node } } - if ($node instanceof ClassMethod && $this->isName($node, '__construct')) { - if (count((array) $node->stmts) !== 1) { - return null; - } - - $onlyNode = $node->stmts[0]; - if ($onlyNode instanceof Expression) { - $onlyNode = $onlyNode->expr; - - $commandName = $this->matchCommandNameNodeInConstruct($onlyNode); - if ($commandName === null) { - return null; - } - - if (count($node->params) === 0) { - $this->removeNode($node); - } - } - } - if ($node instanceof StaticCall) { if (! $this->isType($node, self::COMMAND_CLASS)) { return null;