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)
210210 return $ this ;
211211 }
212212
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+
213228 /**
214229 * Get attribs of image
215230 *
@@ -222,6 +237,12 @@ public function setAttribs(array $attribs)
222237 */
223238 public function getAttribs ()
224239 {
240+ trigger_error (sprintf (
241+ '%s is deprecated; please use %s::getAttributes ' ,
242+ __METHOD__ ,
243+ __CLASS__
244+ ), E_USER_DEPRECATED );
245+
225246 return $ this ->attribs ;
226247 }
227248
Original file line number Diff line number Diff line change @@ -302,4 +302,11 @@ public function testSetAttribsDocCommentHasDeprecated()
302302
303303 $ this ->assertContains ('@deprecated ' , $ comment );
304304 }
305+
306+ public function testGetAttribsIsDeprecated ()
307+ {
308+ $ this ->expectException (DeprecatedError::class);
309+
310+ $ this ->helper ->getAttribs ();
311+ }
305312}
You can’t perform that action at this time.
0 commit comments