Skip to content

Commit

Permalink
misc
Browse files Browse the repository at this point in the history
  • Loading branch information
TomasVotruba committed Feb 10, 2021
1 parent 79cae16 commit f96a725
Show file tree
Hide file tree
Showing 8 changed files with 3 additions and 275 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -11,53 +11,7 @@
$services->set(MethodCallToStaticCallRector::class)->call('configure', [[
MethodCallToStaticCallRector::METHOD_CALLS_TO_STATIC_CALLS => ValueObjectInliner::inline([


















new MethodCallToStaticCall(
AnotherDependency::class,
'process',
'StaticCaller',
'anotherMethod'
),
























new MethodCallToStaticCall(AnotherDependency::class, 'process', 'StaticCaller', 'anotherMethod'),

]),
]]);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,60 +13,12 @@
[[
ReplaceParentCallByPropertyCallRector::PARENT_CALLS_TO_PROPERTIES => ValueObjectInliner::inline([

























new ReplaceParentCallByPropertyCall(
TypeClassToReplaceMethodCallBy::class,
'someMethod',
'someProperty'
),

























]),
]]
);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,49 +12,8 @@
$services->set(NewToMethodCallRector::class)->call('configure', [[
NewToMethodCallRector::NEWS_TO_METHOD_CALLS => ValueObjectInliner::inline([


















new NewToMethodCall(MyClass::class, MyClassFactory::class, 'create'),

























]),
]]);
};
Original file line number Diff line number Diff line change
Expand Up @@ -12,49 +12,8 @@
$services->set(NewToStaticCallRector::class)->call('configure', [[
NewToStaticCallRector::TYPE_TO_STATIC_CALLS => ValueObjectInliner::inline([


















new NewToStaticCall(FromNewClass::class, IntoStaticClass::class, 'run'),

























]),
]]);
};
Original file line number Diff line number Diff line change
Expand Up @@ -11,49 +11,8 @@
$services->set(StaticCallToFuncCallRector::class)->call('configure', [[
StaticCallToFuncCallRector::STATIC_CALLS_TO_FUNCTIONS => ValueObjectInliner::inline([


















new StaticCallToFuncCall(SomeOldStaticClass::class, 'render', 'view'),

























]),
]]);
};
Original file line number Diff line number Diff line change
Expand Up @@ -17,30 +17,6 @@
[[
AddParamTypeDeclarationRector::PARAMETER_TYPEHINTS => ValueObjectInliner::inline([

























new AddParamTypeDeclaration(
ParentInterfaceWithChangeTypeInterface::class,
'process',
Expand All @@ -55,30 +31,6 @@
new ObjectType('Doctrine\ORM\EntityManagerInterface')
),

























]),
]]
);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,13 +17,6 @@
new ChangeMethodVisibility(ParentObject::class, 'toBePrivateMethod', Visibility::PRIVATE),
new ChangeMethodVisibility(ParentObject::class, 'toBePublicStaticMethod', Visibility::PUBLIC),








]),
]]);
};
4 changes: 2 additions & 2 deletions src/PhpParser/NodeTraverser/RectorNodeTraverser.php
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ public function __construct(
public function traverseFileNode(FileNode $fileNode): array
{
if ($this->enabledRectorProvider->isConfigured()) {
$this->configureEnabledRectorOnly();
$this->activateEnabledRectorOnly();
}

if (! $this->hasFileNodeRectorsEnabled()) {
Expand All @@ -93,7 +93,7 @@ public function traverseFileNode(FileNode $fileNode): array
public function traverse(array $nodes): array
{
if ($this->enabledRectorProvider->isConfigured()) {
$this->configureEnabledRectorOnly();
$this->activateEnabledRectorOnly();
}

$hasNamespace = (bool) $this->nodeFinder->findFirstInstanceOf($nodes, Namespace_::class);
Expand Down

0 comments on commit f96a725

Please sign in to comment.