66 * Link type: Image and text
77 *
88 * @package Msls
9- * @property string $txt
10- * @property string $src
11- * @property string $alt
12- * @property string $url
139 */
14- class MslsLink extends MslsGetSet {
10+ class MslsLink extends MslsGetSet implements LinkInterface {
1511
1612 /**
1713 * Output format
@@ -63,9 +59,9 @@ public static function get_types_description(): array {
6359 *
6460 * @param ?int $display
6561 *
66- * @return MslsLink
62+ * @return LinkInterface
6763 */
68- public static function create ( ?int $ display ): MslsLink {
64+ public static function create ( ?int $ display ): LinkInterface {
6965 $ types = self ::get_types ();
7066 if ( ! in_array ( $ display , array_keys ( $ types ), true ) ) {
7167 $ display = 0 ;
@@ -75,13 +71,13 @@ public static function create( ?int $display ): MslsLink {
7571
7672 if ( has_filter ( 'msls_link_create ' ) ) {
7773 /**
78- * @param MslsLink $obj
74+ * @param LinkInterface $obj
7975 * @param int $display
8076 *
81- * @return MslsLink
77+ * @return LinkInterface
8278 */
8379 $ obj = apply_filters ( 'msls_link_create ' , $ obj , $ display );
84- if ( in_array ( __CLASS__ , $ types ) || is_subclass_of ( $ obj, __CLASS__ ) ) {
80+ if ( $ obj instanceof LinkInterface ) {
8581 return $ obj ;
8682 }
8783 }
@@ -102,10 +98,8 @@ public static function callback( $x ) {
10298
10399 /**
104100 * Handles the request to print the object
105- *
106- * @return string
107101 */
108- public function __toString () {
102+ public function __toString (): string {
109103 $ temp = $ this ->get_arr ();
110104
111105 return str_replace (
0 commit comments