Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Merge pull request ezsystems#6 from clash82/psr2
Switch coding standards to PSR-2
  • Loading branch information
andrerom committed Aug 28, 2015
2 parents db93da0 + a8ab469 commit 1b5cded
Show file tree
Hide file tree
Showing 10 changed files with 32 additions and 15 deletions.
1 change: 1 addition & 0 deletions .gitignore
Expand Up @@ -2,3 +2,4 @@
/vendor/
composer.lock
composer.phar
.php_cs.cache
27 changes: 27 additions & 0 deletions .php_cs
@@ -0,0 +1,27 @@
<?php

return Symfony\CS\Config\Config::create()
->setUsingLinter(false)
->setUsingCache(true)
->level(Symfony\CS\FixerInterface::SYMFONY_LEVEL)
->fixers([
'concat_with_spaces',
'-concat_without_spaces',
'-empty_return',
'-phpdoc_params',
'-phpdoc_separation',
'-phpdoc_to_comment',
'-spaces_cast',
'-blankline_after_open_tag',
'-single_blank_line_before_namespace',
])
->finder(
Symfony\CS\Finder\DefaultFinder::create()
->in(__DIR__)
->exclude([
'vendor',
'Resources'
])
->files()->name('*.php')
)
;
1 change: 0 additions & 1 deletion Banner/Banner.php
Expand Up @@ -2,7 +2,6 @@
/**
* @license For full copyright and license information view LICENSE file distributed with this source code.
*/

namespace EzSystems\PrivacyCookieBundle\Banner;

class Banner
Expand Down
1 change: 0 additions & 1 deletion Banner/BannerFactory.php
Expand Up @@ -2,7 +2,6 @@
/**
* @license For full copyright and license information view LICENSE file distributed with this source code.
*/

namespace EzSystems\PrivacyCookieBundle\Banner;

interface BannerFactory
Expand Down
6 changes: 1 addition & 5 deletions Banner/BannerOptions.php
Expand Up @@ -2,11 +2,8 @@
/**
* @license For full copyright and license information view LICENSE file distributed with this source code.
*/

namespace EzSystems\PrivacyCookieBundle\Banner;

use \EzSystems\PrivacyCookieBundle\Banner\Banner;

class BannerOptions
{
/**
Expand All @@ -21,8 +18,7 @@ public function map(array $options, Banner $banner)
$bannerOptions = get_object_vars($banner);

$validatedOptions = array();
foreach ($bannerOptions as $name => $value)
{
foreach ($bannerOptions as $name => $value) {
$validatedOptions[$name] = empty($options[$name]) ? $value : $options[$name];
}

Expand Down
1 change: 0 additions & 1 deletion DependencyInjection/Configuration.php
Expand Up @@ -2,7 +2,6 @@
/**
* @license For full copyright and license information view LICENSE file distributed with this source code.
*/

namespace EzSystems\PrivacyCookieBundle\DependencyInjection;

use Symfony\Component\Config\Definition\Builder\TreeBuilder;
Expand Down
3 changes: 1 addition & 2 deletions DependencyInjection/EzSystemsPrivacyCookieExtension.php
Expand Up @@ -2,7 +2,6 @@
/**
* @license For full copyright and license information view LICENSE file distributed with this source code.
*/

namespace EzSystems\PrivacyCookieBundle\DependencyInjection;

use Symfony\Component\DependencyInjection\ContainerBuilder;
Expand All @@ -17,7 +16,7 @@ public function load(array $configs, ContainerBuilder $container)
$configuration = $this->getConfiguration($configs, $container);
$config = $this->processConfiguration($configuration, $configs);

$loader = new Loader\YamlFileLoader($container, new FileLocator(__DIR__.'/../Resources/config'));
$loader = new Loader\YamlFileLoader($container, new FileLocator(__DIR__ . '/../Resources/config'));
$loader->load('services.yml');
$loader->load('default_settings.yml');
}
Expand Down
1 change: 0 additions & 1 deletion EzSystemsPrivacyCookieBundle.php
Expand Up @@ -2,7 +2,6 @@
/**
* @license For full copyright and license information view LICENSE file distributed with this source code.
*/

namespace EzSystems\PrivacyCookieBundle;

use Symfony\Component\HttpKernel\Bundle\Bundle;
Expand Down
1 change: 0 additions & 1 deletion Factory/ConfigurationBasedBannerFactory.php
Expand Up @@ -2,7 +2,6 @@
/**
* @license For full copyright and license information view LICENSE file distributed with this source code.
*/

namespace EzSystems\PrivacyCookieBundle\Factory;

use EzSystems\PrivacyCookieBundle\Banner\Banner;
Expand Down
5 changes: 2 additions & 3 deletions Twig/PrivacyCookieTwigExtension.php
Expand Up @@ -2,7 +2,6 @@
/**
* @license For full copyright and license information view LICENSE file distributed with this source code.
*/

namespace EzSystems\PrivacyCookieBundle\Twig;

use EzSystems\PrivacyCookieBundle\Banner\Banner;
Expand Down Expand Up @@ -42,14 +41,14 @@ public function getFunctions()
return array(
new Twig_SimpleFunction('show_privacy_cookie_banner', array($this, 'showPrivacyCookieBanner'), array(
'is_safe' => array('html'),
'needs_environment' => true
'needs_environment' => true,
)),
);
}

/**
* Render cookie privacy banner snippet code
* - should be included at the end of template before the body ending tag
* - should be included at the end of template before the body ending tag.
*
* @param Twig_Environment $twigEnvironment
* @param string $policyPageUrl cookie policy page address (not required, no policy link will be shown)
Expand Down

0 comments on commit 1b5cded

Please sign in to comment.