| Total Complexity | 11 |
| Total Lines | 57 |
| Duplicated Lines | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 7 | class VariableTpl |
||
| 8 | { |
||
| 9 | private $pattern = '/{\s?([\w]+.?[\w]+.?[\w]+)\s?\|?\s?([\w]+)?\s?}/is'; |
||
| 10 | private $match = []; |
||
| 11 | private $matches = []; |
||
| 12 | private $replace = ''; |
||
| 13 | private $variable = ''; |
||
| 14 | |||
| 15 | public function __construct(string $content) |
||
| 19 | } |
||
| 20 | |||
| 21 | public function __toString(): string |
||
| 24 | } |
||
| 25 | |||
| 26 | private function variable(): void |
||
| 36 | }; |
||
| 37 | } |
||
| 38 | } |
||
| 39 | |||
| 40 | private function getVariable(): void |
||
| 41 | { |
||
| 42 | $explode = explode('.', $this->match[1]); |
||
| 43 | |||
| 44 | $variable = $explode[0]; |
||
| 45 | |||
| 46 | $variable = '$'.$variable; |
||
| 47 | |||
| 48 | for ($k = 1; $k < count($explode); $k++) { |
||
| 49 | $variable .= "->".$explode[$k]; |
||
| 50 | } |
||
| 51 | |||
| 52 | $this->variable = $variable; |
||
| 53 | } |
||
| 54 | |||
| 55 | private function filter(string $name): void |
||
| 56 | { |
||
| 57 | $this->$name(); |
||
| 58 | } |
||
| 59 | |||
| 60 | private function upper(): void |
||
| 64 | } |
||
| 65 | } |
||
| 66 | } |
||
| 67 |