@@ -48,7 +48,7 @@ |
||
48 | 48 | )* # special part of "unrolling the loop" |
49 | 49 | ) # use a the "unrolling the loop" technique to be able to skip escaped quotes like ="\"" |
50 | 50 | \1? # match the same quote symbol as matched before |
51 | - /x', function ($match) { |
|
51 | + /x', function($match) { |
|
52 | 52 | return $this->minifyAttribute($match); |
53 | 53 | }, $context->getContents())); |
54 | 54 | } |
@@ -31,7 +31,7 @@ |
||
31 | 31 | ([\'"])? # optional to use a quote |
32 | 32 | (\1|true|false|([\s>"\'])) # match the boolean attribute name again or true|false |
33 | 33 | \2? # match the quote again |
34 | - /xi', function ($match) { |
|
34 | + /xi', function($match) { |
|
35 | 35 | if (isset($match[4])) { |
36 | 36 | return ' '.$match[1]; |
37 | 37 | } |
@@ -23,7 +23,7 @@ |
||
23 | 23 | <! # search for the start of a comment |
24 | 24 | [^>]* # search for everything without a ">" |
25 | 25 | > # match the end of the comment |
26 | - /xs', function ($match) { |
|
26 | + /xs', function($match) { |
|
27 | 27 | if (Str::contains(strtolower($match[0]), 'doctype')) { |
28 | 28 | return $match[0]; |
29 | 29 | } |
@@ -36,7 +36,7 @@ |
||
36 | 36 | \2 # Backreference to the matched quote |
37 | 37 | \s* |
38 | 38 | /x', |
39 | - function ($match) { |
|
39 | + function($match) { |
|
40 | 40 | if ($this->isBooleanAttribute($match[1])) { |
41 | 41 | return Html::isLastAttribute($match[0]) ? $match[1] : $match[1].' '; |
42 | 42 | } |
@@ -25,7 +25,7 @@ |
||
25 | 25 | ["\']? # Match an optional quote |
26 | 26 | \s*javascript: # Match the text "javascript:" which should be removed |
27 | 27 | /xis', |
28 | - function ($match) { |
|
28 | + function($match) { |
|
29 | 29 | return str_replace('javascript:', '', $match[0]); |
30 | 30 | }, $context->getContents()); |
31 | 31 |
@@ -40,8 +40,8 @@ discard block |
||
40 | 40 | */ |
41 | 41 | public function process(MinifyContext $context) |
42 | 42 | { |
43 | - Collection::make($this->redundantAttributes)->each(function ($attributes, $element) use (&$context) { |
|
44 | - Collection::make($attributes)->each(function ($value, $attribute) use ($element, &$context) { |
|
43 | + Collection::make($this->redundantAttributes)->each(function($attributes, $element) use (&$context) { |
|
44 | + Collection::make($attributes)->each(function($value, $attribute) use ($element, &$context) { |
|
45 | 45 | $contents = preg_replace_callback( |
46 | 46 | '/ |
47 | 47 | '.$element.' # Match the given element |
@@ -55,7 +55,7 @@ discard block |
||
55 | 55 | \s* |
56 | 56 | ) |
57 | 57 | /xis', |
58 | - function ($match) { |
|
58 | + function($match) { |
|
59 | 59 | return $this->removeAttribute($match[0], $match[2]); |
60 | 60 | }, $context->getContents()); |
61 | 61 |
@@ -83,7 +83,7 @@ discard block |
||
83 | 83 | */ |
84 | 84 | public function getContentSize($contentsWithPlaceholders) |
85 | 85 | { |
86 | - $placeholderSize = $this->map(function ($value, $key) use (&$contentsWithPlaceholders){ |
|
86 | + $placeholderSize = $this->map(function($value, $key) use (&$contentsWithPlaceholders){ |
|
87 | 87 | $count = substr_count($contentsWithPlaceholders, $key); |
88 | 88 | |
89 | 89 | return strlen($key) * $count - strlen($value) * $count; |
@@ -111,7 +111,7 @@ discard block |
||
111 | 111 | */ |
112 | 112 | protected function removeNestedPlaceholders($originalContent) |
113 | 113 | { |
114 | - return preg_replace_callback('/'.Constants::PLACEHOLDER_PATTERN.'/', function ($match) { |
|
114 | + return preg_replace_callback('/'.Constants::PLACEHOLDER_PATTERN.'/', function($match) { |
|
115 | 115 | return $this->pull($match[0]); |
116 | 116 | }, $originalContent); |
117 | 117 | } |
@@ -30,7 +30,7 @@ discard block |
||
30 | 30 | */ |
31 | 31 | protected function setCDataPlaceholder($contents, PlaceholderContainer $placeholderContainer) |
32 | 32 | { |
33 | - return preg_replace_callback('/<!\[CDATA\[((?!\]\]>).)*\]\]>/s', function ($match) use ($placeholderContainer) { |
|
33 | + return preg_replace_callback('/<!\[CDATA\[((?!\]\]>).)*\]\]>/s', function($match) use ($placeholderContainer) { |
|
34 | 34 | return $placeholderContainer->createPlaceholder($match[0]); |
35 | 35 | }, $contents); |
36 | 36 | } |
@@ -66,7 +66,7 @@ discard block |
||
66 | 66 | > # Match the endif with the captured dashes |
67 | 67 | ) |
68 | 68 | /xis', |
69 | - function ($match) use ($placeholderContainer) { |
|
69 | + function($match) use ($placeholderContainer) { |
|
70 | 70 | if (!empty(preg_replace('/\s*/', '', $match[3]))) { |
71 | 71 | return $placeholderContainer->createPlaceholder($match[1]).$match[3].$placeholderContainer->createPlaceholder($match[4]); |
72 | 72 | } else { |
@@ -16,10 +16,10 @@ |
||
16 | 16 | public function process($context) |
17 | 17 | { |
18 | 18 | $contents = $context->getContents(); |
19 | - $contents = preg_replace_callback('/<\?=((?!\?>).)*\?>/s', function ($match) use ($context) { |
|
19 | + $contents = preg_replace_callback('/<\?=((?!\?>).)*\?>/s', function($match) use ($context) { |
|
20 | 20 | return $context->getPlaceholderContainer()->createPlaceholder($match[0]); |
21 | 21 | }, $contents); |
22 | - $contents = preg_replace_callback('/<\?php((?!\?>).)*(\?>)?/s', function ($match) use ($context) { |
|
22 | + $contents = preg_replace_callback('/<\?php((?!\?>).)*(\?>)?/s', function($match) use ($context) { |
|
23 | 23 | return $context->getPlaceholderContainer()->createPlaceholder($match[0]); |
24 | 24 | }, $contents); |
25 | 25 |