| Total Complexity | 8 |
| Total Lines | 33 |
| Duplicated Lines | 0 % |
| Coverage | 94.44% |
| Changes | 0 | ||
| 1 | <?php |
||
| 13 | class TemplateHook extends AbstractTag |
||
| 14 | { |
||
| 15 | 6 | public function getLabel() |
|
| 16 | { |
||
| 17 | 6 | $matches = []; |
|
| 18 | 6 | $result = (preg_match_all($this->pattern, $this->tag,$matches, PREG_SET_ORDER) !== false); |
|
| 19 | |||
| 20 | 6 | return ($result ? $matches[0][1] : false); |
|
| 21 | } |
||
| 22 | |||
| 23 | 13 | public function setup() { |
|
| 24 | 13 | $this->type = AbstractTag::HOOK; |
|
|
|
|||
| 25 | 13 | } |
|
| 26 | |||
| 27 | 2 | public function fart($dictionary) { |
|
| 28 | 2 | $label = $this->getLabel(); |
|
| 29 | 2 | foreach($dictionary as $find => $replace) { |
|
| 30 | 1 | if(strcmp($find,$label) === 0) { |
|
| 31 | $this->replacement = $replace; |
||
| 32 | 1 | return true; |
|
| 33 | } |
||
| 34 | } |
||
| 35 | |||
| 36 | 2 | return false; |
|
| 37 | } |
||
| 38 | |||
| 39 | 1 | public function getTag() { |
|
| 41 | } |
||
| 42 | |||
| 43 | 2 | public function getReplacement() |
|
| 44 | { |
||
| 48 | } |