@@ -93,7 +93,7 @@ discard block |
||
| 93 | 93 | * |
| 94 | 94 | * @var array |
| 95 | 95 | */ |
| 96 | - protected $excludeEntityManagerForAutoBuildEntityMap = []; |
|
| 96 | + protected $excludeEntityManagerForAutoBuildEntityMap = [ ]; |
|
| 97 | 97 | |
| 98 | 98 | /** |
| 99 | 99 | * Флаг позволяет отключить использования кеширования при работе с entityMap |
@@ -314,7 +314,7 @@ discard block |
||
| 314 | 314 | * |
| 315 | 315 | * @return $this |
| 316 | 316 | */ |
| 317 | - public function setExcludeEntityManagerForAutoBuildEntityMap(array $excludeEntityManagerForAutoBuildEntityMap = []) |
|
| 317 | + public function setExcludeEntityManagerForAutoBuildEntityMap(array $excludeEntityManagerForAutoBuildEntityMap = [ ]) |
|
| 318 | 318 | { |
| 319 | 319 | $this->excludeEntityManagerForAutoBuildEntityMap = $excludeEntityManagerForAutoBuildEntityMap; |
| 320 | 320 | |
@@ -41,5 +41,5 @@ |
||
| 41 | 41 | * |
| 42 | 42 | * @return mixed |
| 43 | 43 | */ |
| 44 | - public function createEntityObject($entityName, array $options = []); |
|
| 44 | + public function createEntityObject($entityName, array $options = [ ]); |
|
| 45 | 45 | } |
@@ -88,7 +88,7 @@ |
||
| 88 | 88 | * @throws \Nnx\Doctrine\Service\Exception\InvalidEntityObjectException |
| 89 | 89 | * @throws \Interop\Container\Exception\NotFoundException |
| 90 | 90 | */ |
| 91 | - public function createEntityObject($entityName, array $options = []) |
|
| 91 | + public function createEntityObject($entityName, array $options = [ ]) |
|
| 92 | 92 | { |
| 93 | 93 | return $this->getEntityManager()->get($entityName, $options); |
| 94 | 94 | } |
@@ -41,7 +41,7 @@ discard block |
||
| 41 | 41 | * |
| 42 | 42 | * @var array |
| 43 | 43 | */ |
| 44 | - protected $cacheKeys = []; |
|
| 44 | + protected $cacheKeys = [ ]; |
|
| 45 | 45 | |
| 46 | 46 | /** |
| 47 | 47 | * EntityMapCache constructor. |
@@ -69,7 +69,7 @@ discard block |
||
| 69 | 69 | */ |
| 70 | 70 | public function saveEntityMap($objectManagerName) |
| 71 | 71 | { |
| 72 | - $moduleOptions = $this->getModuleOptions(); |
|
| 72 | + $moduleOptions = $this->getModuleOptions(); |
|
| 73 | 73 | $originalFlag = $this->getModuleOptions()->getFlagDisableUseEntityMapDoctrineCache(); |
| 74 | 74 | $moduleOptions->setFlagDisableUseEntityMapDoctrineCache(true); |
| 75 | 75 | |
@@ -144,15 +144,15 @@ discard block |
||
| 144 | 144 | public function getCacheKeyForObjectManagerName($objectManagerName) |
| 145 | 145 | { |
| 146 | 146 | if (array_key_exists($objectManagerName, $this->cacheKeys)) { |
| 147 | - return $this->cacheKeys[$objectManagerName]; |
|
| 147 | + return $this->cacheKeys[ $objectManagerName ]; |
|
| 148 | 148 | } |
| 149 | 149 | |
| 150 | 150 | $preffix = $this->getModuleOptions()->getEntityMapDoctrineCachePrefix(); |
| 151 | - $key = $preffix . '_' . $objectManagerName; |
|
| 151 | + $key = $preffix.'_'.$objectManagerName; |
|
| 152 | 152 | |
| 153 | - $this->cacheKeys[$objectManagerName] = $key; |
|
| 153 | + $this->cacheKeys[ $objectManagerName ] = $key; |
|
| 154 | 154 | |
| 155 | - return $this->cacheKeys[$objectManagerName]; |
|
| 155 | + return $this->cacheKeys[ $objectManagerName ]; |
|
| 156 | 156 | } |
| 157 | 157 | |
| 158 | 158 | /** |
@@ -28,7 +28,7 @@ discard block |
||
| 28 | 28 | * |
| 29 | 29 | * @var array |
| 30 | 30 | */ |
| 31 | - protected $doctrineConfig = []; |
|
| 31 | + protected $doctrineConfig = [ ]; |
|
| 32 | 32 | |
| 33 | 33 | /** |
| 34 | 34 | * Ключем является имя ObjectManager'a значением либо массив содержащий имена неймспейсов в которых расположены |
@@ -37,7 +37,7 @@ discard block |
||
| 37 | 37 | * |
| 38 | 38 | * @var array |
| 39 | 39 | */ |
| 40 | - protected $namespacesByObjectManagerCache = []; |
|
| 40 | + protected $namespacesByObjectManagerCache = [ ]; |
|
| 41 | 41 | |
| 42 | 42 | /** |
| 43 | 43 | * Опции модуля |
@@ -59,7 +59,7 @@ discard block |
||
| 59 | 59 | * @param array $doctrineConfig |
| 60 | 60 | * @param ModuleOptionsInterface $moduleOptions |
| 61 | 61 | */ |
| 62 | - public function __construct(array $doctrineConfig = [], ModuleOptionsInterface $moduleOptions) |
|
| 62 | + public function __construct(array $doctrineConfig = [ ], ModuleOptionsInterface $moduleOptions) |
|
| 63 | 63 | { |
| 64 | 64 | $this->setDoctrineConfig($doctrineConfig); |
| 65 | 65 | $this->setModuleOptions($moduleOptions); |
@@ -83,7 +83,7 @@ discard block |
||
| 83 | 83 | * |
| 84 | 84 | * @return $this |
| 85 | 85 | */ |
| 86 | - public function setDoctrineConfig(array $doctrineConfig = []) |
|
| 86 | + public function setDoctrineConfig(array $doctrineConfig = [ ]) |
|
| 87 | 87 | { |
| 88 | 88 | $this->doctrineConfig = $doctrineConfig; |
| 89 | 89 | |
@@ -102,15 +102,15 @@ discard block |
||
| 102 | 102 | } |
| 103 | 103 | |
| 104 | 104 | if (!$this->isValidDoctrineOrmModuleEntityManagerConfig()) { |
| 105 | - $this->listObjectManagerName = []; |
|
| 105 | + $this->listObjectManagerName = [ ]; |
|
| 106 | 106 | return $this->listObjectManagerName; |
| 107 | 107 | } |
| 108 | 108 | |
| 109 | 109 | $doctrineConfig = $this->getDoctrineConfig(); |
| 110 | 110 | |
| 111 | - $listObjectManagerName = array_keys($doctrineConfig['entitymanager']); |
|
| 112 | - $prepareListObjectManagerName = array_map(function ($objectManagerName) { |
|
| 113 | - return 'doctrine.entitymanager.' . $objectManagerName; |
|
| 111 | + $listObjectManagerName = array_keys($doctrineConfig[ 'entitymanager' ]); |
|
| 112 | + $prepareListObjectManagerName = array_map(function($objectManagerName) { |
|
| 113 | + return 'doctrine.entitymanager.'.$objectManagerName; |
|
| 114 | 114 | }, $listObjectManagerName); |
| 115 | 115 | |
| 116 | 116 | $this->listObjectManagerName = array_combine($listObjectManagerName, $prepareListObjectManagerName); |
@@ -128,16 +128,16 @@ discard block |
||
| 128 | 128 | public function hasNamespacesByObjectManager($objectManagerServiceName) |
| 129 | 129 | { |
| 130 | 130 | if (array_key_exists($objectManagerServiceName, $this->namespacesByObjectManagerCache)) { |
| 131 | - return false !== $this->namespacesByObjectManagerCache[$objectManagerServiceName]; |
|
| 131 | + return false !== $this->namespacesByObjectManagerCache[ $objectManagerServiceName ]; |
|
| 132 | 132 | } |
| 133 | 133 | |
| 134 | 134 | if (!$this->isValidDoctrineOrmModuleConfig()) { |
| 135 | - $this->namespacesByObjectManagerCache[$objectManagerServiceName] = false; |
|
| 135 | + $this->namespacesByObjectManagerCache[ $objectManagerServiceName ] = false; |
|
| 136 | 136 | return false; |
| 137 | 137 | } |
| 138 | 138 | |
| 139 | 139 | if (0 !== strpos($objectManagerServiceName, static::DOCTRINE_PREFIX)) { |
| 140 | - $this->namespacesByObjectManagerCache[$objectManagerServiceName] = false; |
|
| 140 | + $this->namespacesByObjectManagerCache[ $objectManagerServiceName ] = false; |
|
| 141 | 141 | return false; |
| 142 | 142 | } |
| 143 | 143 | |
@@ -145,49 +145,49 @@ discard block |
||
| 145 | 145 | |
| 146 | 146 | $doctrineConfig = $this->getDoctrineConfig(); |
| 147 | 147 | |
| 148 | - if (!array_key_exists($objectManagerName, $doctrineConfig['entitymanager'])) { |
|
| 149 | - $this->namespacesByObjectManagerCache[$objectManagerServiceName] = false; |
|
| 148 | + if (!array_key_exists($objectManagerName, $doctrineConfig[ 'entitymanager' ])) { |
|
| 149 | + $this->namespacesByObjectManagerCache[ $objectManagerServiceName ] = false; |
|
| 150 | 150 | return false; |
| 151 | 151 | } |
| 152 | 152 | |
| 153 | - $omConfig = $doctrineConfig['entitymanager'][$objectManagerName]; |
|
| 153 | + $omConfig = $doctrineConfig[ 'entitymanager' ][ $objectManagerName ]; |
|
| 154 | 154 | |
| 155 | - if (!is_array($omConfig) || !array_key_exists('configuration', $omConfig) || !is_string($omConfig['configuration'])) { |
|
| 156 | - $this->namespacesByObjectManagerCache[$objectManagerServiceName] = false; |
|
| 155 | + if (!is_array($omConfig) || !array_key_exists('configuration', $omConfig) || !is_string($omConfig[ 'configuration' ])) { |
|
| 156 | + $this->namespacesByObjectManagerCache[ $objectManagerServiceName ] = false; |
|
| 157 | 157 | return false; |
| 158 | 158 | } |
| 159 | 159 | |
| 160 | - $confName = $omConfig['configuration']; |
|
| 160 | + $confName = $omConfig[ 'configuration' ]; |
|
| 161 | 161 | |
| 162 | - if (!array_key_exists($confName, $doctrineConfig['configuration']) || !is_array($doctrineConfig['configuration'][$confName])) { |
|
| 163 | - $this->namespacesByObjectManagerCache[$objectManagerServiceName] = false; |
|
| 162 | + if (!array_key_exists($confName, $doctrineConfig[ 'configuration' ]) || !is_array($doctrineConfig[ 'configuration' ][ $confName ])) { |
|
| 163 | + $this->namespacesByObjectManagerCache[ $objectManagerServiceName ] = false; |
|
| 164 | 164 | return false; |
| 165 | 165 | } |
| 166 | 166 | |
| 167 | - $omConfiguration = $doctrineConfig['configuration'][$confName]; |
|
| 167 | + $omConfiguration = $doctrineConfig[ 'configuration' ][ $confName ]; |
|
| 168 | 168 | |
| 169 | - if (!array_key_exists('driver', $omConfiguration) || !is_string($omConfiguration['driver'])) { |
|
| 170 | - $this->namespacesByObjectManagerCache[$objectManagerServiceName] = false; |
|
| 169 | + if (!array_key_exists('driver', $omConfiguration) || !is_string($omConfiguration[ 'driver' ])) { |
|
| 170 | + $this->namespacesByObjectManagerCache[ $objectManagerServiceName ] = false; |
|
| 171 | 171 | return false; |
| 172 | 172 | } |
| 173 | 173 | |
| 174 | - $driverName = $omConfiguration['driver']; |
|
| 174 | + $driverName = $omConfiguration[ 'driver' ]; |
|
| 175 | 175 | |
| 176 | - if (!array_key_exists($driverName, $doctrineConfig['driver']) || !is_array($doctrineConfig['driver'][$driverName])) { |
|
| 177 | - $this->namespacesByObjectManagerCache[$objectManagerServiceName] = false; |
|
| 176 | + if (!array_key_exists($driverName, $doctrineConfig[ 'driver' ]) || !is_array($doctrineConfig[ 'driver' ][ $driverName ])) { |
|
| 177 | + $this->namespacesByObjectManagerCache[ $objectManagerServiceName ] = false; |
|
| 178 | 178 | return false; |
| 179 | 179 | } |
| 180 | 180 | |
| 181 | - $driverConfig = $doctrineConfig['driver'][$driverName]; |
|
| 181 | + $driverConfig = $doctrineConfig[ 'driver' ][ $driverName ]; |
|
| 182 | 182 | |
| 183 | - if (!array_key_exists('drivers', $driverConfig) || !is_array($driverConfig['drivers'])) { |
|
| 184 | - $this->namespacesByObjectManagerCache[$objectManagerServiceName] = false; |
|
| 183 | + if (!array_key_exists('drivers', $driverConfig) || !is_array($driverConfig[ 'drivers' ])) { |
|
| 184 | + $this->namespacesByObjectManagerCache[ $objectManagerServiceName ] = false; |
|
| 185 | 185 | return false; |
| 186 | 186 | } |
| 187 | 187 | |
| 188 | - $this->namespacesByObjectManagerCache[$objectManagerServiceName] = $this->buildIndexNamespaces($driverConfig['drivers']); |
|
| 188 | + $this->namespacesByObjectManagerCache[ $objectManagerServiceName ] = $this->buildIndexNamespaces($driverConfig[ 'drivers' ]); |
|
| 189 | 189 | |
| 190 | - return false !== $this->namespacesByObjectManagerCache[$objectManagerServiceName]; |
|
| 190 | + return false !== $this->namespacesByObjectManagerCache[ $objectManagerServiceName ]; |
|
| 191 | 191 | } |
| 192 | 192 | |
| 193 | 193 | /** |
@@ -206,15 +206,15 @@ discard block |
||
| 206 | 206 | $moduleOptions = $this->getModuleOptions(); |
| 207 | 207 | $entitySeparator = $moduleOptions->getEntitySeparator(); |
| 208 | 208 | |
| 209 | - $index = []; |
|
| 209 | + $index = [ ]; |
|
| 210 | 210 | foreach ($listNamespaces as $currentNamespace) { |
| 211 | 211 | $prepareNamespace = rtrim($currentNamespace, '\\'); |
| 212 | - $normalizeNamespace = $prepareNamespace . '\\'; |
|
| 212 | + $normalizeNamespace = $prepareNamespace.'\\'; |
|
| 213 | 213 | |
| 214 | 214 | $normalizeNamespaceStack = explode($entitySeparator, $normalizeNamespace); |
| 215 | 215 | |
| 216 | 216 | $namespacePrefix = array_shift($normalizeNamespaceStack); |
| 217 | - $index[$currentNamespace] = $namespacePrefix . $entitySeparator; |
|
| 217 | + $index[ $currentNamespace ] = $namespacePrefix.$entitySeparator; |
|
| 218 | 218 | } |
| 219 | 219 | |
| 220 | 220 | return $index; |
@@ -236,7 +236,7 @@ discard block |
||
| 236 | 236 | throw new Exception\EntityNamespacesNotFoundException($errMsh); |
| 237 | 237 | } |
| 238 | 238 | |
| 239 | - return $this->namespacesByObjectManagerCache[$objectManagerServiceName]; |
|
| 239 | + return $this->namespacesByObjectManagerCache[ $objectManagerServiceName ]; |
|
| 240 | 240 | } |
| 241 | 241 | |
| 242 | 242 | /** |
@@ -250,8 +250,8 @@ discard block |
||
| 250 | 250 | $doctrineConfig = $this->getDoctrineConfig(); |
| 251 | 251 | |
| 252 | 252 | return $this->isValidDoctrineOrmModuleEntityManagerConfig() |
| 253 | - && array_key_exists('configuration', $doctrineConfig) && is_array($doctrineConfig['configuration']) |
|
| 254 | - && array_key_exists('driver', $doctrineConfig) && is_array($doctrineConfig['driver']); |
|
| 253 | + && array_key_exists('configuration', $doctrineConfig) && is_array($doctrineConfig[ 'configuration' ]) |
|
| 254 | + && array_key_exists('driver', $doctrineConfig) && is_array($doctrineConfig[ 'driver' ]); |
|
| 255 | 255 | } |
| 256 | 256 | |
| 257 | 257 | /** |
@@ -263,7 +263,7 @@ discard block |
||
| 263 | 263 | { |
| 264 | 264 | $doctrineConfig = $this->getDoctrineConfig(); |
| 265 | 265 | |
| 266 | - return array_key_exists('entitymanager', $doctrineConfig) && is_array($doctrineConfig['entitymanager']); |
|
| 266 | + return array_key_exists('entitymanager', $doctrineConfig) && is_array($doctrineConfig[ 'entitymanager' ]); |
|
| 267 | 267 | } |
| 268 | 268 | |
| 269 | 269 | /** |
@@ -121,7 +121,7 @@ discard block |
||
| 121 | 121 | return array( |
| 122 | 122 | 'Zend\Loader\StandardAutoloader' => array( |
| 123 | 123 | 'namespaces' => array( |
| 124 | - __NAMESPACE__ => __DIR__ . '/src/', |
|
| 124 | + __NAMESPACE__ => __DIR__.'/src/', |
|
| 125 | 125 | ), |
| 126 | 126 | ), |
| 127 | 127 | ); |
@@ -133,7 +133,7 @@ discard block |
||
| 133 | 133 | */ |
| 134 | 134 | public function getConfig() |
| 135 | 135 | { |
| 136 | - return include __DIR__ . '/config/module.config.php'; |
|
| 136 | + return include __DIR__.'/config/module.config.php'; |
|
| 137 | 137 | } |
| 138 | 138 | |
| 139 | 139 | /** |
@@ -143,7 +143,7 @@ discard block |
||
| 143 | 143 | * |
| 144 | 144 | * @return string |
| 145 | 145 | */ |
| 146 | - public function getConsoleBanner(Console $console){ |
|
| 146 | + public function getConsoleBanner(Console $console) { |
|
| 147 | 147 | return 'Tools for entity map'; |
| 148 | 148 | } |
| 149 | 149 | |
@@ -154,13 +154,13 @@ discard block |
||
| 154 | 154 | * |
| 155 | 155 | * @return array |
| 156 | 156 | */ |
| 157 | - public function getConsoleUsage(Console $console){ |
|
| 157 | + public function getConsoleUsage(Console $console) { |
|
| 158 | 158 | return [ |
| 159 | 159 | 'Entity map builder', |
| 160 | 160 | 'entity-map build --objectManager=' => 'Generation entity maps and cached', |
| 161 | - ['--objectManager=MANAGER_NAME', 'ObjectManager name'], |
|
| 161 | + [ '--objectManager=MANAGER_NAME', 'ObjectManager name' ], |
|
| 162 | 162 | 'entity-map clear --objectManager=' => 'Clear entity maps from cached', |
| 163 | - ['--objectManager=MANAGER_NAME', 'ObjectManager name'], |
|
| 163 | + [ '--objectManager=MANAGER_NAME', 'ObjectManager name' ], |
|
| 164 | 164 | ]; |
| 165 | 165 | } |
| 166 | 166 | } |
| 167 | 167 | \ No newline at end of file |
@@ -55,7 +55,7 @@ discard block |
||
| 55 | 55 | /** |
| 56 | 56 | * Список EntityManager'ов, для которых никогда не нужно собирать кеш entityMap в автоматическом режими |
| 57 | 57 | */ |
| 58 | - 'excludeEntityManagerForAutoBuildEntityMap' => [], |
|
| 58 | + 'excludeEntityManagerForAutoBuildEntityMap' => [ ], |
|
| 59 | 59 | |
| 60 | 60 | |
| 61 | 61 | /** |
@@ -77,13 +77,13 @@ discard block |
||
| 77 | 77 | ]; |
| 78 | 78 | |
| 79 | 79 | return array_merge_recursive( |
| 80 | - include __DIR__ . '/moduleOptions.config.php', |
|
| 81 | - include __DIR__ . '/doctrineObjectManager.config.php', |
|
| 82 | - include __DIR__ . '/entityManager.config.php', |
|
| 83 | - include __DIR__ . '/serviceManager.config.php', |
|
| 84 | - include __DIR__ . '/controllers.config.php', |
|
| 85 | - include __DIR__ . '/console.config.php', |
|
| 86 | - include __DIR__ . '/hydrators.config.php', |
|
| 80 | + include __DIR__.'/moduleOptions.config.php', |
|
| 81 | + include __DIR__.'/doctrineObjectManager.config.php', |
|
| 82 | + include __DIR__.'/entityManager.config.php', |
|
| 83 | + include __DIR__.'/serviceManager.config.php', |
|
| 84 | + include __DIR__.'/controllers.config.php', |
|
| 85 | + include __DIR__.'/console.config.php', |
|
| 86 | + include __DIR__.'/hydrators.config.php', |
|
| 87 | 87 | |
| 88 | 88 | $config |
| 89 | 89 | ); |
| 90 | 90 | \ No newline at end of file |