From ef82e218ea7f7a6b007e0558c0b90d0e2ba95155 Mon Sep 17 00:00:00 2001 From: Alexandre Alapetite Date: Wed, 19 Apr 2023 09:16:48 +0200 Subject: PHPStan Level 7 Minz_ActionController and lib_date (#5313) --- lib/Minz/ActionController.php | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) (limited to 'lib/Minz/ActionController.php') 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 (); -- cgit v1.2.3