@@ -317,7 +317,7 @@ |
||
| 317 | 317 | /** |
| 318 | 318 | * Gets a query parameter. |
| 319 | 319 | * |
| 320 | - * @param mixed $key The key (index or name) of the bound parameter. |
|
| 320 | + * @param string $key The key (index or name) of the bound parameter. |
|
| 321 | 321 | * |
| 322 | 322 | * @return Query\Parameter|null The value of the bound parameter, or NULL if not available. |
| 323 | 323 | */ |
@@ -22,13 +22,10 @@ |
||
| 22 | 22 | use Doctrine\Common\Util\ClassUtils; |
| 23 | 23 | use Doctrine\Common\Collections\Collection; |
| 24 | 24 | use Doctrine\Common\Collections\ArrayCollection; |
| 25 | - |
|
| 26 | 25 | use Doctrine\ORM\Query\Parameter; |
| 27 | 26 | use Doctrine\ORM\Cache\QueryCacheKey; |
| 28 | 27 | use Doctrine\DBAL\Cache\QueryCacheProfile; |
| 29 | - |
|
| 30 | 28 | use Doctrine\ORM\Cache; |
| 31 | -use Doctrine\ORM\Query\QueryException; |
|
| 32 | 29 | |
| 33 | 30 | /** |
| 34 | 31 | * Base contract for ORM queries. Base class for Query and NativeQuery. |
@@ -212,10 +212,10 @@ |
||
| 212 | 212 | } |
| 213 | 213 | |
| 214 | 214 | /** |
| 215 | - * Obtain the name of the second level query cache region in which query results will be stored |
|
| 216 | - * |
|
| 217 | - * @return string|null The cache region name; NULL indicates the default region. |
|
| 218 | - */ |
|
| 215 | + * Obtain the name of the second level query cache region in which query results will be stored |
|
| 216 | + * |
|
| 217 | + * @return string|null The cache region name; NULL indicates the default region. |
|
| 218 | + */ |
|
| 219 | 219 | public function getCacheRegion() |
| 220 | 220 | { |
| 221 | 221 | return $this->cacheRegion; |
@@ -324,7 +324,7 @@ discard block |
||
| 324 | 324 | public function getParameter($key) |
| 325 | 325 | { |
| 326 | 326 | $filteredParameters = $this->parameters->filter( |
| 327 | - function ($parameter) use ($key) |
|
| 327 | + function($parameter) use ($key) |
|
| 328 | 328 | { |
| 329 | 329 | // Must not be identical because of string to integer conversion |
| 330 | 330 | return ($key == $parameter->getName()); |
@@ -373,7 +373,7 @@ discard block |
||
| 373 | 373 | public function setParameter($key, $value, $type = null) |
| 374 | 374 | { |
| 375 | 375 | $filteredParameters = $this->parameters->filter( |
| 376 | - function ($parameter) use ($key) |
|
| 376 | + function($parameter) use ($key) |
|
| 377 | 377 | { |
| 378 | 378 | // Must not be identical because of string to integer conversion |
| 379 | 379 | return ($key == $parameter->getName()); |
@@ -469,7 +469,7 @@ discard block |
||
| 469 | 469 | */ |
| 470 | 470 | private function translateNamespaces(Query\ResultSetMapping $rsm) |
| 471 | 471 | { |
| 472 | - $translate = function ($alias) { |
|
| 472 | + $translate = function($alias) { |
|
| 473 | 473 | return $this->_em->getClassMetadata($alias)->getName(); |
| 474 | 474 | }; |
| 475 | 475 | |
@@ -1114,6 +1114,6 @@ discard block |
||
| 1114 | 1114 | |
| 1115 | 1115 | ksort($hints); |
| 1116 | 1116 | |
| 1117 | - return sha1($query . '-' . serialize($params) . '-' . serialize($hints)); |
|
| 1117 | + return sha1($query.'-'.serialize($params).'-'.serialize($hints)); |
|
| 1118 | 1118 | } |
| 1119 | 1119 | } |
@@ -282,7 +282,7 @@ |
||
| 282 | 282 | /** |
| 283 | 283 | * Generates a string of currently query |
| 284 | 284 | * |
| 285 | - * @param array $query |
|
| 285 | + * @param string $query |
|
| 286 | 286 | * @param string $criteria |
| 287 | 287 | * @param array $orderBy |
| 288 | 288 | * @param integer $limit |
@@ -41,9 +41,9 @@ discard block |
||
| 41 | 41 | */ |
| 42 | 42 | abstract class AbstractEntityPersister implements CachedEntityPersister |
| 43 | 43 | { |
| 44 | - /** |
|
| 45 | - * @var \Doctrine\ORM\UnitOfWork |
|
| 46 | - */ |
|
| 44 | + /** |
|
| 45 | + * @var \Doctrine\ORM\UnitOfWork |
|
| 46 | + */ |
|
| 47 | 47 | protected $uow; |
| 48 | 48 | |
| 49 | 49 | /** |
@@ -61,9 +61,9 @@ discard block |
||
| 61 | 61 | */ |
| 62 | 62 | protected $class; |
| 63 | 63 | |
| 64 | - /** |
|
| 65 | - * @var array |
|
| 66 | - */ |
|
| 64 | + /** |
|
| 65 | + * @var array |
|
| 66 | + */ |
|
| 67 | 67 | protected $queuedCache = array(); |
| 68 | 68 | |
| 69 | 69 | /** |
@@ -297,7 +297,7 @@ |
||
| 297 | 297 | ? $this->persister->expandCriteriaParameters($criteria) |
| 298 | 298 | : $this->persister->expandParameters($criteria); |
| 299 | 299 | |
| 300 | - return sha1($query . serialize($params) . serialize($orderBy) . $limit . $offset . $timestamp); |
|
| 300 | + return sha1($query.serialize($params).serialize($orderBy).$limit.$offset.$timestamp); |
|
| 301 | 301 | } |
| 302 | 302 | |
| 303 | 303 | /** |
@@ -21,7 +21,6 @@ |
||
| 21 | 21 | |
| 22 | 22 | use Doctrine\Common\Collections\ArrayCollection; |
| 23 | 23 | use Doctrine\Common\Collections\Criteria; |
| 24 | - |
|
| 25 | 24 | use Doctrine\ORM\Query\Expr; |
| 26 | 25 | use Doctrine\ORM\Query\QueryExpressionVisitor; |
| 27 | 26 | |
@@ -91,7 +91,7 @@ |
||
| 91 | 91 | /** |
| 92 | 92 | * Sets the strategy for automatically generating proxy classes. |
| 93 | 93 | * |
| 94 | - * @param boolean|int $autoGenerate Possible values are constants of Doctrine\Common\Proxy\AbstractProxyFactory. |
|
| 94 | + * @param boolean $autoGenerate Possible values are constants of Doctrine\Common\Proxy\AbstractProxyFactory. |
|
| 95 | 95 | * True is converted to AUTOGENERATE_ALWAYS, false to AUTOGENERATE_NEVER. |
| 96 | 96 | * |
| 97 | 97 | * @return void |
@@ -151,7 +151,7 @@ |
||
| 151 | 151 | */ |
| 152 | 152 | public function newDefaultAnnotationDriver($paths = array(), $useSimpleAnnotationReader = true) |
| 153 | 153 | { |
| 154 | - AnnotationRegistry::registerFile(__DIR__ . '/Mapping/Driver/DoctrineAnnotations.php'); |
|
| 154 | + AnnotationRegistry::registerFile(__DIR__.'/Mapping/Driver/DoctrineAnnotations.php'); |
|
| 155 | 155 | |
| 156 | 156 | if ($useSimpleAnnotationReader) { |
| 157 | 157 | // Register the ORM Annotations in the AnnotationRegistry |
@@ -24,7 +24,6 @@ |
||
| 24 | 24 | use Doctrine\Common\Persistence\ObjectRepository; |
| 25 | 25 | use Doctrine\Common\Collections\Selectable; |
| 26 | 26 | use Doctrine\Common\Collections\Criteria; |
| 27 | -use Doctrine\Common\Collections\ArrayCollection; |
|
| 28 | 27 | |
| 29 | 28 | /** |
| 30 | 29 | * An EntityRepository serves as a repository for entities with generic as well as |
@@ -231,7 +231,7 @@ |
||
| 231 | 231 | } |
| 232 | 232 | |
| 233 | 233 | if (empty($arguments)) { |
| 234 | - throw ORMException::findByRequiresParameter($method . $by); |
|
| 234 | + throw ORMException::findByRequiresParameter($method.$by); |
|
| 235 | 235 | } |
| 236 | 236 | |
| 237 | 237 | $fieldName = lcfirst(\Doctrine\Common\Util\Inflector::classify($by)); |
@@ -24,9 +24,6 @@ |
||
| 24 | 24 | use Doctrine\ORM\Mapping\ClassMetadata; |
| 25 | 25 | use Doctrine\ORM\PersistentCollection; |
| 26 | 26 | use Doctrine\ORM\Query; |
| 27 | -use Doctrine\ORM\Events; |
|
| 28 | -use Doctrine\ORM\Event\LifecycleEventArgs; |
|
| 29 | -use Doctrine\ORM\Event\PostLoadEventDispatcher; |
|
| 30 | 27 | use Doctrine\Common\Collections\ArrayCollection; |
| 31 | 28 | use Doctrine\ORM\Proxy\Proxy; |
| 32 | 29 | |
@@ -202,7 +202,7 @@ discard block |
||
| 202 | 202 | $class->reflFields[$fieldName]->setValue($entity, $value); |
| 203 | 203 | $this->_uow->setOriginalEntityProperty($oid, $fieldName, $value); |
| 204 | 204 | |
| 205 | - $this->initializedCollections[$oid . $fieldName] = $value; |
|
| 205 | + $this->initializedCollections[$oid.$fieldName] = $value; |
|
| 206 | 206 | } else if ( |
| 207 | 207 | isset($this->_hints[Query::HINT_REFRESH]) || |
| 208 | 208 | isset($this->_hints['fetched'][$parentDqlAlias][$fieldName]) && |
@@ -213,10 +213,10 @@ discard block |
||
| 213 | 213 | $value->setInitialized(true); |
| 214 | 214 | $value->unwrap()->clear(); |
| 215 | 215 | |
| 216 | - $this->initializedCollections[$oid . $fieldName] = $value; |
|
| 216 | + $this->initializedCollections[$oid.$fieldName] = $value; |
|
| 217 | 217 | } else { |
| 218 | 218 | // Is already PersistentCollection, and DON'T REFRESH or FETCH-JOIN! |
| 219 | - $this->existingCollections[$oid . $fieldName] = $value; |
|
| 219 | + $this->existingCollections[$oid.$fieldName] = $value; |
|
| 220 | 220 | } |
| 221 | 221 | |
| 222 | 222 | return $value; |
@@ -289,7 +289,7 @@ discard block |
||
| 289 | 289 | $idHash = ''; |
| 290 | 290 | |
| 291 | 291 | foreach ($class->identifier as $fieldName) { |
| 292 | - $idHash .= ' ' . (isset($class->associationMappings[$fieldName]) |
|
| 292 | + $idHash .= ' '.(isset($class->associationMappings[$fieldName]) |
|
| 293 | 293 | ? $data[$class->associationMappings[$fieldName]['joinColumns'][0]['name']] |
| 294 | 294 | : $data[$fieldName]); |
| 295 | 295 | } |
@@ -342,7 +342,7 @@ discard block |
||
| 342 | 342 | $parentAlias = $this->_rsm->parentAliasMap[$dqlAlias]; |
| 343 | 343 | // we need the $path to save into the identifier map which entities were already |
| 344 | 344 | // seen for this parent-child relationship |
| 345 | - $path = $parentAlias . '.' . $dqlAlias; |
|
| 345 | + $path = $parentAlias.'.'.$dqlAlias; |
|
| 346 | 346 | |
| 347 | 347 | // We have a RIGHT JOIN result here. Doctrine cannot hydrate RIGHT JOIN Object-Graphs |
| 348 | 348 | if ( ! isset($nonemptyComponents[$parentAlias])) { |
@@ -382,7 +382,7 @@ discard block |
||
| 382 | 382 | $reflFieldValue = $reflField->getValue($parentObject); |
| 383 | 383 | |
| 384 | 384 | if (isset($nonemptyComponents[$dqlAlias])) { |
| 385 | - $collKey = $oid . $relationField; |
|
| 385 | + $collKey = $oid.$relationField; |
|
| 386 | 386 | if (isset($this->initializedCollections[$collKey])) { |
| 387 | 387 | $reflFieldValue = $this->initializedCollections[$collKey]; |
| 388 | 388 | } else if ( ! isset($this->existingCollections[$collKey])) { |
@@ -430,7 +430,7 @@ discard block |
||
| 430 | 430 | // PATH B: Single-valued association |
| 431 | 431 | $reflFieldValue = $reflField->getValue($parentObject); |
| 432 | 432 | |
| 433 | - if ( ! $reflFieldValue || isset($this->_hints[Query::HINT_REFRESH]) || ($reflFieldValue instanceof Proxy && !$reflFieldValue->__isInitialized__)) { |
|
| 433 | + if ( ! $reflFieldValue || isset($this->_hints[Query::HINT_REFRESH]) || ($reflFieldValue instanceof Proxy && ! $reflFieldValue->__isInitialized__)) { |
|
| 434 | 434 | // we only need to take action if this value is null, |
| 435 | 435 | // we refresh the entity or its an unitialized proxy. |
| 436 | 436 | if (isset($nonemptyComponents[$dqlAlias])) { |
@@ -475,7 +475,7 @@ discard block |
||
| 475 | 475 | $entityKey = $this->_rsm->entityMappings[$dqlAlias] ?: 0; |
| 476 | 476 | |
| 477 | 477 | // if this row has a NULL value for the root result id then make it a null result. |
| 478 | - if ( ! isset($nonemptyComponents[$dqlAlias]) ) { |
|
| 478 | + if ( ! isset($nonemptyComponents[$dqlAlias])) { |
|
| 479 | 479 | if ($this->_rsm->isMixed) { |
| 480 | 480 | $result[] = array($entityKey => null); |
| 481 | 481 | } else { |
@@ -531,13 +531,13 @@ discard block |
||
| 531 | 531 | } |
| 532 | 532 | } |
| 533 | 533 | |
| 534 | - if ( ! isset($resultKey) ) { |
|
| 534 | + if ( ! isset($resultKey)) { |
|
| 535 | 535 | $this->resultCounter++; |
| 536 | 536 | } |
| 537 | 537 | |
| 538 | 538 | // Append scalar values to mixed result sets |
| 539 | 539 | if (isset($rowData['scalars'])) { |
| 540 | - if ( ! isset($resultKey) ) { |
|
| 540 | + if ( ! isset($resultKey)) { |
|
| 541 | 541 | $resultKey = (isset($this->_rsm->indexByMap['scalars'])) |
| 542 | 542 | ? $row[$this->_rsm->indexByMap['scalars']] |
| 543 | 543 | : $this->resultCounter - 1; |
@@ -550,19 +550,19 @@ discard block |
||
| 550 | 550 | |
| 551 | 551 | // Append new object to mixed result sets |
| 552 | 552 | if (isset($rowData['newObjects'])) { |
| 553 | - if ( ! isset($resultKey) ) { |
|
| 553 | + if ( ! isset($resultKey)) { |
|
| 554 | 554 | $resultKey = $this->resultCounter - 1; |
| 555 | 555 | } |
| 556 | 556 | |
| 557 | 557 | |
| 558 | - $scalarCount = (isset($rowData['scalars'])? count($rowData['scalars']): 0); |
|
| 558 | + $scalarCount = (isset($rowData['scalars']) ? count($rowData['scalars']) : 0); |
|
| 559 | 559 | |
| 560 | 560 | foreach ($rowData['newObjects'] as $objIndex => $newObject) { |
| 561 | 561 | $class = $newObject['class']; |
| 562 | 562 | $args = $newObject['args']; |
| 563 | 563 | $obj = $class->newInstanceArgs($args); |
| 564 | 564 | |
| 565 | - if ($scalarCount == 0 && count($rowData['newObjects']) == 1 ) { |
|
| 565 | + if ($scalarCount == 0 && count($rowData['newObjects']) == 1) { |
|
| 566 | 566 | $result[$resultKey] = $obj; |
| 567 | 567 | |
| 568 | 568 | continue; |
@@ -667,7 +667,7 @@ discard block |
||
| 667 | 667 | /** |
| 668 | 668 | * Gets the ReflectionProperties of the mapped class. |
| 669 | 669 | * |
| 670 | - * @return array An array of ReflectionProperty instances. |
|
| 670 | + * @return \ReflectionProperty[] An array of ReflectionProperty instances. |
|
| 671 | 671 | */ |
| 672 | 672 | public function getReflectionProperties() |
| 673 | 673 | { |
@@ -805,7 +805,7 @@ discard block |
||
| 805 | 805 | * - reflClass (ReflectionClass) |
| 806 | 806 | * - reflFields (ReflectionProperty array) |
| 807 | 807 | * |
| 808 | - * @return array The names of all the fields that should be serialized. |
|
| 808 | + * @return string[] The names of all the fields that should be serialized. |
|
| 809 | 809 | */ |
| 810 | 810 | public function __sleep() |
| 811 | 811 | { |
@@ -905,7 +905,7 @@ discard block |
||
| 905 | 905 | /** |
| 906 | 906 | * Creates a new instance of the mapped class, without invoking the constructor. |
| 907 | 907 | * |
| 908 | - * @return object |
|
| 908 | + * @return ClassMetadata |
|
| 909 | 909 | */ |
| 910 | 910 | public function newInstance() |
| 911 | 911 | { |
@@ -1431,7 +1431,7 @@ |
||
| 1431 | 1431 | |
| 1432 | 1432 | if (Type::hasType($mapping['type']) && Type::getType($mapping['type'])->canRequireSQLConversion()) { |
| 1433 | 1433 | if (isset($mapping['id']) && $mapping['id'] === true) { |
| 1434 | - throw MappingException::sqlConversionNotAllowedForIdentifiers($this->name, $mapping['fieldName'], $mapping['type']); |
|
| 1434 | + throw MappingException::sqlConversionNotAllowedForIdentifiers($this->name, $mapping['fieldName'], $mapping['type']); |
|
| 1435 | 1435 | } |
| 1436 | 1436 | |
| 1437 | 1437 | $mapping['requireSQLConversion'] = true; |
@@ -696,7 +696,7 @@ discard block |
||
| 696 | 696 | public function getSingleIdReflectionProperty() |
| 697 | 697 | { |
| 698 | 698 | if ($this->isIdentifierComposite) { |
| 699 | - throw new BadMethodCallException("Class " . $this->name . " has a composite identifier."); |
|
| 699 | + throw new BadMethodCallException("Class ".$this->name." has a composite identifier."); |
|
| 700 | 700 | } |
| 701 | 701 | |
| 702 | 702 | return $this->reflFields[$this->identifier[0]]; |
@@ -791,7 +791,7 @@ discard block |
||
| 791 | 791 | */ |
| 792 | 792 | public function __toString() |
| 793 | 793 | { |
| 794 | - return __CLASS__ . '@' . spl_object_hash($this); |
|
| 794 | + return __CLASS__.'@'.spl_object_hash($this); |
|
| 795 | 795 | } |
| 796 | 796 | |
| 797 | 797 | /** |
@@ -1020,7 +1020,7 @@ discard block |
||
| 1020 | 1020 | public function validateAssociations() |
| 1021 | 1021 | { |
| 1022 | 1022 | foreach ($this->associationMappings as $mapping) { |
| 1023 | - if ( ! ClassLoader::classExists($mapping['targetEntity']) ) { |
|
| 1023 | + if ( ! ClassLoader::classExists($mapping['targetEntity'])) { |
|
| 1024 | 1024 | throw MappingException::invalidTargetEntityClass($mapping['targetEntity'], $this->name, $mapping['fieldName']); |
| 1025 | 1025 | } |
| 1026 | 1026 | } |
@@ -1080,7 +1080,7 @@ discard block |
||
| 1080 | 1080 | */ |
| 1081 | 1081 | public function enableAssociationCache($fieldName, array $cache) |
| 1082 | 1082 | { |
| 1083 | - $this->associationMappings[$fieldName]['cache'] = $this->getAssociationCacheDefaults ($fieldName, $cache); |
|
| 1083 | + $this->associationMappings[$fieldName]['cache'] = $this->getAssociationCacheDefaults($fieldName, $cache); |
|
| 1084 | 1084 | } |
| 1085 | 1085 | |
| 1086 | 1086 | /** |
@@ -1098,7 +1098,7 @@ discard block |
||
| 1098 | 1098 | } |
| 1099 | 1099 | |
| 1100 | 1100 | if ( ! isset($cache['region'])) { |
| 1101 | - $cache['region'] = strtolower(str_replace('\\', '_', $this->rootEntityName)) . '__' . $fieldName; |
|
| 1101 | + $cache['region'] = strtolower(str_replace('\\', '_', $this->rootEntityName)).'__'.$fieldName; |
|
| 1102 | 1102 | } |
| 1103 | 1103 | |
| 1104 | 1104 | return $cache; |
@@ -1461,7 +1461,7 @@ discard block |
||
| 1461 | 1461 | $mapping['isOwningSide'] = true; // assume owning side until we hit mappedBy |
| 1462 | 1462 | |
| 1463 | 1463 | // unset optional indexBy attribute if its empty |
| 1464 | - if ( ! isset($mapping['indexBy']) || !$mapping['indexBy']) { |
|
| 1464 | + if ( ! isset($mapping['indexBy']) || ! $mapping['indexBy']) { |
|
| 1465 | 1465 | unset($mapping['indexBy']); |
| 1466 | 1466 | } |
| 1467 | 1467 | |
@@ -1500,7 +1500,7 @@ discard block |
||
| 1500 | 1500 | $this->isIdentifierComposite = true; |
| 1501 | 1501 | } |
| 1502 | 1502 | |
| 1503 | - if ($this->cache && !isset($mapping['cache'])) { |
|
| 1503 | + if ($this->cache && ! isset($mapping['cache'])) { |
|
| 1504 | 1504 | throw CacheException::nonCacheableEntityAssociation($this->name, $mapping['fieldName']); |
| 1505 | 1505 | } |
| 1506 | 1506 | } |
@@ -1632,7 +1632,7 @@ discard block |
||
| 1632 | 1632 | throw new RuntimeException("ClassMetadataInfo::setTable() has to be called before defining a one to one relationship."); |
| 1633 | 1633 | } |
| 1634 | 1634 | |
| 1635 | - $this->table['uniqueConstraints'][$mapping['fieldName'] . "_uniq"] = array( |
|
| 1635 | + $this->table['uniqueConstraints'][$mapping['fieldName']."_uniq"] = array( |
|
| 1636 | 1636 | 'columns' => $uniqueConstraintColumns |
| 1637 | 1637 | ); |
| 1638 | 1638 | } |
@@ -1647,7 +1647,7 @@ discard block |
||
| 1647 | 1647 | unset($mapping['unique']); |
| 1648 | 1648 | } |
| 1649 | 1649 | |
| 1650 | - if (isset($mapping['id']) && $mapping['id'] === true && !$mapping['isOwningSide']) { |
|
| 1650 | + if (isset($mapping['id']) && $mapping['id'] === true && ! $mapping['isOwningSide']) { |
|
| 1651 | 1651 | throw MappingException::illegalInverseIdentifierAssociation($this->name, $mapping['fieldName']); |
| 1652 | 1652 | } |
| 1653 | 1653 | |
@@ -1705,7 +1705,7 @@ discard block |
||
| 1705 | 1705 | } |
| 1706 | 1706 | |
| 1707 | 1707 | $selfReferencingEntityWithoutJoinColumns = $mapping['sourceEntity'] == $mapping['targetEntity'] |
| 1708 | - && (! (isset($mapping['joinTable']['joinColumns']) || isset($mapping['joinTable']['inverseJoinColumns']))); |
|
| 1708 | + && ( ! (isset($mapping['joinTable']['joinColumns']) || isset($mapping['joinTable']['inverseJoinColumns']))); |
|
| 1709 | 1709 | |
| 1710 | 1710 | if ( ! isset($mapping['joinTable']['joinColumns'])) { |
| 1711 | 1711 | $mapping['joinTable']['joinColumns'] = array( |
@@ -1898,7 +1898,7 @@ discard block |
||
| 1898 | 1898 | |
| 1899 | 1899 | // Association defined as Id field |
| 1900 | 1900 | $joinColumns = $this->associationMappings[$idProperty]['joinColumns']; |
| 1901 | - $assocColumnNames = array_map(function ($joinColumn) { return $joinColumn['name']; }, $joinColumns); |
|
| 1901 | + $assocColumnNames = array_map(function($joinColumn) { return $joinColumn['name']; }, $joinColumns); |
|
| 1902 | 1902 | |
| 1903 | 1903 | $columnNames = array_merge($columnNames, $assocColumnNames); |
| 1904 | 1904 | } |
@@ -2079,7 +2079,7 @@ discard block |
||
| 2079 | 2079 | public function getTemporaryIdTableName() |
| 2080 | 2080 | { |
| 2081 | 2081 | // replace dots with underscores because PostgreSQL creates temporary tables in a special schema |
| 2082 | - return str_replace('.', '_', $this->getTableName() . '_id_tmp'); |
|
| 2082 | + return str_replace('.', '_', $this->getTableName().'_id_tmp'); |
|
| 2083 | 2083 | } |
| 2084 | 2084 | |
| 2085 | 2085 | /** |
@@ -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 | |
@@ -3103,7 +3103,7 @@ discard block |
||
| 3103 | 3103 | public function getAssociationTargetClass($assocName) |
| 3104 | 3104 | { |
| 3105 | 3105 | if ( ! isset($this->associationMappings[$assocName])) { |
| 3106 | - throw new InvalidArgumentException("Association name expected, '" . $assocName ."' is not an association."); |
|
| 3106 | + throw new InvalidArgumentException("Association name expected, '".$assocName."' is not an association."); |
|
| 3107 | 3107 | } |
| 3108 | 3108 | |
| 3109 | 3109 | return $this->associationMappings[$assocName]['targetEntity']; |
@@ -3142,7 +3142,7 @@ discard block |
||
| 3142 | 3142 | // Association defined as Id field |
| 3143 | 3143 | $joinColumns = $this->associationMappings[$idProperty]['joinColumns']; |
| 3144 | 3144 | $assocQuotedColumnNames = array_map( |
| 3145 | - function ($joinColumn) use ($platform) { |
|
| 3145 | + function($joinColumn) use ($platform) { |
|
| 3146 | 3146 | return isset($joinColumn['quoted']) |
| 3147 | 3147 | ? $platform->quoteIdentifier($joinColumn['name']) |
| 3148 | 3148 | : $joinColumn['name']; |
@@ -3253,7 +3253,7 @@ discard block |
||
| 3253 | 3253 | } |
| 3254 | 3254 | |
| 3255 | 3255 | if ($className !== null && strpos($className, '\\') === false && strlen($this->namespace) > 0) { |
| 3256 | - return $this->namespace . '\\' . $className; |
|
| 3256 | + return $this->namespace.'\\'.$className; |
|
| 3257 | 3257 | } |
| 3258 | 3258 | |
| 3259 | 3259 | return $className; |
@@ -3307,15 +3307,15 @@ discard block |
||
| 3307 | 3307 | ? $fieldMapping['originalClass'] |
| 3308 | 3308 | : $embeddable->name; |
| 3309 | 3309 | $fieldMapping['declaredField'] = isset($fieldMapping['declaredField']) |
| 3310 | - ? $property . '.' . $fieldMapping['declaredField'] |
|
| 3310 | + ? $property.'.'.$fieldMapping['declaredField'] |
|
| 3311 | 3311 | : $property; |
| 3312 | 3312 | $fieldMapping['originalField'] = isset($fieldMapping['originalField']) |
| 3313 | 3313 | ? $fieldMapping['originalField'] |
| 3314 | 3314 | : $fieldMapping['fieldName']; |
| 3315 | - $fieldMapping['fieldName'] = $property . "." . $fieldMapping['fieldName']; |
|
| 3315 | + $fieldMapping['fieldName'] = $property.".".$fieldMapping['fieldName']; |
|
| 3316 | 3316 | |
| 3317 | - if (! empty($this->embeddedClasses[$property]['columnPrefix'])) { |
|
| 3318 | - $fieldMapping['columnName'] = $this->embeddedClasses[$property]['columnPrefix'] . $fieldMapping['columnName']; |
|
| 3317 | + if ( ! empty($this->embeddedClasses[$property]['columnPrefix'])) { |
|
| 3318 | + $fieldMapping['columnName'] = $this->embeddedClasses[$property]['columnPrefix'].$fieldMapping['columnName']; |
|
| 3319 | 3319 | } elseif ($this->embeddedClasses[$property]['columnPrefix'] !== false) { |
| 3320 | 3320 | $fieldMapping['columnName'] = $this->namingStrategy |
| 3321 | 3321 | ->embeddedFieldToColumnName( |
@@ -3356,7 +3356,7 @@ discard block |
||
| 3356 | 3356 | { |
| 3357 | 3357 | $sequencePrefix = $this->getSequencePrefix($platform); |
| 3358 | 3358 | $columnName = $this->getSingleIdentifierColumnName(); |
| 3359 | - $sequenceName = $sequencePrefix . '_' . $columnName . '_seq'; |
|
| 3359 | + $sequenceName = $sequencePrefix.'_'.$columnName.'_seq'; |
|
| 3360 | 3360 | |
| 3361 | 3361 | return $sequenceName; |
| 3362 | 3362 | } |
@@ -3376,10 +3376,10 @@ discard block |
||
| 3376 | 3376 | |
| 3377 | 3377 | // Prepend the schema name to the table name if there is one |
| 3378 | 3378 | if ($schemaName = $this->getSchemaName()) { |
| 3379 | - $sequencePrefix = $schemaName . '.' . $tableName; |
|
| 3379 | + $sequencePrefix = $schemaName.'.'.$tableName; |
|
| 3380 | 3380 | |
| 3381 | 3381 | if ( ! $platform->supportsSchemas() && $platform->canEmulateSchemas()) { |
| 3382 | - $sequencePrefix = $schemaName . '__' . $tableName; |
|
| 3382 | + $sequencePrefix = $schemaName.'__'.$tableName; |
|
| 3383 | 3383 | } |
| 3384 | 3384 | } |
| 3385 | 3385 | |
@@ -70,8 +70,6 @@ |
||
| 70 | 70 | * Returns a join column name for a property. |
| 71 | 71 | * |
| 72 | 72 | * @param string $propertyName A property name. |
| 73 | - * @param string|null $className The fully-qualified class name. |
|
| 74 | - * This parameter is omitted from the signature due to BC |
|
| 75 | 73 | * |
| 76 | 74 | * @return string A join column name. |
| 77 | 75 | */ |
@@ -49,7 +49,7 @@ |
||
| 49 | 49 | /** |
| 50 | 50 | * Gets the SQL query. |
| 51 | 51 | * |
| 52 | - * @return mixed The built SQL query or an array of all SQL queries. |
|
| 52 | + * @return string The built SQL query or an array of all SQL queries. |
|
| 53 | 53 | * |
| 54 | 54 | * @override |
| 55 | 55 | */ |
@@ -579,7 +579,7 @@ |
||
| 579 | 579 | * Internal note: Tried to implement Serializable first but that did not work well |
| 580 | 580 | * with circular references. This solution seems simpler and works well. |
| 581 | 581 | * |
| 582 | - * @return array |
|
| 582 | + * @return string[] |
|
| 583 | 583 | */ |
| 584 | 584 | public function __sleep() |
| 585 | 585 | { |
@@ -403,7 +403,7 @@ discard block |
||
| 403 | 403 | */ |
| 404 | 404 | public function containsKey($key) |
| 405 | 405 | { |
| 406 | - if (! $this->initialized && $this->association['fetch'] === ClassMetadata::FETCH_EXTRA_LAZY |
|
| 406 | + if ( ! $this->initialized && $this->association['fetch'] === ClassMetadata::FETCH_EXTRA_LAZY |
|
| 407 | 407 | && isset($this->association['indexBy'])) { |
| 408 | 408 | $persister = $this->em->getUnitOfWork()->getCollectionPersister($this->association); |
| 409 | 409 | |
@@ -436,7 +436,7 @@ discard block |
||
| 436 | 436 | && $this->association['fetch'] === ClassMetadata::FETCH_EXTRA_LAZY |
| 437 | 437 | && isset($this->association['indexBy']) |
| 438 | 438 | ) { |
| 439 | - if (!$this->typeClass->isIdentifierComposite && $this->typeClass->isIdentifier($this->association['indexBy'])) { |
|
| 439 | + if ( ! $this->typeClass->isIdentifierComposite && $this->typeClass->isIdentifier($this->association['indexBy'])) { |
|
| 440 | 440 | return $this->em->find($this->typeClass->name, $key); |
| 441 | 441 | } |
| 442 | 442 | |