Conditions | 2 |
Paths | 2 |
Total Lines | 19 |
Code Lines | 11 |
Lines | 0 |
Ratio | 0 % |
Changes | 0 |
1 | <?php |
||
19 | protected function processImageData($framework_file) |
||
20 | { |
||
21 | /* make sure we get the object type we're expecting */ |
||
22 | if (!$framework_file instanceof UploadedFile) { |
||
|
|||
23 | throw new Exception('You must provide an instance of the UploadedFile class'); |
||
24 | } |
||
25 | |||
26 | /* set up modules for gathering data */ |
||
27 | $this->stream = file_get_contents($framework_file); |
||
28 | $image = (new ImageManager())->make($this->stream); |
||
29 | |||
30 | /* set all remaining data points */ |
||
31 | $this->extension = $framework_file->getClientOriginalExtension(); |
||
32 | $this->size = $framework_file->getClientSize(); |
||
33 | $this->filename = $framework_file->getClientOriginalName(); |
||
34 | $this->mime_type = $framework_file->getClientMimeType(); |
||
35 | $this->width = $image->width(); |
||
36 | $this->height = $image->height(); |
||
37 | } |
||
38 | } |
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.