-
-
Notifications
You must be signed in to change notification settings - Fork 106
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Route: changed internal getTargetPresenter() to getTargetPresenters()…
… that returns array (inspired by #40)
- Loading branch information
Showing
2 changed files
with
9 additions
and
18 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -21,7 +21,6 @@ | |
* @property-read string $mask | ||
* @property-read array $defaults | ||
* @property-read int $flags | ||
* @property-read string|FALSE $targetPresenter | ||
*/ | ||
class Route extends Nette\Object implements Application\IRouter | ||
{ | ||
|
@@ -674,12 +673,12 @@ public function getFlags() | |
/** | ||
* Proprietary cache aim. | ||
* @internal | ||
* @return string|FALSE | ||
* @return string[]|NULL | ||
*/ | ||
public function getTargetPresenter() | ||
public function getTargetPresenters() | ||
{ | ||
if ($this->flags & self::ONE_WAY) { | ||
return FALSE; | ||
return array(); | ||
} | ||
|
||
$m = $this->metadata; | ||
|
@@ -689,14 +688,14 @@ public function getTargetPresenter() | |
if (isset($m[self::MODULE_KEY]['fixity']) && $m[self::MODULE_KEY]['fixity'] === self::CONSTANT) { | ||
$module = $m[self::MODULE_KEY][self::VALUE] . ':'; | ||
} else { | ||
return NULL; | ||
return; | ||
This comment has been minimized.
Sorry, something went wrong.
This comment has been minimized.
Sorry, something went wrong.
dg
Author
Member
|
||
} | ||
} | ||
|
||
if (isset($m[self::PRESENTER_KEY]['fixity']) && $m[self::PRESENTER_KEY]['fixity'] === self::CONSTANT) { | ||
return $module . $m[self::PRESENTER_KEY][self::VALUE]; | ||
return array($module . $m[self::PRESENTER_KEY][self::VALUE]); | ||
} | ||
return NULL; | ||
return; | ||
} | ||
|
||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Its better to write
return NULL
because now you are returningvoid
and that is semantically different. You should never mix returning void with returning a value.