| Total Complexity | 5 |
| Total Lines | 33 |
| Duplicated Lines | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 13 | class TemplateHookWithArgs extends AbstractTag |
||
| 14 | { |
||
| 15 | |||
| 16 | public function setup() |
||
| 20 | } |
||
| 21 | |||
| 22 | private function trimArg($arg) { |
||
| 23 | |||
| 24 | $arg = str_replace("|",'',$arg); |
||
| 25 | $arg = trim($arg); |
||
| 26 | return $arg; |
||
| 27 | } |
||
| 28 | |||
| 29 | public function parseArgs() { |
||
| 30 | $argsPattern = '/(\|(?:{{){0,1}([A-Za-z0-9-]+)(?:}}){0,1})/'; |
||
| 31 | $matches = []; |
||
| 32 | |||
| 33 | preg_match_all($argsPattern, $this->tag, $matches, PREG_PATTERN_ORDER); |
||
| 34 | |||
| 35 | //Clean up the args. |
||
| 36 | $this->args = array_map([$this,'trimArg'], $matches[0]); |
||
| 37 | |||
| 38 | } |
||
| 39 | |||
| 40 | public function getLabel() |
||
| 46 | } |
||
| 47 | } |