@@ -109,7 +109,7 @@ discard block |
||
109 | 109 | // Evaluate named native queries |
110 | 110 | if (isset($element['namedNativeQueries'])) { |
111 | 111 | foreach ($element['namedNativeQueries'] as $name => $mappingElement) { |
112 | - if (!isset($mappingElement['name'])) { |
|
112 | + if ( ! isset($mappingElement['name'])) { |
|
113 | 113 | $mappingElement['name'] = $name; |
114 | 114 | } |
115 | 115 | $metadata->addNamedNativeQuery( |
@@ -126,7 +126,7 @@ discard block |
||
126 | 126 | // Evaluate sql result set mappings |
127 | 127 | if (isset($element['sqlResultSetMappings'])) { |
128 | 128 | foreach ($element['sqlResultSetMappings'] as $name => $resultSetMapping) { |
129 | - if (!isset($resultSetMapping['name'])) { |
|
129 | + if ( ! isset($resultSetMapping['name'])) { |
|
130 | 130 | $resultSetMapping['name'] = $name; |
131 | 131 | } |
132 | 132 | |
@@ -173,7 +173,7 @@ discard block |
||
173 | 173 | } |
174 | 174 | |
175 | 175 | if (isset($element['inheritanceType'])) { |
176 | - $metadata->setInheritanceType(constant('Doctrine\ORM\Mapping\ClassMetadata::INHERITANCE_TYPE_' . strtoupper($element['inheritanceType']))); |
|
176 | + $metadata->setInheritanceType(constant('Doctrine\ORM\Mapping\ClassMetadata::INHERITANCE_TYPE_'.strtoupper($element['inheritanceType']))); |
|
177 | 177 | |
178 | 178 | if ($metadata->inheritanceType != Metadata::INHERITANCE_TYPE_NONE) { |
179 | 179 | // Evaluate discriminatorColumn |
@@ -362,7 +362,7 @@ discard block |
||
362 | 362 | } |
363 | 363 | |
364 | 364 | if (isset($oneToOneElement['fetch'])) { |
365 | - $mapping['fetch'] = constant('Doctrine\ORM\Mapping\ClassMetadata::FETCH_' . $oneToOneElement['fetch']); |
|
365 | + $mapping['fetch'] = constant('Doctrine\ORM\Mapping\ClassMetadata::FETCH_'.$oneToOneElement['fetch']); |
|
366 | 366 | } |
367 | 367 | |
368 | 368 | if (isset($oneToOneElement['mappedBy'])) { |
@@ -416,7 +416,7 @@ discard block |
||
416 | 416 | ]; |
417 | 417 | |
418 | 418 | if (isset($oneToManyElement['fetch'])) { |
419 | - $mapping['fetch'] = constant('Doctrine\ORM\Mapping\ClassMetadata::FETCH_' . $oneToManyElement['fetch']); |
|
419 | + $mapping['fetch'] = constant('Doctrine\ORM\Mapping\ClassMetadata::FETCH_'.$oneToManyElement['fetch']); |
|
420 | 420 | } |
421 | 421 | |
422 | 422 | if (isset($oneToManyElement['cascade'])) { |
@@ -458,7 +458,7 @@ discard block |
||
458 | 458 | } |
459 | 459 | |
460 | 460 | if (isset($manyToOneElement['fetch'])) { |
461 | - $mapping['fetch'] = constant('Doctrine\ORM\Mapping\ClassMetadata::FETCH_' . $manyToOneElement['fetch']); |
|
461 | + $mapping['fetch'] = constant('Doctrine\ORM\Mapping\ClassMetadata::FETCH_'.$manyToOneElement['fetch']); |
|
462 | 462 | } |
463 | 463 | |
464 | 464 | if (isset($manyToOneElement['inversedBy'])) { |
@@ -503,7 +503,7 @@ discard block |
||
503 | 503 | ]; |
504 | 504 | |
505 | 505 | if (isset($manyToManyElement['fetch'])) { |
506 | - $mapping['fetch'] = constant('Doctrine\ORM\Mapping\ClassMetadata::FETCH_' . $manyToManyElement['fetch']); |
|
506 | + $mapping['fetch'] = constant('Doctrine\ORM\Mapping\ClassMetadata::FETCH_'.$manyToManyElement['fetch']); |
|
507 | 507 | } |
508 | 508 | |
509 | 509 | if (isset($manyToManyElement['mappedBy'])) { |
@@ -573,7 +573,7 @@ discard block |
||
573 | 573 | if (isset($element['associationOverride']) && is_array($element['associationOverride'])) { |
574 | 574 | |
575 | 575 | foreach ($element['associationOverride'] as $fieldName => $associationOverrideElement) { |
576 | - $override = []; |
|
576 | + $override = []; |
|
577 | 577 | |
578 | 578 | // Check for joinColumn |
579 | 579 | if (isset($associationOverrideElement['joinColumn'])) { |
@@ -591,7 +591,7 @@ discard block |
||
591 | 591 | if (isset($associationOverrideElement['joinTable'])) { |
592 | 592 | |
593 | 593 | $joinTableElement = $associationOverrideElement['joinTable']; |
594 | - $joinTable = [ |
|
594 | + $joinTable = [ |
|
595 | 595 | 'name' => $joinTableElement['name'] |
596 | 596 | ]; |
597 | 597 | |
@@ -625,7 +625,7 @@ discard block |
||
625 | 625 | |
626 | 626 | // Check for `fetch` |
627 | 627 | if (isset($associationOverrideElement['fetch'])) { |
628 | - $override['fetch'] = constant(Metadata::class . '::FETCH_' . $associationOverrideElement['fetch']); |
|
628 | + $override['fetch'] = constant(Metadata::class.'::FETCH_'.$associationOverrideElement['fetch']); |
|
629 | 629 | } |
630 | 630 | |
631 | 631 | $metadata->setAssociationOverride($fieldName, $override); |
@@ -645,7 +645,7 @@ discard block |
||
645 | 645 | if (isset($element['lifecycleCallbacks'])) { |
646 | 646 | foreach ($element['lifecycleCallbacks'] as $type => $methods) { |
647 | 647 | foreach ($methods as $method) { |
648 | - $metadata->addLifecycleCallback($method, constant('Doctrine\ORM\Events::' . $type)); |
|
648 | + $metadata->addLifecycleCallback($method, constant('Doctrine\ORM\Events::'.$type)); |
|
649 | 649 | } |
650 | 650 | } |
651 | 651 | } |
@@ -787,12 +787,12 @@ discard block |
||
787 | 787 | $region = isset($cacheMapping['region']) ? (string) $cacheMapping['region'] : null; |
788 | 788 | $usage = isset($cacheMapping['usage']) ? strtoupper($cacheMapping['usage']) : null; |
789 | 789 | |
790 | - if ($usage && ! defined('Doctrine\ORM\Mapping\ClassMetadata::CACHE_USAGE_' . $usage)) { |
|
790 | + if ($usage && ! defined('Doctrine\ORM\Mapping\ClassMetadata::CACHE_USAGE_'.$usage)) { |
|
791 | 791 | throw new \InvalidArgumentException(sprintf('Invalid cache usage "%s"', $usage)); |
792 | 792 | } |
793 | 793 | |
794 | 794 | if ($usage) { |
795 | - $usage = constant('Doctrine\ORM\Mapping\ClassMetadata::CACHE_USAGE_' . $usage); |
|
795 | + $usage = constant('Doctrine\ORM\Mapping\ClassMetadata::CACHE_USAGE_'.$usage); |
|
796 | 796 | } |
797 | 797 | |
798 | 798 | return [ |
@@ -296,7 +296,7 @@ discard block |
||
296 | 296 | |
297 | 297 | // If there are field name collisions in the child class, then we need |
298 | 298 | // to only hydrate if we are looking at the correct discriminator value |
299 | - if( |
|
299 | + if ( |
|
300 | 300 | isset($cacheKeyInfo['discriminatorColumn']) && |
301 | 301 | isset($data[$cacheKeyInfo['discriminatorColumn']]) && |
302 | 302 | // Note: loose comparison required. See https://github.com/doctrine/doctrine2/pull/6304#issuecomment-323294442 |
@@ -317,7 +317,7 @@ discard block |
||
317 | 317 | : $value; |
318 | 318 | |
319 | 319 | if ($cacheKeyInfo['isIdentifier'] && $value !== null) { |
320 | - $id[$dqlAlias] .= '|' . $value; |
|
320 | + $id[$dqlAlias] .= '|'.$value; |
|
321 | 321 | $nonemptyComponents[$dqlAlias] = true; |
322 | 322 | } |
323 | 323 | break; |
@@ -355,7 +355,7 @@ discard block |
||
355 | 355 | if ( ! isset($cacheKeyInfo['isScalar'])) { |
356 | 356 | $dqlAlias = $cacheKeyInfo['dqlAlias']; |
357 | 357 | $type = $cacheKeyInfo['type']; |
358 | - $fieldName = $dqlAlias . '_' . $fieldName; |
|
358 | + $fieldName = $dqlAlias.'_'.$fieldName; |
|
359 | 359 | $value = $type |
360 | 360 | ? $type->convertToPHPValue($value, $this->_platform) |
361 | 361 | : $value; |
@@ -208,8 +208,8 @@ discard block |
||
208 | 208 | $sqlIdentifier = $this->getSQLIdentifier($AST); |
209 | 209 | |
210 | 210 | if ($hasOrderBy) { |
211 | - $orderGroupBy = ' GROUP BY ' . implode(', ', $sqlIdentifier); |
|
212 | - $sqlIdentifier[] = 'MIN(' . $this->walkResultVariable('dctrn_rownum') . ') AS dctrn_minrownum'; |
|
211 | + $orderGroupBy = ' GROUP BY '.implode(', ', $sqlIdentifier); |
|
212 | + $sqlIdentifier[] = 'MIN('.$this->walkResultVariable('dctrn_rownum').') AS dctrn_minrownum'; |
|
213 | 213 | } |
214 | 214 | |
215 | 215 | // Build the counter query |
@@ -220,7 +220,7 @@ discard block |
||
220 | 220 | ); |
221 | 221 | |
222 | 222 | if ($hasOrderBy) { |
223 | - $sql .= $orderGroupBy . $outerOrderBy; |
|
223 | + $sql .= $orderGroupBy.$outerOrderBy; |
|
224 | 224 | } |
225 | 225 | |
226 | 226 | // Apply the limit and offset. |
@@ -323,7 +323,7 @@ discard block |
||
323 | 323 | foreach ($orderByPathExpressions as $pathExpression) { |
324 | 324 | $idVar = $pathExpression->identificationVariable; |
325 | 325 | $field = $pathExpression->field; |
326 | - if (!isset($selects[$idVar])) { |
|
326 | + if ( ! isset($selects[$idVar])) { |
|
327 | 327 | $selects[$idVar] = []; |
328 | 328 | } |
329 | 329 | $selects[$idVar][$field] = true; |
@@ -334,7 +334,7 @@ discard block |
||
334 | 334 | foreach ($AST->selectClause->selectExpressions as $selectExpression) { |
335 | 335 | if ($selectExpression instanceof SelectExpression) { |
336 | 336 | $idVar = $selectExpression->expression; |
337 | - if (!is_string($idVar)) { |
|
337 | + if ( ! is_string($idVar)) { |
|
338 | 338 | continue; |
339 | 339 | } |
340 | 340 | $field = $selectExpression->fieldIdentificationVariable; |
@@ -370,7 +370,7 @@ discard block |
||
370 | 370 | ?OrderByClause $orderByClause |
371 | 371 | ) : string { |
372 | 372 | // If the sql statement has an order by clause, we need to wrap it in a new select distinct statement |
373 | - if (! $orderByClause) { |
|
373 | + if ( ! $orderByClause) { |
|
374 | 374 | return $sql; |
375 | 375 | } |
376 | 376 | |
@@ -412,7 +412,7 @@ discard block |
||
412 | 412 | $orderByItems[] = $orderByItemString; |
413 | 413 | $identifier = \substr($orderByItemString, 0, \strrpos($orderByItemString, ' ')); |
414 | 414 | |
415 | - if (! \in_array($identifier, $identifiers, true)) { |
|
415 | + if ( ! \in_array($identifier, $identifiers, true)) { |
|
416 | 416 | $identifiers[] = $identifier; |
417 | 417 | } |
418 | 418 | } |
@@ -444,7 +444,7 @@ discard block |
||
444 | 444 | $class = $metadataList[$dqlAliasForFieldAlias]; |
445 | 445 | |
446 | 446 | // If the field is from a joined child table, we won't be ordering on it. |
447 | - if (! isset($class->fieldMappings[$fieldName])) { |
|
447 | + if ( ! isset($class->fieldMappings[$fieldName])) { |
|
448 | 448 | continue; |
449 | 449 | } |
450 | 450 | |
@@ -465,7 +465,7 @@ discard block |
||
465 | 465 | // for the joined parent table. |
466 | 466 | $otherClassMetadata = $this->em->getClassMetadata($fieldMapping['declared']); |
467 | 467 | |
468 | - if (! $otherClassMetadata->isMappedSuperclass) { |
|
468 | + if ( ! $otherClassMetadata->isMappedSuperclass) { |
|
469 | 469 | $sqlTableAliasForFieldAlias = $this->getSQLTableAlias($otherClassMetadata->getTableName(), $dqlAliasForFieldAlias); |
470 | 470 | } |
471 | 471 | } |
@@ -582,7 +582,7 @@ discard block |
||
582 | 582 | */ |
583 | 583 | public function walkPathExpression($pathExpr) |
584 | 584 | { |
585 | - if (!$this->inSubSelect && !$this->platformSupportsRowNumber() && !in_array($pathExpr, $this->orderByPathExpressions)) { |
|
585 | + if ( ! $this->inSubSelect && ! $this->platformSupportsRowNumber() && ! in_array($pathExpr, $this->orderByPathExpressions)) { |
|
586 | 586 | $this->orderByPathExpressions[] = $pathExpr; |
587 | 587 | } |
588 | 588 |
@@ -1,6 +1,6 @@ |
||
1 | 1 | <?php |
2 | 2 | |
3 | -declare(strict_types=1); |
|
3 | +declare(strict_types = 1); |
|
4 | 4 | |
5 | 5 | namespace Doctrine\Tests\ORM\Functional\Ticket; |
6 | 6 |