@@ -19,16 +19,16 @@ |
||
| 19 | 19 | public function providerParameterTypeInferer() |
| 20 | 20 | { |
| 21 | 21 | $data = [ |
| 22 | - [1, Type::INTEGER], |
|
| 23 | - ['bar', ParameterType::STRING], |
|
| 24 | - ['1', ParameterType::STRING], |
|
| 25 | - [new DateTime(), Type::DATETIME], |
|
| 22 | + [1, Type::INTEGER], |
|
| 23 | + ['bar', ParameterType::STRING], |
|
| 24 | + ['1', ParameterType::STRING], |
|
| 25 | + [new DateTime(), Type::DATETIME], |
|
| 26 | 26 | [new DateInterval('P1D'), Type::DATEINTERVAL], |
| 27 | - [[2], Connection::PARAM_INT_ARRAY], |
|
| 28 | - [['foo'], Connection::PARAM_STR_ARRAY], |
|
| 29 | - [['1','2'], Connection::PARAM_STR_ARRAY], |
|
| 30 | - [[], Connection::PARAM_STR_ARRAY], |
|
| 31 | - [true, Type::BOOLEAN], |
|
| 27 | + [[2], Connection::PARAM_INT_ARRAY], |
|
| 28 | + [['foo'], Connection::PARAM_STR_ARRAY], |
|
| 29 | + [['1', '2'], Connection::PARAM_STR_ARRAY], |
|
| 30 | + [[], Connection::PARAM_STR_ARRAY], |
|
| 31 | + [true, Type::BOOLEAN], |
|
| 32 | 32 | ]; |
| 33 | 33 | |
| 34 | 34 | if (PHP_VERSION_ID >= 50500) { |
@@ -59,7 +59,7 @@ discard block |
||
| 59 | 59 | |
| 60 | 60 | protected function createRegion() |
| 61 | 61 | { |
| 62 | - $this->directory = sys_get_temp_dir() . '/doctrine_lock_' . uniqid(); |
|
| 62 | + $this->directory = sys_get_temp_dir().'/doctrine_lock_'.uniqid(); |
|
| 63 | 63 | |
| 64 | 64 | $region = new DefaultRegion('concurren_region_test', $this->cache); |
| 65 | 65 | |
@@ -262,7 +262,7 @@ discard block |
||
| 262 | 262 | $reflectionDirectory->setAccessible(true); |
| 263 | 263 | $reflectionDirectory->setValue($region, str_repeat('a', 10000)); |
| 264 | 264 | |
| 265 | - set_error_handler(static function () { |
|
| 265 | + set_error_handler(static function() { |
|
| 266 | 266 | }, E_WARNING); |
| 267 | 267 | self::assertTrue($region->evictAll()); |
| 268 | 268 | restore_error_handler(); |
@@ -275,7 +275,7 @@ discard block |
||
| 275 | 275 | { |
| 276 | 276 | $path = $path ?: $this->directory; |
| 277 | 277 | |
| 278 | - if (! is_dir($path)) { |
|
| 278 | + if ( ! is_dir($path)) { |
|
| 279 | 279 | return; |
| 280 | 280 | } |
| 281 | 281 | |
@@ -173,7 +173,7 @@ discard block |
||
| 173 | 173 | ->expects(self::once()) |
| 174 | 174 | ->method('loadCollection') |
| 175 | 175 | ->with($this->collection) |
| 176 | - ->willReturnCallback(static function (PersistentCollection $persistentCollection) use ($persistedElement) : void { |
|
| 176 | + ->willReturnCallback(static function(PersistentCollection $persistentCollection) use ($persistedElement) : void { |
|
| 177 | 177 | $persistentCollection->unwrap()->add($persistedElement); |
| 178 | 178 | }); |
| 179 | 179 | |
@@ -210,7 +210,7 @@ discard block |
||
| 210 | 210 | ->expects(self::once()) |
| 211 | 211 | ->method('loadCollection') |
| 212 | 212 | ->with($this->collection) |
| 213 | - ->willReturnCallback(static function (PersistentCollection $persistentCollection) use ( |
|
| 213 | + ->willReturnCallback(static function(PersistentCollection $persistentCollection) use ( |
|
| 214 | 214 | $persistedElement, |
| 215 | 215 | $newElementThatIsAlsoPersisted |
| 216 | 216 | ) : void { |
@@ -252,7 +252,7 @@ discard block |
||
| 252 | 252 | ->expects(self::once()) |
| 253 | 253 | ->method('loadCollection') |
| 254 | 254 | ->with($this->collection) |
| 255 | - ->willReturnCallback(static function (PersistentCollection $persistentCollection) use ( |
|
| 255 | + ->willReturnCallback(static function(PersistentCollection $persistentCollection) use ( |
|
| 256 | 256 | $persistedElement, |
| 257 | 257 | $newElementThatIsAlsoPersisted |
| 258 | 258 | ) : void { |
@@ -35,6 +35,6 @@ |
||
| 35 | 35 | |
| 36 | 36 | public function __toString() |
| 37 | 37 | { |
| 38 | - return self::class . '[id=' . $this->id . ']'; |
|
| 38 | + return self::class.'[id='.$this->id.']'; |
|
| 39 | 39 | } |
| 40 | 40 | } |
@@ -15,20 +15,20 @@ |
||
| 15 | 15 | error_reporting(E_ALL | E_STRICT); |
| 16 | 16 | date_default_timezone_set('UTC'); |
| 17 | 17 | |
| 18 | -if (file_exists(__DIR__ . '/../../../vendor/autoload.php')) { |
|
| 18 | +if (file_exists(__DIR__.'/../../../vendor/autoload.php')) { |
|
| 19 | 19 | // dependencies were installed via composer - this is the main project |
| 20 | - require __DIR__ . '/../../../vendor/autoload.php'; |
|
| 21 | -} elseif (file_exists(__DIR__ . '/../../../../../autoload.php')) { |
|
| 20 | + require __DIR__.'/../../../vendor/autoload.php'; |
|
| 21 | +} elseif (file_exists(__DIR__.'/../../../../../autoload.php')) { |
|
| 22 | 22 | // installed as a dependency in `vendor` |
| 23 | - require __DIR__ . '/../../../../../autoload.php'; |
|
| 23 | + require __DIR__.'/../../../../../autoload.php'; |
|
| 24 | 24 | } else { |
| 25 | 25 | throw new Exception('Can\'t find autoload.php. Did you install dependencies via composer?'); |
| 26 | 26 | } |
| 27 | 27 | |
| 28 | -if (! file_exists(__DIR__ . '/Proxies') && ! mkdir(__DIR__ . '/Proxies')) { |
|
| 29 | - throw new Exception('Could not create ' . __DIR__ . '/Proxies Folder.'); |
|
| 28 | +if ( ! file_exists(__DIR__.'/Proxies') && ! mkdir(__DIR__.'/Proxies')) { |
|
| 29 | + throw new Exception('Could not create '.__DIR__.'/Proxies Folder.'); |
|
| 30 | 30 | } |
| 31 | 31 | |
| 32 | -if (! file_exists(__DIR__ . '/ORM/Proxy/generated') && ! mkdir(__DIR__ . '/ORM/Proxy/generated')) { |
|
| 33 | - throw new Exception('Could not create ' . __DIR__ . '/ORM/Proxy/generated Folder.'); |
|
| 32 | +if ( ! file_exists(__DIR__.'/ORM/Proxy/generated') && ! mkdir(__DIR__.'/ORM/Proxy/generated')) { |
|
| 33 | + throw new Exception('Could not create '.__DIR__.'/ORM/Proxy/generated Folder.'); |
|
| 34 | 34 | } |
@@ -88,7 +88,7 @@ discard block |
||
| 88 | 88 | string $className, |
| 89 | 89 | ClassMetadataBuildingContext $metadataBuildingContext |
| 90 | 90 | ) : ?ClassMetadata { |
| 91 | - if (! $this->evm->hasListeners(Events::onClassMetadataNotFound)) { |
|
| 91 | + if ( ! $this->evm->hasListeners(Events::onClassMetadataNotFound)) { |
|
| 92 | 92 | return null; |
| 93 | 93 | } |
| 94 | 94 | |
@@ -149,7 +149,7 @@ discard block |
||
| 149 | 149 | $classMetadata->setCache(clone $parent->getCache()); |
| 150 | 150 | } |
| 151 | 151 | |
| 152 | - if (! empty($parent->entityListeners) && empty($classMetadata->entityListeners)) { |
|
| 152 | + if ( ! empty($parent->entityListeners) && empty($classMetadata->entityListeners)) { |
|
| 153 | 153 | $classMetadata->entityListeners = $parent->entityListeners; |
| 154 | 154 | } |
| 155 | 155 | } |
@@ -170,7 +170,7 @@ discard block |
||
| 170 | 170 | |
| 171 | 171 | protected function completeRuntimeMetadata(ClassMetadata $class, ?ClassMetadata $parent = null) : void |
| 172 | 172 | { |
| 173 | - if (! $parent || ! $parent->isMappedSuperclass) { |
|
| 173 | + if ( ! $parent || ! $parent->isMappedSuperclass) { |
|
| 174 | 174 | return; |
| 175 | 175 | } |
| 176 | 176 | |
@@ -188,7 +188,7 @@ discard block |
||
| 188 | 188 | continue; |
| 189 | 189 | } |
| 190 | 190 | |
| 191 | - if (! ($property instanceof ToOneAssociationMetadata)) { |
|
| 191 | + if ( ! ($property instanceof ToOneAssociationMetadata)) { |
|
| 192 | 192 | continue; |
| 193 | 193 | } |
| 194 | 194 | |
@@ -207,7 +207,7 @@ discard block |
||
| 207 | 207 | */ |
| 208 | 208 | protected function validateRuntimeMetadata(ClassMetadata $class, ?ClassMetadata $parent = null) : void |
| 209 | 209 | { |
| 210 | - if (! $class->getReflectionClass()) { |
|
| 210 | + if ( ! $class->getReflectionClass()) { |
|
| 211 | 211 | // only validate if there is a reflection class instance |
| 212 | 212 | return; |
| 213 | 213 | } |
@@ -217,13 +217,13 @@ discard block |
||
| 217 | 217 | $class->validateLifecycleCallbacks($this->getReflectionService()); |
| 218 | 218 | |
| 219 | 219 | // verify inheritance |
| 220 | - if (! $class->isMappedSuperclass && $class->inheritanceType !== InheritanceType::NONE) { |
|
| 221 | - if (! $parent) { |
|
| 222 | - if (! $class->discriminatorMap) { |
|
| 220 | + if ( ! $class->isMappedSuperclass && $class->inheritanceType !== InheritanceType::NONE) { |
|
| 221 | + if ( ! $parent) { |
|
| 222 | + if ( ! $class->discriminatorMap) { |
|
| 223 | 223 | throw MappingException::missingDiscriminatorMap($class->getClassName()); |
| 224 | 224 | } |
| 225 | 225 | |
| 226 | - if (! $class->discriminatorColumn) { |
|
| 226 | + if ( ! $class->discriminatorColumn) { |
|
| 227 | 227 | throw MappingException::missingDiscriminatorColumn($class->getClassName()); |
| 228 | 228 | } |
| 229 | 229 | } |
@@ -290,7 +290,7 @@ discard block |
||
| 290 | 290 | private function completeIdentifierGeneratorMappings(ClassMetadata $class) : void |
| 291 | 291 | { |
| 292 | 292 | foreach ($class->getDeclaredPropertiesIterator() as $property) { |
| 293 | - if (! $property instanceof FieldMetadata /*&& ! $property instanceof AssocationMetadata*/) { |
|
| 293 | + if ( ! $property instanceof FieldMetadata /*&& ! $property instanceof AssocationMetadata*/) { |
|
| 294 | 294 | continue; |
| 295 | 295 | } |
| 296 | 296 | |
@@ -300,7 +300,7 @@ discard block |
||
| 300 | 300 | |
| 301 | 301 | private function completeFieldIdentifierGeneratorMapping(FieldMetadata $field) |
| 302 | 302 | { |
| 303 | - if (! $field->hasValueGenerator()) { |
|
| 303 | + if ( ! $field->hasValueGenerator()) { |
|
| 304 | 304 | return; |
| 305 | 305 | } |
| 306 | 306 | |
@@ -352,10 +352,10 @@ discard block |
||
| 352 | 352 | |
| 353 | 353 | case GeneratorType::CUSTOM: |
| 354 | 354 | $definition = $generator->getDefinition(); |
| 355 | - if (! isset($definition['class'])) { |
|
| 355 | + if ( ! isset($definition['class'])) { |
|
| 356 | 356 | throw InvalidCustomGenerator::onClassNotConfigured(); |
| 357 | 357 | } |
| 358 | - if (! class_exists($definition['class'])) { |
|
| 358 | + if ( ! class_exists($definition['class'])) { |
|
| 359 | 359 | throw InvalidCustomGenerator::onMissingClass($definition); |
| 360 | 360 | } |
| 361 | 361 | |
@@ -388,7 +388,7 @@ discard block |
||
| 388 | 388 | |
| 389 | 389 | private function getTargetPlatform() : Platforms\AbstractPlatform |
| 390 | 390 | { |
| 391 | - if (! $this->targetPlatform) { |
|
| 391 | + if ( ! $this->targetPlatform) { |
|
| 392 | 392 | $this->targetPlatform = $this->em->getConnection()->getDatabasePlatform(); |
| 393 | 393 | } |
| 394 | 394 | |
@@ -143,8 +143,8 @@ discard block |
||
| 143 | 143 | ) { |
| 144 | 144 | $this->reverseEngineerMappingFromDatabase(); |
| 145 | 145 | |
| 146 | - if (! isset($this->classToTableNames[$className])) { |
|
| 147 | - throw new InvalidArgumentException('Unknown class ' . $className); |
|
| 146 | + if ( ! isset($this->classToTableNames[$className])) { |
|
| 147 | + throw new InvalidArgumentException('Unknown class '.$className); |
|
| 148 | 148 | } |
| 149 | 149 | |
| 150 | 150 | // @todo guilhermeblanco This should somehow disappear... =) |
@@ -174,7 +174,7 @@ discard block |
||
| 174 | 174 | } |
| 175 | 175 | } |
| 176 | 176 | |
| 177 | - if (! $otherFk) { |
|
| 177 | + if ( ! $otherFk) { |
|
| 178 | 178 | // the definition of this many to many table does not contain |
| 179 | 179 | // enough foreign key information to continue reverse engineering. |
| 180 | 180 | continue; |
@@ -255,9 +255,9 @@ discard block |
||
| 255 | 255 | $allForeignKeyColumns = array_merge($allForeignKeyColumns, $foreignKey->getLocalColumns()); |
| 256 | 256 | } |
| 257 | 257 | |
| 258 | - if (! $table->hasPrimaryKey()) { |
|
| 258 | + if ( ! $table->hasPrimaryKey()) { |
|
| 259 | 259 | throw new Mapping\MappingException( |
| 260 | - 'Table ' . $table->getName() . ' has no primary key. Doctrine does not ' . |
|
| 260 | + 'Table '.$table->getName().' has no primary key. Doctrine does not '. |
|
| 261 | 261 | "support reverse engineering from tables that don't have a primary key." |
| 262 | 262 | ); |
| 263 | 263 | } |
@@ -447,7 +447,7 @@ discard block |
||
| 447 | 447 | } |
| 448 | 448 | |
| 449 | 449 | // Here we need to check if $fkColumns are the same as $primaryKeys |
| 450 | - if (! array_diff($fkColumns, $primaryKeys)) { |
|
| 450 | + if ( ! array_diff($fkColumns, $primaryKeys)) { |
|
| 451 | 451 | $metadata->addProperty($associationMapping); |
| 452 | 452 | } else { |
| 453 | 453 | $metadata->addProperty($associationMapping); |
@@ -492,7 +492,7 @@ discard block |
||
| 492 | 492 | */ |
| 493 | 493 | private function getClassNameForTable($tableName) |
| 494 | 494 | { |
| 495 | - return $this->namespace . ( |
|
| 495 | + return $this->namespace.( |
|
| 496 | 496 | $this->classNamesForTables[$tableName] |
| 497 | 497 | ?? Inflector::classify(strtolower($tableName)) |
| 498 | 498 | ); |
@@ -305,8 +305,8 @@ discard block |
||
| 305 | 305 | |
| 306 | 306 | // FIXME: Order with composite keys might not be correct |
| 307 | 307 | $sql = 'SELECT ' . $columnName |
| 308 | - . ' FROM ' . $tableName |
|
| 309 | - . ' WHERE ' . implode(' = ? AND ', $identifier) . ' = ?'; |
|
| 308 | + . ' FROM ' . $tableName |
|
| 309 | + . ' WHERE ' . implode(' = ? AND ', $identifier) . ' = ?'; |
|
| 310 | 310 | |
| 311 | 311 | $flattenedId = $this->em->getIdentifierFlattener()->flattenIdentifier($versionedClass, $id); |
| 312 | 312 | $versionType = $versionProperty->getType(); |
@@ -519,8 +519,8 @@ discard block |
||
| 519 | 519 | } |
| 520 | 520 | |
| 521 | 521 | $sql = 'UPDATE ' . $quotedTableName |
| 522 | - . ' SET ' . implode(', ', $set) |
|
| 523 | - . ' WHERE ' . implode(' = ? AND ', $where) . ' = ?'; |
|
| 522 | + . ' SET ' . implode(', ', $set) |
|
| 523 | + . ' WHERE ' . implode(' = ? AND ', $where) . ' = ?'; |
|
| 524 | 524 | |
| 525 | 525 | $result = $this->conn->executeUpdate($sql, $params, $types); |
| 526 | 526 | |
@@ -1641,9 +1641,9 @@ discard block |
||
| 1641 | 1641 | $lock = $this->getLockTablesSql($lockMode); |
| 1642 | 1642 | $where = ($conditionSql ? ' WHERE ' . $conditionSql : '') . ' '; |
| 1643 | 1643 | $sql = 'SELECT 1 ' |
| 1644 | - . $lock |
|
| 1645 | - . $where |
|
| 1646 | - . $lockSql; |
|
| 1644 | + . $lock |
|
| 1645 | + . $where |
|
| 1646 | + . $lockSql; |
|
| 1647 | 1647 | |
| 1648 | 1648 | [$params, $types] = $this->expandParameters($criteria); |
| 1649 | 1649 | |
@@ -2112,8 +2112,8 @@ discard block |
||
| 2112 | 2112 | $alias = $this->getSQLTableAlias($this->class->getTableName()); |
| 2113 | 2113 | |
| 2114 | 2114 | $sql = 'SELECT 1 ' |
| 2115 | - . $this->getLockTablesSql(null) |
|
| 2116 | - . ' WHERE ' . $this->getSelectConditionSQL($criteria); |
|
| 2115 | + . $this->getLockTablesSql(null) |
|
| 2116 | + . ' WHERE ' . $this->getSelectConditionSQL($criteria); |
|
| 2117 | 2117 | |
| 2118 | 2118 | [$params, $types] = $this->expandParameters($criteria); |
| 2119 | 2119 | |
@@ -297,16 +297,16 @@ discard block |
||
| 297 | 297 | $tableName = $versionedClass->table->getQuotedQualifiedName($this->platform); |
| 298 | 298 | $columnName = $this->platform->quoteIdentifier($versionProperty->getColumnName()); |
| 299 | 299 | $identifier = array_map( |
| 300 | - function ($columnName) { |
|
| 300 | + function($columnName) { |
|
| 301 | 301 | return $this->platform->quoteIdentifier($columnName); |
| 302 | 302 | }, |
| 303 | 303 | array_keys($versionedClass->getIdentifierColumns($this->em)) |
| 304 | 304 | ); |
| 305 | 305 | |
| 306 | 306 | // FIXME: Order with composite keys might not be correct |
| 307 | - $sql = 'SELECT ' . $columnName |
|
| 308 | - . ' FROM ' . $tableName |
|
| 309 | - . ' WHERE ' . implode(' = ? AND ', $identifier) . ' = ?'; |
|
| 307 | + $sql = 'SELECT '.$columnName |
|
| 308 | + . ' FROM '.$tableName |
|
| 309 | + . ' WHERE '.implode(' = ? AND ', $identifier).' = ?'; |
|
| 310 | 310 | |
| 311 | 311 | $flattenedId = $this->em->getIdentifierFlattener()->flattenIdentifier($versionedClass, $id); |
| 312 | 312 | $versionType = $versionProperty->getType(); |
@@ -345,13 +345,13 @@ discard block |
||
| 345 | 345 | $tableName = $this->class->getTableName(); |
| 346 | 346 | $updateData = $this->prepareUpdateData($entity); |
| 347 | 347 | |
| 348 | - if (! isset($updateData[$tableName])) { |
|
| 348 | + if ( ! isset($updateData[$tableName])) { |
|
| 349 | 349 | return; |
| 350 | 350 | } |
| 351 | 351 | |
| 352 | 352 | $data = $updateData[$tableName]; |
| 353 | 353 | |
| 354 | - if (! $data) { |
|
| 354 | + if ( ! $data) { |
|
| 355 | 355 | return; |
| 356 | 356 | } |
| 357 | 357 | |
@@ -403,7 +403,7 @@ discard block |
||
| 403 | 403 | |
| 404 | 404 | if ($value !== null) { |
| 405 | 405 | // @todo guilhermeblanco Make sure we do not have flat association values. |
| 406 | - if (! is_array($value)) { |
|
| 406 | + if ( ! is_array($value)) { |
|
| 407 | 407 | $value = [$targetClass->identifier[0] => $value]; |
| 408 | 408 | } |
| 409 | 409 | |
@@ -416,7 +416,7 @@ discard block |
||
| 416 | 416 | $referencedColumnName = $joinColumn->getReferencedColumnName(); |
| 417 | 417 | $targetField = $targetClass->fieldNames[$referencedColumnName]; |
| 418 | 418 | |
| 419 | - if (! $joinColumn->getType()) { |
|
| 419 | + if ( ! $joinColumn->getType()) { |
|
| 420 | 420 | $joinColumn->setType(PersisterHelper::getTypeOfColumn($referencedColumnName, $targetClass, $this->em)); |
| 421 | 421 | } |
| 422 | 422 | |
@@ -482,7 +482,7 @@ discard block |
||
| 482 | 482 | $quotedColumnName = $this->platform->quoteIdentifier($joinColumn->getColumnName()); |
| 483 | 483 | $referencedColumnName = $joinColumn->getReferencedColumnName(); |
| 484 | 484 | |
| 485 | - if (! $joinColumn->getType()) { |
|
| 485 | + if ( ! $joinColumn->getType()) { |
|
| 486 | 486 | $joinColumn->setType(PersisterHelper::getTypeOfColumn($referencedColumnName, $targetClass, $this->em)); |
| 487 | 487 | } |
| 488 | 488 | |
@@ -509,18 +509,18 @@ discard block |
||
| 509 | 509 | case Type::SMALLINT: |
| 510 | 510 | case Type::INTEGER: |
| 511 | 511 | case Type::BIGINT: |
| 512 | - $set[] = $versionColumnName . ' = ' . $versionColumnName . ' + 1'; |
|
| 512 | + $set[] = $versionColumnName.' = '.$versionColumnName.' + 1'; |
|
| 513 | 513 | break; |
| 514 | 514 | |
| 515 | 515 | case Type::DATETIME: |
| 516 | - $set[] = $versionColumnName . ' = CURRENT_TIMESTAMP'; |
|
| 516 | + $set[] = $versionColumnName.' = CURRENT_TIMESTAMP'; |
|
| 517 | 517 | break; |
| 518 | 518 | } |
| 519 | 519 | } |
| 520 | 520 | |
| 521 | - $sql = 'UPDATE ' . $quotedTableName |
|
| 522 | - . ' SET ' . implode(', ', $set) |
|
| 523 | - . ' WHERE ' . implode(' = ? AND ', $where) . ' = ?'; |
|
| 521 | + $sql = 'UPDATE '.$quotedTableName |
|
| 522 | + . ' SET '.implode(', ', $set) |
|
| 523 | + . ' WHERE '.implode(' = ? AND ', $where).' = ?'; |
|
| 524 | 524 | |
| 525 | 525 | $result = $this->conn->executeUpdate($sql, $params, $types); |
| 526 | 526 | |
@@ -537,7 +537,7 @@ discard block |
||
| 537 | 537 | protected function deleteJoinTableRecords($identifier) |
| 538 | 538 | { |
| 539 | 539 | foreach ($this->class->getDeclaredPropertiesIterator() as $association) { |
| 540 | - if (! ($association instanceof ManyToManyAssociationMetadata)) { |
|
| 540 | + if ( ! ($association instanceof ManyToManyAssociationMetadata)) { |
|
| 541 | 541 | continue; |
| 542 | 542 | } |
| 543 | 543 | |
@@ -549,7 +549,7 @@ discard block |
||
| 549 | 549 | $otherKeys = []; |
| 550 | 550 | $keys = []; |
| 551 | 551 | |
| 552 | - if (! $owningAssociation->isOwningSide()) { |
|
| 552 | + if ( ! $owningAssociation->isOwningSide()) { |
|
| 553 | 553 | $class = $this->em->getClassMetadata($association->getTargetEntity()); |
| 554 | 554 | $owningAssociation = $class->getProperty($association->getMappedBy()); |
| 555 | 555 | } |
@@ -659,7 +659,7 @@ discard block |
||
| 659 | 659 | } |
| 660 | 660 | |
| 661 | 661 | // Only owning side of x-1 associations can have a FK column. |
| 662 | - if (! $property instanceof ToOneAssociationMetadata || ! $property->isOwningSide()) { |
|
| 662 | + if ( ! $property instanceof ToOneAssociationMetadata || ! $property->isOwningSide()) { |
|
| 663 | 663 | continue; |
| 664 | 664 | } |
| 665 | 665 | |
@@ -679,7 +679,7 @@ discard block |
||
| 679 | 679 | /** @var JoinColumnMetadata $joinColumn */ |
| 680 | 680 | $referencedColumnName = $joinColumn->getReferencedColumnName(); |
| 681 | 681 | |
| 682 | - if (! $joinColumn->getType()) { |
|
| 682 | + if ( ! $joinColumn->getType()) { |
|
| 683 | 683 | $joinColumn->setType(PersisterHelper::getTypeOfColumn($referencedColumnName, $targetClass, $this->em)); |
| 684 | 684 | } |
| 685 | 685 | |
@@ -706,7 +706,7 @@ discard block |
||
| 706 | 706 | $propertyName = $this->class->fieldNames[$columnName]; |
| 707 | 707 | $property = $this->class->getProperty($propertyName); |
| 708 | 708 | |
| 709 | - if (! $property) { |
|
| 709 | + if ( ! $property) { |
|
| 710 | 710 | return null; |
| 711 | 711 | } |
| 712 | 712 | |
@@ -725,7 +725,7 @@ discard block |
||
| 725 | 725 | /** @var JoinColumnMetadata $joinColumn */ |
| 726 | 726 | $referencedColumnName = $joinColumn->getReferencedColumnName(); |
| 727 | 727 | |
| 728 | - if (! $joinColumn->getType()) { |
|
| 728 | + if ( ! $joinColumn->getType()) { |
|
| 729 | 729 | $joinColumn->setType(PersisterHelper::getTypeOfColumn($referencedColumnName, $targetClass, $this->em)); |
| 730 | 730 | } |
| 731 | 731 | |
@@ -830,7 +830,7 @@ discard block |
||
| 830 | 830 | $sourceKeyColumn = $joinColumn->getReferencedColumnName(); |
| 831 | 831 | $targetKeyColumn = $joinColumn->getColumnName(); |
| 832 | 832 | |
| 833 | - if (! isset($sourceClass->fieldNames[$sourceKeyColumn])) { |
|
| 833 | + if ( ! isset($sourceClass->fieldNames[$sourceKeyColumn])) { |
|
| 834 | 834 | throw MappingException::joinColumnMustPointToMappedField( |
| 835 | 835 | $sourceClass->getClassName(), |
| 836 | 836 | $sourceKeyColumn |
@@ -1057,7 +1057,7 @@ discard block |
||
| 1057 | 1057 | $criteria = []; |
| 1058 | 1058 | $parameters = []; |
| 1059 | 1059 | |
| 1060 | - if (! $association->isOwningSide()) { |
|
| 1060 | + if ( ! $association->isOwningSide()) { |
|
| 1061 | 1061 | $class = $this->em->getClassMetadata($association->getTargetEntity()); |
| 1062 | 1062 | $owningAssoc = $class->getProperty($association->getMappedBy()); |
| 1063 | 1063 | } |
@@ -1085,7 +1085,7 @@ discard block |
||
| 1085 | 1085 | $value = $value[$targetClass->identifier[0]]; |
| 1086 | 1086 | } |
| 1087 | 1087 | |
| 1088 | - $criteria[$joinTableName . '.' . $quotedColumnName] = $value; |
|
| 1088 | + $criteria[$joinTableName.'.'.$quotedColumnName] = $value; |
|
| 1089 | 1089 | $parameters[] = [ |
| 1090 | 1090 | 'value' => $value, |
| 1091 | 1091 | 'field' => $fieldName, |
@@ -1135,11 +1135,11 @@ discard block |
||
| 1135 | 1135 | |
| 1136 | 1136 | switch ($lockMode) { |
| 1137 | 1137 | case LockMode::PESSIMISTIC_READ: |
| 1138 | - $lockSql = ' ' . $this->platform->getReadLockSQL(); |
|
| 1138 | + $lockSql = ' '.$this->platform->getReadLockSQL(); |
|
| 1139 | 1139 | break; |
| 1140 | 1140 | |
| 1141 | 1141 | case LockMode::PESSIMISTIC_WRITE: |
| 1142 | - $lockSql = ' ' . $this->platform->getWriteLockSQL(); |
|
| 1142 | + $lockSql = ' '.$this->platform->getWriteLockSQL(); |
|
| 1143 | 1143 | break; |
| 1144 | 1144 | } |
| 1145 | 1145 | |
@@ -1150,14 +1150,14 @@ discard block |
||
| 1150 | 1150 | |
| 1151 | 1151 | if ($filterSql !== '') { |
| 1152 | 1152 | $conditionSql = $conditionSql |
| 1153 | - ? $conditionSql . ' AND ' . $filterSql |
|
| 1153 | + ? $conditionSql.' AND '.$filterSql |
|
| 1154 | 1154 | : $filterSql; |
| 1155 | 1155 | } |
| 1156 | 1156 | |
| 1157 | - $select = 'SELECT ' . $columnList; |
|
| 1158 | - $from = ' FROM ' . $tableName . ' ' . $tableAlias; |
|
| 1159 | - $join = $this->currentPersisterContext->selectJoinSql . $joinSql; |
|
| 1160 | - $where = ($conditionSql ? ' WHERE ' . $conditionSql : ''); |
|
| 1157 | + $select = 'SELECT '.$columnList; |
|
| 1158 | + $from = ' FROM '.$tableName.' '.$tableAlias; |
|
| 1159 | + $join = $this->currentPersisterContext->selectJoinSql.$joinSql; |
|
| 1160 | + $where = ($conditionSql ? ' WHERE '.$conditionSql : ''); |
|
| 1161 | 1161 | $lock = $this->platform->appendLockHint($from, $lockMode); |
| 1162 | 1162 | $query = $select |
| 1163 | 1163 | . $lock |
@@ -1165,7 +1165,7 @@ discard block |
||
| 1165 | 1165 | . $where |
| 1166 | 1166 | . $orderBySql; |
| 1167 | 1167 | |
| 1168 | - return $this->platform->modifyLimitQuery($query, $limit, $offset ?? 0) . $lockSql; |
|
| 1168 | + return $this->platform->modifyLimitQuery($query, $limit, $offset ?? 0).$lockSql; |
|
| 1169 | 1169 | } |
| 1170 | 1170 | |
| 1171 | 1171 | /** |
@@ -1184,13 +1184,13 @@ discard block |
||
| 1184 | 1184 | |
| 1185 | 1185 | if ($filterSql !== '') { |
| 1186 | 1186 | $conditionSql = $conditionSql |
| 1187 | - ? $conditionSql . ' AND ' . $filterSql |
|
| 1187 | + ? $conditionSql.' AND '.$filterSql |
|
| 1188 | 1188 | : $filterSql; |
| 1189 | 1189 | } |
| 1190 | 1190 | |
| 1191 | 1191 | return 'SELECT COUNT(*) ' |
| 1192 | - . 'FROM ' . $tableName . ' ' . $tableAlias |
|
| 1193 | - . (empty($conditionSql) ? '' : ' WHERE ' . $conditionSql); |
|
| 1192 | + . 'FROM '.$tableName.' '.$tableAlias |
|
| 1193 | + . (empty($conditionSql) ? '' : ' WHERE '.$conditionSql); |
|
| 1194 | 1194 | } |
| 1195 | 1195 | |
| 1196 | 1196 | /** |
@@ -1205,7 +1205,7 @@ discard block |
||
| 1205 | 1205 | */ |
| 1206 | 1206 | final protected function getOrderBySQL(array $orderBy, $baseTableAlias) |
| 1207 | 1207 | { |
| 1208 | - if (! $orderBy) { |
|
| 1208 | + if ( ! $orderBy) { |
|
| 1209 | 1209 | return ''; |
| 1210 | 1210 | } |
| 1211 | 1211 | |
@@ -1214,7 +1214,7 @@ discard block |
||
| 1214 | 1214 | foreach ($orderBy as $fieldName => $orientation) { |
| 1215 | 1215 | $orientation = strtoupper(trim($orientation)); |
| 1216 | 1216 | |
| 1217 | - if (! in_array($orientation, ['ASC', 'DESC'], true)) { |
|
| 1217 | + if ( ! in_array($orientation, ['ASC', 'DESC'], true)) { |
|
| 1218 | 1218 | throw InvalidOrientation::fromClassNameAndField($this->class->getClassName(), $fieldName); |
| 1219 | 1219 | } |
| 1220 | 1220 | |
@@ -1224,11 +1224,11 @@ discard block |
||
| 1224 | 1224 | $tableAlias = $this->getSQLTableAlias($property->getTableName()); |
| 1225 | 1225 | $columnName = $this->platform->quoteIdentifier($property->getColumnName()); |
| 1226 | 1226 | |
| 1227 | - $orderByList[] = $tableAlias . '.' . $columnName . ' ' . $orientation; |
|
| 1227 | + $orderByList[] = $tableAlias.'.'.$columnName.' '.$orientation; |
|
| 1228 | 1228 | |
| 1229 | 1229 | continue; |
| 1230 | 1230 | } elseif ($property instanceof AssociationMetadata) { |
| 1231 | - if (! $property->isOwningSide()) { |
|
| 1231 | + if ( ! $property->isOwningSide()) { |
|
| 1232 | 1232 | throw InvalidFindByCall::fromInverseSideUsage( |
| 1233 | 1233 | $this->class->getClassName(), |
| 1234 | 1234 | $fieldName |
@@ -1244,7 +1244,7 @@ discard block |
||
| 1244 | 1244 | /** @var JoinColumnMetadata $joinColumn */ |
| 1245 | 1245 | $quotedColumnName = $this->platform->quoteIdentifier($joinColumn->getColumnName()); |
| 1246 | 1246 | |
| 1247 | - $orderByList[] = $tableAlias . '.' . $quotedColumnName . ' ' . $orientation; |
|
| 1247 | + $orderByList[] = $tableAlias.'.'.$quotedColumnName.' '.$orientation; |
|
| 1248 | 1248 | } |
| 1249 | 1249 | |
| 1250 | 1250 | continue; |
@@ -1253,7 +1253,7 @@ discard block |
||
| 1253 | 1253 | throw UnrecognizedField::byName($fieldName); |
| 1254 | 1254 | } |
| 1255 | 1255 | |
| 1256 | - return ' ORDER BY ' . implode(', ', $orderByList); |
|
| 1256 | + return ' ORDER BY '.implode(', ', $orderByList); |
|
| 1257 | 1257 | } |
| 1258 | 1258 | |
| 1259 | 1259 | /** |
@@ -1295,7 +1295,7 @@ discard block |
||
| 1295 | 1295 | $isAssocToOneInverseSide = $property instanceof ToOneAssociationMetadata && ! $property->isOwningSide(); |
| 1296 | 1296 | $isAssocFromOneEager = ! $property instanceof ManyToManyAssociationMetadata && $property->getFetchMode() === FetchMode::EAGER; |
| 1297 | 1297 | |
| 1298 | - if (! ($isAssocFromOneEager || $isAssocToOneInverseSide)) { |
|
| 1298 | + if ( ! ($isAssocFromOneEager || $isAssocToOneInverseSide)) { |
|
| 1299 | 1299 | break; |
| 1300 | 1300 | } |
| 1301 | 1301 | |
@@ -1310,7 +1310,7 @@ discard block |
||
| 1310 | 1310 | break; // now this is why you shouldn't use inheritance |
| 1311 | 1311 | } |
| 1312 | 1312 | |
| 1313 | - $assocAlias = 'e' . ($eagerAliasCounter++); |
|
| 1313 | + $assocAlias = 'e'.($eagerAliasCounter++); |
|
| 1314 | 1314 | |
| 1315 | 1315 | $this->currentPersisterContext->rsm->addJoinedEntityResult($targetEntity, $assocAlias, 'r', $fieldName); |
| 1316 | 1316 | |
@@ -1338,14 +1338,14 @@ discard block |
||
| 1338 | 1338 | $this->currentPersisterContext->rsm->addIndexBy($assocAlias, $property->getIndexedBy()); |
| 1339 | 1339 | } |
| 1340 | 1340 | |
| 1341 | - if (! $property->isOwningSide()) { |
|
| 1341 | + if ( ! $property->isOwningSide()) { |
|
| 1342 | 1342 | $owningAssociation = $eagerEntity->getProperty($property->getMappedBy()); |
| 1343 | 1343 | } |
| 1344 | 1344 | |
| 1345 | 1345 | $joinTableAlias = $this->getSQLTableAlias($eagerEntity->getTableName(), $assocAlias); |
| 1346 | 1346 | $joinTableName = $eagerEntity->table->getQuotedQualifiedName($this->platform); |
| 1347 | 1347 | |
| 1348 | - $this->currentPersisterContext->selectJoinSql .= ' ' . $this->getJoinSQLForAssociation($property); |
|
| 1348 | + $this->currentPersisterContext->selectJoinSql .= ' '.$this->getJoinSQLForAssociation($property); |
|
| 1349 | 1349 | |
| 1350 | 1350 | $sourceClass = $this->em->getClassMetadata($owningAssociation->getSourceEntity()); |
| 1351 | 1351 | $targetClass = $this->em->getClassMetadata($owningAssociation->getTargetEntity()); |
@@ -1369,7 +1369,7 @@ discard block |
||
| 1369 | 1369 | $joinCondition[] = $filterSql; |
| 1370 | 1370 | } |
| 1371 | 1371 | |
| 1372 | - $this->currentPersisterContext->selectJoinSql .= ' ' . $joinTableName . ' ' . $joinTableAlias . ' ON '; |
|
| 1372 | + $this->currentPersisterContext->selectJoinSql .= ' '.$joinTableName.' '.$joinTableAlias.' ON '; |
|
| 1373 | 1373 | $this->currentPersisterContext->selectJoinSql .= implode(' AND ', $joinCondition); |
| 1374 | 1374 | |
| 1375 | 1375 | break; |
@@ -1391,7 +1391,7 @@ discard block |
||
| 1391 | 1391 | */ |
| 1392 | 1392 | protected function getSelectColumnAssociationSQL($field, AssociationMetadata $association, ClassMetadata $class, $alias = 'r') |
| 1393 | 1393 | { |
| 1394 | - if (! ($association->isOwningSide() && $association instanceof ToOneAssociationMetadata)) { |
|
| 1394 | + if ( ! ($association->isOwningSide() && $association instanceof ToOneAssociationMetadata)) { |
|
| 1395 | 1395 | return ''; |
| 1396 | 1396 | } |
| 1397 | 1397 | |
@@ -1406,7 +1406,7 @@ discard block |
||
| 1406 | 1406 | $referencedColumnName = $joinColumn->getReferencedColumnName(); |
| 1407 | 1407 | $resultColumnName = $this->getSQLColumnAlias(); |
| 1408 | 1408 | |
| 1409 | - if (! $joinColumn->getType()) { |
|
| 1409 | + if ( ! $joinColumn->getType()) { |
|
| 1410 | 1410 | $joinColumn->setType(PersisterHelper::getTypeOfColumn($referencedColumnName, $targetClass, $this->em)); |
| 1411 | 1411 | } |
| 1412 | 1412 | |
@@ -1436,7 +1436,7 @@ discard block |
||
| 1436 | 1436 | $owningAssociation = $association; |
| 1437 | 1437 | $sourceTableAlias = $this->getSQLTableAlias($this->class->getTableName()); |
| 1438 | 1438 | |
| 1439 | - if (! $association->isOwningSide()) { |
|
| 1439 | + if ( ! $association->isOwningSide()) { |
|
| 1440 | 1440 | $targetEntity = $this->em->getClassMetadata($association->getTargetEntity()); |
| 1441 | 1441 | $owningAssociation = $targetEntity->getProperty($association->getMappedBy()); |
| 1442 | 1442 | } |
@@ -1457,7 +1457,7 @@ discard block |
||
| 1457 | 1457 | ); |
| 1458 | 1458 | } |
| 1459 | 1459 | |
| 1460 | - return ' INNER JOIN ' . $joinTableName . ' ON ' . implode(' AND ', $conditions); |
|
| 1460 | + return ' INNER JOIN '.$joinTableName.' ON '.implode(' AND ', $conditions); |
|
| 1461 | 1461 | } |
| 1462 | 1462 | |
| 1463 | 1463 | /** |
@@ -1551,7 +1551,7 @@ discard block |
||
| 1551 | 1551 | $columnName = $joinColumn->getColumnName(); |
| 1552 | 1552 | $referencedColumnName = $joinColumn->getReferencedColumnName(); |
| 1553 | 1553 | |
| 1554 | - if (! $joinColumn->getType()) { |
|
| 1554 | + if ( ! $joinColumn->getType()) { |
|
| 1555 | 1555 | $joinColumn->setType(PersisterHelper::getTypeOfColumn($referencedColumnName, $targetClass, $this->em)); |
| 1556 | 1556 | } |
| 1557 | 1557 | |
@@ -1590,7 +1590,7 @@ discard block |
||
| 1590 | 1590 | |
| 1591 | 1591 | $this->currentPersisterContext->rsm->addFieldResult($alias, $columnAlias, $field, $class->getClassName()); |
| 1592 | 1592 | |
| 1593 | - return $property->getType()->convertToPHPValueSQL($sql, $this->platform) . ' AS ' . $columnAlias; |
|
| 1593 | + return $property->getType()->convertToPHPValueSQL($sql, $this->platform).' AS '.$columnAlias; |
|
| 1594 | 1594 | } |
| 1595 | 1595 | |
| 1596 | 1596 | /** |
@@ -1604,14 +1604,14 @@ discard block |
||
| 1604 | 1604 | protected function getSQLTableAlias($tableName, $assocName = '') |
| 1605 | 1605 | { |
| 1606 | 1606 | if ($tableName) { |
| 1607 | - $tableName .= '#' . $assocName; |
|
| 1607 | + $tableName .= '#'.$assocName; |
|
| 1608 | 1608 | } |
| 1609 | 1609 | |
| 1610 | 1610 | if (isset($this->currentPersisterContext->sqlTableAliases[$tableName])) { |
| 1611 | 1611 | return $this->currentPersisterContext->sqlTableAliases[$tableName]; |
| 1612 | 1612 | } |
| 1613 | 1613 | |
| 1614 | - $tableAlias = 't' . $this->currentPersisterContext->sqlAliasCounter++; |
|
| 1614 | + $tableAlias = 't'.$this->currentPersisterContext->sqlAliasCounter++; |
|
| 1615 | 1615 | |
| 1616 | 1616 | $this->currentPersisterContext->sqlTableAliases[$tableName] = $tableAlias; |
| 1617 | 1617 | |
@@ -1637,7 +1637,7 @@ discard block |
||
| 1637 | 1637 | } |
| 1638 | 1638 | |
| 1639 | 1639 | $lock = $this->getLockTablesSql($lockMode); |
| 1640 | - $where = ($conditionSql ? ' WHERE ' . $conditionSql : '') . ' '; |
|
| 1640 | + $where = ($conditionSql ? ' WHERE '.$conditionSql : '').' '; |
|
| 1641 | 1641 | $sql = 'SELECT 1 ' |
| 1642 | 1642 | . $lock |
| 1643 | 1643 | . $where |
@@ -1660,7 +1660,7 @@ discard block |
||
| 1660 | 1660 | $tableName = $this->class->table->getQuotedQualifiedName($this->platform); |
| 1661 | 1661 | |
| 1662 | 1662 | return $this->platform->appendLockHint( |
| 1663 | - 'FROM ' . $tableName . ' ' . $this->getSQLTableAlias($this->class->getTableName()), |
|
| 1663 | + 'FROM '.$tableName.' '.$this->getSQLTableAlias($this->class->getTableName()), |
|
| 1664 | 1664 | $lockMode |
| 1665 | 1665 | ); |
| 1666 | 1666 | } |
@@ -1710,19 +1710,19 @@ discard block |
||
| 1710 | 1710 | |
| 1711 | 1711 | if ($comparison !== null) { |
| 1712 | 1712 | // special case null value handling |
| 1713 | - if (($comparison === Comparison::EQ || $comparison === Comparison::IS) && $value ===null) { |
|
| 1714 | - $selectedColumns[] = $column . ' IS NULL'; |
|
| 1713 | + if (($comparison === Comparison::EQ || $comparison === Comparison::IS) && $value === null) { |
|
| 1714 | + $selectedColumns[] = $column.' IS NULL'; |
|
| 1715 | 1715 | |
| 1716 | 1716 | continue; |
| 1717 | 1717 | } |
| 1718 | 1718 | |
| 1719 | 1719 | if ($comparison === Comparison::NEQ && $value === null) { |
| 1720 | - $selectedColumns[] = $column . ' IS NOT NULL'; |
|
| 1720 | + $selectedColumns[] = $column.' IS NOT NULL'; |
|
| 1721 | 1721 | |
| 1722 | 1722 | continue; |
| 1723 | 1723 | } |
| 1724 | 1724 | |
| 1725 | - $selectedColumns[] = $column . ' ' . sprintf(self::$comparisonMap[$comparison], $placeholder); |
|
| 1725 | + $selectedColumns[] = $column.' '.sprintf(self::$comparisonMap[$comparison], $placeholder); |
|
| 1726 | 1726 | |
| 1727 | 1727 | continue; |
| 1728 | 1728 | } |
@@ -1770,7 +1770,7 @@ discard block |
||
| 1770 | 1770 | $tableAlias = $this->getSQLTableAlias($property->getTableName()); |
| 1771 | 1771 | $columnName = $this->platform->quoteIdentifier($property->getColumnName()); |
| 1772 | 1772 | |
| 1773 | - return [$tableAlias . '.' . $columnName]; |
|
| 1773 | + return [$tableAlias.'.'.$columnName]; |
|
| 1774 | 1774 | } |
| 1775 | 1775 | |
| 1776 | 1776 | if ($property instanceof AssociationMetadata) { |
@@ -1779,7 +1779,7 @@ discard block |
||
| 1779 | 1779 | |
| 1780 | 1780 | // Many-To-Many requires join table check for joinColumn |
| 1781 | 1781 | if ($owningAssociation instanceof ManyToManyAssociationMetadata) { |
| 1782 | - if (! $owningAssociation->isOwningSide()) { |
|
| 1782 | + if ( ! $owningAssociation->isOwningSide()) { |
|
| 1783 | 1783 | $owningAssociation = $association; |
| 1784 | 1784 | } |
| 1785 | 1785 | |
@@ -1792,10 +1792,10 @@ discard block |
||
| 1792 | 1792 | foreach ($joinColumns as $joinColumn) { |
| 1793 | 1793 | $quotedColumnName = $this->platform->quoteIdentifier($joinColumn->getColumnName()); |
| 1794 | 1794 | |
| 1795 | - $columns[] = $joinTableName . '.' . $quotedColumnName; |
|
| 1795 | + $columns[] = $joinTableName.'.'.$quotedColumnName; |
|
| 1796 | 1796 | } |
| 1797 | 1797 | } else { |
| 1798 | - if (! $owningAssociation->isOwningSide()) { |
|
| 1798 | + if ( ! $owningAssociation->isOwningSide()) { |
|
| 1799 | 1799 | throw InvalidFindByCall::fromInverseSideUsage( |
| 1800 | 1800 | $this->class->getClassName(), |
| 1801 | 1801 | $field |
@@ -1810,7 +1810,7 @@ discard block |
||
| 1810 | 1810 | foreach ($owningAssociation->getJoinColumns() as $joinColumn) { |
| 1811 | 1811 | $quotedColumnName = $this->platform->quoteIdentifier($joinColumn->getColumnName()); |
| 1812 | 1812 | |
| 1813 | - $columns[] = $tableAlias . '.' . $quotedColumnName; |
|
| 1813 | + $columns[] = $tableAlias.'.'.$quotedColumnName; |
|
| 1814 | 1814 | } |
| 1815 | 1815 | } |
| 1816 | 1816 | |
@@ -1919,7 +1919,7 @@ discard block |
||
| 1919 | 1919 | $value = $value[$targetClass->identifier[0]]; |
| 1920 | 1920 | } |
| 1921 | 1921 | |
| 1922 | - $criteria[$tableAlias . '.' . $quotedColumnName] = $value; |
|
| 1922 | + $criteria[$tableAlias.'.'.$quotedColumnName] = $value; |
|
| 1923 | 1923 | $parameters[] = [ |
| 1924 | 1924 | 'value' => $value, |
| 1925 | 1925 | 'field' => $fieldName, |
@@ -2004,7 +2004,7 @@ discard block |
||
| 2004 | 2004 | case $property instanceof AssociationMetadata: |
| 2005 | 2005 | $class = $this->em->getClassMetadata($property->getTargetEntity()); |
| 2006 | 2006 | |
| 2007 | - if (! $property->isOwningSide()) { |
|
| 2007 | + if ( ! $property->isOwningSide()) { |
|
| 2008 | 2008 | $property = $class->getProperty($property->getMappedBy()); |
| 2009 | 2009 | $class = $this->em->getClassMetadata($property->getTargetEntity()); |
| 2010 | 2010 | } |
@@ -2017,7 +2017,7 @@ discard block |
||
| 2017 | 2017 | /** @var JoinColumnMetadata $joinColumn */ |
| 2018 | 2018 | $referencedColumnName = $joinColumn->getReferencedColumnName(); |
| 2019 | 2019 | |
| 2020 | - if (! $joinColumn->getType()) { |
|
| 2020 | + if ( ! $joinColumn->getType()) { |
|
| 2021 | 2021 | $joinColumn->setType(PersisterHelper::getTypeOfColumn($referencedColumnName, $class, $this->em)); |
| 2022 | 2022 | } |
| 2023 | 2023 | |
@@ -2032,7 +2032,7 @@ discard block |
||
| 2032 | 2032 | } |
| 2033 | 2033 | |
| 2034 | 2034 | if (is_array($value)) { |
| 2035 | - return array_map(static function ($type) { |
|
| 2035 | + return array_map(static function($type) { |
|
| 2036 | 2036 | return $type->getBindingType() + Connection::ARRAY_PARAM_OFFSET; |
| 2037 | 2037 | }, $types); |
| 2038 | 2038 | } |
@@ -2089,7 +2089,7 @@ discard block |
||
| 2089 | 2089 | */ |
| 2090 | 2090 | private function getIndividualValue($value) |
| 2091 | 2091 | { |
| 2092 | - if (! is_object($value) || ! $this->em->getMetadataFactory()->hasMetadataFor(StaticClassNameConverter::getClass($value))) { |
|
| 2092 | + if ( ! is_object($value) || ! $this->em->getMetadataFactory()->hasMetadataFor(StaticClassNameConverter::getClass($value))) { |
|
| 2093 | 2093 | return $value; |
| 2094 | 2094 | } |
| 2095 | 2095 | |
@@ -2103,7 +2103,7 @@ discard block |
||
| 2103 | 2103 | { |
| 2104 | 2104 | $criteria = $this->getIdentifier($entity); |
| 2105 | 2105 | |
| 2106 | - if (! $criteria) { |
|
| 2106 | + if ( ! $criteria) { |
|
| 2107 | 2107 | return false; |
| 2108 | 2108 | } |
| 2109 | 2109 | |
@@ -2111,12 +2111,12 @@ discard block |
||
| 2111 | 2111 | |
| 2112 | 2112 | $sql = 'SELECT 1 ' |
| 2113 | 2113 | . $this->getLockTablesSql(null) |
| 2114 | - . ' WHERE ' . $this->getSelectConditionSQL($criteria); |
|
| 2114 | + . ' WHERE '.$this->getSelectConditionSQL($criteria); |
|
| 2115 | 2115 | |
| 2116 | 2116 | [$params, $types] = $this->expandParameters($criteria); |
| 2117 | 2117 | |
| 2118 | 2118 | if ($extraConditions !== null) { |
| 2119 | - $sql .= ' AND ' . $this->getSelectConditionCriteriaSQL($extraConditions); |
|
| 2119 | + $sql .= ' AND '.$this->getSelectConditionCriteriaSQL($extraConditions); |
|
| 2120 | 2120 | [$criteriaParams, $criteriaTypes] = $this->expandCriteriaParameters($extraConditions); |
| 2121 | 2121 | |
| 2122 | 2122 | $params = array_merge($params, $criteriaParams); |
@@ -2126,7 +2126,7 @@ discard block |
||
| 2126 | 2126 | $filterSql = $this->generateFilterConditionSQL($this->class, $alias); |
| 2127 | 2127 | |
| 2128 | 2128 | if ($filterSql) { |
| 2129 | - $sql .= ' AND ' . $filterSql; |
|
| 2129 | + $sql .= ' AND '.$filterSql; |
|
| 2130 | 2130 | } |
| 2131 | 2131 | |
| 2132 | 2132 | return (bool) $this->conn->fetchColumn($sql, $params, 0, $types); |
@@ -2139,13 +2139,13 @@ discard block |
||
| 2139 | 2139 | */ |
| 2140 | 2140 | protected function getJoinSQLForAssociation(AssociationMetadata $association) |
| 2141 | 2141 | { |
| 2142 | - if (! $association->isOwningSide()) { |
|
| 2142 | + if ( ! $association->isOwningSide()) { |
|
| 2143 | 2143 | return 'LEFT JOIN'; |
| 2144 | 2144 | } |
| 2145 | 2145 | |
| 2146 | 2146 | // if one of the join columns is nullable, return left join |
| 2147 | 2147 | foreach ($association->getJoinColumns() as $joinColumn) { |
| 2148 | - if (! $joinColumn->isNullable()) { |
|
| 2148 | + if ( ! $joinColumn->isNullable()) { |
|
| 2149 | 2149 | continue; |
| 2150 | 2150 | } |
| 2151 | 2151 | |
@@ -2162,7 +2162,7 @@ discard block |
||
| 2162 | 2162 | */ |
| 2163 | 2163 | public function getSQLColumnAlias() |
| 2164 | 2164 | { |
| 2165 | - return $this->platform->getSQLResultCasing('c' . $this->currentPersisterContext->sqlAliasCounter++); |
|
| 2165 | + return $this->platform->getSQLResultCasing('c'.$this->currentPersisterContext->sqlAliasCounter++); |
|
| 2166 | 2166 | } |
| 2167 | 2167 | |
| 2168 | 2168 | /** |
@@ -2181,13 +2181,13 @@ discard block |
||
| 2181 | 2181 | $filterExpr = $filter->addFilterConstraint($targetEntity, $targetTableAlias); |
| 2182 | 2182 | |
| 2183 | 2183 | if ($filterExpr !== '') { |
| 2184 | - $filterClauses[] = '(' . $filterExpr . ')'; |
|
| 2184 | + $filterClauses[] = '('.$filterExpr.')'; |
|
| 2185 | 2185 | } |
| 2186 | 2186 | } |
| 2187 | 2187 | |
| 2188 | 2188 | $sql = implode(' AND ', $filterClauses); |
| 2189 | 2189 | |
| 2190 | - return $sql ? '(' . $sql . ')' : ''; // Wrap again to avoid "X or Y and FilterConditionSQL" |
|
| 2190 | + return $sql ? '('.$sql.')' : ''; // Wrap again to avoid "X or Y and FilterConditionSQL" |
|
| 2191 | 2191 | } |
| 2192 | 2192 | |
| 2193 | 2193 | /** |
@@ -85,10 +85,10 @@ discard block |
||
| 85 | 85 | // It's a joined result |
| 86 | 86 | |
| 87 | 87 | $parent = $this->rsm->parentAliasMap[$dqlAlias]; |
| 88 | - $path = $parent . '.' . $dqlAlias; |
|
| 88 | + $path = $parent.'.'.$dqlAlias; |
|
| 89 | 89 | |
| 90 | 90 | // missing parent data, skipping as RIGHT JOIN hydration is not supported. |
| 91 | - if (! isset($nonemptyComponents[$parent])) { |
|
| 91 | + if ( ! isset($nonemptyComponents[$parent])) { |
|
| 92 | 92 | continue; |
| 93 | 93 | } |
| 94 | 94 | |
@@ -97,9 +97,9 @@ discard block |
||
| 97 | 97 | if ($this->rsm->isMixed && isset($this->rootAliases[$parent])) { |
| 98 | 98 | $first = reset($this->resultPointers); |
| 99 | 99 | // TODO: Exception if $key === null ? |
| 100 | - $baseElement =& $this->resultPointers[$parent][key($first)]; |
|
| 100 | + $baseElement = & $this->resultPointers[$parent][key($first)]; |
|
| 101 | 101 | } elseif (isset($this->resultPointers[$parent])) { |
| 102 | - $baseElement =& $this->resultPointers[$parent]; |
|
| 102 | + $baseElement = & $this->resultPointers[$parent]; |
|
| 103 | 103 | } else { |
| 104 | 104 | unset($this->resultPointers[$dqlAlias]); // Ticket #1228 |
| 105 | 105 | |
@@ -111,10 +111,10 @@ discard block |
||
| 111 | 111 | $relation = $parentClass->getProperty($relationAlias); |
| 112 | 112 | |
| 113 | 113 | // Check the type of the relation (many or single-valued) |
| 114 | - if (! $relation instanceof ToOneAssociationMetadata) { |
|
| 114 | + if ( ! $relation instanceof ToOneAssociationMetadata) { |
|
| 115 | 115 | $oneToOne = false; |
| 116 | 116 | |
| 117 | - if (! isset($baseElement[$relationAlias])) { |
|
| 117 | + if ( ! isset($baseElement[$relationAlias])) { |
|
| 118 | 118 | $baseElement[$relationAlias] = []; |
| 119 | 119 | } |
| 120 | 120 | |
@@ -123,7 +123,7 @@ discard block |
||
| 123 | 123 | $index = $indexExists ? $this->identifierMap[$path][$id[$parent]][$id[$dqlAlias]] : false; |
| 124 | 124 | $indexIsValid = $index !== false ? isset($baseElement[$relationAlias][$index]) : false; |
| 125 | 125 | |
| 126 | - if (! $indexExists || ! $indexIsValid) { |
|
| 126 | + if ( ! $indexExists || ! $indexIsValid) { |
|
| 127 | 127 | $element = $data; |
| 128 | 128 | |
| 129 | 129 | if (isset($this->rsm->indexByMap[$dqlAlias])) { |
@@ -140,16 +140,16 @@ discard block |
||
| 140 | 140 | } else { |
| 141 | 141 | $oneToOne = true; |
| 142 | 142 | |
| 143 | - if (! isset($nonemptyComponents[$dqlAlias]) && |
|
| 143 | + if ( ! isset($nonemptyComponents[$dqlAlias]) && |
|
| 144 | 144 | ( ! isset($baseElement[$relationAlias])) |
| 145 | 145 | ) { |
| 146 | 146 | $baseElement[$relationAlias] = null; |
| 147 | - } elseif (! isset($baseElement[$relationAlias])) { |
|
| 147 | + } elseif ( ! isset($baseElement[$relationAlias])) { |
|
| 148 | 148 | $baseElement[$relationAlias] = $data; |
| 149 | 149 | } |
| 150 | 150 | } |
| 151 | 151 | |
| 152 | - $coll =& $baseElement[$relationAlias]; |
|
| 152 | + $coll = & $baseElement[$relationAlias]; |
|
| 153 | 153 | |
| 154 | 154 | if (is_array($coll)) { |
| 155 | 155 | $this->updateResultPointer($coll, $index, $dqlAlias, $oneToOne); |
@@ -161,7 +161,7 @@ discard block |
||
| 161 | 161 | $entityKey = $this->rsm->entityMappings[$dqlAlias] ?: 0; |
| 162 | 162 | |
| 163 | 163 | // if this row has a NULL value for the root result id then make it a null result. |
| 164 | - if (! isset($nonemptyComponents[$dqlAlias])) { |
|
| 164 | + if ( ! isset($nonemptyComponents[$dqlAlias])) { |
|
| 165 | 165 | $result[] = $this->rsm->isMixed |
| 166 | 166 | ? [$entityKey => null] |
| 167 | 167 | : null; |
@@ -198,13 +198,13 @@ discard block |
||
| 198 | 198 | } |
| 199 | 199 | } |
| 200 | 200 | |
| 201 | - if (! isset($resultKey)) { |
|
| 201 | + if ( ! isset($resultKey)) { |
|
| 202 | 202 | $this->resultCounter++; |
| 203 | 203 | } |
| 204 | 204 | |
| 205 | 205 | // Append scalar values to mixed result sets |
| 206 | 206 | if (isset($rowData['scalars'])) { |
| 207 | - if (! isset($resultKey)) { |
|
| 207 | + if ( ! isset($resultKey)) { |
|
| 208 | 208 | // this only ever happens when no object is fetched (scalar result only) |
| 209 | 209 | $resultKey = isset($this->rsm->indexByMap['scalars']) |
| 210 | 210 | ? $row[$this->rsm->indexByMap['scalars']] |
@@ -218,7 +218,7 @@ discard block |
||
| 218 | 218 | |
| 219 | 219 | // Append new object to mixed result sets |
| 220 | 220 | if (isset($rowData['newObjects'])) { |
| 221 | - if (! isset($resultKey)) { |
|
| 221 | + if ( ! isset($resultKey)) { |
|
| 222 | 222 | $resultKey = $this->resultCounter - 1; |
| 223 | 223 | } |
| 224 | 224 | |
@@ -259,22 +259,22 @@ discard block |
||
| 259 | 259 | } |
| 260 | 260 | |
| 261 | 261 | if ($oneToOne) { |
| 262 | - $this->resultPointers[$dqlAlias] =& $coll; |
|
| 262 | + $this->resultPointers[$dqlAlias] = & $coll; |
|
| 263 | 263 | |
| 264 | 264 | return; |
| 265 | 265 | } |
| 266 | 266 | |
| 267 | 267 | if ($index !== false) { |
| 268 | - $this->resultPointers[$dqlAlias] =& $coll[$index]; |
|
| 268 | + $this->resultPointers[$dqlAlias] = & $coll[$index]; |
|
| 269 | 269 | |
| 270 | 270 | return; |
| 271 | 271 | } |
| 272 | 272 | |
| 273 | - if (! $coll) { |
|
| 273 | + if ( ! $coll) { |
|
| 274 | 274 | return; |
| 275 | 275 | } |
| 276 | 276 | |
| 277 | 277 | end($coll); |
| 278 | - $this->resultPointers[$dqlAlias] =& $coll[key($coll)]; |
|
| 278 | + $this->resultPointers[$dqlAlias] = & $coll[key($coll)]; |
|
| 279 | 279 | } |
| 280 | 280 | } |