1 | <?php |
||
19 | final class Image |
||
20 | { |
||
21 | /** |
||
22 | * |
||
23 | * @var resource |
||
24 | */ |
||
25 | private $resource = null; |
||
26 | |||
27 | const TYPE_UNKNOWN = 'application/octet-stream'; |
||
28 | const TYPE_JPEG = 'image/jpeg'; |
||
29 | const TYPE_PNG = 'image/png'; |
||
30 | const TYPE_GIF = 'image/gif'; |
||
31 | const TYPE_BMP = 'image/x-windows-bmp'; |
||
32 | const TYPE_TIFF = 'image/tiff'; |
||
33 | |||
34 | /** |
||
35 | * |
||
36 | * @var resource |
||
37 | */ |
||
38 | private $mimeType = null; |
||
39 | |||
40 | /** |
||
41 | * |
||
42 | * @var ImageFactory |
||
43 | */ |
||
44 | private $factory; |
||
45 | |||
46 | /** |
||
47 | * |
||
48 | * @param ImageFactory $factory |
||
49 | */ |
||
50 | 6 | public function __construct(ImageFactory $factory) |
|
55 | |||
56 | 1 | public function __call($name, $arguments) |
|
67 | |||
68 | 6 | private function create($resource) |
|
72 | |||
73 | /** |
||
74 | * |
||
75 | * |
||
76 | * @param string $binary |
||
77 | * @return string TYPE_* constant |
||
78 | */ |
||
79 | 6 | private function getMimeTypeFromBinary($binary) |
|
111 | |||
112 | 1 | public function getMimeType() |
|
116 | |||
117 | 6 | public function createFromPath($path) |
|
121 | |||
122 | public function createFromGd($resource) |
||
128 | |||
129 | 6 | public function createFromString($imageData) |
|
136 | |||
137 | 2 | public function filter(FilterInterface $filter) |
|
143 | |||
144 | 2 | public function isInitialized() |
|
148 | |||
149 | 2 | public function getResource() |
|
157 | |||
158 | /** |
||
159 | * Output image directly |
||
160 | * |
||
161 | * Appopriate MIME types will be set. |
||
162 | */ |
||
163 | public function output() |
||
194 | |||
195 | /** |
||
196 | * |
||
197 | * @return string Binary string containing image data |
||
198 | */ |
||
199 | 3 | public function outputRaw() |
|
228 | |||
229 | /** |
||
230 | * |
||
231 | * @return ImageFactory |
||
232 | */ |
||
233 | 1 | public function getFactory() |
|
237 | |||
238 | /** |
||
239 | * |
||
240 | * @param ImageFactory $factory |
||
241 | */ |
||
242 | 1 | public function setFactory(ImageFactory $factory) |
|
246 | |||
247 | /** |
||
248 | * |
||
249 | */ |
||
250 | 1 | public function __clone() |
|
256 | } |
||
257 |
Our type inference engine has found an assignment to a property that is incompatible with the declared type of that property.
Either this assignment is in error or the assigned type should be added to the documentation/type hint for that property..