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

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