@@ -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 | |
@@ -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->createPlaceholder(' '); |
| 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->createPlaceholder(' '); |
| 113 | 113 | }, $element); |
| 114 | 114 | } |
@@ -125,7 +125,7 @@ discard block |
||
| 125 | 125 | |
| 126 | 126 | $pattern = '/ |
| 127 | 127 | ( |
| 128 | - <(' . $htmlTags . ') # Match html start tag and capture |
|
| 128 | + <(' . $htmlTags.') # Match html start tag and capture |
|
| 129 | 129 | (?: |
| 130 | 130 | [^"\'>]*|"[^"]*"|\'[^\']*\' |
| 131 | 131 | )* # Match all attributes |
@@ -140,7 +140,7 @@ discard block |
||
| 140 | 140 | (<\/\2>) # Match end tag by back referencing the start tag |
| 141 | 141 | /xis'; |
| 142 | 142 | |
| 143 | - return preg_replace_callback($pattern, function ($match) use ($placeholderContainer) { |
|
| 143 | + return preg_replace_callback($pattern, function($match) use ($placeholderContainer) { |
|
| 144 | 144 | return $match[1].$placeholderContainer->createPlaceholder($match[3]).$match[4]; |
| 145 | 145 | }, $contents); |
| 146 | 146 | } |
@@ -7,7 +7,7 @@ |
||
| 7 | 7 | /** |
| 8 | 8 | * @param string $message Exception message to throw |
| 9 | 9 | * @param int $code Exception code |
| 10 | - * @param Exception $previous previous exception used for the exception chaining |
|
| 10 | + * @param \Exception $previous previous exception used for the exception chaining |
|
| 11 | 11 | */ |
| 12 | 12 | public function __construct($message = 'The file does not exists.', $code = 0, \Exception $previous = null) |
| 13 | 13 | { |