@@ -721,13 +721,13 @@ |
||
| 721 | 721 | return $joinColumn; |
| 722 | 722 | } |
| 723 | 723 | |
| 724 | - /** |
|
| 725 | - * Parses the given field as array. |
|
| 726 | - * |
|
| 727 | - * @param SimpleXMLElement $fieldMapping |
|
| 728 | - * |
|
| 729 | - * @return array |
|
| 730 | - */ |
|
| 724 | + /** |
|
| 725 | + * Parses the given field as array. |
|
| 726 | + * |
|
| 727 | + * @param SimpleXMLElement $fieldMapping |
|
| 728 | + * |
|
| 729 | + * @return array |
|
| 730 | + */ |
|
| 731 | 731 | private function columnToArray(SimpleXMLElement $fieldMapping) |
| 732 | 732 | { |
| 733 | 733 | $mapping = [ |
@@ -164,7 +164,7 @@ discard block |
||
| 164 | 164 | |
| 165 | 165 | if (isset($xmlRoot['inheritance-type'])) { |
| 166 | 166 | $inheritanceType = (string) $xmlRoot['inheritance-type']; |
| 167 | - $metadata->setInheritanceType(constant('Doctrine\ORM\Mapping\ClassMetadata::INHERITANCE_TYPE_' . $inheritanceType)); |
|
| 167 | + $metadata->setInheritanceType(constant('Doctrine\ORM\Mapping\ClassMetadata::INHERITANCE_TYPE_'.$inheritanceType)); |
|
| 168 | 168 | |
| 169 | 169 | if ($metadata->inheritanceType != Metadata::INHERITANCE_TYPE_NONE) { |
| 170 | 170 | // Evaluate <discriminator-column...> |
@@ -366,7 +366,7 @@ discard block |
||
| 366 | 366 | } |
| 367 | 367 | |
| 368 | 368 | if (isset($oneToOneElement['fetch'])) { |
| 369 | - $mapping['fetch'] = constant('Doctrine\ORM\Mapping\ClassMetadata::FETCH_' . (string) $oneToOneElement['fetch']); |
|
| 369 | + $mapping['fetch'] = constant('Doctrine\ORM\Mapping\ClassMetadata::FETCH_'.(string) $oneToOneElement['fetch']); |
|
| 370 | 370 | } |
| 371 | 371 | |
| 372 | 372 | if (isset($oneToOneElement['mapped-by'])) { |
@@ -415,7 +415,7 @@ discard block |
||
| 415 | 415 | ]; |
| 416 | 416 | |
| 417 | 417 | if (isset($oneToManyElement['fetch'])) { |
| 418 | - $mapping['fetch'] = constant('Doctrine\ORM\Mapping\ClassMetadata::FETCH_' . (string) $oneToManyElement['fetch']); |
|
| 418 | + $mapping['fetch'] = constant('Doctrine\ORM\Mapping\ClassMetadata::FETCH_'.(string) $oneToManyElement['fetch']); |
|
| 419 | 419 | } |
| 420 | 420 | |
| 421 | 421 | if (isset($oneToManyElement->cascade)) { |
@@ -462,7 +462,7 @@ discard block |
||
| 462 | 462 | } |
| 463 | 463 | |
| 464 | 464 | if (isset($manyToOneElement['fetch'])) { |
| 465 | - $mapping['fetch'] = constant('Doctrine\ORM\Mapping\ClassMetadata::FETCH_' . (string) $manyToOneElement['fetch']); |
|
| 465 | + $mapping['fetch'] = constant('Doctrine\ORM\Mapping\ClassMetadata::FETCH_'.(string) $manyToOneElement['fetch']); |
|
| 466 | 466 | } |
| 467 | 467 | |
| 468 | 468 | if (isset($manyToOneElement['inversed-by'])) { |
@@ -504,7 +504,7 @@ discard block |
||
| 504 | 504 | ]; |
| 505 | 505 | |
| 506 | 506 | if (isset($manyToManyElement['fetch'])) { |
| 507 | - $mapping['fetch'] = constant('Doctrine\ORM\Mapping\ClassMetadata::FETCH_' . (string) $manyToManyElement['fetch']); |
|
| 507 | + $mapping['fetch'] = constant('Doctrine\ORM\Mapping\ClassMetadata::FETCH_'.(string) $manyToManyElement['fetch']); |
|
| 508 | 508 | } |
| 509 | 509 | |
| 510 | 510 | if (isset($manyToManyElement['orphan-removal'])) { |
@@ -624,7 +624,7 @@ discard block |
||
| 624 | 624 | |
| 625 | 625 | // Check for `fetch` |
| 626 | 626 | if (isset($overrideElement['fetch'])) { |
| 627 | - $override['fetch'] = constant(Metadata::class . '::FETCH_' . (string) $overrideElement['fetch']); |
|
| 627 | + $override['fetch'] = constant(Metadata::class.'::FETCH_'.(string) $overrideElement['fetch']); |
|
| 628 | 628 | } |
| 629 | 629 | |
| 630 | 630 | $metadata->setAssociationOverride($fieldName, $override); |
@@ -634,7 +634,7 @@ discard block |
||
| 634 | 634 | // Evaluate <lifecycle-callbacks...> |
| 635 | 635 | if (isset($xmlRoot->{'lifecycle-callbacks'})) { |
| 636 | 636 | foreach ($xmlRoot->{'lifecycle-callbacks'}->{'lifecycle-callback'} as $lifecycleCallback) { |
| 637 | - $metadata->addLifecycleCallback((string) $lifecycleCallback['method'], constant('Doctrine\ORM\Events::' . (string) $lifecycleCallback['type'])); |
|
| 637 | + $metadata->addLifecycleCallback((string) $lifecycleCallback['method'], constant('Doctrine\ORM\Events::'.(string) $lifecycleCallback['type'])); |
|
| 638 | 638 | } |
| 639 | 639 | } |
| 640 | 640 | |
@@ -795,12 +795,12 @@ discard block |
||
| 795 | 795 | $region = isset($cacheMapping['region']) ? (string) $cacheMapping['region'] : null; |
| 796 | 796 | $usage = isset($cacheMapping['usage']) ? strtoupper($cacheMapping['usage']) : null; |
| 797 | 797 | |
| 798 | - if ($usage && ! defined('Doctrine\ORM\Mapping\ClassMetadata::CACHE_USAGE_' . $usage)) { |
|
| 798 | + if ($usage && ! defined('Doctrine\ORM\Mapping\ClassMetadata::CACHE_USAGE_'.$usage)) { |
|
| 799 | 799 | throw new \InvalidArgumentException(sprintf('Invalid cache usage "%s"', $usage)); |
| 800 | 800 | } |
| 801 | 801 | |
| 802 | 802 | if ($usage) { |
| 803 | - $usage = constant('Doctrine\ORM\Mapping\ClassMetadata::CACHE_USAGE_' . $usage); |
|
| 803 | + $usage = constant('Doctrine\ORM\Mapping\ClassMetadata::CACHE_USAGE_'.$usage); |
|
| 804 | 804 | } |
| 805 | 805 | |
| 806 | 806 | return [ |
@@ -152,7 +152,7 @@ |
||
| 152 | 152 | */ |
| 153 | 153 | public function addIndex(array $columns, $name) |
| 154 | 154 | { |
| 155 | - if (!isset($this->cm->table['indexes'])) { |
|
| 155 | + if ( ! isset($this->cm->table['indexes'])) { |
|
| 156 | 156 | $this->cm->table['indexes'] = []; |
| 157 | 157 | } |
| 158 | 158 | |
@@ -1428,7 +1428,7 @@ |
||
| 1428 | 1428 | |
| 1429 | 1429 | if (Type::hasType($mapping['type']) && Type::getType($mapping['type'])->canRequireSQLConversion()) { |
| 1430 | 1430 | if (isset($mapping['id']) && true === $mapping['id']) { |
| 1431 | - throw MappingException::sqlConversionNotAllowedForIdentifiers($this->name, $mapping['fieldName'], $mapping['type']); |
|
| 1431 | + throw MappingException::sqlConversionNotAllowedForIdentifiers($this->name, $mapping['fieldName'], $mapping['type']); |
|
| 1432 | 1432 | } |
| 1433 | 1433 | |
| 1434 | 1434 | $mapping['requireSQLConversion'] = true; |
@@ -695,7 +695,7 @@ discard block |
||
| 695 | 695 | public function getSingleIdReflectionProperty() |
| 696 | 696 | { |
| 697 | 697 | if ($this->isIdentifierComposite) { |
| 698 | - throw new BadMethodCallException("Class " . $this->name . " has a composite identifier."); |
|
| 698 | + throw new BadMethodCallException("Class ".$this->name." has a composite identifier."); |
|
| 699 | 699 | } |
| 700 | 700 | |
| 701 | 701 | return $this->reflFields[$this->identifier[0]]; |
@@ -790,7 +790,7 @@ discard block |
||
| 790 | 790 | */ |
| 791 | 791 | public function __toString() |
| 792 | 792 | { |
| 793 | - return __CLASS__ . '@' . spl_object_hash($this); |
|
| 793 | + return __CLASS__.'@'.spl_object_hash($this); |
|
| 794 | 794 | } |
| 795 | 795 | |
| 796 | 796 | /** |
@@ -1106,7 +1106,7 @@ discard block |
||
| 1106 | 1106 | } |
| 1107 | 1107 | |
| 1108 | 1108 | if ( ! isset($cache['region'])) { |
| 1109 | - $cache['region'] = strtolower(str_replace('\\', '_', $this->rootEntityName)) . '__' . $fieldName; |
|
| 1109 | + $cache['region'] = strtolower(str_replace('\\', '_', $this->rootEntityName)).'__'.$fieldName; |
|
| 1110 | 1110 | } |
| 1111 | 1111 | |
| 1112 | 1112 | return $cache; |
@@ -1386,7 +1386,7 @@ discard block |
||
| 1386 | 1386 | protected function _validateAndCompleteFieldMapping(array &$mapping) |
| 1387 | 1387 | { |
| 1388 | 1388 | // Check mandatory fields |
| 1389 | - if ( ! isset($mapping['fieldName']) || !$mapping['fieldName']) { |
|
| 1389 | + if ( ! isset($mapping['fieldName']) || ! $mapping['fieldName']) { |
|
| 1390 | 1390 | throw MappingException::missingFieldName($this->name); |
| 1391 | 1391 | } |
| 1392 | 1392 | |
@@ -1499,14 +1499,14 @@ discard block |
||
| 1499 | 1499 | $this->isIdentifierComposite = true; |
| 1500 | 1500 | } |
| 1501 | 1501 | |
| 1502 | - if ($this->cache && !isset($mapping['cache'])) { |
|
| 1502 | + if ($this->cache && ! isset($mapping['cache'])) { |
|
| 1503 | 1503 | throw CacheException::nonCacheableEntityAssociation($this->name, $mapping['fieldName']); |
| 1504 | 1504 | } |
| 1505 | 1505 | } |
| 1506 | 1506 | |
| 1507 | 1507 | // Mandatory attributes for both sides |
| 1508 | 1508 | // Mandatory: fieldName, targetEntity |
| 1509 | - if ( ! isset($mapping['fieldName']) || !$mapping['fieldName']) { |
|
| 1509 | + if ( ! isset($mapping['fieldName']) || ! $mapping['fieldName']) { |
|
| 1510 | 1510 | throw MappingException::missingFieldName($this->name); |
| 1511 | 1511 | } |
| 1512 | 1512 | |
@@ -1628,7 +1628,7 @@ discard block |
||
| 1628 | 1628 | throw new RuntimeException("ClassMetadataInfo::setTable() has to be called before defining a one to one relationship."); |
| 1629 | 1629 | } |
| 1630 | 1630 | |
| 1631 | - $this->table['uniqueConstraints'][$mapping['fieldName'] . "_uniq"] = [ |
|
| 1631 | + $this->table['uniqueConstraints'][$mapping['fieldName']."_uniq"] = [ |
|
| 1632 | 1632 | 'columns' => $uniqueConstraintColumns |
| 1633 | 1633 | ]; |
| 1634 | 1634 | } |
@@ -1643,7 +1643,7 @@ discard block |
||
| 1643 | 1643 | unset($mapping['unique']); |
| 1644 | 1644 | } |
| 1645 | 1645 | |
| 1646 | - if (isset($mapping['id']) && $mapping['id'] === true && !$mapping['isOwningSide']) { |
|
| 1646 | + if (isset($mapping['id']) && $mapping['id'] === true && ! $mapping['isOwningSide']) { |
|
| 1647 | 1647 | throw MappingException::illegalInverseIdentifierAssociation($this->name, $mapping['fieldName']); |
| 1648 | 1648 | } |
| 1649 | 1649 | |
@@ -1697,7 +1697,7 @@ discard block |
||
| 1697 | 1697 | } |
| 1698 | 1698 | |
| 1699 | 1699 | $selfReferencingEntityWithoutJoinColumns = $mapping['sourceEntity'] == $mapping['targetEntity'] |
| 1700 | - && (! (isset($mapping['joinTable']['joinColumns']) || isset($mapping['joinTable']['inverseJoinColumns']))); |
|
| 1700 | + && ( ! (isset($mapping['joinTable']['joinColumns']) || isset($mapping['joinTable']['inverseJoinColumns']))); |
|
| 1701 | 1701 | |
| 1702 | 1702 | if ( ! isset($mapping['joinTable']['joinColumns'])) { |
| 1703 | 1703 | $mapping['joinTable']['joinColumns'] = [ |
@@ -1890,7 +1890,7 @@ discard block |
||
| 1890 | 1890 | |
| 1891 | 1891 | // Association defined as Id field |
| 1892 | 1892 | $joinColumns = $this->associationMappings[$idProperty]['joinColumns']; |
| 1893 | - $assocColumnNames = array_map(function ($joinColumn) { return $joinColumn['name']; }, $joinColumns); |
|
| 1893 | + $assocColumnNames = array_map(function($joinColumn) { return $joinColumn['name']; }, $joinColumns); |
|
| 1894 | 1894 | |
| 1895 | 1895 | $columnNames = array_merge($columnNames, $assocColumnNames); |
| 1896 | 1896 | } |
@@ -2071,7 +2071,7 @@ discard block |
||
| 2071 | 2071 | public function getTemporaryIdTableName() |
| 2072 | 2072 | { |
| 2073 | 2073 | // replace dots with underscores because PostgreSQL creates temporary tables in a special schema |
| 2074 | - return str_replace('.', '_', $this->getTableName() . '_id_tmp'); |
|
| 2074 | + return str_replace('.', '_', $this->getTableName().'_id_tmp'); |
|
| 2075 | 2075 | } |
| 2076 | 2076 | |
| 2077 | 2077 | /** |
@@ -2408,7 +2408,7 @@ discard block |
||
| 2408 | 2408 | */ |
| 2409 | 2409 | public function addNamedQuery(array $queryMapping) |
| 2410 | 2410 | { |
| 2411 | - if (!isset($queryMapping['name'])) { |
|
| 2411 | + if ( ! isset($queryMapping['name'])) { |
|
| 2412 | 2412 | throw MappingException::nameIsMandatoryForQueryMapping($this->name); |
| 2413 | 2413 | } |
| 2414 | 2414 | |
@@ -2416,7 +2416,7 @@ discard block |
||
| 2416 | 2416 | throw MappingException::duplicateQueryMapping($this->name, $queryMapping['name']); |
| 2417 | 2417 | } |
| 2418 | 2418 | |
| 2419 | - if (!isset($queryMapping['query'])) { |
|
| 2419 | + if ( ! isset($queryMapping['query'])) { |
|
| 2420 | 2420 | throw MappingException::emptyQueryMapping($this->name, $queryMapping['name']); |
| 2421 | 2421 | } |
| 2422 | 2422 | |
@@ -2443,7 +2443,7 @@ discard block |
||
| 2443 | 2443 | */ |
| 2444 | 2444 | public function addNamedNativeQuery(array $queryMapping) |
| 2445 | 2445 | { |
| 2446 | - if (!isset($queryMapping['name'])) { |
|
| 2446 | + if ( ! isset($queryMapping['name'])) { |
|
| 2447 | 2447 | throw MappingException::nameIsMandatoryForQueryMapping($this->name); |
| 2448 | 2448 | } |
| 2449 | 2449 | |
@@ -2451,11 +2451,11 @@ discard block |
||
| 2451 | 2451 | throw MappingException::duplicateQueryMapping($this->name, $queryMapping['name']); |
| 2452 | 2452 | } |
| 2453 | 2453 | |
| 2454 | - if (!isset($queryMapping['query'])) { |
|
| 2454 | + if ( ! isset($queryMapping['query'])) { |
|
| 2455 | 2455 | throw MappingException::emptyQueryMapping($this->name, $queryMapping['name']); |
| 2456 | 2456 | } |
| 2457 | 2457 | |
| 2458 | - if (!isset($queryMapping['resultClass']) && !isset($queryMapping['resultSetMapping'])) { |
|
| 2458 | + if ( ! isset($queryMapping['resultClass']) && ! isset($queryMapping['resultSetMapping'])) { |
|
| 2459 | 2459 | throw MappingException::missingQueryMapping($this->name, $queryMapping['name']); |
| 2460 | 2460 | } |
| 2461 | 2461 | |
@@ -2487,7 +2487,7 @@ discard block |
||
| 2487 | 2487 | */ |
| 2488 | 2488 | public function addSqlResultSetMapping(array $resultMapping) |
| 2489 | 2489 | { |
| 2490 | - if (!isset($resultMapping['name'])) { |
|
| 2490 | + if ( ! isset($resultMapping['name'])) { |
|
| 2491 | 2491 | throw MappingException::nameIsMandatoryForSqlResultSetMapping($this->name); |
| 2492 | 2492 | } |
| 2493 | 2493 | |
@@ -2497,7 +2497,7 @@ discard block |
||
| 2497 | 2497 | |
| 2498 | 2498 | if (isset($resultMapping['entities'])) { |
| 2499 | 2499 | foreach ($resultMapping['entities'] as $key => $entityResult) { |
| 2500 | - if (!isset($entityResult['entityClass'])) { |
|
| 2500 | + if ( ! isset($entityResult['entityClass'])) { |
|
| 2501 | 2501 | throw MappingException::missingResultSetMappingEntity($this->name, $resultMapping['name']); |
| 2502 | 2502 | } |
| 2503 | 2503 | |
@@ -2516,11 +2516,11 @@ discard block |
||
| 2516 | 2516 | |
| 2517 | 2517 | if (isset($entityResult['fields'])) { |
| 2518 | 2518 | foreach ($entityResult['fields'] as $k => $field) { |
| 2519 | - if (!isset($field['name'])) { |
|
| 2519 | + if ( ! isset($field['name'])) { |
|
| 2520 | 2520 | throw MappingException::missingResultSetMappingFieldName($this->name, $resultMapping['name']); |
| 2521 | 2521 | } |
| 2522 | 2522 | |
| 2523 | - if (!isset($field['column'])) { |
|
| 2523 | + if ( ! isset($field['column'])) { |
|
| 2524 | 2524 | $fieldName = $field['name']; |
| 2525 | 2525 | if (strpos($fieldName, '.')) { |
| 2526 | 2526 | list(, $fieldName) = explode('.', $fieldName); |
@@ -3011,7 +3011,7 @@ discard block |
||
| 3011 | 3011 | } |
| 3012 | 3012 | |
| 3013 | 3013 | if ($definition['sequenceName'][0] == '`') { |
| 3014 | - $definition['sequenceName'] = trim($definition['sequenceName'], '`'); |
|
| 3014 | + $definition['sequenceName'] = trim($definition['sequenceName'], '`'); |
|
| 3015 | 3015 | $definition['quoted'] = true; |
| 3016 | 3016 | } |
| 3017 | 3017 | |
@@ -3111,7 +3111,7 @@ discard block |
||
| 3111 | 3111 | public function getAssociationTargetClass($assocName) |
| 3112 | 3112 | { |
| 3113 | 3113 | if ( ! isset($this->associationMappings[$assocName])) { |
| 3114 | - throw new InvalidArgumentException("Association name expected, '" . $assocName ."' is not an association."); |
|
| 3114 | + throw new InvalidArgumentException("Association name expected, '".$assocName."' is not an association."); |
|
| 3115 | 3115 | } |
| 3116 | 3116 | |
| 3117 | 3117 | return $this->associationMappings[$assocName]['targetEntity']; |
@@ -3150,7 +3150,7 @@ discard block |
||
| 3150 | 3150 | // Association defined as Id field |
| 3151 | 3151 | $joinColumns = $this->associationMappings[$idProperty]['joinColumns']; |
| 3152 | 3152 | $assocQuotedColumnNames = array_map( |
| 3153 | - function ($joinColumn) use ($platform) { |
|
| 3153 | + function($joinColumn) use ($platform) { |
|
| 3154 | 3154 | return isset($joinColumn['quoted']) |
| 3155 | 3155 | ? $platform->quoteIdentifier($joinColumn['name']) |
| 3156 | 3156 | : $joinColumn['name']; |
@@ -3261,7 +3261,7 @@ discard block |
||
| 3261 | 3261 | } |
| 3262 | 3262 | |
| 3263 | 3263 | if ($className !== null && strpos($className, '\\') === false && $this->namespace) { |
| 3264 | - return $this->namespace . '\\' . $className; |
|
| 3264 | + return $this->namespace.'\\'.$className; |
|
| 3265 | 3265 | } |
| 3266 | 3266 | |
| 3267 | 3267 | return $className; |
@@ -3313,13 +3313,13 @@ discard block |
||
| 3313 | 3313 | foreach ($embeddable->fieldMappings as $fieldMapping) { |
| 3314 | 3314 | $fieldMapping['originalClass'] = $fieldMapping['originalClass'] ?? $embeddable->name; |
| 3315 | 3315 | $fieldMapping['declaredField'] = isset($fieldMapping['declaredField']) |
| 3316 | - ? $property . '.' . $fieldMapping['declaredField'] |
|
| 3316 | + ? $property.'.'.$fieldMapping['declaredField'] |
|
| 3317 | 3317 | : $property; |
| 3318 | 3318 | $fieldMapping['originalField'] = $fieldMapping['originalField'] ?? $fieldMapping['fieldName']; |
| 3319 | - $fieldMapping['fieldName'] = $property . "." . $fieldMapping['fieldName']; |
|
| 3319 | + $fieldMapping['fieldName'] = $property.".".$fieldMapping['fieldName']; |
|
| 3320 | 3320 | |
| 3321 | - if (! empty($this->embeddedClasses[$property]['columnPrefix'])) { |
|
| 3322 | - $fieldMapping['columnName'] = $this->embeddedClasses[$property]['columnPrefix'] . $fieldMapping['columnName']; |
|
| 3321 | + if ( ! empty($this->embeddedClasses[$property]['columnPrefix'])) { |
|
| 3322 | + $fieldMapping['columnName'] = $this->embeddedClasses[$property]['columnPrefix'].$fieldMapping['columnName']; |
|
| 3323 | 3323 | } elseif ($this->embeddedClasses[$property]['columnPrefix'] !== false) { |
| 3324 | 3324 | $fieldMapping['columnName'] = $this->namingStrategy |
| 3325 | 3325 | ->embeddedFieldToColumnName( |
@@ -3360,7 +3360,7 @@ discard block |
||
| 3360 | 3360 | { |
| 3361 | 3361 | $sequencePrefix = $this->getSequencePrefix($platform); |
| 3362 | 3362 | $columnName = $this->getSingleIdentifierColumnName(); |
| 3363 | - $sequenceName = $sequencePrefix . '_' . $columnName . '_seq'; |
|
| 3363 | + $sequenceName = $sequencePrefix.'_'.$columnName.'_seq'; |
|
| 3364 | 3364 | |
| 3365 | 3365 | return $sequenceName; |
| 3366 | 3366 | } |
@@ -3380,10 +3380,10 @@ discard block |
||
| 3380 | 3380 | |
| 3381 | 3381 | // Prepend the schema name to the table name if there is one |
| 3382 | 3382 | if ($schemaName = $this->getSchemaName()) { |
| 3383 | - $sequencePrefix = $schemaName . '.' . $tableName; |
|
| 3383 | + $sequencePrefix = $schemaName.'.'.$tableName; |
|
| 3384 | 3384 | |
| 3385 | 3385 | if ( ! $platform->supportsSchemas() && $platform->canEmulateSchemas()) { |
| 3386 | - $sequencePrefix = $schemaName . '__' . $tableName; |
|
| 3386 | + $sequencePrefix = $schemaName.'__'.$tableName; |
|
| 3387 | 3387 | } |
| 3388 | 3388 | } |
| 3389 | 3389 | |
@@ -3395,8 +3395,8 @@ discard block |
||
| 3395 | 3395 | */ |
| 3396 | 3396 | private function assertMappingOrderBy(array $mapping) |
| 3397 | 3397 | { |
| 3398 | - if (isset($mapping['orderBy']) && !is_array($mapping['orderBy'])) { |
|
| 3399 | - throw new InvalidArgumentException("'orderBy' is expected to be an array, not " . gettype($mapping['orderBy'])); |
|
| 3398 | + if (isset($mapping['orderBy']) && ! is_array($mapping['orderBy'])) { |
|
| 3399 | + throw new InvalidArgumentException("'orderBy' is expected to be an array, not ".gettype($mapping['orderBy'])); |
|
| 3400 | 3400 | } |
| 3401 | 3401 | } |
| 3402 | 3402 | } |
@@ -30,9 +30,9 @@ |
||
| 30 | 30 | */ |
| 31 | 31 | class ReadOnlyCachedCollectionPersister extends NonStrictReadWriteCachedCollectionPersister |
| 32 | 32 | { |
| 33 | - /** |
|
| 34 | - * {@inheritdoc} |
|
| 35 | - */ |
|
| 33 | + /** |
|
| 34 | + * {@inheritdoc} |
|
| 35 | + */ |
|
| 36 | 36 | public function update(PersistentCollection $collection) |
| 37 | 37 | { |
| 38 | 38 | if ($collection->isDirty() && $collection->getSnapshot()) { |
@@ -37,9 +37,9 @@ discard block |
||
| 37 | 37 | */ |
| 38 | 38 | abstract class AbstractCollectionPersister implements CachedCollectionPersister |
| 39 | 39 | { |
| 40 | - /** |
|
| 41 | - * @var \Doctrine\ORM\UnitOfWork |
|
| 42 | - */ |
|
| 40 | + /** |
|
| 41 | + * @var \Doctrine\ORM\UnitOfWork |
|
| 42 | + */ |
|
| 43 | 43 | protected $uow; |
| 44 | 44 | |
| 45 | 45 | /** |
@@ -67,9 +67,9 @@ discard block |
||
| 67 | 67 | */ |
| 68 | 68 | protected $association; |
| 69 | 69 | |
| 70 | - /** |
|
| 71 | - * @var array |
|
| 72 | - */ |
|
| 70 | + /** |
|
| 71 | + * @var array |
|
| 72 | + */ |
|
| 73 | 73 | protected $queuedCache = []; |
| 74 | 74 | |
| 75 | 75 | /** |
@@ -73,7 +73,7 @@ discard block |
||
| 73 | 73 | */ |
| 74 | 74 | public function getCacheLogger() |
| 75 | 75 | { |
| 76 | - return $this->cacheLogger; |
|
| 76 | + return $this->cacheLogger; |
|
| 77 | 77 | } |
| 78 | 78 | |
| 79 | 79 | /** |
@@ -115,7 +115,7 @@ discard block |
||
| 115 | 115 | ); |
| 116 | 116 | } |
| 117 | 117 | |
| 118 | - return $this->queryValidator; |
|
| 118 | + return $this->queryValidator; |
|
| 119 | 119 | } |
| 120 | 120 | |
| 121 | 121 | /** |
@@ -153,7 +153,7 @@ |
||
| 153 | 153 | */ |
| 154 | 154 | public function newDefaultAnnotationDriver($paths = [], $useSimpleAnnotationReader = true) |
| 155 | 155 | { |
| 156 | - AnnotationRegistry::registerFile(__DIR__ . '/Mapping/Driver/DoctrineAnnotations.php'); |
|
| 156 | + AnnotationRegistry::registerFile(__DIR__.'/Mapping/Driver/DoctrineAnnotations.php'); |
|
| 157 | 157 | |
| 158 | 158 | if ($useSimpleAnnotationReader) { |
| 159 | 159 | // Register the ORM Annotations in the AnnotationRegistry |
@@ -40,12 +40,12 @@ |
||
| 40 | 40 | $ids = []; |
| 41 | 41 | |
| 42 | 42 | foreach ($id as $key => $value) { |
| 43 | - $ids[] = $key . '(' . $value . ')'; |
|
| 43 | + $ids[] = $key.'('.$value.')'; |
|
| 44 | 44 | } |
| 45 | 45 | |
| 46 | 46 | |
| 47 | 47 | return new self( |
| 48 | - 'Entity of type \'' . $className . '\'' . ($ids ? ' for IDs ' . implode(', ', $ids) : '') . ' was not found' |
|
| 48 | + 'Entity of type \''.$className.'\''.($ids ? ' for IDs '.implode(', ', $ids) : '').' was not found' |
|
| 49 | 49 | ); |
| 50 | 50 | } |
| 51 | 51 | } |
@@ -108,10 +108,10 @@ discard block |
||
| 108 | 108 | // It's a joined result |
| 109 | 109 | |
| 110 | 110 | $parent = $this->_rsm->parentAliasMap[$dqlAlias]; |
| 111 | - $path = $parent . '.' . $dqlAlias; |
|
| 111 | + $path = $parent.'.'.$dqlAlias; |
|
| 112 | 112 | |
| 113 | 113 | // missing parent data, skipping as RIGHT JOIN hydration is not supported. |
| 114 | - if ( ! isset($nonemptyComponents[$parent]) ) { |
|
| 114 | + if ( ! isset($nonemptyComponents[$parent])) { |
|
| 115 | 115 | continue; |
| 116 | 116 | } |
| 117 | 117 | |
@@ -120,9 +120,9 @@ discard block |
||
| 120 | 120 | if ($this->_rsm->isMixed && isset($this->_rootAliases[$parent])) { |
| 121 | 121 | $first = reset($this->_resultPointers); |
| 122 | 122 | // TODO: Exception if $key === null ? |
| 123 | - $baseElement =& $this->_resultPointers[$parent][key($first)]; |
|
| 123 | + $baseElement = & $this->_resultPointers[$parent][key($first)]; |
|
| 124 | 124 | } else if (isset($this->_resultPointers[$parent])) { |
| 125 | - $baseElement =& $this->_resultPointers[$parent]; |
|
| 125 | + $baseElement = & $this->_resultPointers[$parent]; |
|
| 126 | 126 | } else { |
| 127 | 127 | unset($this->_resultPointers[$dqlAlias]); // Ticket #1228 |
| 128 | 128 | |
@@ -173,7 +173,7 @@ discard block |
||
| 173 | 173 | } |
| 174 | 174 | } |
| 175 | 175 | |
| 176 | - $coll =& $baseElement[$relationAlias]; |
|
| 176 | + $coll = & $baseElement[$relationAlias]; |
|
| 177 | 177 | |
| 178 | 178 | if (is_array($coll)) { |
| 179 | 179 | $this->updateResultPointer($coll, $index, $dqlAlias, $oneToOne); |
@@ -185,7 +185,7 @@ discard block |
||
| 185 | 185 | $entityKey = $this->_rsm->entityMappings[$dqlAlias] ?: 0; |
| 186 | 186 | |
| 187 | 187 | // if this row has a NULL value for the root result id then make it a null result. |
| 188 | - if ( ! isset($nonemptyComponents[$dqlAlias]) ) { |
|
| 188 | + if ( ! isset($nonemptyComponents[$dqlAlias])) { |
|
| 189 | 189 | $result[] = $this->_rsm->isMixed |
| 190 | 190 | ? [$entityKey => null] |
| 191 | 191 | : null; |
@@ -246,7 +246,7 @@ discard block |
||
| 246 | 246 | $resultKey = $this->_resultCounter - 1; |
| 247 | 247 | } |
| 248 | 248 | |
| 249 | - $scalarCount = (isset($rowData['scalars'])? count($rowData['scalars']): 0); |
|
| 249 | + $scalarCount = (isset($rowData['scalars']) ? count($rowData['scalars']) : 0); |
|
| 250 | 250 | |
| 251 | 251 | foreach ($rowData['newObjects'] as $objIndex => $newObject) { |
| 252 | 252 | $class = $newObject['class']; |
@@ -284,13 +284,13 @@ discard block |
||
| 284 | 284 | } |
| 285 | 285 | |
| 286 | 286 | if ($oneToOne) { |
| 287 | - $this->_resultPointers[$dqlAlias] =& $coll; |
|
| 287 | + $this->_resultPointers[$dqlAlias] = & $coll; |
|
| 288 | 288 | |
| 289 | 289 | return; |
| 290 | 290 | } |
| 291 | 291 | |
| 292 | 292 | if ($index !== false) { |
| 293 | - $this->_resultPointers[$dqlAlias] =& $coll[$index]; |
|
| 293 | + $this->_resultPointers[$dqlAlias] = & $coll[$index]; |
|
| 294 | 294 | |
| 295 | 295 | return; |
| 296 | 296 | } |
@@ -300,7 +300,7 @@ discard block |
||
| 300 | 300 | } |
| 301 | 301 | |
| 302 | 302 | end($coll); |
| 303 | - $this->_resultPointers[$dqlAlias] =& $coll[key($coll)]; |
|
| 303 | + $this->_resultPointers[$dqlAlias] = & $coll[key($coll)]; |
|
| 304 | 304 | |
| 305 | 305 | return; |
| 306 | 306 | } |