@@ -21,7 +21,7 @@ discard block |
||
| 21 | 21 | |
| 22 | 22 | private function trimArg($arg) { |
| 23 | 23 | |
| 24 | - $arg = str_replace("|",'',$arg); |
|
| 24 | + $arg = str_replace("|", '', $arg); |
|
| 25 | 25 | $arg = trim($arg); |
| 26 | 26 | return $arg; |
| 27 | 27 | } |
@@ -33,14 +33,14 @@ discard block |
||
| 33 | 33 | preg_match_all($argsPattern, $this->tag, $matches, PREG_PATTERN_ORDER); |
| 34 | 34 | |
| 35 | 35 | //Clean up the args. |
| 36 | - $this->args = array_map([$this,'trimArg'], $matches[0]); |
|
| 36 | + $this->args = array_map([$this, 'trimArg'], $matches[0]); |
|
| 37 | 37 | |
| 38 | 38 | } |
| 39 | 39 | |
| 40 | 40 | public function getLabel() |
| 41 | 41 | { |
| 42 | 42 | $matches = []; |
| 43 | - $result = (preg_match_all($this->pattern, $this->tag,$matches, PREG_SET_ORDER) !== false); |
|
| 43 | + $result = (preg_match_all($this->pattern, $this->tag, $matches, PREG_SET_ORDER) !== false); |
|
| 44 | 44 | |
| 45 | 45 | return ($result ? $matches[0][1] : false); |
| 46 | 46 | } |
@@ -20,15 +20,15 @@ |
||
| 20 | 20 | |
| 21 | 21 | $matches = []; |
| 22 | 22 | |
| 23 | - if(preg_match($templatePattern, $tag) === 1 ) { |
|
| 23 | + if (preg_match($templatePattern, $tag) === 1) { |
|
| 24 | 24 | return new TemplateTag($templatePattern, $tag); |
| 25 | 25 | } |
| 26 | 26 | |
| 27 | - if(preg_match($templateHookPattern, $tag) === 1 ) { |
|
| 27 | + if (preg_match($templateHookPattern, $tag) === 1) { |
|
| 28 | 28 | return new TemplateHook($templateHookPattern, $tag); |
| 29 | 29 | } |
| 30 | 30 | |
| 31 | - if(preg_match($templateHookWithArgsPattern, $tag) === 1 ) { |
|
| 31 | + if (preg_match($templateHookWithArgsPattern, $tag) === 1) { |
|
| 32 | 32 | return new TemplateHookWithArgs($templateHookWithArgsPattern, $tag); |
| 33 | 33 | } |
| 34 | 34 | |
@@ -16,7 +16,7 @@ |
||
| 16 | 16 | public function getLabel() |
| 17 | 17 | { |
| 18 | 18 | $matches = []; |
| 19 | - preg_match_all($this->pattern, $this->tag,$matches, PREG_SET_ORDER); |
|
| 19 | + preg_match_all($this->pattern, $this->tag, $matches, PREG_SET_ORDER); |
|
| 20 | 20 | return $matches[0][1]; |
| 21 | 21 | } |
| 22 | 22 | |
@@ -15,7 +15,7 @@ |
||
| 15 | 15 | public function getLabel() |
| 16 | 16 | { |
| 17 | 17 | $matches = []; |
| 18 | - $result = (preg_match_all($this->pattern, $this->tag,$matches, PREG_SET_ORDER) !== false); |
|
| 18 | + $result = (preg_match_all($this->pattern, $this->tag, $matches, PREG_SET_ORDER) !== false); |
|
| 19 | 19 | |
| 20 | 20 | return ($result ? $matches[0][1] : false); |
| 21 | 21 | } |
@@ -58,10 +58,10 @@ discard block |
||
| 58 | 58 | if (file_exists($this->templateDirectory) === false) { |
| 59 | 59 | throw new Exception("Template directory not set!"); |
| 60 | 60 | } |
| 61 | - if (file_exists($targetTemplate) === false) { |
|
| 61 | + if (file_exists($targetTemplate) === false) { |
|
| 62 | 62 | throw new Exception("Requested template does not exist in $targetTemplate"); |
| 63 | 63 | } |
| 64 | - if (is_readable($targetTemplate) === false) { |
|
| 64 | + if (is_readable($targetTemplate) === false) { |
|
| 65 | 65 | throw new Exception("Requested template is not readable ($targetTemplate)"); |
| 66 | 66 | } |
| 67 | 67 | |
@@ -235,15 +235,15 @@ discard block |
||
| 235 | 235 | $action = $Tag->getLabel(); |
| 236 | 236 | |
| 237 | 237 | //1. Replace template tags here. |
| 238 | - if(count($Tag->getArgs()) > 0) { |
|
| 239 | - $args = array_map([$this,'doFart'], $Tag->getArgs()); |
|
| 238 | + if (count($Tag->getArgs()) > 0) { |
|
| 239 | + $args = array_map([$this, 'doFart'], $Tag->getArgs()); |
|
| 240 | 240 | } |
| 241 | 241 | |
| 242 | 242 | //2. Lookup the callback in the hooks dictionary. |
| 243 | 243 | $callback = $this->hooks[$action]; |
| 244 | 244 | |
| 245 | 245 | if (method_exists($this, $callback) === false) { |
| 246 | - throw new Exception("Hook method does not exist! Cannot execute $callback in " . __FILE__ . ":" . __LINE__); |
|
| 246 | + throw new Exception("Hook method does not exist! Cannot execute $callback in " . __FILE__ . ":" . __LINE__); |
|
| 247 | 247 | } |
| 248 | 248 | |
| 249 | 249 | return (count($Tag->getArgs()) == 0 ? $this->$callback() : $this->$callback($args)); |