@@ -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; |
@@ -43,14 +43,14 @@ discard block |
||
| 43 | 43 | * |
| 44 | 44 | * @var array |
| 45 | 45 | */ |
| 46 | - protected $entityManagerAllClassNames = []; |
|
| 46 | + protected $entityManagerAllClassNames = [ ]; |
|
| 47 | 47 | |
| 48 | 48 | /** |
| 49 | 49 | * Ключем является имя класса, а значением discriminatorValue, взятое из методанных |
| 50 | 50 | * |
| 51 | 51 | * @var array |
| 52 | 52 | */ |
| 53 | - protected $discriminatorValueMap = []; |
|
| 53 | + protected $discriminatorValueMap = [ ]; |
|
| 54 | 54 | |
| 55 | 55 | /** |
| 56 | 56 | * DiscriminatorEntryListener constructor. |
@@ -86,7 +86,7 @@ discard block |
||
| 86 | 86 | protected function init() |
| 87 | 87 | { |
| 88 | 88 | try { |
| 89 | - AnnotationRegistry::registerLoader(function ($class) { |
|
| 89 | + AnnotationRegistry::registerLoader(function($class) { |
|
| 90 | 90 | return (bool) class_exists($class); |
| 91 | 91 | }); |
| 92 | 92 | } catch (\Exception $e) { |
@@ -123,7 +123,7 @@ discard block |
||
| 123 | 123 | $rootEntityMetadata = $eventArgs->getEntityManager()->getClassMetadata($classMetadata->rootEntityName); |
| 124 | 124 | |
| 125 | 125 | if (array_key_exists($discriminatorValue, $rootEntityMetadata->discriminatorMap)) { |
| 126 | - $errMsg = sprintf('Found duplicate discriminator map entry \'%s\' in %s', $discriminatorValue, $classMetadata->name); |
|
| 126 | + $errMsg = sprintf('Found duplicate discriminator map entry \'%s\' in %s', $discriminatorValue, $classMetadata->name); |
|
| 127 | 127 | throw new Exception\DuplicateDiscriminatorMapEntryException($errMsg); |
| 128 | 128 | } |
| 129 | 129 | |
@@ -139,11 +139,11 @@ discard block |
||
| 139 | 139 | public function hasDiscriminatorValue($className) |
| 140 | 140 | { |
| 141 | 141 | if (array_key_exists($className, $this->discriminatorValueMap)) { |
| 142 | - return false !== $this->discriminatorValueMap[$className]; |
|
| 142 | + return false !== $this->discriminatorValueMap[ $className ]; |
|
| 143 | 143 | } |
| 144 | - $this->discriminatorValueMap[$className] = $this->buildDiscriminatorValueMap($className); |
|
| 144 | + $this->discriminatorValueMap[ $className ] = $this->buildDiscriminatorValueMap($className); |
|
| 145 | 145 | |
| 146 | - return $this->discriminatorValueMap[$className]; |
|
| 146 | + return $this->discriminatorValueMap[ $className ]; |
|
| 147 | 147 | } |
| 148 | 148 | |
| 149 | 149 | /** |
@@ -162,7 +162,7 @@ discard block |
||
| 162 | 162 | throw new Exception\DiscriminatorValueNotFoundException($errMsg); |
| 163 | 163 | } |
| 164 | 164 | |
| 165 | - return $this->discriminatorValueMap[$className]; |
|
| 165 | + return $this->discriminatorValueMap[ $className ]; |
|
| 166 | 166 | } |
| 167 | 167 | |
| 168 | 168 | /** |