1 | <?php |
||
24 | class ConsumerThumbnail implements ThumbnailInterface |
||
25 | { |
||
26 | /** |
||
27 | * @var string |
||
28 | */ |
||
29 | protected $id; |
||
30 | |||
31 | /** |
||
32 | * @var ThumbnailInterface |
||
33 | */ |
||
34 | protected $thumbnail; |
||
35 | |||
36 | /** |
||
37 | * @var BackendInterface |
||
38 | */ |
||
39 | protected $backend; |
||
40 | |||
41 | /** |
||
42 | * @var EventDispatcherInterface |
||
43 | */ |
||
44 | protected $dispatcher; |
||
45 | |||
46 | /** |
||
47 | * NEXT_MAJOR: remove optional null for EventDispatcherInterface. |
||
48 | * |
||
49 | * @param string $id |
||
50 | * @param EventDispatcherInterface $dispatcher |
||
51 | */ |
||
52 | public function __construct($id, ThumbnailInterface $thumbnail, BackendInterface $backend, ?EventDispatcherInterface $dispatcher = null) |
||
53 | { |
||
54 | /* |
||
55 | * NEXT_MAJOR: remove this check |
||
56 | */ |
||
57 | if (null === $dispatcher) { |
||
58 | @trigger_error( |
||
|
|||
59 | 'Since version 3.0, passing an empty parameter in argument 4 for __construct() in '.__CLASS__.' is |
||
60 | deprecated and the workaround for it will be removed in 4.0.', |
||
61 | E_USER_DEPRECATED |
||
62 | ); |
||
63 | } |
||
64 | |||
65 | $this->id = $id; |
||
66 | $this->thumbnail = $thumbnail; |
||
67 | $this->backend = $backend; |
||
68 | $this->dispatcher = $dispatcher; |
||
69 | } |
||
70 | |||
71 | public function generatePublicUrl(MediaProviderInterface $provider, MediaInterface $media, $format) |
||
75 | |||
76 | public function generatePrivateUrl(MediaProviderInterface $provider, MediaInterface $media, $format) |
||
80 | |||
81 | public function generate(MediaProviderInterface $provider, MediaInterface $media): void |
||
107 | |||
108 | public function delete(MediaProviderInterface $provider, MediaInterface $media, $formats = null) |
||
112 | } |
||
113 |
If you suppress an error, we recommend checking for the error condition explicitly: