-
-
Notifications
You must be signed in to change notification settings - Fork 1.9k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'mathmarques-route-callable' into 3.x
- Loading branch information
Showing
6 changed files
with
71 additions
and
3 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
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 |
---|---|---|
|
@@ -18,6 +18,8 @@ | |
*/ | ||
abstract class Routable | ||
{ | ||
use CallableResolverAwareTrait; | ||
|
||
/** | ||
* Route callable | ||
* | ||
|
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
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
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 |
---|---|---|
@@ -0,0 +1,39 @@ | ||
<?php | ||
/** | ||
* Slim Framework (http://slimframework.com) | ||
* | ||
* @link https://github.com/slimphp/Slim | ||
* @copyright Copyright (c) 2011-2016 Josh Lockhart | ||
* @license https://github.com/slimphp/Slim/blob/master/LICENSE.md (MIT License) | ||
*/ | ||
namespace Slim\Tests\Mocks; | ||
|
||
use Psr\Http\Message\ResponseInterface; | ||
use Psr\Http\Message\ServerRequestInterface; | ||
use Slim\Interfaces\InvocationStrategyInterface; | ||
|
||
class InvocationStrategyTest implements InvocationStrategyInterface | ||
{ | ||
public static $LastCalledFor = null; | ||
|
||
/** | ||
* Invoke a route callable. | ||
* | ||
* @param callable $callable The callable to invoke using the strategy. | ||
* @param ServerRequestInterface $request The request object. | ||
* @param ResponseInterface $response The response object. | ||
* @param array $routeArguments The route's placholder arguments | ||
* | ||
* @return ResponseInterface|string The response from the callable. | ||
*/ | ||
public function __invoke( | ||
callable $callable, | ||
ServerRequestInterface $request, | ||
ResponseInterface $response, | ||
array $routeArguments | ||
) { | ||
static::$LastCalledFor = $callable; | ||
|
||
return $response; | ||
} | ||
} |
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