1 | <?php |
||
19 | class Gd |
||
20 | { |
||
21 | /** |
||
22 | * @var string |
||
23 | */ |
||
24 | protected $file; |
||
25 | |||
26 | /** |
||
27 | * @var resource |
||
28 | */ |
||
29 | protected $image; |
||
30 | |||
31 | /** |
||
32 | * @var integer |
||
33 | */ |
||
34 | protected $width; |
||
35 | |||
36 | /** |
||
37 | * @var integer |
||
38 | */ |
||
39 | protected $height; |
||
40 | |||
41 | /** |
||
42 | * Compression quality for JPEG |
||
43 | * |
||
44 | * @var integer |
||
45 | */ |
||
46 | protected $quality = 86; |
||
47 | |||
48 | /** |
||
49 | * Constructor of Gd |
||
50 | * |
||
51 | * @param string $file |
||
52 | * |
||
53 | * @throws Exception |
||
54 | */ |
||
55 | public function __construct($file) |
||
77 | |||
78 | /** |
||
79 | * @param integer $quality |
||
80 | * |
||
81 | * @return void |
||
82 | */ |
||
83 | public function setImageCompressionQuality($quality): void |
||
87 | |||
88 | /** |
||
89 | * Create a crop thumbnail image from source image |
||
90 | * cropped by smaller side |
||
91 | * |
||
92 | * @param integer $width |
||
93 | * @param integer $height |
||
94 | * |
||
95 | * @return bool |
||
96 | */ |
||
97 | public function cropThumbnailImage($width, $height): bool |
||
135 | |||
136 | /** |
||
137 | * Save the image to a file. Type is determined from the extension |
||
138 | * |
||
139 | * @param string $fileName |
||
140 | * |
||
141 | * @return bool |
||
142 | */ |
||
143 | public function writeImage($fileName): bool |
||
169 | |||
170 | /** |
||
171 | * Destroy image source |
||
172 | */ |
||
173 | public function __destruct() |
||
177 | } |
||
178 |
This check marks access to variables or properties that have not been declared yet. While PHP has no explicit notion of declaring a variable, accessing it before a value is assigned to it is most likely a bug.