From cc9e4c7dc7ac82378679a0bc2fa09c5016659b6d Mon Sep 17 00:00:00 2001 From: Yassine Doghri Date: Wed, 9 Jun 2021 12:47:08 +0000 Subject: [PATCH] refactor(rector): update contributor controller's remap logic --- app/Controllers/Admin/ContributorController.php | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/app/Controllers/Admin/ContributorController.php b/app/Controllers/Admin/ContributorController.php index 9df5bc9b..0604a868 100644 --- a/app/Controllers/Admin/ContributorController.php +++ b/app/Controllers/Admin/ContributorController.php @@ -37,14 +37,15 @@ class ContributorController extends BaseController $this->podcast = $podcast; - if ( - count($params) > 1 && - ($this->user = (new UserModel())->getPodcastContributor((int) $params[1], (int) $params[0])) === null - ) { - throw PageNotFoundException::forPageNotFound(); + if (count($params) <= 1) { + return $this->{$method}(); } - return $this->{$method}(); + if (($this->user = (new UserModel())->getPodcastContributor((int) $params[1], (int) $params[0])) !== null) { + return $this->{$method}(); + } + + throw PageNotFoundException::forPageNotFound(); } public function list(): string