mirror of
https://github.com/skipperbent/simple-php-router.git
synced 2026-07-10 22:32:13 +00:00
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:
@@ -74,7 +74,7 @@ class EventArgument implements IEventArgument
|
||||
* @param string $name
|
||||
* @return mixed
|
||||
*/
|
||||
public function __get($name)
|
||||
public function __get(string $name)
|
||||
{
|
||||
return $this->arguments[$name] ?? null;
|
||||
}
|
||||
@@ -83,7 +83,7 @@ class EventArgument implements IEventArgument
|
||||
* @param string $name
|
||||
* @return bool
|
||||
*/
|
||||
public function __isset($name)
|
||||
public function __isset(string $name)
|
||||
{
|
||||
return array_key_exists($name, $this->arguments);
|
||||
}
|
||||
@@ -93,7 +93,7 @@ class EventArgument implements IEventArgument
|
||||
* @param mixed $value
|
||||
* @throws \InvalidArgumentException
|
||||
*/
|
||||
public function __set($name, $value)
|
||||
public function __set(string $name, $value)
|
||||
{
|
||||
throw new \InvalidArgumentException('Not supported');
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user