From 0834833f8d1f220153a154e9a009a8bec387607a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gr=C3=A9goire=20Humeau?= Date: Mon, 20 Feb 2017 09:07:57 +0100 Subject: [PATCH] Style CI --- Bundle/WidgetMapBundle/Builder/WidgetMapBuilder.php | 5 ++--- .../Command/WidgetMapOverwriteValidationCommand.php | 6 +----- Bundle/WidgetMapBundle/Entity/WidgetMap.php | 4 +--- Bundle/WidgetMapBundle/Manager/WidgetMapManager.php | 7 +++---- .../Resolver/WidgetMapChildrenResolver.php | 9 +++------ 5 files changed, 10 insertions(+), 21 deletions(-) diff --git a/Bundle/WidgetMapBundle/Builder/WidgetMapBuilder.php b/Bundle/WidgetMapBundle/Builder/WidgetMapBuilder.php index f0c205678..72ddc119d 100644 --- a/Bundle/WidgetMapBundle/Builder/WidgetMapBuilder.php +++ b/Bundle/WidgetMapBundle/Builder/WidgetMapBuilder.php @@ -20,14 +20,13 @@ class WidgetMapBuilder /** * WidgetMapBuilder constructor. * - * @param ContextualViewWarmer $contextualViewWarmer + * @param ContextualViewWarmer $contextualViewWarmer * @param WidgetMapChildrenResolver $resolver */ public function __construct( ContextualViewWarmer $contextualViewWarmer, WidgetMapChildrenResolver $resolver - ) - { + ) { $this->contextualViewWarmer = $contextualViewWarmer; $this->resolver = $resolver; } diff --git a/Bundle/WidgetMapBundle/Command/WidgetMapOverwriteValidationCommand.php b/Bundle/WidgetMapBundle/Command/WidgetMapOverwriteValidationCommand.php index 7ac7f14c6..810e7968e 100644 --- a/Bundle/WidgetMapBundle/Command/WidgetMapOverwriteValidationCommand.php +++ b/Bundle/WidgetMapBundle/Command/WidgetMapOverwriteValidationCommand.php @@ -6,7 +6,6 @@ use Symfony\Bundle\FrameworkBundle\Command\ContainerAwareCommand; use Symfony\Component\Console\Helper\Table; use Symfony\Component\Console\Input\InputInterface; -use Symfony\Component\Console\Input\InputOption; use Symfony\Component\Console\Output\OutputInterface; use Victoire\Bundle\CoreBundle\Entity\View; use Victoire\Bundle\WidgetMapBundle\Entity\WidgetMap; @@ -52,15 +51,12 @@ protected function execute(InputInterface $input, OutputInterface $output) $views = $entityManager->getRepository('Victoire\Bundle\CoreBundle\Entity\View')->findAll(); foreach ($views as $view) { - $widgetMaps = $contextualViewWarmer->warm($view); foreach ($widgetMaps as $widgetMap) { - $positions = [WidgetMap::POSITION_BEFORE, WidgetMap::POSITION_AFTER]; $children = []; foreach ($positions as $position) { - $children[$position] = null; $matchingChildren = []; @@ -97,7 +93,7 @@ protected function execute(InputInterface $input, OutputInterface $output) } } - if($conflictNb > 0) { + if ($conflictNb > 0) { $output->writeln(sprintf('%s WidgetMaps conflicts found.', $conflictNb)); $output->writeln('At least one of those WidgetMaps must have a replace_id with action "overwrite".'); $table->render(); diff --git a/Bundle/WidgetMapBundle/Entity/WidgetMap.php b/Bundle/WidgetMapBundle/Entity/WidgetMap.php index 565243738..46048bb7c 100644 --- a/Bundle/WidgetMapBundle/Entity/WidgetMap.php +++ b/Bundle/WidgetMapBundle/Entity/WidgetMap.php @@ -423,14 +423,12 @@ public function getSubstituteForView(View $view) return $substitute; } - while($template = $view->getTemplate()) { + while ($template = $view->getTemplate()) { if ($substitute->getView() === $template) { return $substitute; } } } - - return null; } /** diff --git a/Bundle/WidgetMapBundle/Manager/WidgetMapManager.php b/Bundle/WidgetMapBundle/Manager/WidgetMapManager.php index f64255e02..d0c86dc7d 100644 --- a/Bundle/WidgetMapBundle/Manager/WidgetMapManager.php +++ b/Bundle/WidgetMapBundle/Manager/WidgetMapManager.php @@ -19,16 +19,15 @@ class WidgetMapManager /** * WidgetMapManager constructor. * - * @param EntityManager $em - * @param WidgetMapBuilder $builder + * @param EntityManager $em + * @param WidgetMapBuilder $builder * @param WidgetMapChildrenResolver $resolver */ public function __construct( EntityManager $em, WidgetMapBuilder $builder, WidgetMapChildrenResolver $resolver - ) - { + ) { $this->em = $em; $this->builder = $builder; $this->resolver = $resolver; diff --git a/Bundle/WidgetMapBundle/Resolver/WidgetMapChildrenResolver.php b/Bundle/WidgetMapBundle/Resolver/WidgetMapChildrenResolver.php index 7f4885c51..aa2bf2a72 100644 --- a/Bundle/WidgetMapBundle/Resolver/WidgetMapChildrenResolver.php +++ b/Bundle/WidgetMapBundle/Resolver/WidgetMapChildrenResolver.php @@ -8,19 +8,18 @@ class WidgetMapChildrenResolver { - private $logger; /** * WidgetMapChildrenResolver constructor. - * + * * @param Logger $logger */ public function __construct(Logger $logger) { $this->logger = $logger; } - + /** * Return "after" and "before" children, * based on contextual View and its Templates. @@ -32,7 +31,6 @@ public function getChildren(WidgetMap $widgetMap, View $view = null) $positions = [WidgetMap::POSITION_BEFORE, WidgetMap::POSITION_AFTER]; $children = []; foreach ($positions as $position) { - $matchingChildren = []; //Position is null by default @@ -68,7 +66,6 @@ public function getChildren(WidgetMap $widgetMap, View $view = null) $view->getId() )); } - } return $children; @@ -90,4 +87,4 @@ public function hasChildren(WidgetMap $widgetMap, $position, View $view = null) return false; } -} \ No newline at end of file +}