Code Duplication    Length = 3-7 lines in 2 locations

code/Model/SiteTree.php 2 locations

@@ 417-419 (lines=3) @@
414
            if (!$next) {
415
                $parentID = (int) $sitetree->ID;
416
417
                if ($alternatives = static::singleton()->extend('alternateGetByLink', $segment, $parentID)) {
418
                    foreach ($alternatives as $alternative) {
419
                        if ($alternative) {
420
                            $next = $alternative;
421
                        }
422
                    }
@@ 385-391 (lines=7) @@
382
        if (!$sitetree) {
383
            $parentID = self::config()->nested_urls ? 0 : null;
384
385
            if ($alternatives = static::singleton()->extend('alternateGetByLink', $URLSegment, $parentID)) {
386
                foreach ($alternatives as $alternative) {
387
                    if ($alternative) {
388
                        $sitetree = $alternative;
389
                    }
390
                }
391
            }
392
393
            if (!$sitetree) {
394
                return null;