@@ -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 |
@@ -28,7 +28,7 @@ discard block |
||
28 | 28 | public function __construct($serviceContainer, $autoAppend) |
29 | 29 | { |
30 | 30 | $this->twig = $serviceContainer->get('twig'); |
31 | - $this->autoAppend = (bool)$autoAppend; |
|
31 | + $this->autoAppend = (bool) $autoAppend; |
|
32 | 32 | } |
33 | 33 | |
34 | 34 | /** |
@@ -38,7 +38,7 @@ discard block |
||
38 | 38 | */ |
39 | 39 | public function onKernelResponse(FilterResponseEvent $event) |
40 | 40 | { |
41 | - if (!$this->allowRender($event)) { |
|
41 | + if ( ! $this->allowRender($event)) { |
|
42 | 42 | return false; |
43 | 43 | } |
44 | 44 | |
@@ -76,17 +76,17 @@ discard block |
||
76 | 76 | private function allowRender(FilterResponseEvent $event) |
77 | 77 | { |
78 | 78 | // not configured to append automatically |
79 | - if (!$this->autoAppend) { |
|
79 | + if ( ! $this->autoAppend) { |
|
80 | 80 | return false; |
81 | 81 | } |
82 | 82 | |
83 | 83 | // only append to HTML responses |
84 | - if (!in_array($event->getResponse()->headers->get('content-type'), ['text/html', null])) { |
|
84 | + if ( ! in_array($event->getResponse()->headers->get('content-type'), ['text/html', null])) { |
|
85 | 85 | return false; |
86 | 86 | } |
87 | 87 | |
88 | 88 | // only append to master request |
89 | - if (!$event->isMasterRequest()) { |
|
89 | + if ( ! $event->isMasterRequest()) { |
|
90 | 90 | return false; |
91 | 91 | } |
92 | 92 |