@@ -76,7 +76,7 @@ discard block |
||
| 76 | 76 | { |
| 77 | 77 | $helper = clone $this->helper; |
| 78 | 78 | $helper->appendFile('/js/test1.js') |
| 79 | - ->appendFile('/js/test2.js'); |
|
| 79 | + ->appendFile('/js/test2.js'); |
|
| 80 | 80 | |
| 81 | 81 | $result = $helper->toString(); |
| 82 | 82 | $domDocument = new \DOMDocument(); |
@@ -96,7 +96,7 @@ discard block |
||
| 96 | 96 | { |
| 97 | 97 | $helper = clone $this->helper; |
| 98 | 98 | $helper->appendFile('/js/test1.js') |
| 99 | - ->prependFile('/js/test2.js'); |
|
| 99 | + ->prependFile('/js/test2.js'); |
|
| 100 | 100 | |
| 101 | 101 | $result = $helper->toString(); |
| 102 | 102 | $domDocument = new \DOMDocument(); |
@@ -76,7 +76,7 @@ discard block |
||
| 76 | 76 | { |
| 77 | 77 | $helper = clone $this->helper; |
| 78 | 78 | $helper->appendStylesheet('/css/test1.css') |
| 79 | - ->appendStylesheet('/css/test2.css'); |
|
| 79 | + ->appendStylesheet('/css/test2.css'); |
|
| 80 | 80 | |
| 81 | 81 | $result = $helper->toString(); |
| 82 | 82 | $domDocument = new \DOMDocument(); |
@@ -96,7 +96,7 @@ discard block |
||
| 96 | 96 | { |
| 97 | 97 | $helper = clone $this->helper; |
| 98 | 98 | $helper->appendStylesheet('/css/test1.css') |
| 99 | - ->prependStylesheet('/css/test2.css'); |
|
| 99 | + ->prependStylesheet('/css/test2.css'); |
|
| 100 | 100 | |
| 101 | 101 | $result = $helper->toString(); |
| 102 | 102 | $domDocument = new \DOMDocument(); |
@@ -29,8 +29,8 @@ |
||
| 29 | 29 | public function __invoke(ContainerInterface $container, $requestedName, array $options = null) |
| 30 | 30 | { |
| 31 | 31 | $applicationConfig = (array)$container->get('config'); |
| 32 | - if (! array_key_exists('minify_head', $applicationConfig) |
|
| 33 | - && ! array_key_exists('script', $applicationConfig['minify_head'])) { |
|
| 32 | + if (!array_key_exists('minify_head', $applicationConfig) |
|
| 33 | + && !array_key_exists('script', $applicationConfig['minify_head'])) { |
|
| 34 | 34 | throw new \Exception('Configuration not available.'); |
| 35 | 35 | } |
| 36 | 36 | $config = $applicationConfig['minify_head']['script']; |
@@ -29,8 +29,8 @@ |
||
| 29 | 29 | public function __invoke(ContainerInterface $container, $requestedName, array $options = null) |
| 30 | 30 | { |
| 31 | 31 | $applicationConfig = (array)$container->get('config'); |
| 32 | - if (! array_key_exists('minify_head', $applicationConfig) |
|
| 33 | - && ! array_key_exists('script', $applicationConfig['minify_head'])) { |
|
| 32 | + if (!array_key_exists('minify_head', $applicationConfig) |
|
| 33 | + && !array_key_exists('script', $applicationConfig['minify_head'])) { |
|
| 34 | 34 | throw new \Exception('Configuration not available.'); |
| 35 | 35 | } |
| 36 | 36 | $config = $applicationConfig['minify_head']['link']; |
@@ -80,7 +80,7 @@ |
||
| 80 | 80 | // returned in $items. |
| 81 | 81 | $links = $this->minifyFile($minifiedFile, $cacheItems, $items) |
| 82 | 82 | // Generate the links |
| 83 | - ->generateLinks($items); |
|
| 83 | + ->generateLinks($items); |
|
| 84 | 84 | |
| 85 | 85 | return $indent . implode($this->escape($this->getSeparator()) . $indent, $links); |
| 86 | 86 | } |
@@ -60,7 +60,7 @@ discard block |
||
| 60 | 60 | public function toString($indent = null): string |
| 61 | 61 | { |
| 62 | 62 | // If configuration tells us minifying is not enabled, use the default view helper. |
| 63 | - if (! $this->options['enabled']) { |
|
| 63 | + if (!$this->options['enabled']) { |
|
| 64 | 64 | return parent::toString($indent); |
| 65 | 65 | } |
| 66 | 66 | |
@@ -94,7 +94,7 @@ discard block |
||
| 94 | 94 | { |
| 95 | 95 | $items = []; |
| 96 | 96 | foreach ($this as $index => $item) { |
| 97 | - if (! $item->href || $item->type != 'text/css') { |
|
| 97 | + if (!$item->href || $item->type != 'text/css') { |
|
| 98 | 98 | continue; |
| 99 | 99 | } |
| 100 | 100 | $localUri = str_replace($this->baseUrl, '', preg_replace('/\?.*/', '', $this->publicDir . $item->href)); |
@@ -142,10 +142,10 @@ discard block |
||
| 142 | 142 | */ |
| 143 | 143 | private function minifyFile(string $minifiedFileName, array $cacheItems, array &$items): HeadLink |
| 144 | 144 | { |
| 145 | - if (! empty($cacheItems)) { |
|
| 146 | - if (! is_file($this->cacheDir . $minifiedFileName)) { |
|
| 145 | + if (!empty($cacheItems)) { |
|
| 146 | + if (!is_file($this->cacheDir . $minifiedFileName)) { |
|
| 147 | 147 | $minifier = new Minify\CSS(); |
| 148 | - array_map(function ($uri) use ($minifier) { |
|
| 148 | + array_map(function($uri) use ($minifier) { |
|
| 149 | 149 | $minifier->add($uri); |
| 150 | 150 | }, $cacheItems); |
| 151 | 151 | $minifier->minify($this->cacheDir . $minifiedFileName); |
@@ -61,7 +61,7 @@ discard block |
||
| 61 | 61 | public function toString($indent = null): string |
| 62 | 62 | { |
| 63 | 63 | // If configuration tells us minifying is not enabled, use the default view helper. |
| 64 | - if (! $this->options['enabled']) { |
|
| 64 | + if (!$this->options['enabled']) { |
|
| 65 | 65 | return parent::toString($indent); |
| 66 | 66 | } |
| 67 | 67 | |
@@ -95,7 +95,7 @@ discard block |
||
| 95 | 95 | { |
| 96 | 96 | $items = []; |
| 97 | 97 | foreach ($this as $index => $item) { |
| 98 | - if ($item->type !== 'text/javascript' && (! @$item->attributes['src'] || ! $item->source)) { |
|
| 98 | + if ($item->type !== 'text/javascript' && (!@$item->attributes['src'] || !$item->source)) { |
|
| 99 | 99 | $items[] = $item; |
| 100 | 100 | continue; |
| 101 | 101 | } |
@@ -151,10 +151,10 @@ discard block |
||
| 151 | 151 | */ |
| 152 | 152 | private function minifyFile(string $minifiedFileName, array $cacheItems, array &$items): HeadScript |
| 153 | 153 | { |
| 154 | - if (! empty($cacheItems)) { |
|
| 155 | - if (! is_file($this->cacheDir . $minifiedFileName)) { |
|
| 154 | + if (!empty($cacheItems)) { |
|
| 155 | + if (!is_file($this->cacheDir . $minifiedFileName)) { |
|
| 156 | 156 | $minifier = new Minify\JS(); |
| 157 | - array_map(function ($uri) use ($minifier) { |
|
| 157 | + array_map(function($uri) use ($minifier) { |
|
| 158 | 158 | $minifier->add($uri); |
| 159 | 159 | }, $cacheItems); |
| 160 | 160 | $minifier->minify($this->cacheDir . $minifiedFileName); |