Development

- Removed unused exception from PHP-docs.
- Fixed types not same as declared.
- Fixed issues with reg-ex and php-unit tests.
- Removed unnecessary type casting.
- Declared functions as static (better scoping + performance).
- Moved `\is_callable($callback) === false` as the execution costs less than previous in `Router.php`.
- Changed `ob_get_contents` to `ob_get_clean`.
- Added type hints to methods.
This commit is contained in:
Simon Sessingø
2021-03-17 20:20:28 +01:00
parent 27cd8b8a1f
commit ca88e86c3d
15 changed files with 40 additions and 37 deletions
@@ -76,7 +76,7 @@ class RouteResource extends LoadableRoute implements IControllerRoute
return $this->url;
}
protected function call($method)
protected function call($method): bool
{
$this->setCallback($this->controller . '@' . $method);
@@ -190,7 +190,7 @@ class RouteResource extends LoadableRoute implements IControllerRoute
* @param array $names
* @return static $this
*/
public function setMethodNames(array $names)
public function setMethodNames(array $names): RouteResource
{
$this->methodNames = $names;