cleanup tests

This commit is contained in:
TomasVotruba 2018-03-03 14:35:26 +01:00
parent abc13cc352
commit f2ba8acf1c
4 changed files with 10 additions and 10 deletions

View File

@ -33,7 +33,7 @@ final class GetParameterToConstructorInjectionRector extends AbstractRector
*/
private $getParameterAwareTypes = [
'Symfony\Bundle\FrameworkBundle\Controller\Controller',
'Symfony\Component\DependencyInjection\ContainerAwareInterface'
'Symfony\Component\DependencyInjection\ContainerAwareInterface',
];
/**

View File

@ -2,7 +2,9 @@
namespace SomeNamespace;
class ClassWithNamedService3 implements ContainerAwareInterface
use Symfony\Bundle\FrameworkBundle\Controller\Controller;
class ClassWithNamedService3 extends Controller
{
/**
* @var string
@ -14,9 +16,7 @@ class ClassWithNamedService3 implements ContainerAwareInterface
}
public function render()
{
$this->renderTwig([
'value' => $this->someParameter
]);
$value = $this->someParameter;
$query = new DoctrineQuery();
$queryId = $query->getParameter('id');

View File

@ -24,7 +24,7 @@ final class GetParameterToConstructorInjectionRectorTest extends AbstractRectorT
{
return [
[__DIR__ . '/Wrong/wrong.php.inc', __DIR__ . '/Correct/correct.php.inc'],
// [__DIR__ . '/Wrong/wrong2.php.inc', __DIR__ . '/Correct/correct2.php.inc'],
[__DIR__ . '/Wrong/wrong2.php.inc', __DIR__ . '/Correct/correct2.php.inc'],
];
}

View File

@ -2,13 +2,13 @@
namespace SomeNamespace;
class ClassWithNamedService3 implements ContainerAwareInterface
use Symfony\Bundle\FrameworkBundle\Controller\Controller;
class ClassWithNamedService3 extends Controller
{
public function render()
{
$this->renderTwig([
'value' => $this->container->getParameter('some_parameter')
]);
$value = $this->getParameter('some_parameter');
$query = new DoctrineQuery();
$queryId = $query->getParameter('id');