1 | <?php |
||
13 | final class Authorize implements RouteCallbackInterface |
||
14 | { |
||
15 | const ROUTE = '/authorize'; |
||
16 | |||
17 | /** |
||
18 | * The slim framework view helper. |
||
19 | * |
||
20 | * @var object |
||
21 | */ |
||
22 | private $view; |
||
23 | |||
24 | /** |
||
25 | * The oauth2 server imstance. |
||
26 | * |
||
27 | * @var OAuth2\Server |
||
28 | */ |
||
29 | private $server; |
||
30 | |||
31 | /** |
||
32 | * The template for /authorize |
||
33 | * |
||
34 | * @var string |
||
35 | */ |
||
36 | private $template; |
||
37 | |||
38 | /** |
||
39 | * Extracts user_id from the incoming request. |
||
40 | * |
||
41 | * @var UserIdProviderInterface |
||
42 | */ |
||
43 | private $userIdProvider; |
||
44 | |||
45 | /** |
||
46 | * Construct a new instance of Authorize. |
||
47 | * |
||
48 | * @param OAuth2\Server $server The oauth2 server imstance. |
||
49 | * @param object $view The slim framework view helper. |
||
50 | * @param string $template The template for /authorize. |
||
51 | * @param UserIdProviderInterface $userIdProvider Object to extract a user_id based on the incoming request. |
||
52 | * |
||
53 | * @throws \InvalidArgumentException Thrown if $view is not an object implementing a render method. |
||
54 | */ |
||
55 | public function __construct( |
||
75 | |||
76 | /** |
||
77 | * Invoke this route callback. |
||
78 | * |
||
79 | * @param ServerRequestInterface $request Represents the current HTTP request. |
||
80 | * @param ResponseInterface $response Represents the current HTTP response. |
||
81 | * @param array $arguments Values for the current route’s named placeholders. |
||
82 | * |
||
83 | * @return ResponseInterface |
||
84 | */ |
||
85 | public function __invoke(ServerRequestInterface $request, ResponseInterface $response, array $arguments = []) |
||
109 | } |
||
110 |