Code Duplication    Length = 12-12 lines in 2 locations

src/JsonRepository.php 2 locations

@@ 509-520 (lines=12) @@
506
507
            // We found a mapping that matches the search path
508
            // e.g. mapping /a/b for path /a/b
509
            if ($searchPathForTest === $currentPathForTest) {
510
                $foundMatchingMappings = true;
511
                $result[$currentPath] = $this->resolveReferences($currentReferences, $flags);
512
513
                // Return unless an explicit mapping order is defined
514
                // In that case, the ancestors need to be searched as well
515
                if (($flags & self::STOP_ON_FIRST) && !isset($this->json['_order'][$currentPath])) {
516
                    return $result;
517
                }
518
519
                continue;
520
            }
521
522
            // We found a mapping that lies within the search path
523
            // e.g. mapping /a/b/c for path /a/b
@@ 542-553 (lines=12) @@
539
            if (0 === strpos($searchPathForTest, $currentPathForTest)) {
540
                $foundMatchingMappings = true;
541
542
                if ($flags & self::INCLUDE_ANCESTORS) {
543
                    // Include the references of the ancestor
544
                    $result[$currentPath] = $this->resolveReferences($currentReferences, $flags);
545
546
                    // Return unless an explicit mapping order is defined
547
                    // In that case, the ancestors need to be searched as well
548
                    if (($flags & self::STOP_ON_FIRST) && !isset($this->json['_order'][$currentPath])) {
549
                        return $result;
550
                    }
551
552
                    continue;
553
                }
554
555
                if ($flags & self::NO_SEARCH_FILESYSTEM) {
556
                    continue;