1 | <?php |
||
5 | class Manipulations |
||
6 | { |
||
7 | const CROP_TOP_LEFT = 'crop-top-left'; |
||
8 | const CROP_TOP = 'crop-top'; |
||
9 | const CROP_TOP_RIGHT = 'crop-top-right'; |
||
10 | const CROP_LEFT = 'crop-left'; |
||
11 | const CROP_CENTER = 'crop-center'; |
||
12 | const CROP_RIGHT = 'crop-right'; |
||
13 | const CROP_BOTTOM_LEFT = 'crop-bottom-left'; |
||
14 | const CROP_BOTTOM = 'crop-bottom'; |
||
15 | const CROP_BOTTOM_RIGHT = 'crop-bottom-right'; |
||
16 | |||
17 | const ORIENTATION_AUTO = 'auto'; |
||
18 | const ORIENTATION_90 = 90; |
||
19 | const ORIENTATION_180 = 180; |
||
20 | const ORIENTATION_270 = 270; |
||
21 | |||
22 | const FIT_CONTAIN = 'contain'; |
||
23 | const FIT_MAX = 'max'; |
||
24 | const FIT_FILL = 'fill'; |
||
25 | const FIT_STRETCH = 'stretch'; |
||
26 | const FIT_CROP = 'crop'; |
||
27 | |||
28 | const BORDER_OVERLAY = 'overlay'; |
||
29 | const BORDER_SHRINK = 'shrink'; |
||
30 | const BORDER_EXPAND = 'expand'; |
||
31 | |||
32 | const FORMAT_JPG = 'jpg'; |
||
33 | const FORMAT_PJPG = 'pjpg'; |
||
34 | const FORMAT_PNG = 'png'; |
||
35 | const FORMAT_GIF = 'gif'; |
||
36 | |||
37 | /** @var array */ |
||
38 | protected $manipulations = []; |
||
39 | |||
40 | public function __construct(array $manipulations) |
||
44 | |||
45 | /** |
||
46 | * @param string $orientation |
||
47 | * @return $this |
||
48 | */ |
||
49 | public function orientation(string $orientation) |
||
53 | |||
54 | /** |
||
55 | * @param string $cropMethod |
||
56 | * @param int $width |
||
57 | * @param int $height |
||
58 | * @return $this |
||
59 | * |
||
60 | * @internal param string $method |
||
61 | */ |
||
62 | public function crop(string $cropMethod, int $width, int $height) |
||
69 | |||
70 | /** |
||
71 | * @param int $width |
||
72 | * |
||
73 | * @return $this |
||
74 | */ |
||
75 | public function width(int $width) |
||
79 | |||
80 | /** |
||
81 | * @param int $height |
||
82 | * |
||
83 | * @return $this |
||
84 | */ |
||
85 | public function height(int $height) |
||
89 | |||
90 | public function fit(string $fitMethod, int $width, int $height) |
||
97 | |||
98 | public function devicePixelRatio(int $ratio) |
||
102 | |||
103 | public function brightness(int $brightness) |
||
107 | |||
108 | public function gamma(float $gamma) |
||
112 | |||
113 | public function contrast(int $contrast) |
||
117 | |||
118 | public function sharpen(int $sharpen) |
||
122 | |||
123 | public function blur(int $blur) |
||
127 | |||
128 | public function pixelate(int $pixelate) |
||
132 | |||
133 | public function greyscale() |
||
137 | |||
138 | public function sepia() |
||
142 | |||
143 | public function background(string $colorName) |
||
147 | |||
148 | public function border(int $width, string $color, string $borderType = 'overlay') |
||
152 | |||
153 | public function quality(int $quality) |
||
157 | |||
158 | public function format(string $format) |
||
162 | |||
163 | protected function filter(string $filterName) |
||
167 | |||
168 | public function hasManipulation($manipulationName): bool |
||
172 | |||
173 | public function getManipulation($manipulationName): bool |
||
183 | |||
184 | |||
185 | protected function setManipulation(array $arguments, string $operation = null) |
||
193 | |||
194 | public function mergeManipulations(Manipulations $manipulations) |
||
200 | |||
201 | public function toArray(): array |
||
205 | } |
||
206 |
This check looks from parameters that have been defined for a function or method, but which are not used in the method body.