namespace typos fix

This commit is contained in:
TomasVotruba 2017-07-20 16:37:31 +02:00
parent deaaa019ad
commit 82e8858158
4 changed files with 21 additions and 11 deletions

View File

@ -0,0 +1,8 @@
<?php declare(strict_types=1);
namespace Rector\NodeTraverser;
final class PriorityAwareNodeTraverser
{
// ...
}

View File

@ -1,21 +1,17 @@
<?php declare(strict_types=1);
namespace Rector\NodeVisitor\DependencyInjection\NamedServicesToConstrutor;
namespace Rector\NodeVisitor\DependencyInjection\NamedServicesToConstructor;
use PhpParser\Node;
use PhpParser\Node\Expr;
use PhpParser\Node\Expr\Assign;
use PhpParser\Node\Expr\MethodCall;
use PhpParser\Node\Expr\PropertyFetch;
use PhpParser\Node\Expr\Variable;
use PhpParser\Node\Scalar\String_;
use PhpParser\Node\Stmt\Class_;
use PhpParser\NodeVisitorAbstract;
use Rector\Builder\Kernel\ServiceFromKernelResolver;
use Rector\Builder\Naming\NameResolver;
use Rector\Tests\NodeVisitor\DependencyInjection\NamedServicesToConstructorReconstructor\Source\LocalKernel;
use Symfony\Component\DependencyInjection\ContainerInterface;
use Symfony\Component\HttpKernel\Kernel;
/**
* Converts all:
@ -134,15 +130,21 @@ final class GetterToPropertyNodeVisitor extends NodeVisitorAbstract
$serviceName, LocalKernel::class
);
// Get property name
$propertyName = $this->nameResolver->resolvePropertyNameFromType($serviceType);
// creates "$this->propertyName"
return $this->createPropertyFetch($propertyName);
}
/**
* Creates "$this->propertyName"
*/
private function createPropertyFetch(string $propertyName): PropertyFetch
{
return new PropertyFetch(
new Variable('this', [
'name' => $propertyName
]), $propertyName
);
}
}

View File

@ -1,9 +1,9 @@
<?php declare(strict_types=1);
namespace Rector\NodeVisitor\DependencyInjection;
namespace Rector\NodeVisitor\DependencyInjection\NamedServicesToConstructor;
use PhpParser\Node;
use PhpParser\Node\Expr;
use PhpParser\Node\Expr\Assign;
use PhpParser\Node\Expr\MethodCall;
use PhpParser\Node\Expr\PropertyFetch;

View File

@ -2,7 +2,7 @@
namespace Rector\Tests\NodeVisitor\DependencyInjection\NamedServicesToConstructorReconstructor;
use Rector\NodeVisitor\DependencyInjection\NamedServicesToConstructorNodeVisitor;
use Rector\NodeVisitor\DependencyInjection\NamedServicesToConstructor\NamedServicesToConstructorNodeVisitor;
use Rector\Testing\PHPUnit\AbstractReconstructorTestCase;
final class Test extends AbstractReconstructorTestCase