@@ -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()->addPlaceholder($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()->addPlaceholder($match[0]); |
| 24 | 24 | }, $contents); |
| 25 | 25 | |
@@ -63,7 +63,7 @@ discard block |
||
| 63 | 63 | \s+ # Match minimal 1 whitespace between the elements |
| 64 | 64 | <('.$elementsRegex.') # Match the start of the next inline element |
| 65 | 65 | /xi', |
| 66 | - function ($match) use ($placeholderContainer) { |
|
| 66 | + function($match) use ($placeholderContainer) { |
|
| 67 | 67 | // Where going to respect one space between the inline elements. |
| 68 | 68 | $placeholder = $placeholderContainer->addPlaceholder(' '); |
| 69 | 69 | |
@@ -93,7 +93,7 @@ discard block |
||
| 93 | 93 | ) |
| 94 | 94 | <('.$elementsRegex.') # Match starting tag |
| 95 | 95 | /xis', |
| 96 | - function ($match) use ($placeholderContainer) { |
|
| 96 | + function($match) use ($placeholderContainer) { |
|
| 97 | 97 | return $this->replaceWhitespacesInInlineElements($match[1], $placeholderContainer).'<'.$match[3]; |
| 98 | 98 | }, $contents); |
| 99 | 99 | } |
@@ -108,7 +108,7 @@ discard block |
||
| 108 | 108 | */ |
| 109 | 109 | private function replaceWhitespacesInInlineElements($element, PlaceholderContainer $placeholderContainer) |
| 110 | 110 | { |
| 111 | - return preg_replace_callback('/>\s/', function ($match) use ($placeholderContainer) { |
|
| 111 | + return preg_replace_callback('/>\s/', function($match) use ($placeholderContainer) { |
|
| 112 | 112 | return '>'.$placeholderContainer->addPlaceholder(' '); |
| 113 | 113 | }, $element); |
| 114 | 114 | } |
@@ -134,7 +134,7 @@ discard block |
||
| 134 | 134 | ((?:(?!<\/\2>).)+) |
| 135 | 135 | (<\/\2>)/xis'; |
| 136 | 136 | |
| 137 | - return preg_replace_callback($pattern, function ($match) use ($placeholderContainer) { |
|
| 137 | + return preg_replace_callback($pattern, function($match) use ($placeholderContainer) { |
|
| 138 | 138 | return $match[1].$placeholderContainer->addPlaceholder($match[3]).$match[4]; |
| 139 | 139 | }, $contents); |
| 140 | 140 | } |
@@ -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 | |