Skip to content

Commit

Permalink
fix cs
Browse files Browse the repository at this point in the history
  • Loading branch information
TomasVotruba committed Nov 20, 2016
1 parent 0bcb759 commit b9fe13b
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 8 deletions.
3 changes: 3 additions & 0 deletions src/Controller/ControllerTrait.php
Expand Up @@ -10,10 +10,13 @@
namespace Symplify\ControllerAutowire\Controller;

use Symplify\ControllerAutowire\Controller\Doctrine\ControllerDoctrineTrait;
use Symplify\ControllerAutowire\Controller\Form\ControllerFormTrait;
use Symplify\ControllerAutowire\Controller\HttpKernel\ControllerHttpKernelTrait;
use Symplify\ControllerAutowire\Controller\Routing\ControllerRoutingTrait;
use Symplify\ControllerAutowire\Controller\Security\ControllerSecurityTrait;
use Symplify\ControllerAutowire\Controller\Serializer\ControllerSerializerTrait;
use Symplify\ControllerAutowire\Controller\Session\ControllerFlashTrait;
use Symplify\ControllerAutowire\Controller\Templating\ControllerRenderTrait;

trait ControllerTrait
{
Expand Down
Expand Up @@ -9,6 +9,11 @@

namespace Symplify\ControllerAutowire\DependencyInjection\Compiler;

use Symfony\Component\DependencyInjection\Compiler\CompilerPassInterface;
use Symfony\Component\DependencyInjection\ContainerBuilder;
use Symfony\Component\DependencyInjection\Definition;
use Symfony\Component\DependencyInjection\Reference;
use Symplify\ControllerAutowire\Contract\DependencyInjection\ControllerClassMapInterface;
use Symplify\ControllerAutowire\Controller\Doctrine\ControllerDoctrineTrait;
use Symplify\ControllerAutowire\Controller\Form\ControllerFormTrait;
use Symplify\ControllerAutowire\Controller\HttpKernel\ControllerHttpKernelTrait;
Expand All @@ -17,11 +22,6 @@
use Symplify\ControllerAutowire\Controller\Serializer\ControllerSerializerTrait;
use Symplify\ControllerAutowire\Controller\Session\ControllerFlashTrait;
use Symplify\ControllerAutowire\Controller\Templating\ControllerRenderTrait;
use Symfony\Component\DependencyInjection\Compiler\CompilerPassInterface;
use Symfony\Component\DependencyInjection\ContainerBuilder;
use Symfony\Component\DependencyInjection\Definition;
use Symfony\Component\DependencyInjection\Reference;
use Symplify\ControllerAutowire\Contract\DependencyInjection\ControllerClassMapInterface;

final class AutowireControllerDependencies implements CompilerPassInterface
{
Expand Down Expand Up @@ -66,7 +66,7 @@ final class AutowireControllerDependencies implements CompilerPassInterface
],
ControllerFormTrait::class => [
'setFormFactory' => 'form.factory',
]
],
];

public function __construct(ControllerClassMapInterface $controllerClassMap)
Expand All @@ -89,12 +89,12 @@ private function autowireControllerTraits(Definition $controllerDefinition)
$usedTraits = class_uses($controllerDefinition->getClass());

foreach ($this->traitsToSettersToServiceNameList as $traitClass => $setterToServiceNames) {
if (!array_key_exists($traitClass, $usedTraits)) {
if (! array_key_exists($traitClass, $usedTraits)) {
continue;
}

foreach ($setterToServiceNames as $setter => $serviceName) {
if (!$this->containerBuilder->has($serviceName)) {
if (! $this->containerBuilder->has($serviceName)) {
continue;
}

Expand Down

0 comments on commit b9fe13b

Please sign in to comment.