| Total Complexity | 3 |
| Total Lines | 42 |
| Duplicated Lines | 0 % |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 21 | class ViewException extends \Exception |
||
| 22 | { |
||
| 23 | |||
| 24 | /** |
||
| 25 | * Direct view call message |
||
| 26 | */ |
||
| 27 | const DIRECT_VIEW_INSTANCE = 'Views can not be instantiated directly, use `{%1}` class instead'; |
||
| 28 | |||
| 29 | /** |
||
| 30 | * View file not found message |
||
| 31 | */ |
||
| 32 | const LAYOUT_NOT_SET = 'Layout is not set'; |
||
| 33 | |||
| 34 | /** |
||
| 35 | * View file not found message |
||
| 36 | */ |
||
| 37 | const VIEW_FILE_NOT_FOUND = 'File `{%1}.php` does not exists'; |
||
| 38 | |||
| 39 | /** |
||
| 40 | * @param string $name |
||
| 41 | * @return \Quantum\Exceptions\ViewException |
||
| 42 | */ |
||
| 43 | public static function directInstantiation(string $name): ViewException |
||
| 44 | { |
||
| 45 | return new static(_message(self::DIRECT_VIEW_INSTANCE, $name), E_WARNING); |
||
| 46 | } |
||
| 47 | |||
| 48 | /** |
||
| 49 | * @return \Quantum\Exceptions\ViewException |
||
| 50 | */ |
||
| 51 | public static function noLayoutSet(): ViewException |
||
| 54 | } |
||
| 55 | |||
| 56 | /** |
||
| 57 | * @param string $name |
||
| 58 | * @return \Quantum\Exceptions\ViewException |
||
| 59 | */ |
||
| 60 | public static function fileNotFound(string $name): ViewException |
||
| 67 |