Code Duplication    Length = 7-9 lines in 2 locations

src/Infrastructure/CriteriaFactoryAbstractFactory.php 1 location

@@ 28-34 (lines=7) @@
25
26
        $namespaceParts = explode('\\', trim($namespace, "\\"));
27
28
        if (count($namespaceParts) > 1) {
29
            list($moduleName, $entityName) = $namespaceParts;
30
            $config = $container->get("$moduleName\\$entityName\\Infrastructure\\Config");
31
        } else {
32
            $entityName = $namespaceParts[0];
33
            $config = $container->get("$entityName\\Infrastructure\\Config");
34
        }
35
36
        return new CriteriaFactory($config);
37
    }

src/Infrastructure/MapperAbstractFactory.php 1 location

@@ 29-37 (lines=9) @@
26
27
        $namespaceParts = explode('\\', trim($namespace, "\\"));
28
29
        if (count($namespaceParts) > 1) {
30
            list($moduleName, $entityName) = $namespaceParts;
31
            /** @var Config $config */
32
            $config = $container->get("$moduleName\\$entityName\\Infrastructure\\Config");
33
        } else {
34
            $entityName = $namespaceParts[0];
35
            /** @var Config $config */
36
            $config = $container->get("$entityName\\Infrastructure\\Config");
37
        }
38
39
        return new Mapper(
40
            $config->getColumnsAsAttributesMap($entityName),