Total Complexity | 12 |
Total Lines | 66 |
Duplicated Lines | 0 % |
Coverage | 72.41% |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
23 | class Image extends Media |
||
|
|||
24 | { |
||
25 | // configurables |
||
26 | public static $jpegCompression = 90; |
||
27 | |||
28 | 10 | public function getValue($name) |
|
29 | { |
||
30 | switch ($name) { |
||
31 | 10 | case 'ThumbnailMIMEType': |
|
32 | 3 | switch ($this->getValue('MIMEType')) { |
|
33 | 3 | case 'application/psd': |
|
34 | return 'image/png'; |
||
35 | 3 | case 'image/tiff': |
|
36 | return 'image/jpeg'; |
||
37 | default: |
||
38 | 3 | return $this->getValue('MIMEType'); |
|
39 | } |
||
40 | |||
41 | // no break |
||
42 | 10 | case 'Extension': |
|
43 | |||
44 | 8 | switch ($this->getValue('MIMEType')) { |
|
45 | 8 | case 'application/psd': |
|
46 | return 'psd'; |
||
47 | |||
48 | 8 | case 'image/tiff': |
|
49 | return 'tif'; |
||
50 | |||
51 | 8 | case 'image/gif': |
|
52 | return 'gif'; |
||
53 | |||
54 | 8 | case 'image/jpeg': |
|
55 | return 'jpg'; |
||
56 | |||
57 | 8 | case 'image/png': |
|
58 | 8 | return 'png'; |
|
59 | |||
60 | default: |
||
61 | throw new Exception('Unable to find photo extension for mime-type: '.$this->getValue('MIMEType')); |
||
62 | } |
||
63 | |||
64 | // no break |
||
65 | default: |
||
66 | 10 | return parent::getValue($name); |
|
67 | } |
||
68 | } |
||
69 | |||
70 | /** |
||
71 | * Runs getimagesize on the file and returns an array with the output |
||
72 | * |
||
73 | * @param string $filename |
||
74 | * @param array $mediaInfo |
||
75 | * @return array $mediaInfo |
||
76 | */ |
||
77 | 2 | public static function analyzeFile($filename, $mediaInfo = []) |
|
89 | } |
||
90 | } |
||
91 |
The issue could also be caused by a filter entry in the build configuration. If the path has been excluded in your configuration, e.g.
excluded_paths: ["lib/*"]
, you can move it to the dependency path list as follows:For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths