1 | <?php |
||
9 | class Conversion |
||
10 | { |
||
11 | /** @var string */ |
||
12 | protected $name = ''; |
||
13 | |||
14 | /** @var int */ |
||
15 | protected $extractVideoFrameAtSecond = 0; |
||
16 | |||
17 | /** @var \Spatie\Image\Manipulations */ |
||
18 | protected $manipulations; |
||
19 | |||
20 | /** @var array */ |
||
21 | protected $performOnCollections = []; |
||
22 | |||
23 | /** @var bool */ |
||
24 | protected $performOnQueue = true; |
||
25 | |||
26 | /** @var bool */ |
||
27 | protected $keepOriginalImageFormat = false; |
||
28 | |||
29 | /** @var bool */ |
||
30 | protected $generateResponsiveImages = false; |
||
31 | |||
32 | public function __construct(string $name) |
||
40 | |||
41 | public static function create(string $name) |
||
45 | |||
46 | public function getName(): string |
||
50 | |||
51 | public function getPerformOnCollections(): array |
||
59 | |||
60 | /* |
||
61 | * Set the timecode in seconds to extract a video thumbnail. |
||
62 | * Only used on video media. |
||
63 | */ |
||
64 | public function extractVideoFrameAtSecond(int $timeCode): self |
||
70 | |||
71 | public function getExtractVideoFrameAtSecond(): int |
||
75 | |||
76 | public function keepOriginalImageFormat(): self |
||
82 | |||
83 | public function shouldKeepOriginalImageFormat(): bool |
||
87 | |||
88 | public function getManipulations(): Manipulations |
||
92 | |||
93 | public function removeManipulation(string $manipulationName): self |
||
99 | |||
100 | public function withoutManipulations(): self |
||
106 | |||
107 | public function __call($name, $arguments) |
||
117 | |||
118 | /** |
||
119 | * Set the manipulations for this conversion. |
||
120 | * |
||
121 | * @param \Spatie\Image\Manipulations|\Closure $manipulations |
||
122 | * |
||
123 | * @return $this |
||
124 | */ |
||
125 | public function setManipulations($manipulations): self |
||
137 | |||
138 | /** |
||
139 | * Add the given manipulations as the first ones. |
||
140 | * |
||
141 | * @param \Spatie\Image\Manipulations $manipulations |
||
142 | * |
||
143 | * @return $this |
||
144 | */ |
||
145 | public function addAsFirstManipulations(Manipulations $manipulations): self |
||
155 | |||
156 | /** |
||
157 | * Set the collection names on which this conversion must be performed. |
||
158 | * |
||
159 | * @param $collectionNames |
||
160 | * |
||
161 | * @return $this |
||
162 | */ |
||
163 | public function performOnCollections(...$collectionNames): self |
||
169 | |||
170 | /* |
||
171 | * Determine if this conversion should be performed on the given |
||
172 | * collection. |
||
173 | */ |
||
174 | public function shouldBePerformedOn(string $collectionName): bool |
||
187 | |||
188 | /** |
||
189 | * Mark this conversion as one that should be queued. |
||
190 | * |
||
191 | * @return $this |
||
192 | */ |
||
193 | public function queued(): self |
||
199 | |||
200 | /** |
||
201 | * Mark this conversion as one that should not be queued. |
||
202 | * |
||
203 | * @return $this |
||
204 | */ |
||
205 | public function nonQueued(): self |
||
211 | |||
212 | /** |
||
213 | * Avoid optimization of the converted image. |
||
214 | * |
||
215 | * @return $this |
||
216 | */ |
||
217 | public function nonOptimized(): self |
||
223 | |||
224 | /** |
||
225 | * When creating the converted image, responsive images will be created as well. |
||
226 | */ |
||
227 | public function withResponsiveImages(): self |
||
233 | |||
234 | /** |
||
235 | * Determine if responsive images should be created for this conversion. |
||
236 | */ |
||
237 | public function shouldGenerateResponsiveImages(): bool |
||
241 | |||
242 | /* |
||
243 | * Determine if the conversion should be queued. |
||
244 | */ |
||
245 | public function shouldBeQueued(): bool |
||
249 | |||
250 | /* |
||
251 | * Get the extension that the result of this conversion must have. |
||
252 | */ |
||
253 | public function getResultExtension(string $originalFileExtension = ''): string |
||
267 | |||
268 | public function getConversionFile(string $file): string |
||
277 | } |
||
278 |
It seems like the type of the argument is not accepted by the function/method which you are calling.
In some cases, in particular if PHP’s automatic type-juggling kicks in this might be fine. In other cases, however this might be a bug.
We suggest to add an explicit type cast like in the following example: