Code Duplication    Length = 6-6 lines in 3 locations

src/voku/helper/AbstractSimpleHtmlDom.php 1 location

@@ 160-165 (lines=6) @@
157
            case 'classlist':
158
                $name = 'class';
159
                $nameOrig = 'class';
160
            default:
161
                if ($this->node && \property_exists($this->node, $nameOrig)) {
162
                    return $this->node->{$nameOrig} = $value;
163
                }
164
165
                return $this->setAttribute($name, $value);
166
        }
167
    }
168

src/voku/helper/AbstractSimpleXmlDom.php 2 locations

@@ 64-69 (lines=6) @@
61
                return $this->node ? $this->node->nodeName : '';
62
            case 'attr':
63
                return $this->getAllAttributes();
64
            default:
65
                if ($this->node && \property_exists($this->node, $nameOrig)) {
66
                    return $this->node->{$nameOrig};
67
                }
68
69
                return $this->getAttribute($name);
70
        }
71
    }
72
@@ 132-137 (lines=6) @@
129
                return $this->replaceChildWithString($value);
130
            case 'plaintext':
131
                return $this->replaceTextWithString($value);
132
            default:
133
                if ($this->node && \property_exists($this->node, $nameOrig)) {
134
                    return $this->node->{$nameOrig} = $value;
135
                }
136
137
                return $this->setAttribute($name, $value);
138
        }
139
    }
140