mirror of
https://github.com/rectorphp/rector.git
synced 2025-01-18 05:48:21 +01:00
fix cs
This commit is contained in:
parent
1f7c66bb72
commit
3e9f3b8342
@ -36,4 +36,4 @@ parameters:
|
||||
- src/Rector/Contrib/Nette/NetteObjectToSmartTraitRector.php
|
||||
Symplify\CodingStandard\Sniffs\Debug\CommentedOutCodeSniff:
|
||||
# examples of code to be found
|
||||
- src/NodeVisitor/DependencyInjection/NamedServicesToConstructor/GetterToPropertyRector.php
|
||||
- src/Rector/Contrib/Symfony/GetterToPropertyRector.php
|
||||
|
@ -37,6 +37,4 @@ final class CollectorCompilerPass implements CompilerPassInterface
|
||||
'addRector'
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
@ -55,6 +55,16 @@ final class FormCallbackRector extends NodeVisitorAbstract implements Deprecatio
|
||||
return null;
|
||||
}
|
||||
|
||||
public function isCandidate(Node $node): bool
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
public function refactor(Node $node): ?Node
|
||||
{
|
||||
return $node;
|
||||
}
|
||||
|
||||
private function isFormEventAssign(Node $node): bool
|
||||
{
|
||||
if (! $node instanceof PropertyFetch) {
|
||||
@ -86,14 +96,4 @@ final class FormCallbackRector extends NodeVisitorAbstract implements Deprecatio
|
||||
'kind' => Array_::KIND_SHORT,
|
||||
]);
|
||||
}
|
||||
|
||||
public function isCandidate(Node $node): bool
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
public function refactor(Node $node): ?Node
|
||||
{
|
||||
return $node;
|
||||
}
|
||||
}
|
||||
|
@ -92,9 +92,6 @@ final class GetterToPropertyRector extends AbstractRector
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param Node $assignOrMethodCallNode
|
||||
*/
|
||||
public function refactor(Node $assignOrMethodCallNode): ?Node
|
||||
{
|
||||
if ($assignOrMethodCallNode instanceof Assign) {
|
||||
@ -114,6 +111,16 @@ final class GetterToPropertyRector extends AbstractRector
|
||||
return $assignOrMethodCallNode;
|
||||
}
|
||||
|
||||
public function getSetName(): string
|
||||
{
|
||||
return SetNames::SYMFONY;
|
||||
}
|
||||
|
||||
public function sinceVersion(): float
|
||||
{
|
||||
return 3.3;
|
||||
}
|
||||
|
||||
/**
|
||||
* Is "$this->get('string')" statements?
|
||||
*/
|
||||
@ -168,14 +175,4 @@ final class GetterToPropertyRector extends AbstractRector
|
||||
$propertyName
|
||||
);
|
||||
}
|
||||
|
||||
public function getSetName(): string
|
||||
{
|
||||
return SetNames::SYMFONY;
|
||||
}
|
||||
|
||||
public function sinceVersion(): float
|
||||
{
|
||||
return 3.3;
|
||||
}
|
||||
}
|
||||
|
@ -21,6 +21,7 @@ final class RectorCollector
|
||||
public function getRector(string $class): RectorInterface
|
||||
{
|
||||
$this->ensureRectorsIsFound($class);
|
||||
|
||||
return $this->rectors[$class];
|
||||
}
|
||||
|
||||
@ -37,7 +38,7 @@ final class RectorCollector
|
||||
|
||||
$availableOptionsMessage = sprintf(
|
||||
' Available rectors are: "%s".',
|
||||
implode('", "' , $rectorClasses)
|
||||
implode('", "', $rectorClasses)
|
||||
);
|
||||
|
||||
throw new RectorNotFoundException(sprintf(
|
||||
|
@ -82,7 +82,7 @@ final class FileProcessor
|
||||
|
||||
$oldStmts = $this->parser->parse($fileContent);
|
||||
$oldTokens = $this->lexer->getTokens();
|
||||
$newStmts = $this->cloningNodeTraverser->traverse($oldStmts);
|
||||
$newStmts = $this->cloningNodeTraverser->traverse($oldStmts);
|
||||
|
||||
$newStmts = $this->nodeTraverser->traverse($newStmts);
|
||||
|
||||
|
@ -2,7 +2,6 @@
|
||||
|
||||
namespace Rector\Tests\Rector\Contrib\Nette\FormCallbackRector;
|
||||
|
||||
use Rector\Contract\Rector\RectorInterface;
|
||||
use Rector\Rector\Contrib\Nette\FormCallbackRector;
|
||||
use Rector\Testing\PHPUnit\AbstractRectorTestCase;
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user