Skip to content

Commit

Permalink
Improve type hinting in Routing component
Browse files Browse the repository at this point in the history
  • Loading branch information
rougin committed Dec 26, 2023
1 parent b33f5aa commit cc46a04
Show file tree
Hide file tree
Showing 6 changed files with 31 additions and 31 deletions.
8 changes: 4 additions & 4 deletions src/Routing/PhrouteRouter.php
Original file line number Diff line number Diff line change
Expand Up @@ -36,10 +36,10 @@ public function __construct(array $routes = array())
/**
* Adds a new raw route.
*
* @param string $method
* @param string $uri
* @param callable|string[]|string $handler
* @param \Rougin\Slytherin\Middleware\MiddlewareInterface[]|string[] $middlewares
* @param string $method
* @param string $uri
* @param callable|string[]|string $handler
* @param callable|mixed[]|string $middlewares
* @return self
*/
public function add($method, $uri, $handler, $middlewares = array())
Expand Down
2 changes: 1 addition & 1 deletion src/Routing/Route.php
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ class Route implements RouteInterface
* @param string $method
* @param string $uri
* @param callable|string[]|string $handler
* @param mixed[]|string $middlewares
* @param callable|mixed[]|string $middlewares
*/
public function __construct($method, $uri, $handler, $middlewares = array())
{
Expand Down
46 changes: 23 additions & 23 deletions src/Routing/Router.php
Original file line number Diff line number Diff line change
Expand Up @@ -61,10 +61,10 @@ public function __construct(array $routes = array())
/**
* Adds a new raw route.
*
* @param string $method
* @param string $uri
* @param callable|string[]|string $handler
* @param \Rougin\Slytherin\Middleware\MiddlewareInterface[]|string[] $middlewares
* @param string $method
* @param string $uri
* @param callable|string[]|string $handler
* @param callable|mixed[]|string $middlewares
* @return self
*/
public function add($method, $uri, $handler, $middlewares = array())
Expand Down Expand Up @@ -100,10 +100,10 @@ public function add($method, $uri, $handler, $middlewares = array())
* Adds a new raw route.
* NOTE: To be removed in v1.0.0. Use "add" instead.
*
* @param string $method
* @param string $route
* @param callable|string[]|string $handler
* @param \Rougin\Slytherin\Middleware\MiddlewareInterface[]|string[] $middlewares
* @param string $method
* @param string $route
* @param callable|string[]|string $handler
* @param callable|mixed[]|string $middlewares
* @return self
*/
public function addRoute($method, $route, $handler, $middlewares = array())
Expand All @@ -126,9 +126,9 @@ public function addRoutes(array $routes)
/**
* Adds a DELETE route.
*
* @param string $uri
* @param callable|string[]|string $handler
* @param \Rougin\Slytherin\Middleware\MiddlewareInterface[]|string[] $middlewares
* @param string $uri
* @param callable|string[]|string $handler
* @param callable|mixed[]|string $middlewares
* @return self
*/
public function delete($uri, $handler, $middlewares = array())
Expand Down Expand Up @@ -162,9 +162,9 @@ public function find($method, $uri)
/**
* Adds a GET route.
*
* @param string $uri
* @param callable|string[]|string $handler
* @param \Rougin\Slytherin\Middleware\MiddlewareInterface[]|string[] $middlewares
* @param string $uri
* @param callable|string[]|string $handler
* @param callable|mixed[]|string $middlewares
* @return self
*/
public function get($uri, $handler, $middlewares = array())
Expand Down Expand Up @@ -235,9 +235,9 @@ public function parsed(array $routes = array())
/**
* Adds a PATCH route.
*
* @param string $uri
* @param callable|string[]|string $handler
* @param \Rougin\Slytherin\Middleware\MiddlewareInterface[]|string[] $middlewares
* @param string $uri
* @param callable|string[]|string $handler
* @param callable|mixed[]|string $middlewares
* @return self
*/
public function patch($uri, $handler, $middlewares = array())
Expand All @@ -248,9 +248,9 @@ public function patch($uri, $handler, $middlewares = array())
/**
* Adds a POST route.
*
* @param string $uri
* @param callable|string[]|string $handler
* @param \Rougin\Slytherin\Middleware\MiddlewareInterface[]|string[] $middlewares
* @param string $uri
* @param callable|string[]|string $handler
* @param callable|mixed[]|string $middlewares
* @return self
*/
public function post($uri, $handler, $middlewares = array())
Expand Down Expand Up @@ -284,9 +284,9 @@ public function prefix($prefix = '', $namespace = null)
/**
* Adds a PUT route.
*
* @param string $uri
* @param callable|string[]|string $handler
* @param \Rougin\Slytherin\Middleware\MiddlewareInterface[]|string[] $middlewares
* @param string $uri
* @param callable|string[]|string $handler
* @param callable|mixed[]|string $middlewares
* @return self
*/
public function put($uri, $handler, $middlewares = array())
Expand Down
2 changes: 1 addition & 1 deletion tests/Component/Server.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,4 +19,4 @@
$app = new Application($components);

$app->run();
// @codeCoverageIgnoreEnd
// @codeCoverageIgnoreEnd
2 changes: 1 addition & 1 deletion tests/Previous/Server.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,4 @@
$builder = new Builder;

$builder->make()->run();
// @codeCoverageIgnoreENd
// @codeCoverageIgnoreEnd
2 changes: 1 addition & 1 deletion tests/Sample/Server.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,4 +21,4 @@
$builder->addHandler(new Cors);

$builder->make()->run();
// @codeCoverageIgnoreEnd
// @codeCoverageIgnoreEnd

0 comments on commit cc46a04

Please sign in to comment.