1 | <?php |
||
24 | class ImagineBlock extends AbstractBlock implements TranslatableInterface |
||
25 | { |
||
26 | /** |
||
27 | * @var Image |
||
28 | */ |
||
29 | protected $image; |
||
30 | |||
31 | /** |
||
32 | * @var string |
||
33 | */ |
||
34 | protected $label; |
||
35 | |||
36 | /** |
||
37 | * Optional link url to use on the image. |
||
38 | * |
||
39 | * @var string |
||
40 | */ |
||
41 | protected $linkUrl; |
||
42 | |||
43 | /** |
||
44 | * @var string |
||
45 | */ |
||
46 | protected $filter; |
||
47 | |||
48 | /** |
||
49 | * @var \PHPCR\NodeInterface |
||
50 | */ |
||
51 | protected $node; |
||
52 | |||
53 | /** |
||
54 | * {@inheritdoc} |
||
55 | */ |
||
56 | public function getType() |
||
60 | |||
61 | /** |
||
62 | * Set label. |
||
63 | * |
||
64 | * @param string $label |
||
65 | * |
||
66 | * @return $this |
||
67 | */ |
||
68 | public function setLabel($label) |
||
74 | |||
75 | /** |
||
76 | * Get label. |
||
77 | * |
||
78 | * @return string |
||
79 | */ |
||
80 | public function getLabel() |
||
84 | |||
85 | /** |
||
86 | * Set link url. |
||
87 | * |
||
88 | * @param string $url |
||
89 | * |
||
90 | * @return $this |
||
91 | */ |
||
92 | public function setLinkUrl($url) |
||
98 | |||
99 | /** |
||
100 | * Get link url. |
||
101 | * |
||
102 | * @return string |
||
103 | */ |
||
104 | public function getLinkUrl() |
||
108 | |||
109 | /** |
||
110 | * Sets the Imagine filter which is going to be used. |
||
111 | * |
||
112 | * @param string $filter |
||
113 | * |
||
114 | * @return $this |
||
115 | */ |
||
116 | public function setFilter($filter) |
||
122 | |||
123 | /** |
||
124 | * Get the Imagine filter. |
||
125 | * |
||
126 | * @return string |
||
127 | */ |
||
128 | public function getFilter() |
||
132 | |||
133 | /** |
||
134 | * Set the image for this block. |
||
135 | * |
||
136 | * Setting null will do nothing, as this is what happens when you edit this |
||
137 | * block in a form without uploading a replacement file. |
||
138 | * |
||
139 | * If you need to delete the Image, you can use getImage and delete it with |
||
140 | * the document manager. Note that this block does not make much sense |
||
141 | * without an image, though. |
||
142 | * |
||
143 | * @param ImageInterface|UploadedFile|null $image optional the image to update |
||
144 | * |
||
145 | * @return $this |
||
146 | * |
||
147 | * @throws \InvalidArgumentException if the $image parameter can not be handled |
||
148 | */ |
||
149 | public function setImage($image = null) |
||
178 | |||
179 | /** |
||
180 | * Get image. |
||
181 | * |
||
182 | * @return Image |
||
183 | */ |
||
184 | public function getImage() |
||
188 | |||
189 | /** |
||
190 | * Get node. |
||
191 | * |
||
192 | * @return NodeInterface |
||
193 | */ |
||
194 | public function getNode() |
||
198 | } |
||
199 |
Our type inference engine has found a suspicous assignment of a value to a property. This check raises an issue when a value that can be of a given class or a super-class is assigned to a property that is type hinted more strictly.
Either this assignment is in error or an instanceof check should be added for that assignment.