refactor(rector): update contributor controller's remap logic

This commit is contained in:
Yassine Doghri 2021-06-09 12:47:08 +00:00
parent 92536ddb38
commit cc9e4c7dc7
No known key found for this signature in database
GPG Key ID: 3E7F89498B960C9F

View File

@ -37,16 +37,17 @@ class ContributorController extends BaseController
$this->podcast = $podcast; $this->podcast = $podcast;
if ( if (count($params) <= 1) {
count($params) > 1 && return $this->{$method}();
($this->user = (new UserModel())->getPodcastContributor((int) $params[1], (int) $params[0])) === null
) {
throw PageNotFoundException::forPageNotFound();
} }
if (($this->user = (new UserModel())->getPodcastContributor((int) $params[1], (int) $params[0])) !== null) {
return $this->{$method}(); return $this->{$method}();
} }
throw PageNotFoundException::forPageNotFound();
}
public function list(): string public function list(): string
{ {
$data = [ $data = [