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 | * @param int $width |
||
21 | * @param int $height |
||
22 | * @return ImageInterface |
||
23 | */ |
||
24 | public function resize(int $width, int $height): ImageInterface |
||
31 | |||
32 | /** |
||
33 | * @param int $angle |
||
34 | * @return ImageInterface |
||
35 | */ |
||
36 | public function rotate(int $angle = 90): ImageInterface |
||
43 | |||
44 | /** |
||
45 | * @return ImageInterface |
||
46 | */ |
||
47 | public function flip(): ImageInterface |
||
53 | |||
54 | /** |
||
55 | * @return ImageInterface |
||
56 | */ |
||
57 | public function flop(): ImageInterface |
||
63 | |||
64 | public function grayscale(): ImageInterface |
||
70 | |||
71 | /** |
||
72 | * @param string $text |
||
73 | * @param string $position |
||
74 | * @param string $font |
||
75 | * @return $this |
||
76 | * @throws \Exception |
||
77 | */ |
||
78 | public function copyright(string $text, string $font = 'Courier', string $position = 'SouthWest') |
||
102 | |||
103 | public function getFontsList(): array |
||
107 | |||
108 | /** |
||
109 | * @param string $text |
||
110 | * @param int $position |
||
111 | * @param string $font |
||
112 | * @return \Imagick |
||
113 | * @throws \ImagickException |
||
114 | */ |
||
115 | private function prepareImage(string $text, int $position, string $font): \Imagick |
||
137 | |||
138 | /** |
||
139 | * @param int $width |
||
140 | * @param int $height |
||
141 | * @param int $startX |
||
142 | * @param int $startY |
||
143 | * @return ImageInterface |
||
144 | */ |
||
145 | public function crop(int $width, int $height, int $startX, int $startY): ImageInterface |
||
152 | |||
153 | public function save(string $filename): bool |
||
157 | |||
158 | public function __toString(): string |
||
162 | |||
163 | /** |
||
164 | * @param string $source |
||
165 | * @return ImageInterface |
||
166 | * @throws \Exception |
||
167 | */ |
||
168 | protected function tmp(string $source): ImageInterface |
||
184 | |||
185 | /** |
||
186 | * @param int $width |
||
187 | * @param int $height |
||
188 | * @return \Imagick |
||
189 | * @throws \ImagickException |
||
190 | */ |
||
191 | private function newImage(int $width, int $height): \Imagick |
||
199 | |||
200 | protected function setSizes(): void |
||
206 | |||
207 | /** |
||
208 | * @param Image $watermark |
||
209 | * @param int $x |
||
210 | * @param int $y |
||
211 | * @return ImageInterface |
||
212 | * @throws \Exception |
||
213 | */ |
||
214 | protected function prepareWatermark(Image $watermark, int $x, int $y): ImageInterface |
||
221 | } |
||
222 |
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: