| Total Complexity | 8 |
| Total Lines | 54 |
| Duplicated Lines | 0 % |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 11 | class TestCommonApplication extends CommonApplication |
||
| 12 | { |
||
| 13 | |||
| 14 | /** |
||
| 15 | * Constructor |
||
| 16 | */ |
||
| 17 | function __construct() |
||
|
|
|||
| 18 | { |
||
| 19 | parent::__construct(new HtmlTemplate(__DIR__, 'index')); |
||
| 20 | |||
| 21 | $this->getTemplate()->addPaths([ |
||
| 22 | __DIR__ . '/Res/' |
||
| 23 | ]); |
||
| 24 | } |
||
| 25 | |||
| 26 | function actionArrayResult(): array |
||
| 27 | { |
||
| 28 | return [ |
||
| 29 | 'title' => 'Array result', |
||
| 30 | 'main' => 'Route main' |
||
| 31 | ]; |
||
| 32 | } |
||
| 33 | |||
| 34 | function actionViewResult(): array |
||
| 35 | { |
||
| 36 | return [ |
||
| 37 | 'title' => 'Page title', |
||
| 38 | 'main' => new TestingView(new HtmlTemplate(__DIR__, 'index'), 'test3') |
||
| 39 | ]; |
||
| 40 | } |
||
| 41 | |||
| 42 | function actionInvalid(): string |
||
| 45 | } |
||
| 46 | |||
| 47 | function actionRest(): array |
||
| 48 | { |
||
| 49 | throw (new Rest\Exception('exception', - 1, 502, 'body')); |
||
| 50 | } |
||
| 51 | |||
| 52 | function redirectTo($url): void |
||
| 54 | // do nothing |
||
| 55 | } |
||
| 56 | |||
| 57 | public $hasMessages = true; |
||
| 58 | |||
| 59 | protected function fileExists(string $fileName): bool |
||
| 65 | } |
||
| 66 | } |
||
| 67 | } |
||
| 68 |
Adding explicit visibility (
private,protected, orpublic) is generally recommend to communicate to other developers how, and from where this method is intended to be used.