Skip to content

Commit

Permalink
Style CI
Browse files Browse the repository at this point in the history
  • Loading branch information
gregumo authored and paulandrieux committed Feb 20, 2017
1 parent 420a68e commit 0834833
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 21 deletions.
5 changes: 2 additions & 3 deletions Bundle/WidgetMapBundle/Builder/WidgetMapBuilder.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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 = [];

Expand Down Expand Up @@ -97,7 +93,7 @@ protected function execute(InputInterface $input, OutputInterface $output)
}
}

if($conflictNb > 0) {
if ($conflictNb > 0) {
$output->writeln(sprintf('<error>%s WidgetMaps conflicts found.</error>', $conflictNb));
$output->writeln('<error>At least one of those WidgetMaps must have a replace_id with action "overwrite".</error>');
$table->render();
Expand Down
4 changes: 1 addition & 3 deletions Bundle/WidgetMapBundle/Entity/WidgetMap.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

/**
Expand Down
7 changes: 3 additions & 4 deletions Bundle/WidgetMapBundle/Manager/WidgetMapManager.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
9 changes: 3 additions & 6 deletions Bundle/WidgetMapBundle/Resolver/WidgetMapChildrenResolver.php
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand All @@ -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
Expand Down Expand Up @@ -68,7 +66,6 @@ public function getChildren(WidgetMap $widgetMap, View $view = null)
$view->getId()
));
}

}

return $children;
Expand All @@ -90,4 +87,4 @@ public function hasChildren(WidgetMap $widgetMap, $position, View $view = null)

return false;
}
}
}

0 comments on commit 0834833

Please sign in to comment.