Code Duplication    Length = 10-10 lines in 2 locations

src/voku/helper/SimpleHtmlDom.php 1 location

@@ 366-375 (lines=10) @@
363
     *
364
     * @return SimpleHtmlDomInterface|SimpleHtmlDomInterface[]|SimpleHtmlDomNodeInterface|null
365
     */
366
    public function childNodes(int $idx = -1)
367
    {
368
        $nodeList = $this->getIterator();
369
370
        if ($idx === -1) {
371
            return $nodeList;
372
        }
373
374
        return $nodeList[$idx] ?? null;
375
    }
376
377
    /**
378
     * Find nodes with a CSS selector.

src/voku/helper/SimpleXmlDom.php 1 location

@@ 340-349 (lines=10) @@
337
     *
338
     * @return SimpleXmlDomInterface|SimpleXmlDomInterface[]|SimpleXmlDomNodeInterface|null
339
     */
340
    public function childNodes(int $idx = -1)
341
    {
342
        $nodeList = $this->getIterator();
343
344
        if ($idx === -1) {
345
            return $nodeList;
346
        }
347
348
        return $nodeList[$idx] ?? null;
349
    }
350
351
    /**
352
     * Find nodes with a CSS selector.