diff options
| author | 2023-04-19 09:16:48 +0200 | |
|---|---|---|
| committer | 2023-04-19 09:16:48 +0200 | |
| commit | ef82e218ea7f7a6b007e0558c0b90d0e2ba95155 (patch) | |
| tree | 01b9a3ab2307d492266a67ad665cfe8caf11de34 /lib/Minz/ActionController.php | |
| parent | 687d0b40a89bfaa5fcf99e76b3094c7c4e744f73 (diff) | |
PHPStan Level 7 Minz_ActionController and lib_date (#5313)
Diffstat (limited to 'lib/Minz/ActionController.php')
| -rw-r--r-- | lib/Minz/ActionController.php | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/lib/Minz/ActionController.php b/lib/Minz/ActionController.php index 8cc9fbc0b..c9551a016 100644 --- a/lib/Minz/ActionController.php +++ b/lib/Minz/ActionController.php @@ -28,11 +28,14 @@ class Minz_ActionController { public function __construct () { $this->csp_policies = self::$csp_default; + $view = null; if (class_exists(self::$viewType)) { - $this->view = new self::$viewType(); - } else { - $this->view = new Minz_View(); + $view = new self::$viewType(); + if (!($view instanceof Minz_View)) { + $view = null; + } } + $this->view = $view ?? new Minz_View(); $view_path = Minz_Request::controllerName() . '/' . Minz_Request::actionName() . '.phtml'; $this->view->_path($view_path); $this->view->attributeParams (); |
