Code Duplication    Length = 10-10 lines in 2 locations

src/voku/helper/SimpleXmlDom.php 1 location

@@ 370-379 (lines=10) @@
367
     *
368
     * @return SimpleXmlDomInterface|SimpleXmlDomInterface[]|SimpleXmlDomNodeInterface<SimpleXmlDomInterface>|null
369
     */
370
    public function childNodes(int $idx = -1)
371
    {
372
        $nodeList = $this->getIterator();
373
374
        if ($idx === -1) {
375
            return $nodeList;
376
        }
377
378
        return $nodeList[$idx] ?? null;
379
    }
380
381
    /**
382
     * Find nodes with a CSS or xPath selector.

src/voku/helper/SimpleHtmlDom.php 1 location

@@ 399-408 (lines=10) @@
396
     *
397
     * @return SimpleHtmlDomInterface|SimpleHtmlDomInterface[]|SimpleHtmlDomNodeInterface|null
398
     */
399
    public function childNodes(int $idx = -1)
400
    {
401
        $nodeList = $this->getIterator();
402
403
        if ($idx === -1) {
404
            return $nodeList;
405
        }
406
407
        return $nodeList[$idx] ?? null;
408
    }
409
410
    /**
411
     * Find nodes with a CSS selector.