This repository was archived by the owner on Jan 31, 2020. It is now read-only.
File tree Expand file tree Collapse file tree 2 files changed +28
-0
lines changed Expand file tree Collapse file tree 2 files changed +28
-0
lines changed Original file line number Diff line number Diff line change @@ -210,6 +210,21 @@ public function setAttribs(array $attribs)
210
210
return $ this ;
211
211
}
212
212
213
+ /**
214
+ * Get attributes of image
215
+ *
216
+ * Warning!
217
+ * If you set src attribute, you get it, but this value will be overwritten in
218
+ * protected method setSrcAttribForImg(). And finally your get other src
219
+ * value!
220
+ *
221
+ * @return array
222
+ */
223
+ public function getAttributes ()
224
+ {
225
+ return $ this ->attribs ;
226
+ }
227
+
213
228
/**
214
229
* Get attribs of image
215
230
*
@@ -222,6 +237,12 @@ public function setAttribs(array $attribs)
222
237
*/
223
238
public function getAttribs ()
224
239
{
240
+ trigger_error (sprintf (
241
+ '%s is deprecated; please use %s::getAttributes ' ,
242
+ __METHOD__ ,
243
+ __CLASS__
244
+ ), E_USER_DEPRECATED );
245
+
225
246
return $ this ->attribs ;
226
247
}
227
248
Original file line number Diff line number Diff line change @@ -302,4 +302,11 @@ public function testSetAttribsDocCommentHasDeprecated()
302
302
303
303
$ this ->assertContains ('@deprecated ' , $ comment );
304
304
}
305
+
306
+ public function testGetAttribsIsDeprecated ()
307
+ {
308
+ $ this ->expectException (DeprecatedError::class);
309
+
310
+ $ this ->helper ->getAttribs ();
311
+ }
305
312
}
You can’t perform that action at this time.
0 commit comments