@@ -23,7 +23,7 @@ discard block |
||
| 23 | 23 | * |
| 24 | 24 | * @var array |
| 25 | 25 | */ |
| 26 | - protected $prototype = []; |
|
| 26 | + protected $prototype = [ ]; |
|
| 27 | 27 | |
| 28 | 28 | /** |
| 29 | 29 | * @inheritdoc |
@@ -39,7 +39,7 @@ discard block |
||
| 39 | 39 | public function canCreateServiceWithName(ServiceLocatorInterface $serviceLocator, $name, $requestedName) |
| 40 | 40 | { |
| 41 | 41 | if (array_key_exists($requestedName, $this->prototype)) { |
| 42 | - return false !== $this->prototype[$requestedName]; |
|
| 42 | + return false !== $this->prototype[ $requestedName ]; |
|
| 43 | 43 | } |
| 44 | 44 | |
| 45 | 45 | $appServiceLocator = $serviceLocator; |
@@ -52,7 +52,7 @@ discard block |
||
| 52 | 52 | |
| 53 | 53 | $hasOrmEntity = $ormEntityLocator->has($requestedName); |
| 54 | 54 | if (false === $hasOrmEntity) { |
| 55 | - $this->prototype[$requestedName] = false; |
|
| 55 | + $this->prototype[ $requestedName ] = false; |
|
| 56 | 56 | } |
| 57 | 57 | |
| 58 | 58 | return $hasOrmEntity; |
@@ -75,11 +75,11 @@ discard block |
||
| 75 | 75 | public function createServiceWithName(ServiceLocatorInterface $serviceLocator, $name, $requestedName) |
| 76 | 76 | { |
| 77 | 77 | if (array_key_exists($requestedName, $this->prototype)) { |
| 78 | - if (!is_object($this->prototype[$requestedName])) { |
|
| 78 | + if (!is_object($this->prototype[ $requestedName ])) { |
|
| 79 | 79 | $errMsg = sprintf('Invalid prototype for %s', $requestedName); |
| 80 | 80 | throw new Exception\RuntimeException($errMsg); |
| 81 | 81 | } |
| 82 | - return clone $this->prototype[$requestedName]; |
|
| 82 | + return clone $this->prototype[ $requestedName ]; |
|
| 83 | 83 | } |
| 84 | 84 | |
| 85 | 85 | $appServiceLocator = $serviceLocator; |
@@ -98,7 +98,7 @@ discard block |
||
| 98 | 98 | $r = new ReflectionClass($entityClassName); |
| 99 | 99 | $entity = $r->newInstance(); |
| 100 | 100 | } |
| 101 | - $this->prototype[$requestedName] = $entity; |
|
| 101 | + $this->prototype[ $requestedName ] = $entity; |
|
| 102 | 102 | |
| 103 | 103 | |
| 104 | 104 | return $entity; |
@@ -24,7 +24,7 @@ discard block |
||
| 24 | 24 | * |
| 25 | 25 | * @var array |
| 26 | 26 | */ |
| 27 | - protected $prototype = []; |
|
| 27 | + protected $prototype = [ ]; |
|
| 28 | 28 | |
| 29 | 29 | /** |
| 30 | 30 | * Кеш ключем которого является имя класса гидратора, а значением true/false. Т.е. является ли класс корректным потомком |
@@ -32,7 +32,7 @@ discard block |
||
| 32 | 32 | * |
| 33 | 33 | * @var array |
| 34 | 34 | */ |
| 35 | - protected $validDoctrineObjectHydratorClass = []; |
|
| 35 | + protected $validDoctrineObjectHydratorClass = [ ]; |
|
| 36 | 36 | |
| 37 | 37 | /** |
| 38 | 38 | * Сервис позволяющий получить ObjectManager по имени класса |
@@ -53,7 +53,7 @@ discard block |
||
| 53 | 53 | * |
| 54 | 54 | * @var array |
| 55 | 55 | */ |
| 56 | - protected $reflectionClassCache = []; |
|
| 56 | + protected $reflectionClassCache = [ ]; |
|
| 57 | 57 | |
| 58 | 58 | /** |
| 59 | 59 | * DoctrineObjectHydratorLocator constructor. |
@@ -81,7 +81,7 @@ discard block |
||
| 81 | 81 | throw new Exception\NotFoundDoctrineObjectHydratorException($errMsg); |
| 82 | 82 | } |
| 83 | 83 | |
| 84 | - return clone $this->prototype[$id]; |
|
| 84 | + return clone $this->prototype[ $id ]; |
|
| 85 | 85 | } |
| 86 | 86 | |
| 87 | 87 | /** |
@@ -94,12 +94,12 @@ discard block |
||
| 94 | 94 | public function has($id) |
| 95 | 95 | { |
| 96 | 96 | if (array_key_exists($id, $this->prototype)) { |
| 97 | - return false !== $this->prototype[$id]; |
|
| 97 | + return false !== $this->prototype[ $id ]; |
|
| 98 | 98 | } |
| 99 | 99 | |
| 100 | - $this->prototype[$id] = $this->buildDoctrineObjectHydratorPrototype($id); |
|
| 100 | + $this->prototype[ $id ] = $this->buildDoctrineObjectHydratorPrototype($id); |
|
| 101 | 101 | |
| 102 | - return false !== $this->prototype[$id]; |
|
| 102 | + return false !== $this->prototype[ $id ]; |
|
| 103 | 103 | } |
| 104 | 104 | |
| 105 | 105 | /** |
@@ -112,18 +112,18 @@ discard block |
||
| 112 | 112 | protected function buildDoctrineObjectHydratorPrototype($hydratorName) |
| 113 | 113 | { |
| 114 | 114 | if (!class_exists($hydratorName)) { |
| 115 | - $this->prototype[$hydratorName] = false; |
|
| 115 | + $this->prototype[ $hydratorName ] = false; |
|
| 116 | 116 | return false; |
| 117 | 117 | } |
| 118 | 118 | |
| 119 | 119 | if (!$this->isValidDoctrineObjectHydratorClass($hydratorName)) { |
| 120 | - $this->prototype[$hydratorName] = false; |
|
| 120 | + $this->prototype[ $hydratorName ] = false; |
|
| 121 | 121 | return false; |
| 122 | 122 | } |
| 123 | 123 | |
| 124 | 124 | $objectManagerAutoDetector = $this->getObjectManagerAutoDetector(); |
| 125 | 125 | if (false === $objectManagerAutoDetector->hasObjectManagerNameByClassName($hydratorName)) { |
| 126 | - $this->prototype[$hydratorName] = false; |
|
| 126 | + $this->prototype[ $hydratorName ] = false; |
|
| 127 | 127 | return false; |
| 128 | 128 | } |
| 129 | 129 | |
@@ -132,19 +132,19 @@ discard block |
||
| 132 | 132 | $doctrineObjectManager = $this->getDoctrineObjectManager(); |
| 133 | 133 | |
| 134 | 134 | if (false === $doctrineObjectManager->has($objectManagerName)) { |
| 135 | - $this->prototype[$hydratorName] = false; |
|
| 135 | + $this->prototype[ $hydratorName ] = false; |
|
| 136 | 136 | return false; |
| 137 | 137 | } |
| 138 | 138 | |
| 139 | 139 | /** @var ObjectManager $objectManager */ |
| 140 | 140 | $objectManager = $doctrineObjectManager->get($objectManagerName); |
| 141 | 141 | |
| 142 | - $r = array_key_exists($hydratorName, $this->reflectionClassCache) ? $this->reflectionClassCache[$hydratorName] : new ReflectionClass($hydratorName); |
|
| 142 | + $r = array_key_exists($hydratorName, $this->reflectionClassCache) ? $this->reflectionClassCache[ $hydratorName ] : new ReflectionClass($hydratorName); |
|
| 143 | 143 | |
| 144 | - $this->prototype[$hydratorName] = $r->newInstance($objectManager); |
|
| 144 | + $this->prototype[ $hydratorName ] = $r->newInstance($objectManager); |
|
| 145 | 145 | |
| 146 | 146 | |
| 147 | - return $this->prototype[$hydratorName]; |
|
| 147 | + return $this->prototype[ $hydratorName ]; |
|
| 148 | 148 | } |
| 149 | 149 | |
| 150 | 150 | /** |
@@ -157,18 +157,18 @@ discard block |
||
| 157 | 157 | public function isValidDoctrineObjectHydratorClass($hydratorClass) |
| 158 | 158 | { |
| 159 | 159 | if (array_key_exists($hydratorClass, $this->validDoctrineObjectHydratorClass)) { |
| 160 | - return $this->validDoctrineObjectHydratorClass[$hydratorClass]; |
|
| 160 | + return $this->validDoctrineObjectHydratorClass[ $hydratorClass ]; |
|
| 161 | 161 | } |
| 162 | 162 | |
| 163 | - $r = array_key_exists($hydratorClass, $this->reflectionClassCache) ? $this->reflectionClassCache[$hydratorClass] : new ReflectionClass($hydratorClass); |
|
| 163 | + $r = array_key_exists($hydratorClass, $this->reflectionClassCache) ? $this->reflectionClassCache[ $hydratorClass ] : new ReflectionClass($hydratorClass); |
|
| 164 | 164 | |
| 165 | 165 | if (!$r->isInstantiable()) { |
| 166 | - $this->validDoctrineObjectHydratorClass[$hydratorClass] = false; |
|
| 166 | + $this->validDoctrineObjectHydratorClass[ $hydratorClass ] = false; |
|
| 167 | 167 | return false; |
| 168 | 168 | } |
| 169 | 169 | |
| 170 | 170 | if (!$r->isSubclassOf(DoctrineObject::class)) { |
| 171 | - $this->validDoctrineObjectHydratorClass[$hydratorClass] = false; |
|
| 171 | + $this->validDoctrineObjectHydratorClass[ $hydratorClass ] = false; |
|
| 172 | 172 | return false; |
| 173 | 173 | } |
| 174 | 174 | |
@@ -192,7 +192,7 @@ discard block |
||
| 192 | 192 | } |
| 193 | 193 | |
| 194 | 194 | |
| 195 | - $this->validDoctrineObjectHydratorClass[$hydratorClass] = $isConstructorParamValid; |
|
| 195 | + $this->validDoctrineObjectHydratorClass[ $hydratorClass ] = $isConstructorParamValid; |
|
| 196 | 196 | |
| 197 | 197 | return true; |
| 198 | 198 | } |