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

@@ 136-155 (lines=20) @@
133
     *
134
     * @return HtmlDomParser
135
     */
136
    public static function __callStatic($name, $arguments)
137
    {
138
        $arguments0 = $arguments[0] ?? '';
139
140
        $arguments1 = $arguments[1] ?? null;
141
142
        if ($name === 'str_get_html') {
143
            $parser = new static();
144
145
            return $parser->loadHtml($arguments0, $arguments1);
146
        }
147
148
        if ($name === 'file_get_html') {
149
            $parser = new static();
150
151
            return $parser->loadHtmlFile($arguments0, $arguments1);
152
        }
153
154
        throw new \BadMethodCallException('Method does not exist');
155
    }
156
157
    /** @noinspection MagicMethodsValidityInspection */
158