Skip to content

Commit

Permalink
[ci-review] Rector Rectify
Browse files Browse the repository at this point in the history
  • Loading branch information
kaizen-ci committed Mar 19, 2021
1 parent 6d6ead2 commit 7cf8aad
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 7 deletions.
11 changes: 6 additions & 5 deletions rules/PHPOffice/Rector/StaticCall/ChangePdfWriterRector.php
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -75,7 +76,7 @@ final class PHPUnitStaticToKernelTestCaseGetRector extends AbstractRector implem
private $selfContainerFactory;

/**
* @var \Rector\RemovingStatic\NodeAnalyzer\SetUpClassMethodUpdater
* @var SetUpClassMethodUpdater
*/
private $setUpClassMethodUpdater;

Expand All @@ -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;
Expand Down

0 comments on commit 7cf8aad

Please sign in to comment.