Code Duplication    Length = 11-14 lines in 2 locations

src/EventListener/DefinitionLoaderListener.php 1 location

@@ 25-35 (lines=11) @@
22
{
23
    private $directories;
24
25
    public function __construct(MapInterface $directories)
26
    {
27
        if (
28
            (string) $directories->keyType() !== 'string' ||
29
            (string) $directories->valueType() !== Directory::class
30
        ) {
31
            throw new InvalidArgumentException;
32
        }
33
34
        $this->directories = $directories;
35
    }
36
37
    /**
38
     * {@inheritdoc}

src/Routing/RouteLoader.php 1 location

@@ 32-45 (lines=14) @@
29
    private $routeFactory;
30
    private $imported = false;
31
32
    public function __construct(
33
        MapInterface $directories,
34
        RouteFactory $routeFactory
35
    ) {
36
        if (
37
            (string) $directories->keyType() !== 'string' ||
38
            (string) $directories->valueType() !== Directory::class
39
        ) {
40
            throw new InvalidArgumentException;
41
        }
42
43
        $this->directories = $directories;
44
        $this->routeFactory = $routeFactory;
45
    }
46
47
    /**
48
     * {@inheritdoc}