| Total Complexity | 7 |
| Total Lines | 52 |
| Duplicated Lines | 0 % |
| Changes | 4 | ||
| Bugs | 0 | Features | 1 |
| 1 | <?php |
||
| 5 | class Viewer{ |
||
| 6 | use HelperTrait, CheckTrait; |
||
| 7 | |||
| 8 | private static $instance = null; |
||
| 9 | private string $path = ''; |
||
| 10 | |||
| 11 | public function __construct(string $path) |
||
| 12 | { |
||
| 13 | $this->path = $path; |
||
| 14 | return $this; |
||
| 15 | } |
||
| 16 | |||
| 17 | public static function getInstance(string $path): Viewer |
||
| 18 | { |
||
| 19 | if(is_null(self::$instance)){ |
||
| 20 | self::$instance = new self($path); |
||
| 21 | } |
||
| 22 | return self::$instance; |
||
| 23 | } |
||
| 24 | |||
| 25 | public static function create(string $path): Viewer |
||
| 26 | { |
||
| 27 | return self::getInstance($path); |
||
| 28 | } |
||
| 29 | |||
| 30 | public function render(string $file, array $data = [], bool $return = false): string |
||
| 50 | } |
||
| 51 | |||
| 52 | public function include(string $file): void |
||
| 57 | } |
||
| 58 | |||
| 59 | } |
||
| 60 |