diff --git a/rules/PHPOffice/Rector/StaticCall/ChangePdfWriterRector.php b/rules/PHPOffice/Rector/StaticCall/ChangePdfWriterRector.php index 50640d60dd6c..a46a2efc92f6 100644 --- a/rules/PHPOffice/Rector/StaticCall/ChangePdfWriterRector.php +++ b/rules/PHPOffice/Rector/StaticCall/ChangePdfWriterRector.php @@ -65,11 +65,12 @@ public function refactor(Node $node): ?Node { $callerType = $this->nodeTypeResolver->resolve($node->class); - if ($callerType->isSuperTypeOf(new ObjectType('PHPExcel_Settings'))->yes()) { - if ($this->nodeNameResolver->isNames($node->name, ['setPdfRendererName', 'setPdfRenderer'])) { - $this->removeNode($node); - return null; - } + if ($callerType->isSuperTypeOf(new ObjectType('PHPExcel_Settings'))->yes() && $this->nodeNameResolver->isNames( + $node->name, + ['setPdfRendererName', 'setPdfRenderer'] + )) { + $this->removeNode($node); + return null; } if ($callerType->isSuperTypeOf(new ObjectType('PHPExcel_IOFactory'))->yes() && $this->nodeNameResolver->isName( diff --git a/rules/RemovingStatic/Rector/Class_/PHPUnitStaticToKernelTestCaseGetRector.php b/rules/RemovingStatic/Rector/Class_/PHPUnitStaticToKernelTestCaseGetRector.php index d460813c3a42..cd25efe1646a 100644 --- a/rules/RemovingStatic/Rector/Class_/PHPUnitStaticToKernelTestCaseGetRector.php +++ b/rules/RemovingStatic/Rector/Class_/PHPUnitStaticToKernelTestCaseGetRector.php @@ -22,6 +22,7 @@ use Rector\Naming\Naming\PropertyNaming; use Rector\NodeTypeResolver\Node\AttributeKey; use Rector\PHPUnit\NodeFactory\SetUpClassMethodFactory; +use Rector\RemovingStatic\NodeAnalyzer\SetUpClassMethodUpdater; use Rector\RemovingStatic\NodeFactory\SelfContainerFactory; use Rector\RemovingStatic\NodeFactory\SetUpFactory; use Rector\RemovingStatic\ValueObject\PHPUnitClass; @@ -75,7 +76,7 @@ final class PHPUnitStaticToKernelTestCaseGetRector extends AbstractRector implem private $selfContainerFactory; /** - * @var \Rector\RemovingStatic\NodeAnalyzer\SetUpClassMethodUpdater + * @var SetUpClassMethodUpdater */ private $setUpClassMethodUpdater; @@ -85,7 +86,7 @@ public function __construct( SetUpClassMethodFactory $setUpClassMethodFactory, SetUpFactory $setUpFactory, SelfContainerFactory $selfContainerFactory, - \Rector\RemovingStatic\NodeAnalyzer\SetUpClassMethodUpdater $setUpClassMethodUpdater + SetUpClassMethodUpdater $setUpClassMethodUpdater ) { $this->propertyNaming = $propertyNaming; $this->classInsertManipulator = $classInsertManipulator;