Code Duplication    Length = 16-18 lines in 2 locations

src/Repository/RepositoryManagerImpl.php 1 location

@@ 412-429 (lines=18) @@
409
    /**
410
     * {@inheritdoc}
411
     */
412
    public function hasPathMappings(Expression $expr = null)
413
    {
414
        $this->assertMappingsLoaded();
415
416
        if (!$expr) {
417
            return !$this->mappings->isEmpty();
418
        }
419
420
        foreach ($this->mappings->toArray() as $mappingsByModule) {
421
            foreach ($mappingsByModule as $mapping) {
422
                if ($expr->evaluate($mapping)) {
423
                    return true;
424
                }
425
            }
426
        }
427
428
        return false;
429
    }
430
431
    /**
432
     * {@inheritdoc}

src/Discovery/DiscoveryManagerImpl.php 1 location

@@ 614-629 (lines=16) @@
611
    /**
612
     * {@inheritdoc}
613
     */
614
    public function hasBindingDescriptors(Expression $expr = null)
615
    {
616
        $this->assertModulesLoaded();
617
618
        if (!$expr) {
619
            return !$this->bindingDescriptors->isEmpty();
620
        }
621
622
        foreach ($this->bindingDescriptors->toArray() as $bindingDescriptor) {
623
            if ($expr->evaluate($bindingDescriptor)) {
624
                return true;
625
            }
626
        }
627
628
        return false;
629
    }
630
631
    /**
632
     * {@inheritdoc}