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 | /* |
||
52 | * Set the timecode in seconds to extract a video thumbnail. |
||
53 | * Only used on video media. |
||
54 | */ |
||
55 | public function extractVideoFrameAtSecond(int $timeCode): self |
||
61 | |||
62 | public function getExtractVideoFrameAtSecond(): int |
||
66 | |||
67 | public function keepOriginalImageFormat(): self |
||
73 | |||
74 | public function shouldKeepOriginalImageFormat(): bool |
||
78 | |||
79 | public function getManipulations(): Manipulations |
||
83 | |||
84 | public function removeManipulation(string $manipulationName) : self |
||
90 | |||
91 | public function withoutManipulations() : self |
||
97 | |||
98 | public function __call($name, $arguments) |
||
108 | |||
109 | /** |
||
110 | * Set the manipulations for this conversion. |
||
111 | * |
||
112 | * @param \Spatie\Image\Manipulations|\Closure $manipulations |
||
113 | * |
||
114 | * @return $this |
||
115 | */ |
||
116 | public function setManipulations($manipulations) : self |
||
128 | |||
129 | /** |
||
130 | * Add the given manipulations as the first ones. |
||
131 | * |
||
132 | * @param \Spatie\Image\Manipulations $manipulations |
||
133 | * |
||
134 | * @return $this |
||
135 | */ |
||
136 | public function addAsFirstManipulations(Manipulations $manipulations) : self |
||
146 | |||
147 | /** |
||
148 | * Set the collection names on which this conversion must be performed. |
||
149 | * |
||
150 | * @param $collectionNames |
||
151 | * |
||
152 | * @return $this |
||
153 | */ |
||
154 | public function performOnCollections(...$collectionNames) : self |
||
160 | |||
161 | /** |
||
162 | * Returns the collection names on which this conversion must be performed. |
||
163 | * Assumes 'default' when none is present. |
||
164 | * |
||
165 | * @return array |
||
166 | */ |
||
167 | public function getPerformOnCollections() |
||
175 | |||
176 | /* |
||
177 | * Determine if this conversion should be performed on the given |
||
178 | * collection. |
||
179 | */ |
||
180 | public function shouldBePerformedOn(string $collectionName): bool |
||
193 | |||
194 | /** |
||
195 | * Mark this conversion as one that should be queued. |
||
196 | * |
||
197 | * @return $this |
||
198 | */ |
||
199 | public function queued() : self |
||
205 | |||
206 | /** |
||
207 | * Mark this conversion as one that should not be queued. |
||
208 | * |
||
209 | * @return $this |
||
210 | */ |
||
211 | public function nonQueued() : self |
||
217 | |||
218 | /** |
||
219 | * Avoid optimization of the converted image. |
||
220 | * |
||
221 | * @return $this |
||
222 | */ |
||
223 | public function nonOptimized() : self |
||
229 | |||
230 | /** |
||
231 | * When creating the converted image, responsive images will be created as well. |
||
232 | */ |
||
233 | public function withResponsiveImages() : self |
||
239 | |||
240 | /** |
||
241 | * Determine if responsive images should be created for this conversion. |
||
242 | */ |
||
243 | public function shouldGenerateResponsiveImages(): bool |
||
247 | |||
248 | /* |
||
249 | * Determine if the conversion should be queued. |
||
250 | */ |
||
251 | public function shouldBeQueued(): bool |
||
255 | |||
256 | /* |
||
257 | * Get the extension that the result of this conversion must have. |
||
258 | */ |
||
259 | public function getResultExtension(string $originalFileExtension = ''): string |
||
273 | |||
274 | public function getConversionFile(string $file): string |
||
286 | } |
||
287 |
This error could be the result of:
1. Missing dependencies
PHP Analyzer uses your
composer.json
file (if available) to determine the dependencies of your project and to determine all the available classes and functions. It expects thecomposer.json
to be in the root folder of your repository.Are you sure this class is defined by one of your dependencies, or did you maybe not list a dependency in either the
require
orrequire-dev
section?2. Missing use statement
PHP does not complain about undefined classes in
ìnstanceof
checks. For example, the following PHP code will work perfectly fine:If you have not tested against this specific condition, such errors might go unnoticed.