@@ -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 |
@@ -131,7 +131,7 @@ discard block |
||
| 131 | 131 | foreach ($joinColumns as $joinColumn) { |
| 132 | 132 | $columnName = $this->quoteStrategy->getJoinColumnName($joinColumn, $sourceClass, $this->platform); |
| 133 | 133 | $referencedName = $joinColumn['referencedColumnName']; |
| 134 | - $conditions[] = 't.' . $columnName . ' = ?'; |
|
| 134 | + $conditions[] = 't.'.$columnName.' = ?'; |
|
| 135 | 135 | $params[] = $id[$sourceClass->getFieldForColumn($referencedName)]; |
| 136 | 136 | $types[] = PersisterHelper::getTypeOfColumn($referencedName, $sourceClass, $this->em); |
| 137 | 137 | } |
@@ -160,9 +160,9 @@ discard block |
||
| 160 | 160 | }*/ |
| 161 | 161 | |
| 162 | 162 | $sql = 'SELECT COUNT(*)' |
| 163 | - . ' FROM ' . $joinTableName . ' t' |
|
| 163 | + . ' FROM '.$joinTableName.' t' |
|
| 164 | 164 | . $joinTargetEntitySQL |
| 165 | - . ' WHERE ' . implode(' AND ', $conditions); |
|
| 165 | + . ' WHERE '.implode(' AND ', $conditions); |
|
| 166 | 166 | |
| 167 | 167 | return $this->conn->fetchColumn($sql, $params, 0, $types); |
| 168 | 168 | } |
@@ -190,7 +190,7 @@ discard block |
||
| 190 | 190 | |
| 191 | 191 | list($quotedJoinTable, $whereClauses, $params, $types) = $this->getJoinTableRestrictionsWithKey($collection, $key, true); |
| 192 | 192 | |
| 193 | - $sql = 'SELECT 1 FROM ' . $quotedJoinTable . ' WHERE ' . implode(' AND ', $whereClauses); |
|
| 193 | + $sql = 'SELECT 1 FROM '.$quotedJoinTable.' WHERE '.implode(' AND ', $whereClauses); |
|
| 194 | 194 | |
| 195 | 195 | return (bool) $this->conn->fetchColumn($sql, $params, 0, $types); |
| 196 | 196 | } |
@@ -206,7 +206,7 @@ discard block |
||
| 206 | 206 | |
| 207 | 207 | list($quotedJoinTable, $whereClauses, $params, $types) = $this->getJoinTableRestrictions($collection, $element, true); |
| 208 | 208 | |
| 209 | - $sql = 'SELECT 1 FROM ' . $quotedJoinTable . ' WHERE ' . implode(' AND ', $whereClauses); |
|
| 209 | + $sql = 'SELECT 1 FROM '.$quotedJoinTable.' WHERE '.implode(' AND ', $whereClauses); |
|
| 210 | 210 | |
| 211 | 211 | return (bool) $this->conn->fetchColumn($sql, $params, 0, $types); |
| 212 | 212 | } |
@@ -222,7 +222,7 @@ discard block |
||
| 222 | 222 | |
| 223 | 223 | list($quotedJoinTable, $whereClauses, $params, $types) = $this->getJoinTableRestrictions($collection, $element, false); |
| 224 | 224 | |
| 225 | - $sql = 'DELETE FROM ' . $quotedJoinTable . ' WHERE ' . implode(' AND ', $whereClauses); |
|
| 225 | + $sql = 'DELETE FROM '.$quotedJoinTable.' WHERE '.implode(' AND ', $whereClauses); |
|
| 226 | 226 | |
| 227 | 227 | return (bool) $this->conn->executeUpdate($sql, $params, $types); |
| 228 | 228 | } |
@@ -271,11 +271,11 @@ discard block |
||
| 271 | 271 | $rsm = new Query\ResultSetMappingBuilder($this->em); |
| 272 | 272 | $rsm->addRootEntityFromClassMetadata($targetClass->name, 'te'); |
| 273 | 273 | |
| 274 | - $sql = 'SELECT ' . $rsm->generateSelectClause() |
|
| 275 | - . ' FROM ' . $tableName . ' te' |
|
| 276 | - . ' JOIN ' . $joinTable . ' t ON' |
|
| 274 | + $sql = 'SELECT '.$rsm->generateSelectClause() |
|
| 275 | + . ' FROM '.$tableName.' te' |
|
| 276 | + . ' JOIN '.$joinTable.' t ON' |
|
| 277 | 277 | . implode(' AND ', $onConditions) |
| 278 | - . ' WHERE ' . implode(' AND ', $whereClauses); |
|
| 278 | + . ' WHERE '.implode(' AND ', $whereClauses); |
|
| 279 | 279 | |
| 280 | 280 | $sql .= $this->getOrderingSql($criteria, $targetClass); |
| 281 | 281 | |
@@ -316,8 +316,8 @@ discard block |
||
| 316 | 316 | |
| 317 | 317 | // A join is needed if there is filtering on the target entity |
| 318 | 318 | $tableName = $this->quoteStrategy->getTableName($rootClass, $this->platform); |
| 319 | - $joinSql = ' JOIN ' . $tableName . ' te' |
|
| 320 | - . ' ON' . implode(' AND ', $this->getOnConditionSQL($mapping)); |
|
| 319 | + $joinSql = ' JOIN '.$tableName.' te' |
|
| 320 | + . ' ON'.implode(' AND ', $this->getOnConditionSQL($mapping)); |
|
| 321 | 321 | |
| 322 | 322 | return [$joinSql, $filterSql]; |
| 323 | 323 | } |
@@ -336,12 +336,12 @@ discard block |
||
| 336 | 336 | |
| 337 | 337 | foreach ($this->em->getFilters()->getEnabledFilters() as $filter) { |
| 338 | 338 | if ($filterExpr = $filter->addFilterConstraint($targetEntity, $targetTableAlias)) { |
| 339 | - $filterClauses[] = '(' . $filterExpr . ')'; |
|
| 339 | + $filterClauses[] = '('.$filterExpr.')'; |
|
| 340 | 340 | } |
| 341 | 341 | } |
| 342 | 342 | |
| 343 | 343 | return $filterClauses |
| 344 | - ? '(' . implode(' AND ', $filterClauses) . ')' |
|
| 344 | + ? '('.implode(' AND ', $filterClauses).')' |
|
| 345 | 345 | : ''; |
| 346 | 346 | } |
| 347 | 347 | |
@@ -369,7 +369,7 @@ discard block |
||
| 369 | 369 | $joinColumnName = $this->quoteStrategy->getJoinColumnName($joinColumn, $targetClass, $this->platform); |
| 370 | 370 | $refColumnName = $this->quoteStrategy->getReferencedJoinColumnName($joinColumn, $targetClass, $this->platform); |
| 371 | 371 | |
| 372 | - $conditions[] = ' t.' . $joinColumnName . ' = ' . 'te.' . $refColumnName; |
|
| 372 | + $conditions[] = ' t.'.$joinColumnName.' = '.'te.'.$refColumnName; |
|
| 373 | 373 | } |
| 374 | 374 | |
| 375 | 375 | return $conditions; |
@@ -391,8 +391,8 @@ discard block |
||
| 391 | 391 | $columns[] = $this->quoteStrategy->getJoinColumnName($joinColumn, $class, $this->platform); |
| 392 | 392 | } |
| 393 | 393 | |
| 394 | - return 'DELETE FROM ' . $joinTable |
|
| 395 | - . ' WHERE ' . implode(' = ? AND ', $columns) . ' = ?'; |
|
| 394 | + return 'DELETE FROM '.$joinTable |
|
| 395 | + . ' WHERE '.implode(' = ? AND ', $columns).' = ?'; |
|
| 396 | 396 | } |
| 397 | 397 | |
| 398 | 398 | /** |
@@ -451,8 +451,8 @@ discard block |
||
| 451 | 451 | } |
| 452 | 452 | |
| 453 | 453 | return [ |
| 454 | - 'DELETE FROM ' . $this->quoteStrategy->getJoinTableName($mapping, $class, $this->platform) |
|
| 455 | - . ' WHERE ' . implode(' = ? AND ', $columns) . ' = ?', |
|
| 454 | + 'DELETE FROM '.$this->quoteStrategy->getJoinTableName($mapping, $class, $this->platform) |
|
| 455 | + . ' WHERE '.implode(' = ? AND ', $columns).' = ?', |
|
| 456 | 456 | $types, |
| 457 | 457 | ]; |
| 458 | 458 | } |
@@ -500,10 +500,10 @@ discard block |
||
| 500 | 500 | } |
| 501 | 501 | |
| 502 | 502 | return [ |
| 503 | - 'INSERT INTO ' . $this->quoteStrategy->getJoinTableName($mapping, $class, $this->platform) |
|
| 504 | - . ' (' . implode(', ', $columns) . ')' |
|
| 503 | + 'INSERT INTO '.$this->quoteStrategy->getJoinTableName($mapping, $class, $this->platform) |
|
| 504 | + . ' ('.implode(', ', $columns).')' |
|
| 505 | 505 | . ' VALUES' |
| 506 | - . ' (' . implode(', ', array_fill(0, count($columns), '?')) . ')', |
|
| 506 | + . ' ('.implode(', ', array_fill(0, count($columns), '?')).')', |
|
| 507 | 507 | $types, |
| 508 | 508 | ]; |
| 509 | 509 | } |
@@ -588,7 +588,7 @@ discard block |
||
| 588 | 588 | $sourceClass = $this->em->getClassMetadata($mapping['sourceEntity']); |
| 589 | 589 | $targetClass = $this->em->getClassMetadata($mapping['targetEntity']); |
| 590 | 590 | |
| 591 | - if (! $mapping['isOwningSide']) { |
|
| 591 | + if ( ! $mapping['isOwningSide']) { |
|
| 592 | 592 | $associationSourceClass = $this->em->getClassMetadata($mapping['targetEntity']); |
| 593 | 593 | $mapping = $associationSourceClass->associationMappings[$mapping['mappedBy']]; |
| 594 | 594 | $joinColumns = $mapping['joinTable']['joinColumns']; |
@@ -601,7 +601,7 @@ discard block |
||
| 601 | 601 | $targetRelationMode = 'relationToTargetKeyColumns'; |
| 602 | 602 | } |
| 603 | 603 | |
| 604 | - $quotedJoinTable = $this->quoteStrategy->getJoinTableName($mapping, $associationSourceClass, $this->platform). ' t'; |
|
| 604 | + $quotedJoinTable = $this->quoteStrategy->getJoinTableName($mapping, $associationSourceClass, $this->platform).' t'; |
|
| 605 | 605 | $whereClauses = []; |
| 606 | 606 | $params = []; |
| 607 | 607 | $types = []; |
@@ -612,14 +612,14 @@ discard block |
||
| 612 | 612 | $joinConditions = []; |
| 613 | 613 | |
| 614 | 614 | foreach ($joinColumns as $joinTableColumn) { |
| 615 | - $joinConditions[] = 't.' . $joinTableColumn['name'] . ' = tr.' . $joinTableColumn['referencedColumnName']; |
|
| 615 | + $joinConditions[] = 't.'.$joinTableColumn['name'].' = tr.'.$joinTableColumn['referencedColumnName']; |
|
| 616 | 616 | } |
| 617 | 617 | |
| 618 | 618 | $tableName = $this->quoteStrategy->getTableName($targetClass, $this->platform); |
| 619 | - $quotedJoinTable .= ' JOIN ' . $tableName . ' tr ON ' . implode(' AND ', $joinConditions); |
|
| 619 | + $quotedJoinTable .= ' JOIN '.$tableName.' tr ON '.implode(' AND ', $joinConditions); |
|
| 620 | 620 | $columnName = $targetClass->getColumnName($indexBy); |
| 621 | 621 | |
| 622 | - $whereClauses[] = 'tr.' . $columnName . ' = ?'; |
|
| 622 | + $whereClauses[] = 'tr.'.$columnName.' = ?'; |
|
| 623 | 623 | $params[] = $key; |
| 624 | 624 | $types[] = PersisterHelper::getTypeOfColumn($columnName, $targetClass, $this->em); |
| 625 | 625 | } |
@@ -627,7 +627,7 @@ discard block |
||
| 627 | 627 | foreach ($mapping['joinTableColumns'] as $joinTableColumn) { |
| 628 | 628 | if (isset($mapping[$sourceRelationMode][$joinTableColumn])) { |
| 629 | 629 | $column = $mapping[$sourceRelationMode][$joinTableColumn]; |
| 630 | - $whereClauses[] = 't.' . $joinTableColumn . ' = ?'; |
|
| 630 | + $whereClauses[] = 't.'.$joinTableColumn.' = ?'; |
|
| 631 | 631 | $params[] = $sourceClass->containsForeignIdentifier |
| 632 | 632 | ? $id[$sourceClass->getFieldForColumn($column)] |
| 633 | 633 | : $id[$sourceClass->fieldNames[$column]]; |
@@ -635,7 +635,7 @@ discard block |
||
| 635 | 635 | } elseif ( ! $joinNeeded) { |
| 636 | 636 | $column = $mapping[$targetRelationMode][$joinTableColumn]; |
| 637 | 637 | |
| 638 | - $whereClauses[] = 't.' . $joinTableColumn . ' = ?'; |
|
| 638 | + $whereClauses[] = 't.'.$joinTableColumn.' = ?'; |
|
| 639 | 639 | $params[] = $key; |
| 640 | 640 | $types[] = PersisterHelper::getTypeOfColumn($column, $targetClass, $this->em); |
| 641 | 641 | } |
@@ -645,7 +645,7 @@ discard block |
||
| 645 | 645 | list($joinTargetEntitySQL, $filterSql) = $this->getFilterSql($filterMapping); |
| 646 | 646 | |
| 647 | 647 | if ($filterSql) { |
| 648 | - $quotedJoinTable .= ' ' . $joinTargetEntitySQL; |
|
| 648 | + $quotedJoinTable .= ' '.$joinTargetEntitySQL; |
|
| 649 | 649 | $whereClauses[] = $filterSql; |
| 650 | 650 | } |
| 651 | 651 | } |
@@ -689,7 +689,7 @@ discard block |
||
| 689 | 689 | $types = []; |
| 690 | 690 | |
| 691 | 691 | foreach ($mapping['joinTableColumns'] as $joinTableColumn) { |
| 692 | - $whereClauses[] = ($addFilters ? 't.' : '') . $joinTableColumn . ' = ?'; |
|
| 692 | + $whereClauses[] = ($addFilters ? 't.' : '').$joinTableColumn.' = ?'; |
|
| 693 | 693 | |
| 694 | 694 | if (isset($mapping['relationToTargetKeyColumns'][$joinTableColumn])) { |
| 695 | 695 | $targetColumn = $mapping['relationToTargetKeyColumns'][$joinTableColumn]; |
@@ -711,7 +711,7 @@ discard block |
||
| 711 | 711 | list($joinTargetEntitySQL, $filterSql) = $this->getFilterSql($filterMapping); |
| 712 | 712 | |
| 713 | 713 | if ($filterSql) { |
| 714 | - $quotedJoinTable .= ' ' . $joinTargetEntitySQL; |
|
| 714 | + $quotedJoinTable .= ' '.$joinTargetEntitySQL; |
|
| 715 | 715 | $whereClauses[] = $filterSql; |
| 716 | 716 | } |
| 717 | 717 | } |
@@ -760,10 +760,10 @@ discard block |
||
| 760 | 760 | $targetClass, |
| 761 | 761 | $this->platform |
| 762 | 762 | ); |
| 763 | - $orderBy[] = $field . ' ' . $direction; |
|
| 763 | + $orderBy[] = $field.' '.$direction; |
|
| 764 | 764 | } |
| 765 | 765 | |
| 766 | - return ' ORDER BY ' . implode(', ', $orderBy); |
|
| 766 | + return ' ORDER BY '.implode(', ', $orderBy); |
|
| 767 | 767 | } |
| 768 | 768 | return ''; |
| 769 | 769 | } |
@@ -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 | } |