Code Duplication    Length = 12-12 lines in 2 locations

src/JsonRepository.php 2 locations

@@ 529-540 (lines=12) @@
526
527
            // We found a mapping that matches the search path
528
            // e.g. mapping /a/b for path /a/b
529
            if ($searchPathForTest === $currentPathForTest) {
530
                $foundMatchingMappings = true;
531
                $result[$currentPath] = $this->resolveReferences($currentReferences, $stopOnFirst, $checkFilesystem);
532
533
                // Return unless an explicit mapping order is defined
534
                // In that case, the ancestors need to be searched as well
535
                if ($stopOnFirst && !isset($this->json['_order'][$currentPath])) {
536
                    return $result;
537
                }
538
539
                continue;
540
            }
541
542
            // We found a mapping that lies within the search path
543
            // e.g. mapping /a/b/c for path /a/b
@@ 544-555 (lines=12) @@
541
542
            // We found a mapping that lies within the search path
543
            // e.g. mapping /a/b/c for path /a/b
544
            if ($includeNested && 0 === strpos($currentPathForTest, $searchPathForTest)) {
545
                $foundMatchingMappings = true;
546
                $result[$currentPath] = $this->resolveReferences($currentReferences, $stopOnFirst, $checkFilesystem);
547
548
                // Return unless an explicit mapping order is defined
549
                // In that case, the ancestors need to be searched as well
550
                if ($stopOnFirst && !isset($this->json['_order'][$currentPath])) {
551
                    return $result;
552
                }
553
554
                continue;
555
            }
556
557
            // We found a mapping that is an ancestor of the search path
558
            // e.g. mapping /a for path /a/b