Skip to content

Commit e3ad1c0

Browse files
committed
Merge pull request #320 from symfony-cmf/styleci
Introduced Style CI
2 parents 9d5aba7 + 1fa8ecc commit e3ad1c0

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

46 files changed

+206
-226
lines changed

.styleci.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
preset: symfony

Admin/Extension/FrontendLinkExtension.php

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ class FrontendLinkExtension extends AdminExtension
4141
private $translator;
4242

4343
/**
44-
* @param RouterInterface $router
44+
* @param RouterInterface $router
4545
* @param TranslatorInterface $translator
4646
*/
4747
public function __construct(RouterInterface $router, TranslatorInterface $translator)
@@ -99,16 +99,15 @@ public function configureTabMenu(
9999
'uri' => $uri,
100100
'attributes' => array(
101101
'class' => 'sonata-admin-menu-item',
102-
'role' => 'menuitem'
102+
'role' => 'menuitem',
103103
),
104104
'linkAttributes' => array(
105105
'class' => 'sonata-admin-frontend-link',
106106
'role' => 'button',
107107
'target' => '_blank',
108-
'title' => $this->translator->trans('admin.menu_frontend_link_title', array(), 'CmfRoutingBundle')
109-
)
108+
'title' => $this->translator->trans('admin.menu_frontend_link_title', array(), 'CmfRoutingBundle'),
109+
),
110110
)
111111
);
112112
}
113-
114113
}

Admin/RedirectRouteAdmin.php

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,9 @@ class RedirectRouteAdmin extends Admin
2121
{
2222
protected $translationDomain = 'CmfRoutingBundle';
2323

24-
/**
25-
* Root path for the route parent selection
24+
/**
25+
* Root path for the route parent selection.
26+
*
2627
* @var string
2728
*/
2829
protected $routeRoot;
@@ -54,7 +55,7 @@ protected function configureFormFields(FormMapper $formMapper)
5455
protected function configureDatagridFilters(DatagridMapper $datagridMapper)
5556
{
5657
$datagridMapper
57-
->add('name', 'doctrine_phpcr_nodename')
58+
->add('name', 'doctrine_phpcr_nodename')
5859
;
5960
}
6061

Admin/RouteAdmin.php

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -24,19 +24,22 @@ class RouteAdmin extends Admin
2424
protected $translationDomain = 'CmfRoutingBundle';
2525

2626
/**
27-
* Root path for the route parent selection
27+
* Root path for the route parent selection.
28+
*
2829
* @var string
2930
*/
3031
protected $routeRoot;
3132

3233
/**
33-
* Root path for the route content selection
34+
* Root path for the route content selection.
35+
*
3436
* @var string
3537
*/
3638
protected $contentRoot;
3739

3840
/**
39-
* Full class name for content that can be referenced by a route
41+
* Full class name for content that can be referenced by a route.
42+
*
4043
* @var string
4144
*/
4245
protected $contentClass;
@@ -163,7 +166,7 @@ protected function configureFieldsForDefaults($dynamicDefaults)
163166

164167
//parse variable pattern and add defaults for tokens - taken from routecompiler
165168
/** @var $route Route */
166-
$route = $this->subject;
169+
$route = $this->subject;
167170
if ($route && $route->getVariablePattern()) {
168171
preg_match_all('#\{\w+\}#', $route->getVariablePattern(), $matches, PREG_OFFSET_CAPTURE | PREG_SET_ORDER);
169172
foreach ($matches as $match) {

CmfRoutingBundle.php

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
use Symfony\Cmf\Bundle\RoutingBundle\DependencyInjection\Compiler\SetRouterPass;
2222

2323
/**
24-
* Bundle class
24+
* Bundle class.
2525
*/
2626
class CmfRoutingBundle extends Bundle
2727
{
@@ -92,8 +92,8 @@ private function buildOrmCompilerPass(ContainerBuilder $container)
9292
$container->addCompilerPass(
9393
$doctrineOrmCompiler::createXmlMappingDriver(
9494
array(
95-
realpath(__DIR__ . '/Resources/config/doctrine-model') => 'Symfony\Cmf\Bundle\RoutingBundle\Model',
96-
realpath(__DIR__ . '/Resources/config/doctrine-orm') => 'Symfony\Cmf\Bundle\RoutingBundle\Doctrine\Orm',
95+
realpath(__DIR__.'/Resources/config/doctrine-model') => 'Symfony\Cmf\Bundle\RoutingBundle\Model',
96+
realpath(__DIR__.'/Resources/config/doctrine-orm') => 'Symfony\Cmf\Bundle\RoutingBundle\Doctrine\Orm',
9797
),
9898
array('cmf_routing.dynamic.persistence.orm.manager_name'),
9999
'cmf_routing.backend_type_orm',
@@ -107,8 +107,8 @@ private function buildOrmCompilerPass(ContainerBuilder $container)
107107
* DoctrineBundle (available only since DoctrineBundle 2.4 and Symfony 2.3)
108108
* Otherwise use the standalone one from CmfCoreBundle.
109109
*
110-
* @return boolean|string the compiler pass to use or false if no suitable
111-
* one was found
110+
* @return bool|string the compiler pass to use or false if no suitable
111+
* one was found
112112
*/
113113
private function findDoctrineOrmCompiler()
114114
{
@@ -138,7 +138,7 @@ private function findDoctrineOrmCompiler()
138138
*/
139139
private function buildBaseCompilerPass($compilerClass, $driverClass, $type)
140140
{
141-
$arguments = array(array(realpath(__DIR__ . '/Resources/config/doctrine-base')), sprintf('.%s.xml', $type));
141+
$arguments = array(array(realpath(__DIR__.'/Resources/config/doctrine-base')), sprintf('.%s.xml', $type));
142142
$locator = new Definition('Doctrine\Common\Persistence\Mapping\Driver\DefaultFileLocator', $arguments);
143143
$driver = new Definition($driverClass, array($locator));
144144

Controller/RedirectController.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@
1313

1414
use Symfony\Component\Routing\RouterInterface;
1515
use Symfony\Component\HttpFoundation\RedirectResponse;
16-
1716
use Symfony\Cmf\Component\Routing\RedirectRouteInterface;
1817

1918
/**
@@ -31,6 +30,7 @@ class RedirectController
3130
* @var RouterInterface
3231
*/
3332
protected $router;
33+
3434
/**
3535
* @param RouterInterface $router the router to use to build urls
3636
*/
@@ -40,7 +40,7 @@ public function __construct(RouterInterface $router)
4040
}
4141

4242
/**
43-
* Action to redirect based on a RedirectRouteInterface route
43+
* Action to redirect based on a RedirectRouteInterface route.
4444
*
4545
* @param RedirectRouteInterface $contentDocument
4646
*

DependencyInjection/CmfRoutingExtension.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@
2727
class CmfRoutingExtension extends Extension
2828
{
2929
/**
30-
* {@inheritDoc}
30+
* {@inheritdoc}
3131
*/
3232
public function load(array $configs, ContainerBuilder $container)
3333
{
@@ -71,7 +71,7 @@ private function setupFormTypes(array $config, ContainerBuilder $container, Load
7171
}
7272

7373
/**
74-
* Set up the DynamicRouter - only to be called if enabled is set to true
74+
* Set up the DynamicRouter - only to be called if enabled is set to true.
7575
*
7676
* @param array $config the compiled configuration for the dynamic router
7777
* @param ContainerBuilder $container the container builder
@@ -205,7 +205,7 @@ private function loadPhpcrProvider($config, XmlFileLoader $loader, ContainerBuil
205205
$container->setParameter('cmf_routing.backend_type_phpcr', true);
206206
$container->setParameter('cmf_routing.dynamic.persistence.phpcr.route_basepaths', array_values(array_unique($config['route_basepaths'])));
207207

208-
/**
208+
/*
209209
* @deprecated The cmf_routing.dynamic.persistence.phpcr.route_basepath parameter is deprecated as of version 1.4 and will be removed in 2.0. Use the cmf_routing.dynamic.persistence.phpcr.route_basepaths parameter instead.
210210
*/
211211
$container->setParameter('cmf_routing.dynamic.persistence.phpcr.route_basepath', reset($config['route_basepaths']));

DependencyInjection/Compiler/SetRouterPass.php

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@
1616

1717
/**
1818
* Changes the Router implementation.
19-
*
2019
*/
2120
class SetRouterPass implements CompilerPassInterface
2221
{
@@ -26,6 +25,5 @@ public function process(ContainerBuilder $container)
2625
if ($container->hasParameter('cmf_routing.replace_symfony_router') && true === $container->getParameter('cmf_routing.replace_symfony_router')) {
2726
$container->setAlias('router', 'cmf_routing.router');
2827
}
29-
3028
}
3129
}

DependencyInjection/Configuration.php

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -16,13 +16,13 @@
1616
use Symfony\Component\Config\Definition\Builder\TreeBuilder;
1717

1818
/**
19-
* This class contains the configuration information for the bundle
20-
*
21-
* This information is solely responsible for how the different configuration
22-
* sections are normalized, and merged.
23-
*
24-
* @author David Buchmann
25-
*/
19+
* This class contains the configuration information for the bundle.
20+
*
21+
* This information is solely responsible for how the different configuration
22+
* sections are normalized, and merged.
23+
*
24+
* @author David Buchmann
25+
*/
2626
class Configuration implements ConfigurationInterface
2727
{
2828
/**

Doctrine/DoctrineProvider.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -44,9 +44,9 @@ abstract class DoctrineProvider
4444
protected $className;
4545

4646
/**
47-
* Limit to apply when calling getRoutesByNames() with null
47+
* Limit to apply when calling getRoutesByNames() with null.
4848
*
49-
* @var integer|null
49+
* @var int|null
5050
*/
5151
protected $routeCollectionLimit;
5252

@@ -76,7 +76,7 @@ public function setManagerName($managerName)
7676
*
7777
* Setting the limit to null means no limit is applied.
7878
*
79-
* @param integer|null $routeCollectionLimit
79+
* @param int|null $routeCollectionLimit
8080
*/
8181
public function setRouteCollectionLimit($routeCollectionLimit = null)
8282
{

0 commit comments

Comments
 (0)