@@ -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 | } |
@@ -190,7 +190,7 @@ discard block |
||
| 190 | 190 | /** |
| 191 | 191 | * @param $className |
| 192 | 192 | * |
| 193 | - * @return bool |
|
| 193 | + * @return boolean|string |
|
| 194 | 194 | */ |
| 195 | 195 | public function hasDiscriminatorValue($className) |
| 196 | 196 | { |
@@ -226,7 +226,7 @@ discard block |
||
| 226 | 226 | * |
| 227 | 227 | * @param $className |
| 228 | 228 | * |
| 229 | - * @return bool|string |
|
| 229 | + * @return false|string |
|
| 230 | 230 | */ |
| 231 | 231 | public function buildDiscriminatorValueMap($className) |
| 232 | 232 | { |
@@ -1,8 +1,8 @@ |
||
| 1 | 1 | <?php |
| 2 | 2 | /** |
| 3 | - * @link https://github.com/nnx-framework/doctrine |
|
| 4 | - * @author Malofeykin Andrey <[email protected]> |
|
| 5 | - */ |
|
| 3 | + * @link https://github.com/nnx-framework/doctrine |
|
| 4 | + * @author Malofeykin Andrey <[email protected]> |
|
| 5 | + */ |
|
| 6 | 6 | namespace Nnx\Doctrine; |
| 7 | 7 | |
| 8 | 8 | use Nnx\Doctrine\ObjectManager\DoctrineObjectManager; |
@@ -44,14 +44,14 @@ discard block |
||
| 44 | 44 | * |
| 45 | 45 | * @var array |
| 46 | 46 | */ |
| 47 | - protected $entityManagerAllClassNames = []; |
|
| 47 | + protected $entityManagerAllClassNames = [ ]; |
|
| 48 | 48 | |
| 49 | 49 | /** |
| 50 | 50 | * Ключем является имя класса, а значением discriminatorValue, взятое из методанных |
| 51 | 51 | * |
| 52 | 52 | * @var array |
| 53 | 53 | */ |
| 54 | - protected $discriminatorValueMap = []; |
|
| 54 | + protected $discriminatorValueMap = [ ]; |
|
| 55 | 55 | |
| 56 | 56 | /** |
| 57 | 57 | * DiscriminatorEntryListener constructor. |
@@ -87,7 +87,7 @@ discard block |
||
| 87 | 87 | protected function init() |
| 88 | 88 | { |
| 89 | 89 | try { |
| 90 | - AnnotationRegistry::registerLoader(function ($class) { |
|
| 90 | + AnnotationRegistry::registerLoader(function($class) { |
|
| 91 | 91 | return (bool) class_exists($class); |
| 92 | 92 | }); |
| 93 | 93 | } catch (\Exception $e) { |
@@ -134,14 +134,14 @@ discard block |
||
| 134 | 134 | * @throws Exception\DuplicateDiscriminatorMapEntryException |
| 135 | 135 | * @throws \Doctrine\ORM\Mapping\MappingException |
| 136 | 136 | */ |
| 137 | - public function buildDiscriminatorMapRootEntity(ClassMetadataInfo $classMetadata, array $allClassNames = []) |
|
| 137 | + public function buildDiscriminatorMapRootEntity(ClassMetadataInfo $classMetadata, array $allClassNames = [ ]) |
|
| 138 | 138 | { |
| 139 | 139 | foreach ($allClassNames as $className) { |
| 140 | 140 | if (is_subclass_of($className, $classMetadata->name) && $this->hasDiscriminatorValue($className)) { |
| 141 | 141 | $discriminatorValue = $this->getDiscriminatorValue($className); |
| 142 | 142 | |
| 143 | 143 | if (array_key_exists($discriminatorValue, $classMetadata->discriminatorMap)) { |
| 144 | - $errMsg = sprintf('Found duplicate discriminator map entry \'%s\' in %s', $discriminatorValue, $className); |
|
| 144 | + $errMsg = sprintf('Found duplicate discriminator map entry \'%s\' in %s', $discriminatorValue, $className); |
|
| 145 | 145 | throw new Exception\DuplicateDiscriminatorMapEntryException($errMsg); |
| 146 | 146 | } |
| 147 | 147 | $classMetadata->addDiscriminatorMapClass($discriminatorValue, $className); |
@@ -179,12 +179,12 @@ discard block |
||
| 179 | 179 | { |
| 180 | 180 | $hash = spl_object_hash($em); |
| 181 | 181 | if (array_key_exists($hash, $this->entityManagerAllClassNames)) { |
| 182 | - return $this->entityManagerAllClassNames[$hash]; |
|
| 182 | + return $this->entityManagerAllClassNames[ $hash ]; |
|
| 183 | 183 | } |
| 184 | 184 | |
| 185 | - $this->entityManagerAllClassNames[$hash] = $em->getConfiguration()->getMetadataDriverImpl()->getAllClassNames(); |
|
| 185 | + $this->entityManagerAllClassNames[ $hash ] = $em->getConfiguration()->getMetadataDriverImpl()->getAllClassNames(); |
|
| 186 | 186 | |
| 187 | - return $this->entityManagerAllClassNames[$hash]; |
|
| 187 | + return $this->entityManagerAllClassNames[ $hash ]; |
|
| 188 | 188 | } |
| 189 | 189 | |
| 190 | 190 | /** |
@@ -195,11 +195,11 @@ discard block |
||
| 195 | 195 | public function hasDiscriminatorValue($className) |
| 196 | 196 | { |
| 197 | 197 | if (array_key_exists($className, $this->discriminatorValueMap)) { |
| 198 | - return false !== $this->discriminatorValueMap[$className]; |
|
| 198 | + return false !== $this->discriminatorValueMap[ $className ]; |
|
| 199 | 199 | } |
| 200 | - $this->discriminatorValueMap[$className] = $this->buildDiscriminatorValueMap($className); |
|
| 200 | + $this->discriminatorValueMap[ $className ] = $this->buildDiscriminatorValueMap($className); |
|
| 201 | 201 | |
| 202 | - return $this->discriminatorValueMap[$className]; |
|
| 202 | + return $this->discriminatorValueMap[ $className ]; |
|
| 203 | 203 | } |
| 204 | 204 | |
| 205 | 205 | /** |
@@ -218,7 +218,7 @@ discard block |
||
| 218 | 218 | throw new Exception\DiscriminatorValueNotFoundException($errMsg); |
| 219 | 219 | } |
| 220 | 220 | |
| 221 | - return $this->discriminatorValueMap[$className]; |
|
| 221 | + return $this->discriminatorValueMap[ $className ]; |
|
| 222 | 222 | } |
| 223 | 223 | |
| 224 | 224 | /** |
@@ -1,8 +1,8 @@ |
||
| 1 | 1 | <?php |
| 2 | 2 | /** |
| 3 | - * @link https://github.com/nnx-framework/doctrine |
|
| 4 | - * @author Malofeykin Andrey <[email protected]> |
|
| 5 | - */ |
|
| 3 | + * @link https://github.com/nnx-framework/doctrine |
|
| 4 | + * @author Malofeykin Andrey <[email protected]> |
|
| 5 | + */ |
|
| 6 | 6 | namespace Nnx\Doctrine; |
| 7 | 7 | |
| 8 | 8 | use Nnx\Doctrine\ObjectManager\DoctrineObjectManager; |
@@ -1,8 +1,8 @@ |
||
| 1 | 1 | <?php |
| 2 | 2 | /** |
| 3 | - * @link https://github.com/nnx-framework/doctrine |
|
| 4 | - * @author Malofeykin Andrey <[email protected]> |
|
| 5 | - */ |
|
| 3 | + * @link https://github.com/nnx-framework/doctrine |
|
| 4 | + * @author Malofeykin Andrey <[email protected]> |
|
| 5 | + */ |
|
| 6 | 6 | namespace Nnx\Doctrine; |
| 7 | 7 | |
| 8 | 8 | use Nnx\Doctrine\ObjectManager\DoctrineObjectManager; |
@@ -1,8 +1,8 @@ |
||
| 1 | 1 | <?php |
| 2 | 2 | /** |
| 3 | - * @link https://github.com/nnx-framework/doctrine |
|
| 4 | - * @author Malofeykin Andrey <[email protected]> |
|
| 5 | - */ |
|
| 3 | + * @link https://github.com/nnx-framework/doctrine |
|
| 4 | + * @author Malofeykin Andrey <[email protected]> |
|
| 5 | + */ |
|
| 6 | 6 | namespace Nnx\Doctrine; |
| 7 | 7 | |
| 8 | 8 | use Nnx\Doctrine\ObjectManager\DoctrineObjectManager; |
@@ -1,8 +1,8 @@ |
||
| 1 | 1 | <?php |
| 2 | 2 | /** |
| 3 | - * @link https://github.com/nnx-framework/doctrine |
|
| 4 | - * @author Malofeykin Andrey <[email protected]> |
|
| 5 | - */ |
|
| 3 | + * @link https://github.com/nnx-framework/doctrine |
|
| 4 | + * @author Malofeykin Andrey <[email protected]> |
|
| 5 | + */ |
|
| 6 | 6 | namespace Nnx\Doctrine; |
| 7 | 7 | |
| 8 | 8 | use Nnx\Doctrine\ObjectManager\DoctrineObjectManager; |
@@ -1,8 +1,8 @@ |
||
| 1 | 1 | <?php |
| 2 | 2 | /** |
| 3 | - * @link https://github.com/nnx-framework/doctrine |
|
| 4 | - * @author Malofeykin Andrey <[email protected]> |
|
| 5 | - */ |
|
| 3 | + * @link https://github.com/nnx-framework/doctrine |
|
| 4 | + * @author Malofeykin Andrey <[email protected]> |
|
| 5 | + */ |
|
| 6 | 6 | namespace Nnx\Doctrine; |
| 7 | 7 | |
| 8 | 8 | use Nnx\Doctrine\ObjectManager\DoctrineObjectManager; |
@@ -1,8 +1,8 @@ |
||
| 1 | 1 | <?php |
| 2 | 2 | /** |
| 3 | - * @link https://github.com/nnx-framework/doctrine |
|
| 4 | - * @author Malofeykin Andrey <[email protected]> |
|
| 5 | - */ |
|
| 3 | + * @link https://github.com/nnx-framework/doctrine |
|
| 4 | + * @author Malofeykin Andrey <[email protected]> |
|
| 5 | + */ |
|
| 6 | 6 | namespace Nnx\Doctrine; |
| 7 | 7 | |
| 8 | 8 | use Nnx\Doctrine\ObjectManager\DoctrineObjectManager; |
@@ -1,8 +1,8 @@ |
||
| 1 | 1 | <?php |
| 2 | 2 | /** |
| 3 | - * @link https://github.com/nnx-framework/doctrine |
|
| 4 | - * @author Malofeykin Andrey <[email protected]> |
|
| 5 | - */ |
|
| 3 | + * @link https://github.com/nnx-framework/doctrine |
|
| 4 | + * @author Malofeykin Andrey <[email protected]> |
|
| 5 | + */ |
|
| 6 | 6 | namespace Nnx\Doctrine; |
| 7 | 7 | |
| 8 | 8 | use Nnx\Doctrine\ObjectManager\DoctrineObjectManager; |