@@ -21,7 +21,6 @@ |
||
| 21 | 21 | namespace Doctrine\ORM\Cache; |
| 22 | 22 | |
| 23 | 23 | use Doctrine\Common\Util\ClassUtils; |
| 24 | - |
|
| 25 | 24 | use Doctrine\ORM\Query; |
| 26 | 25 | use Doctrine\ORM\Mapping\ClassMetadata; |
| 27 | 26 | use Doctrine\ORM\EntityManagerInterface; |
@@ -81,7 +81,7 @@ discard block |
||
| 81 | 81 | continue; |
| 82 | 82 | } |
| 83 | 83 | |
| 84 | - if (! ($assoc['type'] & ClassMetadata::TO_ONE)) { |
|
| 84 | + if ( ! ($assoc['type'] & ClassMetadata::TO_ONE)) { |
|
| 85 | 85 | unset($data[$name]); |
| 86 | 86 | continue; |
| 87 | 87 | } |
@@ -93,16 +93,16 @@ discard block |
||
| 93 | 93 | |
| 94 | 94 | foreach ($associationIds as $fieldName => $fieldValue) { |
| 95 | 95 | |
| 96 | - if (isset($targetClassMetadata->associationMappings[$fieldName])){ |
|
| 96 | + if (isset($targetClassMetadata->associationMappings[$fieldName])) { |
|
| 97 | 97 | $targetAssoc = $targetClassMetadata->associationMappings[$fieldName]; |
| 98 | 98 | |
| 99 | - foreach($assoc['targetToSourceKeyColumns'] as $referencedColumn => $localColumn) { |
|
| 99 | + foreach ($assoc['targetToSourceKeyColumns'] as $referencedColumn => $localColumn) { |
|
| 100 | 100 | |
| 101 | 101 | if (isset($targetAssoc['sourceToTargetKeyColumns'][$referencedColumn])) { |
| 102 | 102 | $data[$localColumn] = $fieldValue; |
| 103 | 103 | } |
| 104 | 104 | } |
| 105 | - }else{ |
|
| 105 | + } else { |
|
| 106 | 106 | $data[$assoc['targetToSourceKeyColumns'][$targetClassMetadata->columnNames[$fieldName]]] = $fieldValue; |
| 107 | 107 | } |
| 108 | 108 | } |
@@ -153,7 +153,7 @@ discard block |
||
| 153 | 153 | } |
| 154 | 154 | |
| 155 | 155 | foreach ($metadata->associationMappings as $name => $assoc) { |
| 156 | - if ( ! isset($assoc['cache']) || ! isset($data[$name])) { |
|
| 156 | + if ( ! isset($assoc['cache']) || ! isset($data[$name])) { |
|
| 157 | 157 | continue; |
| 158 | 158 | } |
| 159 | 159 | |
@@ -102,7 +102,7 @@ |
||
| 102 | 102 | $data[$localColumn] = $fieldValue; |
| 103 | 103 | } |
| 104 | 104 | } |
| 105 | - }else{ |
|
| 105 | + } else{ |
|
| 106 | 106 | $data[$assoc['targetToSourceKeyColumns'][$targetClassMetadata->columnNames[$fieldName]]] = $fieldValue; |
| 107 | 107 | } |
| 108 | 108 | } |
@@ -31,7 +31,6 @@ |
||
| 31 | 31 | use Doctrine\ORM\PersistentCollection; |
| 32 | 32 | use Doctrine\ORM\EntityManagerInterface; |
| 33 | 33 | use Doctrine\ORM\Persisters\Entity\EntityPersister; |
| 34 | - |
|
| 35 | 34 | use Doctrine\Common\Util\ClassUtils; |
| 36 | 35 | use Doctrine\Common\Collections\Criteria; |
| 37 | 36 | |
@@ -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 | /** |
@@ -291,7 +291,7 @@ |
||
| 291 | 291 | /** |
| 292 | 292 | * Generates a string of currently query |
| 293 | 293 | * |
| 294 | - * @param array $query |
|
| 294 | + * @param string $query |
|
| 295 | 295 | * @param string $criteria |
| 296 | 296 | * @param array $orderBy |
| 297 | 297 | * @param integer $limit |
@@ -236,7 +236,7 @@ discard block |
||
| 236 | 236 | |
| 237 | 237 | if ($class->containsForeignIdentifier) { |
| 238 | 238 | foreach ($class->associationMappings as $name => $assoc) { |
| 239 | - if (!empty($assoc['id']) && !isset($assoc['cache'])) { |
|
| 239 | + if ( ! empty($assoc['id']) && ! isset($assoc['cache'])) { |
|
| 240 | 240 | throw CacheException::nonCacheableEntityAssociation($class->name, $name); |
| 241 | 241 | } |
| 242 | 242 | } |
@@ -305,7 +305,7 @@ discard block |
||
| 305 | 305 | ? $this->persister->expandCriteriaParameters($criteria) |
| 306 | 306 | : $this->persister->expandParameters($criteria); |
| 307 | 307 | |
| 308 | - return sha1($query . serialize($params) . serialize($orderBy) . $limit . $offset); |
|
| 308 | + return sha1($query.serialize($params).serialize($orderBy).$limit.$offset); |
|
| 309 | 309 | } |
| 310 | 310 | |
| 311 | 311 | /** |
@@ -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 |
@@ -98,7 +98,7 @@ discard block |
||
| 98 | 98 | */ |
| 99 | 99 | public function setAutoGenerateProxyClasses($autoGenerate) |
| 100 | 100 | { |
| 101 | - $this->_attributes['autoGenerateProxyClasses'] = (int)$autoGenerate; |
|
| 101 | + $this->_attributes['autoGenerateProxyClasses'] = (int) $autoGenerate; |
|
| 102 | 102 | } |
| 103 | 103 | |
| 104 | 104 | /** |
@@ -151,7 +151,7 @@ discard block |
||
| 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; |
@@ -20,7 +20,6 @@ |
||
| 20 | 20 | namespace Doctrine\ORM\Internal\Hydration; |
| 21 | 21 | |
| 22 | 22 | use PDO; |
| 23 | -use Doctrine\DBAL\Types\Type; |
|
| 24 | 23 | use Doctrine\ORM\Mapping\ClassMetadata; |
| 25 | 24 | use Doctrine\ORM\Query; |
| 26 | 25 | |
@@ -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 | { |
@@ -400,7 +400,7 @@ discard block |
||
| 400 | 400 | */ |
| 401 | 401 | public function containsKey($key) |
| 402 | 402 | { |
| 403 | - if (! $this->initialized && $this->association['fetch'] === Mapping\ClassMetadataInfo::FETCH_EXTRA_LAZY |
|
| 403 | + if ( ! $this->initialized && $this->association['fetch'] === Mapping\ClassMetadataInfo::FETCH_EXTRA_LAZY |
|
| 404 | 404 | && isset($this->association['indexBy'])) { |
| 405 | 405 | $persister = $this->em->getUnitOfWork()->getCollectionPersister($this->association); |
| 406 | 406 | |
@@ -433,7 +433,7 @@ discard block |
||
| 433 | 433 | && $this->association['fetch'] === Mapping\ClassMetadataInfo::FETCH_EXTRA_LAZY |
| 434 | 434 | && isset($this->association['indexBy']) |
| 435 | 435 | ) { |
| 436 | - if (!$this->typeClass->isIdentifierComposite && $this->typeClass->isIdentifier($this->association['indexBy'])) { |
|
| 436 | + if ( ! $this->typeClass->isIdentifierComposite && $this->typeClass->isIdentifier($this->association['indexBy'])) { |
|
| 437 | 437 | return $this->em->find($this->typeClass->name, $key); |
| 438 | 438 | } |
| 439 | 439 | |