Skip to content

Commit

Permalink
cs PSR-12
Browse files Browse the repository at this point in the history
  • Loading branch information
hummer2k committed Dec 26, 2019
1 parent 8bec574 commit 1eb4039
Show file tree
Hide file tree
Showing 61 changed files with 87 additions and 31 deletions.
2 changes: 1 addition & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ before_script:

script:
- ./vendor/bin/phpunit --coverage-clover ./build/logs/clover.xml
- ./vendor/bin/phpcs --standard=PSR2 ./src/ ./test/
- ./vendor/bin/phpcs --standard=PSR12 ./src/ ./test/

after_script:
- ./vendor/bin/coveralls -v
1 change: 1 addition & 0 deletions src/Block/AbstractBlock.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
<?php

namespace ConLayout\Block;

use Zend\View\Model\ViewModel;
Expand Down
1 change: 1 addition & 0 deletions src/Block/BlockInterface.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
<?php

namespace ConLayout\Block;

use Zend\View\Helper\HelperInterface;
Expand Down
3 changes: 2 additions & 1 deletion src/Block/BlockPool.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
<?php

/**
* @package ConLayout
* @author Cornelius Adams (conlabz GmbH) <cornelius.adams@conlabz.de>
Expand All @@ -12,7 +13,7 @@

final class BlockPool implements BlockPoolInterface
{
const ANONYMOUS_ID_PATTERN = 'anonymous.%s.%s';
public const ANONYMOUS_ID_PATTERN = 'anonymous.%s.%s';

/**
* suffix for anonymous block names
Expand Down
1 change: 1 addition & 0 deletions src/Block/BlockPoolInterface.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
<?php

/**
* @package
* @author Cornelius Adams (conlabz GmbH) <cornelius.adams@conlabz.de>
Expand Down
1 change: 1 addition & 0 deletions src/Block/Container.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
<?php

/**
* @package ConLayout
* @author Cornelius Adams (conlabz GmbH) <cornelius.adams@conlabz.de>
Expand Down
3 changes: 2 additions & 1 deletion src/Block/Factory/BlockFactory.php
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,8 @@ public function createBlock($blockId, array $specs)
private function prepareOptions(array $specs)
{
foreach ($specs as $key => $value) {
if (!isset($this->blockDefaults[$key])
if (
!isset($this->blockDefaults[$key])
&& !isset($specs['options'][$key])
) {
$specs['options'][$key] = $value;
Expand Down
3 changes: 2 additions & 1 deletion src/BlockManagerFactory.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
<?php

/**
* @package ConLayout
* @author Cornelius Adams (conlabz GmbH) <cornelius.adams@conlabz.de>
Expand All @@ -10,5 +11,5 @@

class BlockManagerFactory extends AbstractPluginManagerFactory
{
const PLUGIN_MANAGER_CLASS = 'ConLayout\BlockManager';
public const PLUGIN_MANAGER_CLASS = 'ConLayout\BlockManager';
}
1 change: 1 addition & 0 deletions src/Controller/Plugin/LayoutManager.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
<?php

namespace ConLayout\Controller\Plugin;

use ConLayout\Block\BlockPoolInterface;
Expand Down
1 change: 1 addition & 0 deletions src/Controller/Plugin/LayoutManagerFactory.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
<?php

namespace ConLayout\Controller\Plugin;

use ConLayout\Block\BlockPoolInterface;
Expand Down
1 change: 1 addition & 0 deletions src/Filter/BasePathFilter.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
<?php

namespace ConLayout\Filter;

use Zend\Filter\FilterInterface;
Expand Down
1 change: 1 addition & 0 deletions src/Filter/BasePathFilterFactory.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
<?php

/**
* @package ConLayout
* @author Cornelius Adams (conlabz GmbH) <cornelius.adams@conlabz.de>
Expand Down
1 change: 1 addition & 0 deletions src/Filter/CacheBusterFilterFactory.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
<?php

/**
* @package ConLayout
* @author Cornelius Adams (conlabz GmbH) <cornelius.adams@conlabz.de>
Expand Down
1 change: 1 addition & 0 deletions src/Filter/DebugFilter.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
<?php

/**
* @package ConLayout
* @author Cornelius Adams (conlabz GmbH) <cornelius.adams@conlabz.de>
Expand Down
1 change: 1 addition & 0 deletions src/Filter/DebugFilterFactory.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
<?php

/**
* @package ConLayout
* @author Cornelius Adams (conlabz GmbH) <cornelius.adams@conlabz.de>
Expand Down
1 change: 1 addition & 0 deletions src/Filter/TranslateFilterFactory.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
<?php

/**
* @package ConLayout
* @author Cornelius Adams (conlabz GmbH) <cornelius.adams@conlabz.de>
Expand Down
7 changes: 4 additions & 3 deletions src/Generator/BlocksGenerator.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
<?php

/**
* @package ConLayout
* @author Cornelius Adams (conlabz GmbH) <cornelius.adams@conlabz.de>
Expand All @@ -12,9 +13,9 @@

final class BlocksGenerator implements GeneratorInterface
{
const NAME = 'blocks';
const INSTRUCTION_BLOCKS = 'blocks';
const INSTRUCTION_REFERENCE = 'reference';
public const NAME = 'blocks';
public const INSTRUCTION_BLOCKS = 'blocks';
public const INSTRUCTION_REFERENCE = 'reference';

/**
* @var BlockFactoryInterface
Expand Down
1 change: 1 addition & 0 deletions src/Generator/BlocksGeneratorFactory.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
<?php

/**
* @package
* @author Cornelius Adams (conlabz GmbH) <cornelius.adams@conlabz.de>
Expand Down
1 change: 1 addition & 0 deletions src/Generator/GeneratorInterface.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
<?php

/**
* @package
* @author Cornelius Adams (conlabz GmbH) <cornelius.adams@conlabz.de>
Expand Down
8 changes: 5 additions & 3 deletions src/Generator/ViewHelperGenerator.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
<?php

/**
* @package ConLayout
* @author Cornelius Adams (conlabz GmbH) <cornelius.adams@conlabz.de>
Expand All @@ -20,8 +21,8 @@ final class ViewHelperGenerator implements GeneratorInterface
{
use NamedParametersTrait;

const NAME = 'helpers';
const INSTRUCTION = 'helpers';
public const NAME = 'helpers';
public const INSTRUCTION = 'helpers';

/**
* @var bool
Expand Down Expand Up @@ -149,7 +150,8 @@ private function sort($data)
*/
private function filterArgs(array $instruction)
{
if (!isset($instruction['filter']) ||
if (
!isset($instruction['filter']) ||
!$instruction['filter'] ||
null === $this->filterManager
) {
Expand Down
1 change: 1 addition & 0 deletions src/Generator/ViewHelperGeneratorFactory.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
<?php

/**
* @package
* @author Cornelius Adams (conlabz GmbH) <cornelius.adams@conlabz.de>
Expand Down
6 changes: 4 additions & 2 deletions src/Layout/Layout.php
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,8 @@ public function generate(array $generators = [])
{
$layoutStructure = $this->updater->getLayoutStructure();
foreach ($this->generators as $name => $generator) {
if (!$this->isGeneratorLoaded($name)
if (
!$this->isGeneratorLoaded($name)
&& (empty($generators) || isset($generators[$name]))
) {
$generator->generate($layoutStructure);
Expand All @@ -151,7 +152,8 @@ public function injectBlocks()
$this->blockPool->sort();
$blocks = $this->blockPool->get();
foreach ($blocks as $blockId => $block) {
if ($this->isAllowed($blockId, $block) &&
if (
$this->isAllowed($blockId, $block) &&
$blockId !== self::BLOCK_ID_ROOT
) {
list($parent, $captureTo) = $this->getCaptureTo($block);
Expand Down
1 change: 1 addition & 0 deletions src/Layout/LayoutFactory.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
<?php

/**
* @package ConLayout
* @author Cornelius Adams (conlabz GmbH) <cornelius.adams@conlabz.de>
Expand Down
6 changes: 3 additions & 3 deletions src/Layout/LayoutInterface.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,17 +14,17 @@ interface LayoutInterface
/**
* block id of root view model
*/
const BLOCK_ID_ROOT = 'root';
public const BLOCK_ID_ROOT = 'root';

/**
* block id of view model returned by controller
*/
const BLOCK_ID_ACTION_RESULT = 'action.result';
public const BLOCK_ID_ACTION_RESULT = 'action.result';

/**
* delimiter block_id::cpature_to
*/
const CAPTURE_TO_DELIMITER = '::';
public const CAPTURE_TO_DELIMITER = '::';

/**
* retrieve single block by block id
Expand Down
7 changes: 4 additions & 3 deletions src/Listener/ActionHandlesListener.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
<?php

namespace ConLayout\Listener;

use ConLayout\Handle\Handle;
Expand All @@ -15,7 +16,7 @@
*/
class ActionHandlesListener extends InjectTemplateListener
{
const SEPARATOR = '/';
public const SEPARATOR = '/';

/**
* Layout updater instance.
Expand Down Expand Up @@ -95,8 +96,8 @@ private function getActionHandles(EventInterface $event)

foreach ($templateParts as $name) {
$priority += 10;
$actionHandles[] = new Handle($previousHandle.$name, $priority);
$previousHandle .= $name.self::SEPARATOR;
$actionHandles[] = new Handle($previousHandle . $name, $priority);
$previousHandle .= $name . self::SEPARATOR;
}

return $actionHandles;
Expand Down
1 change: 1 addition & 0 deletions src/Listener/BodyClassListener.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
<?php

namespace ConLayout\Listener;

use ConLayout\View\Helper\BodyClass;
Expand Down
1 change: 1 addition & 0 deletions src/Listener/Factory/ActionHandlesListenerFactory.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
<?php

namespace ConLayout\Listener\Factory;

use ConLayout\Listener\ActionHandlesListener;
Expand Down
1 change: 1 addition & 0 deletions src/Listener/Factory/BodyClassListenerFactory.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
<?php

namespace ConLayout\Listener\Factory;

use ConLayout\Listener\BodyClassListener;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
<?php

/**
* @package ConLayout
* @author Cornelius Adams (conlabz GmbH) <cornelius.adams@conlabz.de>
Expand Down
1 change: 1 addition & 0 deletions src/Listener/LoadLayoutListener.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
<?php

namespace ConLayout\Listener;

use ConLayout\Layout\LayoutInterface;
Expand Down
1 change: 1 addition & 0 deletions src/Module.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
<?php

namespace ConLayout;

use ConLayout\Filter\DebugFilter;
Expand Down
2 changes: 1 addition & 1 deletion src/Options/ModuleOptions.php
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,7 @@ public function isPreferRouteMatchController()
*/
public function setPreferRouteMatchController($preferRouteMatchController)
{
$this->preferRouteMatchController = (boolean) $preferRouteMatchController;
$this->preferRouteMatchController = (bool) $preferRouteMatchController;

return $this;
}
Expand Down
3 changes: 2 additions & 1 deletion src/Options/ModuleOptionsFactory.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,8 @@ public function __invoke(ContainerInterface $container, $requestedName, array $o
$config = $container->get('Config');
$options = isset($config['con-layout']) ? $config['con-layout'] : [];

if (!isset($options['controller_map'])
if (
!isset($options['controller_map'])
&& isset($config['view_manager']['controller_map'])
) {
$options['controller_map'] = (array) $config['view_manager']['controller_map'];
Expand Down
1 change: 1 addition & 0 deletions src/Sorter/BeforeAfterComparison.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
<?php

/**
* @package ConLayout
* @author Cornelius Adams (conlabz GmbH) <cornelius.adams@conlabz.de>
Expand Down
1 change: 1 addition & 0 deletions src/Sorter/DependentComparison.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
<?php

/**
* @package ConLayout
* @author Cornelius Adams (conlabz GmbH) <cornelius.adams@conlabz.de>
Expand Down
1 change: 1 addition & 0 deletions src/Sorter/OrderComparison.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
<?php

/**
* @package ConLayout
* @author Cornelius Adams (conlabz GmbH) <cornelius.adams@conlabz.de>
Expand Down
1 change: 1 addition & 0 deletions src/Sorter/SorterInterface.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
<?php

/**
* @package
* @author Cornelius Adams (conlabz GmbH) <cornelius.adams@conlabz.de>
Expand Down
1 change: 1 addition & 0 deletions src/Updater/Collector/CollectorInterface.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
<?php

/**
* @package ConLayout
* @author Cornelius Adams (conlabz GmbH) <cornelius.adams@conlabz.de>
Expand Down
3 changes: 2 additions & 1 deletion src/Updater/Collector/ConfigCollector.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
<?php

/**
* @package ConLayout
* @author Cornelius Adams (conlabz GmbH) <cornelius.adams@conlabz.de>
Expand All @@ -11,7 +12,7 @@

class ConfigCollector implements CollectorInterface
{
const NAME = 'config';
public const NAME = 'config';

/**
* @var array
Expand Down
1 change: 1 addition & 0 deletions src/Updater/Collector/ConfigCollectorFactory.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
<?php

/**
* @package ConLayout
* @author Cornelius Adams (conlabz GmbH) <cornelius.adams@conlabz.de>
Expand Down
3 changes: 2 additions & 1 deletion src/Updater/Collector/FilesystemCollector.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
<?php

/**
* @package ConLayout
* @author Cornelius Adams (conlabz GmbH) <cornelius.adams@conlabz.de>
Expand All @@ -14,7 +15,7 @@

class FilesystemCollector implements CollectorInterface
{
const NAME = 'filesystem';
public const NAME = 'filesystem';

/**
*
Expand Down
1 change: 1 addition & 0 deletions src/Updater/Collector/FilesystemCollectorFactory.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
<?php

/**
* @package ConLayout
* @author Cornelius Adams (conlabz GmbH) <cornelius.adams@conlabz.de>
Expand Down
4 changes: 2 additions & 2 deletions src/Updater/Event/UpdateEvent.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@
*/
class UpdateEvent extends Event
{
const EVENT_COLLECT = 'collect';
const EVENT_COLLECT_POST = 'collect.post';
public const EVENT_COLLECT = 'collect';
public const EVENT_COLLECT_POST = 'collect.post';

/**
*
Expand Down
Loading

0 comments on commit 1eb4039

Please sign in to comment.