The first test was a prefix of the second, thus it is implicitly checked.
Also run the `wcf` check in all cases, while this might check the same entry
twice for `$application == 'wcf'`, this will not have a relevant performance
impact and make the code much more readable.
// handle controllers with a custom url
$controller = $classData['controller'];
- if (
- isset($this->customUrls['reverse'][$application])
- && isset($this->customUrls['reverse'][$application][$controller])
- ) {
+ if (isset($this->customUrls['reverse'][$application][$controller])) {
return $this->customUrls['reverse'][$application][$controller];
- } elseif ($application !== 'wcf') {
- if (
- isset($this->customUrls['reverse']['wcf'])
- && isset($this->customUrls['reverse']['wcf'][$controller])
- ) {
- return $this->customUrls['reverse']['wcf'][$controller];
- }
+ }
+ if (isset($this->customUrls['reverse']['wcf'][$controller])) {
+ return $this->customUrls['reverse']['wcf'][$controller];
}
}
}