1 | <?php |
||
14 | class Filter extends BaseFilter implements ContainerInterface |
||
15 | { |
||
16 | use ElementTrait; |
||
17 | |||
18 | 24 | public function __construct(ElementInterface $parent, $id = null) |
|
25 | |||
26 | 24 | public function getName() |
|
30 | |||
31 | /** |
||
32 | * Applies a drop shadow effect to the input image. A drop shadow is effectively a blurred, offset version of the |
||
33 | * input image's alpha mask drawn in a particular color, composited below the image. The function accepts a |
||
34 | * parameter of type <shadow> (defined in CSS3 Backgrounds), with the exception that the 'inset' keyword is not |
||
35 | * allowed. This function is similar to the more established box-shadow property; the difference is that with |
||
36 | * filters, some browsers provide hardware acceleration for better performance. The parameters of the <shadow> |
||
37 | * parameter are as follows. |
||
38 | * |
||
39 | * @param ContainerInterface $container |
||
40 | * @param string|float $offsetX These are two <length> values to set the shadow offset. <offset-x> |
||
41 | * specifies the horizontal distance. Negative values place the shadow to |
||
42 | * the left of the element. <offset-y> specifies the vertical distance. |
||
43 | * Negative values place the shadow above the element. See <length> for |
||
44 | * possible units. If both values are 0, the shadow is placed behind the |
||
45 | * element (and may generate a blur effect if <blur-radius> and/or |
||
46 | * <spread-radius> is set). |
||
47 | * @param string|float $offsetY Same as offset. |
||
48 | * @param string|float $blurRadius This is a third <length> value. The larger this value, the bigger the |
||
49 | * blur, so the shadow becomes bigger and lighter. Negative values are not |
||
50 | * allowed. If not specified, it will be 0 (the shadow's edge is sharp). |
||
51 | * @param null $filterId |
||
52 | * |
||
53 | * @return Filter |
||
54 | */ |
||
55 | 1 | public static function shadow(ContainerInterface $container, $offsetX, $offsetY = null, $blurRadius = null, $filterId = null) |
|
91 | |||
92 | /** |
||
93 | * Converts the input image to grayscale. The value of 'amount' defines the proportion of the conversion. A value |
||
94 | * of 100% is completely grayscale. A value of 0% leaves the input unchanged. Values between 0% and 100% are linear |
||
95 | * multipliers on the effect. If the 'amount' parameter is missing, a value of 0 is used. |
||
96 | * |
||
97 | * @param ContainerInterface $container |
||
98 | * @param int|string $amount |
||
99 | * |
||
100 | * @return Filter |
||
101 | */ |
||
102 | 1 | public static function grayScale(ContainerInterface $container, $amount) |
|
122 | |||
123 | /** |
||
124 | * Inverts the samples in the input image. The value of 'amount' defines the proportion of the conversion. A value |
||
125 | * of 100% is completely inverted. A value of 0% leaves the input unchanged. Values between 0% and 100% are linear |
||
126 | * multipliers on the effect. If the 'amount' parameter is missing, a value of 0 is used. |
||
127 | * |
||
128 | * @param ContainerInterface $container |
||
129 | * @param null $filterId |
||
130 | * |
||
131 | * @return Filter |
||
132 | */ |
||
133 | 1 | public static function invert(ContainerInterface $container, $filterId = null) |
|
137 | |||
138 | /** |
||
139 | * Converts the input image to sepia. The value of 'amount' defines the proportion of the conversion. A value of |
||
140 | * 100% is completely sepia. A value of 0% leaves the input unchanged. Values between 0% and 100% are linear |
||
141 | * multipliers on the effect. If the 'amount' parameter is missing, a value of 0 is used. |
||
142 | * |
||
143 | * @param ContainerInterface $container |
||
144 | * @param $amount |
||
145 | * @param null $filterId |
||
146 | * |
||
147 | * @return Filter |
||
148 | */ |
||
149 | 1 | public static function sepia(ContainerInterface $container, $amount, $filterId = null) |
|
162 | } |
Unless you are absolutely sure that the expression can never be null because of other conditions, we strongly recommend to add an additional type check to your code: