1 | <?php |
||
11 | class ImageGenerator |
||
12 | { |
||
13 | use ErrorHandlerTrait; |
||
14 | |||
15 | /** |
||
16 | * @var Server |
||
17 | */ |
||
18 | private $server; |
||
19 | |||
20 | /** |
||
21 | * @var FilenameGeneratorInterface |
||
22 | */ |
||
23 | private $filenameGenerator; |
||
24 | |||
25 | /** |
||
26 | * @var array |
||
27 | */ |
||
28 | private $defaultImageParameters; |
||
29 | |||
30 | /** |
||
31 | * @var string |
||
32 | */ |
||
33 | private $tmpPath; |
||
34 | |||
35 | /** |
||
36 | * @var string |
||
37 | */ |
||
38 | private $tmpPrefix; |
||
39 | |||
40 | /** |
||
41 | * @var string |
||
42 | */ |
||
43 | private $fallbackImage; |
||
44 | |||
45 | /** |
||
46 | * @param Server $server |
||
47 | * @param FilenameGeneratorInterface $filenameGenerator |
||
48 | * @param array $defaultImageParameters |
||
49 | * @param null $fallbackImage |
||
50 | * @param null $tmpPath |
||
51 | * @param null $tmpPrefix |
||
52 | */ |
||
53 | 8 | public function __construct( |
|
68 | |||
69 | /** |
||
70 | * @param MediaInterface $media |
||
71 | * @param ImageParameterBag $parameterBag |
||
72 | * @return mixed |
||
73 | */ |
||
74 | 7 | public function generate(MediaInterface $media, ImageParameterBag $parameterBag) |
|
89 | |||
90 | /** |
||
91 | * @param MediaInterface $media |
||
92 | * @param ImageParameterBag $parameterBag |
||
93 | * @param $filename |
||
94 | * @throws FilesystemException |
||
95 | * @throws \Exception |
||
96 | */ |
||
97 | 6 | protected function generateImage(MediaInterface $media, ImageParameterBag $parameterBag, $filename) |
|
121 | |||
122 | /** |
||
123 | * @param MediaInterface $media |
||
124 | * @return string |
||
125 | * @throws FilesystemException |
||
126 | */ |
||
127 | 6 | protected function getImageData(MediaInterface $media) |
|
139 | |||
140 | /** |
||
141 | * @param MediaInterface $media |
||
142 | * @param string $tmp |
||
143 | * @param ImageParameterBag $parameterBag |
||
144 | * @return string |
||
145 | */ |
||
146 | 5 | protected function doGenerateImage(MediaInterface $media, $tmp, ImageParameterBag $parameterBag) |
|
154 | |||
155 | /** |
||
156 | * @return string |
||
157 | */ |
||
158 | 6 | protected function getTemporaryFile() |
|
173 | |||
174 | /** |
||
175 | * @return Server |
||
176 | */ |
||
177 | 1 | public function getServer() |
|
181 | |||
182 | /** |
||
183 | * @return FilenameGeneratorInterface |
||
184 | */ |
||
185 | 1 | public function getFilenameGenerator() |
|
189 | |||
190 | /** |
||
191 | * @return array |
||
192 | */ |
||
193 | 1 | public function getDefaultImageParameters() |
|
197 | |||
198 | /** |
||
199 | * @return string |
||
200 | */ |
||
201 | 1 | public function getTmpPath() |
|
205 | |||
206 | /** |
||
207 | * @return string |
||
208 | */ |
||
209 | 1 | public function getTmpPrefix() |
|
213 | |||
214 | /** |
||
215 | * @return string |
||
216 | */ |
||
217 | 1 | public function getFallbackImage() |
|
221 | } |
||
222 |
This check looks from parameters that have been defined for a function or method, but which are not used in the method body.