File tree Expand file tree Collapse file tree 1 file changed +8
-7
lines changed
Expand file tree Collapse file tree 1 file changed +8
-7
lines changed Original file line number Diff line number Diff line change @@ -76,7 +76,8 @@ public function removeAttribute(string $name)
7676 */
7777 public function __get ($ name )
7878 {
79- return $ this ->getAttribute ($ name );
79+ $ name = strtolower ($ name );
80+ return isset ($ this ->attributes [$ name ]) ? (string ) $ this ->attributes [$ name ] : null ;
8081 }
8182
8283 /**
@@ -88,7 +89,7 @@ public function __get($name)
8889 */
8990 public function __set (string $ name , $ value )
9091 {
91- $ this ->setAttribute ($ name, $ value) ;
92+ $ this ->attributes [ strtolower ($ name)] = $ value ;
9293 }
9394
9495 /**
@@ -110,7 +111,10 @@ public function __isset(string $name): bool
110111 */
111112 public function __unset (string $ name )
112113 {
113- $ this ->removeAttribute ($ name );
114+ $ name = strtolower ($ name );
115+ if (isset ($ this ->attributes [$ name ])) {
116+ unset($ this ->attributes [$ name ]);
117+ }
114118 }
115119
116120 /**
@@ -122,10 +126,7 @@ public function __toString(): string
122126 foreach ($ this ->attributes as $ name => $ value ) {
123127 $ html .= ' ' . $ name . '=" ' . htmlspecialchars ($ value ) . '" ' ;
124128 }
125- $ html .= '> ' ;
126- $ html .= $ this ->innerHTML ;
127- $ html .= '</component> ' ;
128- return $ html ;
129+ return $ html . '> ' . $ this ->innerHTML . '</component> ' ;
129130 }
130131
131132}
You can’t perform that action at this time.
0 commit comments