Code Duplication    Length = 10-10 lines in 2 locations

src/voku/helper/SimpleHtmlDom.php 1 location

@@ 385-394 (lines=10) @@
382
     *
383
     * @return SimpleHtmlDomInterface|SimpleHtmlDomInterface[]|SimpleHtmlDomNodeInterface|null
384
     */
385
    public function childNodes(int $idx = -1)
386
    {
387
        $nodeList = $this->getIterator();
388
389
        if ($idx === -1) {
390
            return $nodeList;
391
        }
392
393
        return $nodeList[$idx] ?? null;
394
    }
395
396
    /**
397
     * Find nodes with a CSS selector.

src/voku/helper/SimpleXmlDom.php 1 location

@@ 359-368 (lines=10) @@
356
     *
357
     * @return SimpleXmlDomInterface|SimpleXmlDomInterface[]|SimpleXmlDomNodeInterface|null
358
     */
359
    public function childNodes(int $idx = -1)
360
    {
361
        $nodeList = $this->getIterator();
362
363
        if ($idx === -1) {
364
            return $nodeList;
365
        }
366
367
        return $nodeList[$idx] ?? null;
368
    }
369
370
    /**
371
     * Find nodes with a CSS selector.