Code Duplication    Length = 20-20 lines in 2 locations

src/voku/helper/HtmlDomParser.php 1 location

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

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