@@ -31,7 +31,7 @@ |
||
| 31 | 31 | |
| 32 | 32 | /** @var array $appConfig */ |
| 33 | 33 | $appConfig = $appServiceLocator->get('config'); |
| 34 | - $moduleConfig = array_key_exists(Module::CONFIG_KEY, $appConfig) ? $appConfig[Module::CONFIG_KEY] : []; |
|
| 34 | + $moduleConfig = array_key_exists(Module::CONFIG_KEY, $appConfig) ? $appConfig[ Module::CONFIG_KEY ] : [ ]; |
|
| 35 | 35 | |
| 36 | 36 | return new ModuleOptions($moduleConfig); |
| 37 | 37 | } |
@@ -26,7 +26,7 @@ discard block |
||
| 26 | 26 | * |
| 27 | 27 | * @var array |
| 28 | 28 | */ |
| 29 | - protected $classNameToObjectManagerName = []; |
|
| 29 | + protected $classNameToObjectManagerName = [ ]; |
|
| 30 | 30 | |
| 31 | 31 | /** |
| 32 | 32 | * ObjectManagerAutoDetector constructor. |
@@ -54,7 +54,7 @@ discard block |
||
| 54 | 54 | throw new Exception\ErrorBuildObjectManagerNameException($errMsg); |
| 55 | 55 | } |
| 56 | 56 | |
| 57 | - return $this->classNameToObjectManagerName[$className]; |
|
| 57 | + return $this->classNameToObjectManagerName[ $className ]; |
|
| 58 | 58 | } |
| 59 | 59 | |
| 60 | 60 | |
@@ -69,31 +69,31 @@ discard block |
||
| 69 | 69 | public function hasObjectManagerNameByClassName($className) |
| 70 | 70 | { |
| 71 | 71 | if (array_key_exists($className, $this->classNameToObjectManagerName)) { |
| 72 | - return false !== $this->classNameToObjectManagerName[$className]; |
|
| 72 | + return false !== $this->classNameToObjectManagerName[ $className ]; |
|
| 73 | 73 | } |
| 74 | 74 | |
| 75 | - $moduleOptionsManager = $this->getModuleOptionsManager(); |
|
| 75 | + $moduleOptionsManager = $this->getModuleOptionsManager(); |
|
| 76 | 76 | if (!$moduleOptionsManager->hasOptionsByClassName($className)) { |
| 77 | - $this->classNameToObjectManagerName[$className] = false; |
|
| 77 | + $this->classNameToObjectManagerName[ $className ] = false; |
|
| 78 | 78 | return false; |
| 79 | 79 | } |
| 80 | 80 | |
| 81 | 81 | $moduleOptions = $moduleOptionsManager->getOptionsByClassName($className); |
| 82 | 82 | |
| 83 | 83 | if (!$moduleOptions instanceof ObjectManagerNameProviderInterface) { |
| 84 | - $this->classNameToObjectManagerName[$className] = false; |
|
| 84 | + $this->classNameToObjectManagerName[ $className ] = false; |
|
| 85 | 85 | return false; |
| 86 | 86 | } |
| 87 | 87 | |
| 88 | 88 | $objectManagerName = $moduleOptions->getObjectManagerName(); |
| 89 | 89 | |
| 90 | 90 | if (!is_string($objectManagerName)) { |
| 91 | - $this->classNameToObjectManagerName[$className] = false; |
|
| 91 | + $this->classNameToObjectManagerName[ $className ] = false; |
|
| 92 | 92 | return false; |
| 93 | 93 | } |
| 94 | - $this->classNameToObjectManagerName[$className] = $objectManagerName; |
|
| 94 | + $this->classNameToObjectManagerName[ $className ] = $objectManagerName; |
|
| 95 | 95 | |
| 96 | - return false !== $this->classNameToObjectManagerName[$className]; |
|
| 96 | + return false !== $this->classNameToObjectManagerName[ $className ]; |
|
| 97 | 97 | } |
| 98 | 98 | |
| 99 | 99 | |
@@ -30,7 +30,7 @@ |
||
| 30 | 30 | { |
| 31 | 31 | /** @var array $appConfig */ |
| 32 | 32 | $appConfig = $serviceLocator->get('config'); |
| 33 | - $doctrineConfig = array_key_exists('doctrine', $appConfig) ? $appConfig['doctrine'] : []; |
|
| 33 | + $doctrineConfig = array_key_exists('doctrine', $appConfig) ? $appConfig[ 'doctrine' ] : [ ]; |
|
| 34 | 34 | |
| 35 | 35 | /** @var ModuleOptionsPluginManagerInterface $moduleOptionsManager */ |
| 36 | 36 | $moduleOptionsManager = $serviceLocator->get(ModuleOptionsPluginManagerInterface::class); |
@@ -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 | } |
@@ -77,12 +77,12 @@ discard block |
||
| 77 | 77 | |
| 78 | 78 | $listEntityInterfaces = $this->buildListEntityInterfaces($entityClassNames); |
| 79 | 79 | |
| 80 | - $map = []; |
|
| 80 | + $map = [ ]; |
|
| 81 | 81 | |
| 82 | 82 | $entityManager = $this->getEntityManager(); |
| 83 | 83 | foreach ($listEntityInterfaces as $currentInterface) { |
| 84 | 84 | if ($entityManager->hasEntityClassByInterface($currentInterface)) { |
| 85 | - $map[$currentInterface] = $entityManager->getEntityClassByInterface($currentInterface); |
|
| 85 | + $map[ $currentInterface ] = $entityManager->getEntityClassByInterface($currentInterface); |
|
| 86 | 86 | } |
| 87 | 87 | } |
| 88 | 88 | |
@@ -96,9 +96,9 @@ discard block |
||
| 96 | 96 | * |
| 97 | 97 | * @return array |
| 98 | 98 | */ |
| 99 | - public function buildListEntityInterfaces(array $entityClassNames = []) |
|
| 99 | + public function buildListEntityInterfaces(array $entityClassNames = [ ]) |
|
| 100 | 100 | { |
| 101 | - $listEntityInterfaces = []; |
|
| 101 | + $listEntityInterfaces = [ ]; |
|
| 102 | 102 | |
| 103 | 103 | $moduleOptionsManager = $this->getModuleOptionsPluginManager(); |
| 104 | 104 | $allowedModules = $this->getAllowedModules($entityClassNames); |
@@ -110,7 +110,7 @@ discard block |
||
| 110 | 110 | if ($moduleOptionsManager->hasModuleNameByClassName($currentInterface)) { |
| 111 | 111 | $moduleNameByInterface = $moduleOptionsManager->getModuleNameByClassName($currentInterface); |
| 112 | 112 | if (array_key_exists($moduleNameByInterface, $allowedModules)) { |
| 113 | - $listEntityInterfaces[$currentInterface] = $currentInterface; |
|
| 113 | + $listEntityInterfaces[ $currentInterface ] = $currentInterface; |
|
| 114 | 114 | } |
| 115 | 115 | } |
| 116 | 116 | } |
@@ -126,14 +126,14 @@ discard block |
||
| 126 | 126 | * |
| 127 | 127 | * @return array |
| 128 | 128 | */ |
| 129 | - public function getAllowedModules(array $entityClassNames = []) |
|
| 129 | + public function getAllowedModules(array $entityClassNames = [ ]) |
|
| 130 | 130 | { |
| 131 | 131 | $moduleOptionsManager = $this->getModuleOptionsPluginManager(); |
| 132 | - $allowedModules = []; |
|
| 132 | + $allowedModules = [ ]; |
|
| 133 | 133 | foreach ($entityClassNames as $entityClassName) { |
| 134 | 134 | if ($moduleOptionsManager->hasModuleNameByClassName($entityClassName)) { |
| 135 | 135 | $moduleName = $moduleOptionsManager->getModuleNameByClassName($entityClassName); |
| 136 | - $allowedModules[$moduleName] = $moduleName; |
|
| 136 | + $allowedModules[ $moduleName ] = $moduleName; |
|
| 137 | 137 | } |
| 138 | 138 | } |
| 139 | 139 | |
@@ -157,11 +157,11 @@ discard block |
||
| 157 | 157 | |
| 158 | 158 | $allMetadata = $objectManager->getMetadataFactory()->getAllMetadata(); |
| 159 | 159 | |
| 160 | - $entityClassNames = []; |
|
| 160 | + $entityClassNames = [ ]; |
|
| 161 | 161 | foreach ($allMetadata as $classMetadata) { |
| 162 | 162 | if ($classMetadata instanceof ClassMetadata) { |
| 163 | 163 | $entityClassName = $classMetadata->getName(); |
| 164 | - $entityClassNames[$entityClassName] = $entityClassName; |
|
| 164 | + $entityClassNames[ $entityClassName ] = $entityClassName; |
|
| 165 | 165 | } |
| 166 | 166 | } |
| 167 | 167 | |
@@ -26,7 +26,7 @@ discard block |
||
| 26 | 26 | * |
| 27 | 27 | * @var array |
| 28 | 28 | */ |
| 29 | - protected $prototype = []; |
|
| 29 | + protected $prototype = [ ]; |
|
| 30 | 30 | |
| 31 | 31 | /** |
| 32 | 32 | * Флаг определяет была ли инициированна фабрика |
@@ -47,7 +47,7 @@ discard block |
||
| 47 | 47 | * |
| 48 | 48 | * @var array |
| 49 | 49 | */ |
| 50 | - protected $objectManagerToEntityMap = []; |
|
| 50 | + protected $objectManagerToEntityMap = [ ]; |
|
| 51 | 51 | |
| 52 | 52 | /** |
| 53 | 53 | * Колличество ObjectManagers для которых есть EntityMap |
@@ -61,14 +61,14 @@ discard block |
||
| 61 | 61 | * |
| 62 | 62 | * @var array |
| 63 | 63 | */ |
| 64 | - protected $baseEntityMap = []; |
|
| 64 | + protected $baseEntityMap = [ ]; |
|
| 65 | 65 | |
| 66 | 66 | /** |
| 67 | 67 | * Ключем является имя интерфейса, а значением имя класса сущности |
| 68 | 68 | * |
| 69 | 69 | * @var array |
| 70 | 70 | */ |
| 71 | - protected $interfaceNameToClassName = []; |
|
| 71 | + protected $interfaceNameToClassName = [ ]; |
|
| 72 | 72 | |
| 73 | 73 | /** |
| 74 | 74 | * @inheritdoc |
@@ -85,7 +85,7 @@ discard block |
||
| 85 | 85 | { |
| 86 | 86 | $this->init($serviceLocator); |
| 87 | 87 | if (array_key_exists($requestedName, $this->prototype)) { |
| 88 | - return false !== $this->prototype[$requestedName]; |
|
| 88 | + return false !== $this->prototype[ $requestedName ]; |
|
| 89 | 89 | } |
| 90 | 90 | |
| 91 | 91 | return false !== $this->getClassNameByInterface($requestedName); |
@@ -101,25 +101,25 @@ discard block |
||
| 101 | 101 | protected function getClassNameByInterface($interfaceName) |
| 102 | 102 | { |
| 103 | 103 | if (array_key_exists($interfaceName, $this->interfaceNameToClassName)) { |
| 104 | - return $this->interfaceNameToClassName[$interfaceName]; |
|
| 104 | + return $this->interfaceNameToClassName[ $interfaceName ]; |
|
| 105 | 105 | } |
| 106 | 106 | |
| 107 | 107 | if (0 === $this->countObjectManagers) { |
| 108 | - $this->interfaceNameToClassName[$interfaceName] = false; |
|
| 108 | + $this->interfaceNameToClassName[ $interfaceName ] = false; |
|
| 109 | 109 | return false; |
| 110 | 110 | } elseif (1 === $this->countObjectManagers) { |
| 111 | - $this->interfaceNameToClassName[$interfaceName] = array_key_exists($interfaceName, $this->baseEntityMap) ? $this->baseEntityMap[$interfaceName] : false; |
|
| 112 | - return $this->interfaceNameToClassName[$interfaceName]; |
|
| 111 | + $this->interfaceNameToClassName[ $interfaceName ] = array_key_exists($interfaceName, $this->baseEntityMap) ? $this->baseEntityMap[ $interfaceName ] : false; |
|
| 112 | + return $this->interfaceNameToClassName[ $interfaceName ]; |
|
| 113 | 113 | } |
| 114 | 114 | |
| 115 | 115 | foreach ($this->objectManagerToEntityMap as $entityMap) { |
| 116 | 116 | if (array_key_exists($interfaceName, $entityMap)) { |
| 117 | - $this->interfaceNameToClassName[$interfaceName] = $entityMap[$interfaceName]; |
|
| 118 | - return $this->interfaceNameToClassName[$interfaceName]; |
|
| 117 | + $this->interfaceNameToClassName[ $interfaceName ] = $entityMap[ $interfaceName ]; |
|
| 118 | + return $this->interfaceNameToClassName[ $interfaceName ]; |
|
| 119 | 119 | } |
| 120 | 120 | } |
| 121 | - $this->interfaceNameToClassName[$interfaceName] = false; |
|
| 122 | - return $this->interfaceNameToClassName[$interfaceName]; |
|
| 121 | + $this->interfaceNameToClassName[ $interfaceName ] = false; |
|
| 122 | + return $this->interfaceNameToClassName[ $interfaceName ]; |
|
| 123 | 123 | } |
| 124 | 124 | |
| 125 | 125 | /** |
@@ -139,11 +139,11 @@ discard block |
||
| 139 | 139 | $this->init($serviceLocator); |
| 140 | 140 | |
| 141 | 141 | if (array_key_exists($requestedName, $this->prototype)) { |
| 142 | - if (!is_object($this->prototype[$requestedName])) { |
|
| 142 | + if (!is_object($this->prototype[ $requestedName ])) { |
|
| 143 | 143 | $errMsg = sprintf('Invalid prototype for %s', $requestedName); |
| 144 | 144 | throw new Exception\RuntimeException($errMsg); |
| 145 | 145 | } |
| 146 | - return clone $this->prototype[$requestedName]; |
|
| 146 | + return clone $this->prototype[ $requestedName ]; |
|
| 147 | 147 | } |
| 148 | 148 | |
| 149 | 149 | $className = $this->getClassNameByInterface($requestedName); |
@@ -158,7 +158,7 @@ discard block |
||
| 158 | 158 | $r = new ReflectionClass($className); |
| 159 | 159 | $entity = $r->newInstance(); |
| 160 | 160 | } |
| 161 | - $this->prototype[$requestedName] = $entity; |
|
| 161 | + $this->prototype[ $requestedName ] = $entity; |
|
| 162 | 162 | |
| 163 | 163 | return $entity; |
| 164 | 164 | } |
@@ -196,7 +196,7 @@ discard block |
||
| 196 | 196 | $entityMapCache = $appServiceLocator->get(EntityMapCacheInterface::class); |
| 197 | 197 | foreach ($listObjectManagerName as $objectManagerName) { |
| 198 | 198 | if ($entityMapCache->hasEntityMap($objectManagerName)) { |
| 199 | - $this->objectManagerToEntityMap[$objectManagerName] = $entityMapCache->loadEntityMap($objectManagerName); |
|
| 199 | + $this->objectManagerToEntityMap[ $objectManagerName ] = $entityMapCache->loadEntityMap($objectManagerName); |
|
| 200 | 200 | } |
| 201 | 201 | } |
| 202 | 202 | |
@@ -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 | } |
@@ -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 | /** |