Skip to content

Commit

Permalink
Change "PhrouteRoute" to "PhrouteWrapper"
Browse files Browse the repository at this point in the history
  • Loading branch information
rougin committed Dec 2, 2023
1 parent 56db2b7 commit d52dd3a
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 19 deletions.
19 changes: 2 additions & 17 deletions src/Routing/PhrouteResolver.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
/**
* Phroute Resolver
*
* A handler resolver that uses PSR-11 containers to resolve dependencies.
* A handler resolver that wraps the route as the result.
*
* https://github.com/mrjgreen/phroute
*
Expand All @@ -17,26 +17,11 @@
class PhrouteResolver implements HandlerResolverInterface
{
/**
* Create an instance of the given handler.
*
* @param \Rougin\Slytherin\Routing\RouteInterface $handler
* @return array<int, mixed>
*/
public function resolve($handler)
{
/** @var \Rougin\Slytherin\Routing\RouteInterface */
$route = $handler;

$handler = $route->getHandler();

$method = $route->getMethod();

$uri = $route->getUri();

$middlewares = $route->getMiddlewares();

$route = new Route($method, $uri, $handler, $middlewares);

return array(new PhrouteRoute($route), 'setParams');
return array(new PhrouteWrapper($handler), 'setParams');
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,14 @@
namespace Rougin\Slytherin\Routing;

/**
* A simple class for resolving routes in Phroute.
* A simple class wrapper for resolving routes in Phroute.
*
* https://github.com/mrjgreen/phroute
*
* @package Slytherin
* @author Rougin Gutib <rougingutib@gmail.com>
*/
class PhrouteRoute
class PhrouteWrapper
{
/** @var \Rougin\Slytherin\Routing\RouteInterface */
protected $route;
Expand Down

0 comments on commit d52dd3a

Please sign in to comment.