@@ -74,12 +74,12 @@ discard block |
||
74 | 74 | |
75 | 75 | $listEntityInterfaces = $this->buildListEntityInterfaces($entityClassNames); |
76 | 76 | |
77 | - $map = []; |
|
77 | + $map = [ ]; |
|
78 | 78 | |
79 | 79 | $entityManager = $this->getEntityManager(); |
80 | 80 | foreach ($listEntityInterfaces as $currentInterface) { |
81 | 81 | if ($entityManager->hasEntityClassByInterface($currentInterface)) { |
82 | - $map[$currentInterface] = $entityManager->get($currentInterface); |
|
82 | + $map[ $currentInterface ] = $entityManager->get($currentInterface); |
|
83 | 83 | } |
84 | 84 | } |
85 | 85 | |
@@ -93,9 +93,9 @@ discard block |
||
93 | 93 | * |
94 | 94 | * @return array |
95 | 95 | */ |
96 | - public function buildListEntityInterfaces(array $entityClassNames = []) |
|
96 | + public function buildListEntityInterfaces(array $entityClassNames = [ ]) |
|
97 | 97 | { |
98 | - $listEntityInterfaces = []; |
|
98 | + $listEntityInterfaces = [ ]; |
|
99 | 99 | |
100 | 100 | $moduleOptionsManager = $this->getModuleOptionsPluginManager(); |
101 | 101 | $allowedModules = $this->getAllowedModules($entityClassNames); |
@@ -107,7 +107,7 @@ discard block |
||
107 | 107 | if ($moduleOptionsManager->hasModuleNameByClassName($currentInterface)) { |
108 | 108 | $moduleNameByInterface = $moduleOptionsManager->getModuleNameByClassName($currentInterface); |
109 | 109 | if (array_key_exists($moduleNameByInterface, $allowedModules)) { |
110 | - $listEntityInterfaces[$currentInterface] = $currentInterface; |
|
110 | + $listEntityInterfaces[ $currentInterface ] = $currentInterface; |
|
111 | 111 | } |
112 | 112 | } |
113 | 113 | } |
@@ -123,14 +123,14 @@ discard block |
||
123 | 123 | * |
124 | 124 | * @return array |
125 | 125 | */ |
126 | - public function getAllowedModules(array $entityClassNames = []) |
|
126 | + public function getAllowedModules(array $entityClassNames = [ ]) |
|
127 | 127 | { |
128 | 128 | $moduleOptionsManager = $this->getModuleOptionsPluginManager(); |
129 | - $allowedModules = []; |
|
129 | + $allowedModules = [ ]; |
|
130 | 130 | foreach ($entityClassNames as $entityClassName) { |
131 | 131 | if ($moduleOptionsManager->hasModuleNameByClassName($entityClassName)) { |
132 | 132 | $moduleName = $moduleOptionsManager->getModuleNameByClassName($entityClassName); |
133 | - $allowedModules[$moduleName] = $moduleName; |
|
133 | + $allowedModules[ $moduleName ] = $moduleName; |
|
134 | 134 | } |
135 | 135 | } |
136 | 136 | |
@@ -154,11 +154,11 @@ discard block |
||
154 | 154 | |
155 | 155 | $allMetadata = $objectManager->getMetadataFactory()->getAllMetadata(); |
156 | 156 | |
157 | - $entityClassNames = []; |
|
157 | + $entityClassNames = [ ]; |
|
158 | 158 | foreach ($allMetadata as $classMetadata) { |
159 | 159 | if ($classMetadata instanceof ClassMetadata) { |
160 | 160 | $entityClassName = $classMetadata->getName(); |
161 | - $entityClassNames[$entityClassName] = $entityClassName; |
|
161 | + $entityClassNames[ $entityClassName ] = $entityClassName; |
|
162 | 162 | } |
163 | 163 | } |
164 | 164 |
@@ -28,7 +28,7 @@ discard block |
||
28 | 28 | * |
29 | 29 | * @var array |
30 | 30 | */ |
31 | - protected $interfaceNameToEntityClass = []; |
|
31 | + protected $interfaceNameToEntityClass = [ ]; |
|
32 | 32 | |
33 | 33 | /** |
34 | 34 | * EntityManager constructor. |
@@ -72,11 +72,11 @@ discard block |
||
72 | 72 | public function getEntityClassByInterface($interfaceName) |
73 | 73 | { |
74 | 74 | if ($this->hasEntityClassByInterface($interfaceName)) { |
75 | - $errMsg = sprintf('Error build entity class name for %s', $interfaceName) ; |
|
75 | + $errMsg = sprintf('Error build entity class name for %s', $interfaceName); |
|
76 | 76 | throw new Exception\ErrorBuildEntityClassNameException($errMsg); |
77 | 77 | } |
78 | 78 | |
79 | - return $this->interfaceNameToEntityClass[$interfaceName]; |
|
79 | + return $this->interfaceNameToEntityClass[ $interfaceName ]; |
|
80 | 80 | } |
81 | 81 | |
82 | 82 | /** |
@@ -93,22 +93,22 @@ discard block |
||
93 | 93 | public function hasEntityClassByInterface($interfaceName) |
94 | 94 | { |
95 | 95 | if (array_key_exists($interfaceName, $this->interfaceNameToEntityClass)) { |
96 | - return false !== $this->interfaceNameToEntityClass[$interfaceName]; |
|
96 | + return false !== $this->interfaceNameToEntityClass[ $interfaceName ]; |
|
97 | 97 | } |
98 | 98 | |
99 | 99 | if (!$this->has($interfaceName)) { |
100 | - $this->interfaceNameToEntityClass[$interfaceName] = false; |
|
100 | + $this->interfaceNameToEntityClass[ $interfaceName ] = false; |
|
101 | 101 | return false; |
102 | 102 | } |
103 | 103 | |
104 | 104 | $entity = $this->get($interfaceName); |
105 | 105 | |
106 | 106 | if (!is_object($entity)) { |
107 | - $this->interfaceNameToEntityClass[$interfaceName] = false; |
|
107 | + $this->interfaceNameToEntityClass[ $interfaceName ] = false; |
|
108 | 108 | return false; |
109 | 109 | } |
110 | 110 | |
111 | - $this->interfaceNameToEntityClass[$interfaceName] = get_class($entity); |
|
111 | + $this->interfaceNameToEntityClass[ $interfaceName ] = get_class($entity); |
|
112 | 112 | |
113 | 113 | return true; |
114 | 114 | } |