1 | <?php |
||
16 | class PreviewAction implements MiddlewareInterface |
||
17 | { |
||
18 | use ResponseUtilsTrait; |
||
19 | |||
20 | /** |
||
21 | * @var PreviewGeneratorInterface |
||
22 | */ |
||
23 | private $previewGenerator; |
||
24 | /** |
||
25 | * @var UrlShortenerInterface |
||
26 | */ |
||
27 | private $urlShortener; |
||
28 | |||
29 | /** |
||
30 | * PreviewAction constructor. |
||
31 | * @param PreviewGeneratorInterface $previewGenerator |
||
32 | * @param UrlShortenerInterface $urlShortener |
||
33 | * |
||
34 | * @Inject({PreviewGenerator::class, UrlShortener::class}) |
||
35 | */ |
||
36 | 3 | public function __construct(PreviewGeneratorInterface $previewGenerator, UrlShortenerInterface $urlShortener) |
|
41 | |||
42 | /** |
||
43 | * Process an incoming server request and return a response, optionally delegating |
||
44 | * to the next middleware component to create the response. |
||
45 | * |
||
46 | * @param Request $request |
||
47 | * @param DelegateInterface $delegate |
||
48 | * |
||
49 | * @return Response |
||
50 | */ |
||
51 | 3 | public function process(Request $request, DelegateInterface $delegate) |
|
67 | } |
||
68 |