diff --git a/module/BrBundle/Component/Controller/CorporateController.php b/module/BrBundle/Component/Controller/CorporateController.php index 26652e9593..074b4da156 100644 --- a/module/BrBundle/Component/Controller/CorporateController.php +++ b/module/BrBundle/Component/Controller/CorporateController.php @@ -6,7 +6,6 @@ use CommonBundle\Component\Controller\Exception\HasNoAccessException; use CommonBundle\Component\Util\AcademicYear; use Laminas\Mvc\MvcEvent; -use Laminas\View\Model\ViewModel; /** * We extend the CommonBundle controller. @@ -54,9 +53,9 @@ public function onDispatch(MvcEvent $e) /** * @param boolean $login - * @return Corporate|boolean + * @return Corporate|null */ - protected function getCorporateEntity($login = true) + protected function getCorporateEntity(bool $login = true) { if ($this->getAuthentication()->isAuthenticated()) { $person = $this->getAuthentication()->getPersonObject(); @@ -66,7 +65,7 @@ protected function getCorporateEntity($login = true) } } - if ($login == false) { + if (!$login) { throw new HasNoAccessException('You do not have sufficient permissions to access this resource'); } @@ -76,7 +75,7 @@ protected function getCorporateEntity($login = true) 'action' => 'login', ) ); - return new ViewModel(); + return null; } /** diff --git a/module/BrBundle/Controller/Corporate/IndexController.php b/module/BrBundle/Controller/Corporate/IndexController.php index 81b7f93e79..12f0db7a06 100644 --- a/module/BrBundle/Controller/Corporate/IndexController.php +++ b/module/BrBundle/Controller/Corporate/IndexController.php @@ -66,7 +66,7 @@ public function eventsAction() $person = $this->getCorporateEntity(); - if ($person === null) { + if (is_null($person)) { foreach ($events as $event) { $event->atEvent = false; }