Code Duplication    Length = 20-20 lines in 2 locations

src/voku/helper/XmlDomParser.php 1 location

@@ 59-78 (lines=20) @@
56
     *
57
     * @return XmlDomParser
58
     */
59
    public static function __callStatic($name, $arguments)
60
    {
61
        $arguments0 = $arguments[0] ?? '';
62
63
        $arguments1 = $arguments[1] ?? null;
64
65
        if ($name === 'str_get_xml') {
66
            $parser = new static();
67
68
            return $parser->loadXml($arguments0, $arguments1);
69
        }
70
71
        if ($name === 'file_get_xml') {
72
            $parser = new static();
73
74
            return $parser->loadXmlFile($arguments0, $arguments1);
75
        }
76
77
        throw new \BadMethodCallException('Method does not exist');
78
    }
79
80
    /** @noinspection MagicMethodsValidityInspection */
81

src/voku/helper/HtmlDomParser.php 1 location

@@ 180-199 (lines=20) @@
177
     *
178
     * @return HtmlDomParser
179
     */
180
    public static function __callStatic($name, $arguments)
181
    {
182
        $arguments0 = $arguments[0] ?? '';
183
184
        $arguments1 = $arguments[1] ?? null;
185
186
        if ($name === 'str_get_html') {
187
            $parser = new static();
188
189
            return $parser->loadHtml($arguments0, $arguments1);
190
        }
191
192
        if ($name === 'file_get_html') {
193
            $parser = new static();
194
195
            return $parser->loadHtmlFile($arguments0, $arguments1);
196
        }
197
198
        throw new \BadMethodCallException('Method does not exist');
199
    }
200
201
    /** @noinspection MagicMethodsValidityInspection */
202