Skip to content
This repository was archived by the owner on Sep 16, 2021. It is now read-only.

Commit 2f998b4

Browse files
authored
Merge pull request #193 from symfony-cmf/analysis-XWDLEj
Apply fixes from StyleCI
2 parents 425120e + bbeaeba commit 2f998b4

36 files changed

+255
-201
lines changed

src/Adapter/PhpcrOdmAdapter.php

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,20 +3,20 @@
33
/*
44
* This file is part of the Symfony CMF package.
55
*
6-
* (c) 2011-2015 Symfony CMF
6+
* (c) 2011-2017 Symfony CMF
77
*
88
* For the full copyright and license information, please view the LICENSE
99
* file that was distributed with this source code.
1010
*/
1111

1212
namespace Symfony\Cmf\Bundle\RoutingAutoBundle\Adapter;
1313

14-
use Doctrine\ODM\PHPCR\DocumentManager;
15-
use Doctrine\ODM\PHPCR\Document\Generic;
1614
use Doctrine\Common\Util\ClassUtils;
15+
use Doctrine\ODM\PHPCR\Document\Generic;
16+
use Doctrine\ODM\PHPCR\DocumentManager;
17+
use Symfony\Cmf\Component\RoutingAuto\AdapterInterface;
1718
use Symfony\Cmf\Component\RoutingAuto\Model\AutoRouteInterface;
1819
use Symfony\Cmf\Component\RoutingAuto\UriContext;
19-
use Symfony\Cmf\Component\RoutingAuto\AdapterInterface;
2020

2121
/**
2222
* Adapter for PHPCR-ODM.
@@ -58,7 +58,7 @@ public function getLocales($contentDocument)
5858
return $this->dm->getLocalesFor($contentDocument);
5959
}
6060

61-
return array();
61+
return [];
6262
}
6363

6464
/**

src/CmfRoutingAutoBundle.php

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -3,19 +3,19 @@
33
/*
44
* This file is part of the Symfony CMF package.
55
*
6-
* (c) 2011-2015 Symfony CMF
6+
* (c) 2011-2017 Symfony CMF
77
*
88
* For the full copyright and license information, please view the LICENSE
99
* file that was distributed with this source code.
1010
*/
1111

1212
namespace Symfony\Cmf\Bundle\RoutingAutoBundle;
1313

14-
use Symfony\Component\HttpKernel\Bundle\Bundle;
15-
use Symfony\Component\DependencyInjection\ContainerBuilder;
1614
use Doctrine\Bundle\PHPCRBundle\DependencyInjection\Compiler\DoctrinePhpcrMappingsPass;
17-
use Symfony\Cmf\Bundle\RoutingAutoBundle\DependencyInjection\Compiler\ServicePass;
1815
use Symfony\Cmf\Bundle\RoutingAutoBundle\DependencyInjection\Compiler\AdapterPass;
16+
use Symfony\Cmf\Bundle\RoutingAutoBundle\DependencyInjection\Compiler\ServicePass;
17+
use Symfony\Component\DependencyInjection\ContainerBuilder;
18+
use Symfony\Component\HttpKernel\Bundle\Bundle;
1919

2020
class CmfRoutingAutoBundle extends Bundle
2121
{
@@ -46,12 +46,12 @@ private function buildPhpcrCompilerPass(ContainerBuilder $container)
4646
if (isset($bundles['CmfRoutingBundle'])) {
4747
$container->addCompilerPass(
4848
DoctrinePhpcrMappingsPass::createXmlMappingDriver(
49-
array(
49+
[
5050
realpath(__DIR__.'/Resources/config/doctrine-model') => 'Symfony\Cmf\Bundle\RoutingAutoBundle\Model',
51-
),
52-
array('cmf_routing_auto.persistence.phpcr.manager_name'),
51+
],
52+
['cmf_routing_auto.persistence.phpcr.manager_name'],
5353
false,
54-
array('CmfRoutingAutoBundle' => 'Symfony\Cmf\Bundle\RoutingAutoBundle\Model')
54+
['CmfRoutingAutoBundle' => 'Symfony\Cmf\Bundle\RoutingAutoBundle\Model']
5555
)
5656
);
5757
}

src/Command/RefreshCommand.php

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,20 +3,20 @@
33
/*
44
* This file is part of the Symfony CMF package.
55
*
6-
* (c) 2011-2015 Symfony CMF
6+
* (c) 2011-2017 Symfony CMF
77
*
88
* For the full copyright and license information, please view the LICENSE
99
* file that was distributed with this source code.
1010
*/
1111

1212
namespace Symfony\Cmf\Bundle\RoutingAutoBundle\Command;
1313

14+
use Doctrine\Bundle\PHPCRBundle\Command\DoctrineCommandHelper;
1415
use Symfony\Bundle\FrameworkBundle\Command\ContainerAwareCommand;
16+
use Symfony\Cmf\Component\RoutingAuto\UriContextCollection;
1517
use Symfony\Component\Console\Input\InputInterface;
16-
use Symfony\Component\Console\Output\OutputInterface;
1718
use Symfony\Component\Console\Input\InputOption;
18-
use Doctrine\Bundle\PHPCRBundle\Command\DoctrineCommandHelper;
19-
use Symfony\Cmf\Component\RoutingAuto\UriContextCollection;
19+
use Symfony\Component\Console\Output\OutputInterface;
2020

2121
class RefreshCommand extends ContainerAwareCommand
2222
{
@@ -75,7 +75,7 @@ public function execute(InputInterface $input, OutputInterface $output)
7575
);
7676

7777
if ($class) {
78-
$mapping = array($class => $class);
78+
$mapping = [$class => $class];
7979
} else {
8080
$mapping = iterator_to_array($factory->getIterator());
8181
}

src/Controller/RedirectController.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,16 +3,16 @@
33
/*
44
* This file is part of the Symfony CMF package.
55
*
6-
* (c) 2011-2015 Symfony CMF
6+
* (c) 2011-2017 Symfony CMF
77
*
88
* For the full copyright and license information, please view the LICENSE
99
* file that was distributed with this source code.
1010
*/
1111

1212
namespace Symfony\Cmf\Bundle\RoutingAutoBundle\Controller;
1313

14-
use Symfony\Cmf\Component\RoutingAuto\Model\AutoRouteInterface;
1514
use Symfony\Bundle\FrameworkBundle\Controller\Controller;
15+
use Symfony\Cmf\Component\RoutingAuto\Model\AutoRouteInterface;
1616
use Symfony\Component\HttpFoundation\RedirectResponse;
1717
use Symfony\Component\Routing\RouterInterface;
1818

src/DependencyInjection/CmfRoutingAutoExtension.php

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -3,20 +3,20 @@
33
/*
44
* This file is part of the Symfony CMF package.
55
*
6-
* (c) 2011-2015 Symfony CMF
6+
* (c) 2011-2017 Symfony CMF
77
*
88
* For the full copyright and license information, please view the LICENSE
99
* file that was distributed with this source code.
1010
*/
1111

1212
namespace Symfony\Cmf\Bundle\RoutingAutoBundle\DependencyInjection;
1313

14-
use Symfony\Component\DependencyInjection\ContainerBuilder;
15-
use Symfony\Component\Config\FileLocator;
14+
use Symfony\Component\Config\Definition\Exception\InvalidConfigurationException;
1615
use Symfony\Component\Config\Definition\Processor;
17-
use Symfony\Component\HttpKernel\DependencyInjection\Extension;
16+
use Symfony\Component\Config\FileLocator;
17+
use Symfony\Component\DependencyInjection\ContainerBuilder;
1818
use Symfony\Component\DependencyInjection\Loader\XmlFileLoader;
19-
use Symfony\Component\Config\Definition\Exception\InvalidConfigurationException;
19+
use Symfony\Component\HttpKernel\DependencyInjection\Extension;
2020

2121
class CmfRoutingAutoExtension extends Extension
2222
{
@@ -35,7 +35,7 @@ public function load(array $configs, ContainerBuilder $container)
3535

3636
$config = $processor->processConfiguration($configuration, $configs);
3737

38-
$resources = array();
38+
$resources = [];
3939

4040
// auto mapping
4141
if ($config['auto_mapping']) {
@@ -79,14 +79,14 @@ public function load(array $configs, ContainerBuilder $container)
7979

8080
protected function findMappingFiles($bundles)
8181
{
82-
$resources = array();
82+
$resources = [];
8383
foreach ($bundles as $bundle) {
8484
$refl = new \ReflectionClass($bundle);
8585
$bundlePath = dirname($refl->getFileName());
86-
foreach (array('xml', 'yml') as $extension) {
86+
foreach (['xml', 'yml'] as $extension) {
8787
$path = $bundlePath.'/Resources/config/cmf_routing_auto.'.$extension;
8888
if (file_exists($path)) {
89-
$resources[] = array('path' => $path, 'type' => null);
89+
$resources[] = ['path' => $path, 'type' => null];
9090
}
9191
}
9292
}

src/DependencyInjection/Compiler/AdapterPass.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,16 +3,16 @@
33
/*
44
* This file is part of the Symfony CMF package.
55
*
6-
* (c) 2011-2015 Symfony CMF
6+
* (c) 2011-2017 Symfony CMF
77
*
88
* For the full copyright and license information, please view the LICENSE
99
* file that was distributed with this source code.
1010
*/
1111

1212
namespace Symfony\Cmf\Bundle\RoutingAutoBundle\DependencyInjection\Compiler;
1313

14-
use Symfony\Component\DependencyInjection\ContainerBuilder;
1514
use Symfony\Component\DependencyInjection\Compiler\CompilerPassInterface;
15+
use Symfony\Component\DependencyInjection\ContainerBuilder;
1616

1717
/**
1818
* @author Daniel Leech <[email protected]>
@@ -29,7 +29,7 @@ public function process(ContainerBuilder $container)
2929

3030
$adapter = $container->getParameter('cmf_routing_auto.adapter_name');
3131
$adapterId = null;
32-
$adapterNames = array();
32+
$adapterNames = [];
3333
$ids = $container->findTaggedServiceIds('cmf_routing_auto.adapter');
3434

3535
foreach ($ids as $id => $attributes) {

src/DependencyInjection/Compiler/ServicePass.php

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,16 +3,16 @@
33
/*
44
* This file is part of the Symfony CMF package.
55
*
6-
* (c) 2011-2015 Symfony CMF
6+
* (c) 2011-2017 Symfony CMF
77
*
88
* For the full copyright and license information, please view the LICENSE
99
* file that was distributed with this source code.
1010
*/
1111

1212
namespace Symfony\Cmf\Bundle\RoutingAutoBundle\DependencyInjection\Compiler;
1313

14-
use Symfony\Component\DependencyInjection\ContainerBuilder;
1514
use Symfony\Component\DependencyInjection\Compiler\CompilerPassInterface;
15+
use Symfony\Component\DependencyInjection\ContainerBuilder;
1616
use Symfony\Component\DependencyInjection\Reference;
1717

1818
/**
@@ -32,11 +32,11 @@ public function process(ContainerBuilder $container)
3232
'cmf_routing_auto.service_registry'
3333
);
3434

35-
$types = array(
35+
$types = [
3636
'token_provider' => 'registerTokenProvider',
3737
'defunct_route_handler' => 'registerDefunctRouteHandler',
3838
'conflict_resolver' => 'registerConflictResolver',
39-
);
39+
];
4040

4141
foreach ($types as $type => $registerMethod) {
4242
$ids = $container->findTaggedServiceIds('cmf_routing_auto.'.$type);
@@ -51,7 +51,7 @@ public function process(ContainerBuilder $container)
5151

5252
$builderUnitChainFactory->addMethodCall(
5353
$registerMethod,
54-
array($attributes[0]['alias'], new Reference($id))
54+
[$attributes[0]['alias'], new Reference($id)]
5555
);
5656
}
5757
}

src/DependencyInjection/Configuration.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,16 +3,16 @@
33
/*
44
* This file is part of the Symfony CMF package.
55
*
6-
* (c) 2011-2015 Symfony CMF
6+
* (c) 2011-2017 Symfony CMF
77
*
88
* For the full copyright and license information, please view the LICENSE
99
* file that was distributed with this source code.
1010
*/
1111

1212
namespace Symfony\Cmf\Bundle\RoutingAutoBundle\DependencyInjection;
1313

14-
use Symfony\Component\Config\Definition\ConfigurationInterface;
1514
use Symfony\Component\Config\Definition\Builder\TreeBuilder;
15+
use Symfony\Component\Config\Definition\ConfigurationInterface;
1616

1717
class Configuration implements ConfigurationInterface
1818
{
@@ -37,7 +37,7 @@ public function getConfigTreeBuilder()
3737
->beforeNormalization()
3838
->ifString()
3939
->then(function ($v) {
40-
return array('path' => $v);
40+
return ['path' => $v];
4141
})
4242
->end()
4343
->children()

src/Doctrine/Phpcr/AutoRouteListener.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
/*
44
* This file is part of the Symfony CMF package.
55
*
6-
* (c) 2011-2015 Symfony CMF
6+
* (c) 2011-2017 Symfony CMF
77
*
88
* For the full copyright and license information, please view the LICENSE
99
* file that was distributed with this source code.
@@ -13,10 +13,10 @@
1313

1414
use Doctrine\Common\Persistence\Event\ManagerEventArgs;
1515
use Doctrine\ODM\PHPCR\DocumentManager;
16-
use Symfony\Component\DependencyInjection\ContainerInterface;
1716
use Symfony\Cmf\Bundle\RoutingAutoBundle\Model\AutoRoute;
18-
use Symfony\Cmf\Component\RoutingAuto\UriContextCollection;
1917
use Symfony\Cmf\Component\RoutingAuto\Mapping\Exception\ClassNotMappedException;
18+
use Symfony\Cmf\Component\RoutingAuto\UriContextCollection;
19+
use Symfony\Component\DependencyInjection\ContainerInterface;
2020

2121
/**
2222
* Doctrine PHPCR ODM listener for maintaining automatic routes.

src/Model/AutoRoute.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
/*
44
* This file is part of the Symfony CMF package.
55
*
6-
* (c) 2011-2015 Symfony CMF
6+
* (c) 2011-2017 Symfony CMF
77
*
88
* For the full copyright and license information, please view the LICENSE
99
* file that was distributed with this source code.

0 commit comments

Comments
 (0)