Code Duplication    Length = 10-10 lines in 2 locations

src/voku/helper/SimpleHtmlDom.php 1 location

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

src/voku/helper/SimpleXmlDom.php 1 location

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