@@ -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']; |
@@ -49,7 +49,7 @@ discard block |
||
| 49 | 49 | public function toString($indent = null): string |
| 50 | 50 | { |
| 51 | 51 | // If configuration tells us minifying is not enabled, use the default view helper. |
| 52 | - if (! $this->options['enabled']) { |
|
| 52 | + if (!$this->options['enabled']) { |
|
| 53 | 53 | return parent::toString($indent); |
| 54 | 54 | } |
| 55 | 55 | |
@@ -87,7 +87,7 @@ discard block |
||
| 87 | 87 | { |
| 88 | 88 | $items = []; |
| 89 | 89 | foreach ($this as $index => $item) { |
| 90 | - if ($item->type !== 'text/javascript' && (! @$item->attributes['src'] || ! $item->source)) { |
|
| 90 | + if ($item->type !== 'text/javascript' && (!@$item->attributes['src'] || !$item->source)) { |
|
| 91 | 91 | $items[] = $item; |
| 92 | 92 | continue; |
| 93 | 93 | } |
@@ -147,10 +147,10 @@ discard block |
||
| 147 | 147 | */ |
| 148 | 148 | private function minifyFile($minifiedFileName, $publicDir, $cacheDir, array $cacheItems, array &$items) |
| 149 | 149 | { |
| 150 | - if (! empty($cacheItems)) { |
|
| 151 | - if (! is_file($cacheDir . $minifiedFileName)) { |
|
| 150 | + if (!empty($cacheItems)) { |
|
| 151 | + if (!is_file($cacheDir . $minifiedFileName)) { |
|
| 152 | 152 | $minifier = new Minify\JS(); |
| 153 | - array_map(function ($uri) use ($minifier) { |
|
| 153 | + array_map(function($uri) use ($minifier) { |
|
| 154 | 154 | $minifier->add($uri); |
| 155 | 155 | }, $cacheItems); |
| 156 | 156 | $minifier->minify($cacheDir . $minifiedFileName); |
@@ -71,7 +71,7 @@ |
||
| 71 | 71 | // returned in $items. |
| 72 | 72 | $links = $this->minifyFile($minifiedFile, $publicDir, $cacheDir, $cacheItems, $items) |
| 73 | 73 | // Generate the links |
| 74 | - ->generateLinks($items); |
|
| 74 | + ->generateLinks($items); |
|
| 75 | 75 | |
| 76 | 76 | return $indent . implode($this->escape($this->getSeparator()) . $indent, $links); |
| 77 | 77 | } |
@@ -48,7 +48,7 @@ discard block |
||
| 48 | 48 | public function toString($indent = null): string |
| 49 | 49 | { |
| 50 | 50 | // If configuration tells us minifying is not enabled, use the default view helper. |
| 51 | - if (! $this->options['enabled']) { |
|
| 51 | + if (!$this->options['enabled']) { |
|
| 52 | 52 | return parent::toString($indent); |
| 53 | 53 | } |
| 54 | 54 | |
@@ -86,7 +86,7 @@ discard block |
||
| 86 | 86 | { |
| 87 | 87 | $items = []; |
| 88 | 88 | foreach ($this as $index => $item) { |
| 89 | - if (! $item->href || $item->type != 'text/css') { |
|
| 89 | + if (!$item->href || $item->type != 'text/css') { |
|
| 90 | 90 | continue; |
| 91 | 91 | } |
| 92 | 92 | $localUri = str_replace($this->baseUrl, '', preg_replace('/\?.*/', '', $publicDir . $item->href)); |
@@ -138,10 +138,10 @@ discard block |
||
| 138 | 138 | */ |
| 139 | 139 | private function minifyFile($minifiedFileName, $publicDir, $cacheDir, array $cacheItems, array &$items) |
| 140 | 140 | { |
| 141 | - if (! empty($cacheItems)) { |
|
| 142 | - if (! is_file($cacheDir . $minifiedFileName)) { |
|
| 141 | + if (!empty($cacheItems)) { |
|
| 142 | + if (!is_file($cacheDir . $minifiedFileName)) { |
|
| 143 | 143 | $minifier = new Minify\CSS(); |
| 144 | - array_map(function ($uri) use ($minifier) { |
|
| 144 | + array_map(function($uri) use ($minifier) { |
|
| 145 | 145 | $minifier->add($uri); |
| 146 | 146 | }, $cacheItems); |
| 147 | 147 | $minifier->minify($cacheDir . $minifiedFileName); |