@@ -31,7 +31,7 @@ |
||
31 | 31 | list($moduleName, $entityName) = $namespaceParts; |
32 | 32 | $entityClass = "$moduleName\\$entityName\\$entityName"; |
33 | 33 | } else { |
34 | - $entityName = $namespaceParts[0]; |
|
34 | + $entityName = $namespaceParts[ 0 ]; |
|
35 | 35 | |
36 | 36 | /** @var Config $config */ |
37 | 37 | $config = $container->get("$entityName\\Infrastructure\\Config"); |
@@ -36,7 +36,7 @@ discard block |
||
36 | 36 | $mapper = $container->get("$moduleName\\$entityName\\Infrastructure\\Mapper"); |
37 | 37 | $entityFactory = $container->get("$moduleName\\$entityName\\EntityFactory"); |
38 | 38 | } else { |
39 | - $entityName = $namespaceParts[0]; |
|
39 | + $entityName = $namespaceParts[ 0 ]; |
|
40 | 40 | /** @var Config $config */ |
41 | 41 | $config = $container->get("$entityName\\Infrastructure\\Config"); |
42 | 42 | $criteriaFactory = $container->get("$entityName\\Infrastructure\\CriteriaFactory"); |
@@ -44,11 +44,11 @@ discard block |
||
44 | 44 | $entityFactory = $container->get("$entityName\\EntityFactory"); |
45 | 45 | } |
46 | 46 | |
47 | - $features = []; |
|
47 | + $features = [ ]; |
|
48 | 48 | $tableSequence = $config->getSequence($entityName); |
49 | 49 | $tablePrimaryKey = $config->getPrimaryKey($entityName); |
50 | 50 | if (!empty($tableSequence) && !empty($tablePrimaryKey)) { |
51 | - $features[] = new SequenceFeature($tablePrimaryKey, $tableSequence); |
|
51 | + $features[ ] = new SequenceFeature($tablePrimaryKey, $tableSequence); |
|
52 | 52 | } |
53 | 53 | |
54 | 54 | $dbAdapter = $container->get('Zend\Db\Adapter\Adapter'); |
@@ -27,18 +27,18 @@ |
||
27 | 27 | $namespaceParts = explode('\\', trim($namespace, "\\")); |
28 | 28 | |
29 | 29 | if (count($namespaceParts) > 1) { |
30 | - $entityName = $namespaceParts[1]; |
|
30 | + $entityName = $namespaceParts[ 1 ]; |
|
31 | 31 | } else { |
32 | - $entityName = $namespaceParts[0]; |
|
32 | + $entityName = $namespaceParts[ 0 ]; |
|
33 | 33 | } |
34 | 34 | |
35 | 35 | $config = $container->get('Config'); |
36 | 36 | |
37 | - if (!isset($config['entity_map'])) { |
|
37 | + if (!isset($config[ 'entity_map' ])) { |
|
38 | 38 | throw new ServiceNotCreatedException("You must define |
39 | 39 | and configure $entityName in 'entity_map' config entry"); |
40 | 40 | } |
41 | 41 | |
42 | - return new Config($config['entity_map']); |
|
42 | + return new Config($config[ 'entity_map' ]); |
|
43 | 43 | } |
44 | 44 | } |
@@ -33,7 +33,7 @@ |
||
33 | 33 | $criteriaFactory = $container->get("$moduleName\\$entityName\\Infrastructure\\CriteriaFactory"); |
34 | 34 | $entityFactory = $container->get("$moduleName\\$entityName\\EntityFactory"); |
35 | 35 | } else { |
36 | - $entityName = $namespaceParts[0]; |
|
36 | + $entityName = $namespaceParts[ 0 ]; |
|
37 | 37 | /** @var Config $config */ |
38 | 38 | $config = $container->get("$entityName\\Infrastructure\\Config"); |
39 | 39 | $criteriaFactory = $container->get("$entityName\\Infrastructure\\CriteriaFactory"); |
@@ -29,7 +29,7 @@ |
||
29 | 29 | list($moduleName, $entityName) = $namespaceParts; |
30 | 30 | $config = $container->get("$moduleName\\$entityName\\Infrastructure\\Config"); |
31 | 31 | } else { |
32 | - $entityName = $namespaceParts[0]; |
|
32 | + $entityName = $namespaceParts[ 0 ]; |
|
33 | 33 | $config = $container->get("$entityName\\Infrastructure\\Config"); |
34 | 34 | } |
35 | 35 |
@@ -37,7 +37,7 @@ discard block |
||
37 | 37 | $mapper = $container->get("$moduleName\\$entityName\\Infrastructure\\Mapper"); |
38 | 38 | $entityFactory = $container->get("$moduleName\\$entityName\\EntityFactory"); |
39 | 39 | } else { |
40 | - $entityName = $namespaceParts[0]; |
|
40 | + $entityName = $namespaceParts[ 0 ]; |
|
41 | 41 | /** @var Config $config */ |
42 | 42 | $config = $container->get("$entityName\\Infrastructure\\Config"); |
43 | 43 | $repository = $container->get("$entityName\\Infrastructure\\Repository"); |
@@ -47,24 +47,24 @@ discard block |
||
47 | 47 | |
48 | 48 | $appConfig = $container->get('Config'); |
49 | 49 | |
50 | - if (!isset($appConfig['entity_map'])) { |
|
50 | + if (!isset($appConfig[ 'entity_map' ])) { |
|
51 | 51 | throw new ServiceNotCreatedException("You must define |
52 | 52 | and configure Comments\\Comment in 'entity_map' config entry"); |
53 | 53 | } |
54 | 54 | |
55 | - $relationsConfig = $appConfig['entity_map'][$entityName]['relations']; |
|
55 | + $relationsConfig = $appConfig[ 'entity_map' ][ $entityName ][ 'relations' ]; |
|
56 | 56 | |
57 | - $relatedRepository = []; |
|
57 | + $relatedRepository = [ ]; |
|
58 | 58 | foreach ($relationsConfig as $relatedEntity => $joinRule) { |
59 | - $repositoryClass = $relatedEntity . '\Infrastructure\Repository'; |
|
60 | - $relatedRepository[$relatedEntity] = $container->get($repositoryClass); |
|
59 | + $repositoryClass = $relatedEntity.'\Infrastructure\Repository'; |
|
60 | + $relatedRepository[ $relatedEntity ] = $container->get($repositoryClass); |
|
61 | 61 | } |
62 | 62 | |
63 | - $features = []; |
|
63 | + $features = [ ]; |
|
64 | 64 | $tableSequence = $config->getSequence($entityName); |
65 | 65 | $tablePrimaryKey = $config->getPrimaryKey($entityName); |
66 | 66 | if (!empty($tableSequence) && !empty($tablePrimaryKey)) { |
67 | - $features[] = new SequenceFeature($tablePrimaryKey, $tableSequence); |
|
67 | + $features[ ] = new SequenceFeature($tablePrimaryKey, $tableSequence); |
|
68 | 68 | } |
69 | 69 | |
70 | 70 | $dbAdapter = $container->get('Zend\Db\Adapter\Adapter'); |
@@ -31,7 +31,7 @@ |
||
31 | 31 | /** @var Config $config */ |
32 | 32 | $config = $container->get("$moduleName\\$entityName\\Infrastructure\\Config"); |
33 | 33 | } else { |
34 | - $entityName = $namespaceParts[0]; |
|
34 | + $entityName = $namespaceParts[ 0 ]; |
|
35 | 35 | /** @var Config $config */ |
36 | 36 | $config = $container->get("$entityName\\Infrastructure\\Config"); |
37 | 37 | } |
@@ -30,7 +30,7 @@ |
||
30 | 30 | $repository = $container->get("$moduleName\\$entityName\\Infrastructure\\Repository"); |
31 | 31 | $entityEventManager = $container->get("$moduleName\\$entityName\\EntityEventManager"); |
32 | 32 | } else { |
33 | - $entityName = $namespaceParts[0]; |
|
33 | + $entityName = $namespaceParts[ 0 ]; |
|
34 | 34 | $repository = $container->get("$entityName\\Infrastructure\\Repository"); |
35 | 35 | $entityEventManager = $container->get("$entityName\\EntityEventManager"); |
36 | 36 | } |
@@ -30,7 +30,7 @@ |
||
30 | 30 | $repository = $container->get("$moduleName\\$entityName\\Infrastructure\\Repository"); |
31 | 31 | $entityEventManager = $serviceManager->get("$moduleName\\$entityName\\EntityEventManager"); |
32 | 32 | } else { |
33 | - $entityName = $namespaceParts[0]; |
|
33 | + $entityName = $namespaceParts[ 0 ]; |
|
34 | 34 | $repository = $container->get("$entityName\\Infrastructure\\Repository"); |
35 | 35 | $entityEventManager = $serviceManager->get("$entityName\\EntityEventManager"); |
36 | 36 | } |