1 | <?php declare(strict_types=1); |
||
7 | class Imagick extends AbstractImage implements ImageInterface |
||
8 | { |
||
9 | /** |
||
10 | * Imagick constructor. |
||
11 | * @param string $image |
||
12 | * @throws \Exception |
||
13 | */ |
||
14 | public function __construct(string $image) |
||
18 | |||
19 | /** |
||
20 | * @return \Imagick |
||
21 | */ |
||
22 | public function getImage(): \Imagick |
||
26 | |||
27 | /** |
||
28 | * @param int $width |
||
29 | * @param int $height |
||
30 | * @return ImageInterface |
||
31 | */ |
||
32 | public function resize(int $width, int $height): ImageInterface |
||
39 | |||
40 | /** |
||
41 | * @param int $angle |
||
42 | * @return ImageInterface |
||
43 | */ |
||
44 | public function rotate(int $angle = 90): ImageInterface |
||
51 | |||
52 | /** |
||
53 | * @return ImageInterface |
||
54 | */ |
||
55 | public function flip(): ImageInterface |
||
61 | |||
62 | /** |
||
63 | * @return ImageInterface |
||
64 | */ |
||
65 | public function flop(): ImageInterface |
||
71 | |||
72 | public function grayscale(): ImageInterface |
||
78 | |||
79 | /** |
||
80 | * @param string $text |
||
81 | * @param string $position |
||
82 | * @param string $font |
||
83 | * @return $this |
||
84 | * @throws \Exception |
||
85 | */ |
||
86 | public function copyright(string $text, string $font = 'Courier', string $position = 'SouthWest'): ImageInterface |
||
107 | |||
108 | public function getFontsList(): array |
||
112 | |||
113 | /** |
||
114 | * @param string $text |
||
115 | * @param int $position |
||
116 | * @param string $font |
||
117 | * @return \Imagick |
||
118 | * @throws \ImagickException |
||
119 | */ |
||
120 | private function prepareImage(string $text, int $position, string $font): \Imagick |
||
142 | |||
143 | /** |
||
144 | * @param int $width |
||
145 | * @param int $height |
||
146 | * @param int $startX |
||
147 | * @param int $startY |
||
148 | * @return ImageInterface |
||
149 | */ |
||
150 | public function crop(int $width, int $height, int $startX, int $startY): ImageInterface |
||
157 | |||
158 | public function save(string $filename): bool |
||
162 | |||
163 | public function __toString(): string |
||
167 | |||
168 | /** |
||
169 | * @param string $source |
||
170 | * @return ImageInterface |
||
171 | * @throws \Exception |
||
172 | */ |
||
173 | protected function tmp(string $source): ImageInterface |
||
189 | |||
190 | /** |
||
191 | * @param int $width |
||
192 | * @param int $height |
||
193 | * @return \Imagick |
||
194 | * @throws \ImagickException |
||
195 | */ |
||
196 | private function newImage(int $width, int $height): \Imagick |
||
204 | |||
205 | protected function setSizes(): void |
||
211 | |||
212 | /** |
||
213 | * @param Image $watermark |
||
214 | * @param int $x |
||
215 | * @param int $y |
||
216 | * @return ImageInterface |
||
217 | * @throws \Exception |
||
218 | */ |
||
219 | protected function prepareWatermark(Image $watermark, int $x, int $y): ImageInterface |
||
226 | } |
||
227 |
If you implement
__call
and you know which methods are available, you can improve IDE auto-completion and static analysis by adding a @method annotation to the class.This is often the case, when
__call
is implemented by a parent class and only the child class knows which methods exist: