File tree Expand file tree Collapse file tree 2 files changed +9
-6
lines changed
Expand file tree Collapse file tree 2 files changed +9
-6
lines changed Original file line number Diff line number Diff line change 1111 * @inheritdoc
1212 */
1313class DomNode implements DomNodeInterface
14- {// todo: validari
14+ {// todo: validari pe construct
1515 use DomElement;
1616 use QuerySelector;
1717
@@ -130,15 +130,18 @@ public function hasAttribute(string $name): bool
130130 return false ;
131131 }
132132
133- public function removeAttribute (string $ name ): self
133+ public function removeAttribute ($ attr ): self
134134 {
135- if ($ name == '* ' ) {
135+ if ($ attr == '* ' ) {
136136 $ this ->attrs = [];
137137 return $ this ;
138138 }
139139
140- foreach ($ this ->attrs as $ i => $ attr ) {
141- if ($ attr ->getName () == $ name ) {
140+ foreach ($ this ->attrs as $ i => $ _attr ) {
141+ if (is_string ($ attr ) && $ _attr ->getName () == $ attr ) {
142+ unset($ this ->attrs [$ i ]);
143+ }
144+ elseif ($ attr instanceof DomNodeAttrInterface && $ _attr === $ attr ) {
142145 unset($ this ->attrs [$ i ]);
143146 }
144147 }
Original file line number Diff line number Diff line change @@ -11,7 +11,7 @@ class DomNodeAttr implements DomNodeAttrInterface
1111
1212 protected $ name ;
1313 protected $ value ;
14- protected $ valueDelimiter = '" ' ; // todo
14+ protected $ valueDelimiter = '" ' ;
1515
1616 /**
1717 * DomNode Meta Data
You can’t perform that action at this time.
0 commit comments