@@ -38,7 +38,7 @@ |
||
38 | 38 | */ |
39 | 39 | public function __construct($enabled, $id) |
40 | 40 | { |
41 | - $this->enabled = (bool)$enabled; |
|
41 | + $this->enabled = (bool) $enabled; |
|
42 | 42 | $this->id = $id; |
43 | 43 | } |
44 | 44 |
@@ -30,7 +30,7 @@ |
||
30 | 30 | $configuration = new Configuration(); |
31 | 31 | $config = $this->processConfiguration($configuration, $configs); |
32 | 32 | |
33 | - $loader = new Loader\YamlFileLoader($container, new FileLocator(__DIR__.'/../Resources/config')); |
|
33 | + $loader = new Loader\YamlFileLoader($container, new FileLocator(__DIR__ . '/../Resources/config')); |
|
34 | 34 | $loader->load('services.yml'); |
35 | 35 | |
36 | 36 | foreach ($config as $name => $node) { |
@@ -8,7 +8,7 @@ |
||
8 | 8 | * file that was distributed with this source code. |
9 | 9 | */ |
10 | 10 | |
11 | -if (!is_file($autoloadFile = __DIR__.'/../vendor/autoload.php')) { |
|
11 | +if ( ! is_file($autoloadFile = __DIR__ . '/../vendor/autoload.php')) { |
|
12 | 12 | throw new \LogicException('Run "composer install" to create autoloader.'); |
13 | 13 | } |
14 | 14 |
@@ -29,7 +29,7 @@ |
||
29 | 29 | */ |
30 | 30 | protected function loadConfiguration(ContainerBuilder $container, $resource) |
31 | 31 | { |
32 | - $loader = new YamlFileLoader($container, new FileLocator(__DIR__.'/Fixtures/Yaml/')); |
|
32 | + $loader = new YamlFileLoader($container, new FileLocator(__DIR__ . '/Fixtures/Yaml/')); |
|
33 | 33 | $loader->load($resource . self::FILE_TYPE); |
34 | 34 | } |
35 | 35 | } |
36 | 36 | \ No newline at end of file |
@@ -40,7 +40,7 @@ discard block |
||
40 | 40 | } |
41 | 41 | |
42 | 42 | /** |
43 | - * @return array |
|
43 | + * @return \Twig_SimpleFunction[] |
|
44 | 44 | */ |
45 | 45 | public function getFunctions() |
46 | 46 | { |
@@ -120,7 +120,7 @@ discard block |
||
120 | 120 | |
121 | 121 | /** |
122 | 122 | * @param \Twig_Environment $twig |
123 | - * @param $area |
|
123 | + * @param string $area |
|
124 | 124 | * @return string |
125 | 125 | */ |
126 | 126 | private function getRenderedTemplate(\Twig_Environment $twig, $area) |
@@ -10,9 +10,7 @@ |
||
10 | 10 | |
11 | 11 | namespace Xynnn\GoogleTagManagerBundle\Twig; |
12 | 12 | |
13 | -use Symfony\Component\Templating\Helper\HelperInterface; |
|
14 | 13 | use Twig_Extension; |
15 | -use Xynnn\GoogleTagManagerBundle\Helper\GoogleTagManagerHelper; |
|
16 | 14 | use Xynnn\GoogleTagManagerBundle\Helper\GoogleTagManagerHelperInterface; |
17 | 15 | |
18 | 16 | /** |
@@ -125,7 +125,7 @@ |
||
125 | 125 | */ |
126 | 126 | private function getRenderedTemplate(\Twig_Environment $twig, $area) |
127 | 127 | { |
128 | - if (!$this->helper->isEnabled()) { |
|
128 | + if ( ! $this->helper->isEnabled()) { |
|
129 | 129 | return false; |
130 | 130 | } |
131 | 131 |
@@ -37,7 +37,7 @@ discard block |
||
37 | 37 | { |
38 | 38 | $this->environment = $environment; |
39 | 39 | $this->extension = $extension; |
40 | - $this->autoAppend = (bool)$autoAppend; |
|
40 | + $this->autoAppend = (bool) $autoAppend; |
|
41 | 41 | } |
42 | 42 | |
43 | 43 | /** |
@@ -47,7 +47,7 @@ discard block |
||
47 | 47 | */ |
48 | 48 | public function onKernelResponse(FilterResponseEvent $event) |
49 | 49 | { |
50 | - if (!$this->allowRender($event)) { |
|
50 | + if ( ! $this->allowRender($event)) { |
|
51 | 51 | return false; |
52 | 52 | } |
53 | 53 | |
@@ -87,17 +87,17 @@ discard block |
||
87 | 87 | private function allowRender(FilterResponseEvent $event) |
88 | 88 | { |
89 | 89 | // not configured to append automatically |
90 | - if (!$this->autoAppend) { |
|
90 | + if ( ! $this->autoAppend) { |
|
91 | 91 | return false; |
92 | 92 | } |
93 | 93 | |
94 | 94 | // only append to HTML responses |
95 | - if (!in_array($event->getResponse()->headers->get('content-type'), array('text/html', null))) { |
|
95 | + if ( ! in_array($event->getResponse()->headers->get('content-type'), array('text/html', null))) { |
|
96 | 96 | return false; |
97 | 97 | } |
98 | 98 | |
99 | 99 | // only append to master request |
100 | - if (!$event->isMasterRequest()) { |
|
100 | + if ( ! $event->isMasterRequest()) { |
|
101 | 101 | return false; |
102 | 102 | } |
103 | 103 |