@@ -54,8 +54,8 @@ |
||
| 54 | 54 | public function attach(EventManagerInterface $events) |
| 55 | 55 | { |
| 56 | 56 | $sharedManager = $events->getSharedManager(); |
| 57 | - $sharedManager->attach(ManagerRegistry::class, ManagerRegistryResourceEvent::RESOLVE_CONNECTION_EVENT, [$this, 'resolveConnectionByNameHandler']); |
|
| 58 | - $sharedManager->attach(ManagerRegistry::class, ManagerRegistryResourceEvent::RESOLVE_OBJECT_MANAGER_EVENT, [$this, 'resolveObjectManagerByNameHandler']); |
|
| 57 | + $sharedManager->attach(ManagerRegistry::class, ManagerRegistryResourceEvent::RESOLVE_CONNECTION_EVENT, [ $this, 'resolveConnectionByNameHandler' ]); |
|
| 58 | + $sharedManager->attach(ManagerRegistry::class, ManagerRegistryResourceEvent::RESOLVE_OBJECT_MANAGER_EVENT, [ $this, 'resolveObjectManagerByNameHandler' ]); |
|
| 59 | 59 | } |
| 60 | 60 | |
| 61 | 61 | /** |
@@ -51,14 +51,14 @@ discard block |
||
| 51 | 51 | * |
| 52 | 52 | * @var array |
| 53 | 53 | */ |
| 54 | - protected $objectManagerByName = []; |
|
| 54 | + protected $objectManagerByName = [ ]; |
|
| 55 | 55 | |
| 56 | 56 | /** |
| 57 | 57 | * Ключем является имя соеденения, а значением объект соеденения к базе данных |
| 58 | 58 | * |
| 59 | 59 | * @var array |
| 60 | 60 | */ |
| 61 | - protected $connectionByName = []; |
|
| 61 | + protected $connectionByName = [ ]; |
|
| 62 | 62 | |
| 63 | 63 | /** |
| 64 | 64 | * Прототип для создания объекта события, бросаемого когда нужно получить ресурс |
@@ -191,7 +191,7 @@ discard block |
||
| 191 | 191 | protected function getObjectManagerByName($name) |
| 192 | 192 | { |
| 193 | 193 | if (array_key_exists($name, $this->objectManagerByName)) { |
| 194 | - return $this->objectManagerByName[$name]; |
|
| 194 | + return $this->objectManagerByName[ $name ]; |
|
| 195 | 195 | } |
| 196 | 196 | |
| 197 | 197 | $event = clone $this->getManagerRegistryResourceEventPrototype(); |
@@ -200,7 +200,7 @@ discard block |
||
| 200 | 200 | $event->setTarget($this); |
| 201 | 201 | |
| 202 | 202 | |
| 203 | - $resultsEvent = $this->getEventManager()->trigger($event, function ($objectManager) { |
|
| 203 | + $resultsEvent = $this->getEventManager()->trigger($event, function($objectManager) { |
|
| 204 | 204 | return $objectManager instanceof ObjectManager; |
| 205 | 205 | }); |
| 206 | 206 | |
@@ -211,9 +211,9 @@ discard block |
||
| 211 | 211 | throw new Exception\ObjectManagerNotFoundException($errMsg); |
| 212 | 212 | } |
| 213 | 213 | |
| 214 | - $this->objectManagerByName[$name] = $objectManager; |
|
| 214 | + $this->objectManagerByName[ $name ] = $objectManager; |
|
| 215 | 215 | |
| 216 | - return $this->objectManagerByName[$name]; |
|
| 216 | + return $this->objectManagerByName[ $name ]; |
|
| 217 | 217 | } |
| 218 | 218 | |
| 219 | 219 | |
@@ -228,7 +228,7 @@ discard block |
||
| 228 | 228 | protected function getConnectionByName($name) |
| 229 | 229 | { |
| 230 | 230 | if (array_key_exists($name, $this->connectionByName)) { |
| 231 | - return $this->connectionByName[$name]; |
|
| 231 | + return $this->connectionByName[ $name ]; |
|
| 232 | 232 | } |
| 233 | 233 | |
| 234 | 234 | $event = clone $this->getManagerRegistryResourceEventPrototype(); |
@@ -237,7 +237,7 @@ discard block |
||
| 237 | 237 | $event->setTarget($this); |
| 238 | 238 | |
| 239 | 239 | |
| 240 | - $resultsEvent = $this->getEventManager()->trigger($event, function ($connection) { |
|
| 240 | + $resultsEvent = $this->getEventManager()->trigger($event, function($connection) { |
|
| 241 | 241 | return is_object($connection); |
| 242 | 242 | }); |
| 243 | 243 | |
@@ -248,9 +248,9 @@ discard block |
||
| 248 | 248 | throw new Exception\ConnectionNotFoundException($errMsg); |
| 249 | 249 | } |
| 250 | 250 | |
| 251 | - $this->connectionByName[$name] = $connection; |
|
| 251 | + $this->connectionByName[ $name ] = $connection; |
|
| 252 | 252 | |
| 253 | - return $this->connectionByName[$name]; |
|
| 253 | + return $this->connectionByName[ $name ]; |
|
| 254 | 254 | } |
| 255 | 255 | |
| 256 | 256 | |
@@ -55,7 +55,7 @@ discard block |
||
| 55 | 55 | |
| 56 | 56 | |
| 57 | 57 | $buildListConnectionsResult = $this->getEventManager()->trigger(static::EVENT_BUILD_LIST_CONNECTIONS, $this); |
| 58 | - $listConnectionsResult = []; |
|
| 58 | + $listConnectionsResult = [ ]; |
|
| 59 | 59 | foreach ($buildListConnectionsResult as $item) { |
| 60 | 60 | if (is_array($item)) { |
| 61 | 61 | $listConnectionsResult = ArrayUtils::merge($listConnectionsResult, $item); |
@@ -65,7 +65,7 @@ discard block |
||
| 65 | 65 | |
| 66 | 66 | |
| 67 | 67 | $buildListObjectManagersResult = $this->getEventManager()->trigger(static::EVENT_BUILD_LIST_OBJECT_MANAGERS, $this); |
| 68 | - $listObjectManagersResult = []; |
|
| 68 | + $listObjectManagersResult = [ ]; |
|
| 69 | 69 | foreach ($buildListObjectManagersResult as $item) { |
| 70 | 70 | if (is_array($item)) { |
| 71 | 71 | $listObjectManagersResult = ArrayUtils::merge($listObjectManagersResult, $item); |