This commit is contained in:
TomasVotruba 2017-09-03 14:49:56 +02:00
parent 3b7528662a
commit 041b1b5503
3 changed files with 10 additions and 8 deletions

View File

@ -28,8 +28,13 @@ final class FrameworkBundleClassReplacementsRector extends AbstractClassReplacer
protected function getOldToNewClasses(): array
{
return [
'Symfony\Bundle\FrameworkBundle\DependencyInjectino\Compiler\SerializerPass' => 'Symfony\Component\Serializer\DependencyInjection\SerializerPass',
// @todo: complete the rest
'Symfony\Bundle\FrameworkBundle\DependencyInjection\Compiler\AddConsoleCommandPass' => 'Symfony\Component\Console\DependencyInjection\AddConsoleCommandPass',
'Symfony\Bundle\FrameworkBundle\DependencyInjection\Compiler\SerializerPass' => 'Symfony\Component\Serializer\DependencyInjection\SerializerPass',
'Symfony\Bundle\FrameworkBundle\DependencyInjection\Compiler\FormPass' => 'Symfony\Component\Form\DependencyInjection\FormPass',
'Symfony\Bundle\FrameworkBundle\EventListener\SessionListener' => 'Symfony\Component\HttpKernel\EventListener\SessionListener',
'Symfony\Bundle\FrameworkBundle\EventListener\TestSessionListener' => 'Symfony\Component\HttpKernel\EventListener\TestSessionListener',
'Symfony\Bundle\FrameworkBundle\DependencyInjection\Compiler\ConfigCachePass' => 'Symfony\Component\Config\DependencyInjection\ConfigCachePass',
'Symfony\Bundle\FrameworkBundle\DependencyInjection\Compiler\PropertyInfoPass' => 'Symfony\Component\PropertyInfo\DependencyInjection\PropertyInfoPass',
];
}
}

View File

@ -5,7 +5,7 @@ namespace Rector\Rector\Contrib\SymfonyExtra;
use Nette\Utils\Strings;
use PhpParser\Node;
use PhpParser\Node\Expr\MethodCall;
use PhpParser\Node\Name;
use PhpParser\Node\Name\FullyQualified;
use Rector\Builder\Class_\ClassPropertyCollector;
use Rector\Builder\Kernel\ServiceFromKernelResolver;
use Rector\Builder\Naming\NameResolver;
@ -18,9 +18,6 @@ use Rector\Tests\Rector\Contrib\SymfonyExtra\GetterToPropertyRector\Source\Local
/**
* Ref: https://github.com/symfony/symfony/blob/master/UPGRADE-4.0.md#console
*
* Similar to @see \Rector\Rector\Contrib\Symfony\GetterToPropertyRector
* @todo Extract common logic!
*
* Before:
* class MyCommand extends ContainerAwareCommand
*
@ -126,6 +123,6 @@ final class CommandToConstructorInjectionRector extends AbstractRector
private function replaceParentContainerAwareCommandWithCommand(): void
{
$this->classNode->extends = new Name('\Symfony\Component\Console\Command\Command');
$this->classNode->extends = new FullyQualified('Symfony\Component\Console\Command\Command');
}
}

View File

@ -1,4 +1,4 @@
<?php declare (strict_types=1);
$containerBuilder = new \Symfony\Component\DependencyInjection\ContainerBuilder;
$containerBuilder->addCompilerPass(new Symfony\Bundle\FrameworkBundle\DependencyInjectino\Compiler\SerializerPass);
$containerBuilder->addCompilerPass(new Symfony\Bundle\FrameworkBundle\DependencyInjection\Compiler\SerializerPass);