1 | <?php |
||
17 | class QrCodeAction implements MiddlewareInterface |
||
18 | { |
||
19 | /** |
||
20 | * @var RouterInterface |
||
21 | */ |
||
22 | private $router; |
||
23 | /** |
||
24 | * @var UrlShortenerInterface |
||
25 | */ |
||
26 | private $urlShortener; |
||
27 | /** |
||
28 | * @var LoggerInterface |
||
29 | */ |
||
30 | private $logger; |
||
31 | |||
32 | /** |
||
33 | * QrCodeAction constructor. |
||
34 | * @param RouterInterface $router |
||
35 | * @param UrlShortenerInterface $urlShortener |
||
36 | * @param LoggerInterface $logger |
||
37 | * |
||
38 | * @Inject({RouterInterface::class, UrlShortener::class, "Logger_Shlink"}) |
||
39 | */ |
||
40 | 3 | public function __construct( |
|
49 | |||
50 | /** |
||
51 | * Process an incoming request and/or response. |
||
52 | * |
||
53 | * Accepts a server-side request and a response instance, and does |
||
54 | * something with them. |
||
55 | * |
||
56 | * If the response is not complete and/or further processing would not |
||
57 | * interfere with the work done in the middleware, or if the middleware |
||
58 | * wants to delegate to another process, it can use the `$out` callable |
||
59 | * if present. |
||
60 | * |
||
61 | * If the middleware does not return a value, execution of the current |
||
62 | * request is considered complete, and the response instance provided will |
||
63 | * be considered the response to return. |
||
64 | * |
||
65 | * Alternately, the middleware may return a response instance. |
||
66 | * |
||
67 | * Often, middleware will `return $out();`, with the assumption that a |
||
68 | * later middleware will return a response. |
||
69 | * |
||
70 | * @param Request $request |
||
71 | * @param Response $response |
||
72 | * @param null|callable $out |
||
73 | * @return null|Response |
||
74 | */ |
||
75 | 3 | public function __invoke(Request $request, Response $response, callable $out = null) |
|
97 | |||
98 | /** |
||
99 | * @param Request $request |
||
100 | * @return int |
||
101 | */ |
||
102 | 1 | protected function getSizeParam(Request $request) |
|
113 | } |
||
114 |