@@ -49,10 +49,10 @@ discard block |
||
| 49 | 49 | $tableName = $class->table['name']; |
| 50 | 50 | |
| 51 | 51 | if ( ! empty($class->table['schema'])) { |
| 52 | - $tableName = $class->table['schema'] . '.' . $class->table['name']; |
|
| 52 | + $tableName = $class->table['schema'].'.'.$class->table['name']; |
|
| 53 | 53 | |
| 54 | 54 | if ( ! $platform->supportsSchemas() && $platform->canEmulateSchemas()) { |
| 55 | - $tableName = $class->table['schema'] . '__' . $class->table['name']; |
|
| 55 | + $tableName = $class->table['schema'].'__'.$class->table['name']; |
|
| 56 | 56 | } |
| 57 | 57 | } |
| 58 | 58 | |
@@ -99,7 +99,7 @@ discard block |
||
| 99 | 99 | $schema = ''; |
| 100 | 100 | |
| 101 | 101 | if (isset($association['joinTable']['schema'])) { |
| 102 | - $schema = $association['joinTable']['schema'] . '.'; |
|
| 102 | + $schema = $association['joinTable']['schema'].'.'; |
|
| 103 | 103 | } |
| 104 | 104 | |
| 105 | 105 | $tableName = $association['joinTable']['name']; |
@@ -108,7 +108,7 @@ discard block |
||
| 108 | 108 | $tableName = $platform->quoteIdentifier($tableName); |
| 109 | 109 | } |
| 110 | 110 | |
| 111 | - return $schema . $tableName; |
|
| 111 | + return $schema.$tableName; |
|
| 112 | 112 | } |
| 113 | 113 | |
| 114 | 114 | /** |
@@ -128,7 +128,7 @@ discard block |
||
| 128 | 128 | // Association defined as Id field |
| 129 | 129 | $joinColumns = $class->associationMappings[$fieldName]['joinColumns']; |
| 130 | 130 | $assocQuotedColumnNames = array_map( |
| 131 | - function ($joinColumn) use ($platform) |
|
| 131 | + function($joinColumn) use ($platform) |
|
| 132 | 132 | { |
| 133 | 133 | return isset($joinColumn['quoted']) |
| 134 | 134 | ? $platform->quoteIdentifier($joinColumn['name']) |
@@ -153,10 +153,10 @@ discard block |
||
| 153 | 153 | // If the alias is to long, characters are cut off from the beginning. |
| 154 | 154 | // 3 ) Strip non alphanumeric characters |
| 155 | 155 | // 4 ) Prefix with "_" if the result its numeric |
| 156 | - $columnName = $columnName . '_' . $counter; |
|
| 156 | + $columnName = $columnName.'_'.$counter; |
|
| 157 | 157 | $columnName = substr($columnName, -$platform->getMaxIdentifierLength()); |
| 158 | 158 | $columnName = preg_replace('/[^A-Za-z0-9_]/', '', $columnName); |
| 159 | - $columnName = is_numeric($columnName) ? '_' . $columnName : $columnName; |
|
| 159 | + $columnName = is_numeric($columnName) ? '_'.$columnName : $columnName; |
|
| 160 | 160 | |
| 161 | 161 | return $platform->getSQLResultCasing($columnName); |
| 162 | 162 | } |
@@ -155,9 +155,9 @@ |
||
| 155 | 155 | } |
| 156 | 156 | |
| 157 | 157 | if ($property->isProtected()) { |
| 158 | - return "\0*\0" . $propertyName; |
|
| 158 | + return "\0*\0".$propertyName; |
|
| 159 | 159 | } |
| 160 | 160 | |
| 161 | - return "\0" . $property->getDeclaringClass()->getName() . "\0" . $propertyName; |
|
| 161 | + return "\0".$property->getDeclaringClass()->getName()."\0".$propertyName; |
|
| 162 | 162 | } |
| 163 | 163 | } |
@@ -275,7 +275,7 @@ |
||
| 275 | 275 | { |
| 276 | 276 | $cm = $this->builder->getClassMetadata(); |
| 277 | 277 | if ($this->generatedValue) { |
| 278 | - $cm->setIdGeneratorType(constant('Doctrine\ORM\Mapping\ClassMetadata::GENERATOR_TYPE_' . $this->generatedValue)); |
|
| 278 | + $cm->setIdGeneratorType(constant('Doctrine\ORM\Mapping\ClassMetadata::GENERATOR_TYPE_'.$this->generatedValue)); |
|
| 279 | 279 | } |
| 280 | 280 | |
| 281 | 281 | if ($this->version) { |
@@ -180,7 +180,7 @@ |
||
| 180 | 180 | * Sets an option. |
| 181 | 181 | * |
| 182 | 182 | * @param string $name |
| 183 | - * @param mixed $value |
|
| 183 | + * @param boolean $value |
|
| 184 | 184 | * |
| 185 | 185 | * @return FieldBuilder |
| 186 | 186 | */ |
@@ -67,7 +67,7 @@ |
||
| 67 | 67 | public function resolve($className) |
| 68 | 68 | { |
| 69 | 69 | if (isset($this->instances[$className = trim($className, '\\')])) { |
| 70 | - return $this->instances[$className]; |
|
| 70 | + return $this->instances[$className]; |
|
| 71 | 71 | } |
| 72 | 72 | |
| 73 | 73 | return $this->instances[$className] = new $className(); |
@@ -918,7 +918,7 @@ |
||
| 918 | 918 | * @since 2.5 |
| 919 | 919 | * |
| 920 | 920 | * @param string $name The name of the hint. |
| 921 | - * @param mixed $value The value of the hint. |
|
| 921 | + * @param string $value The value of the hint. |
|
| 922 | 922 | */ |
| 923 | 923 | public function setDefaultQueryHint($name, $value) |
| 924 | 924 | { |
@@ -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 |
@@ -143,7 +143,7 @@ discard block |
||
| 143 | 143 | /** |
| 144 | 144 | * Adds Index. |
| 145 | 145 | * |
| 146 | - * @param array $columns |
|
| 146 | + * @param string[] $columns |
|
| 147 | 147 | * @param string $name |
| 148 | 148 | * |
| 149 | 149 | * @return ClassMetadataBuilder |
@@ -162,7 +162,7 @@ discard block |
||
| 162 | 162 | /** |
| 163 | 163 | * Adds Unique Constraint. |
| 164 | 164 | * |
| 165 | - * @param array $columns |
|
| 165 | + * @param string[] $columns |
|
| 166 | 166 | * @param string $name |
| 167 | 167 | * |
| 168 | 168 | * @return ClassMetadataBuilder |
@@ -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 | |
@@ -57,7 +57,7 @@ |
||
| 57 | 57 | /** |
| 58 | 58 | * Constructor. |
| 59 | 59 | * |
| 60 | - * @param Query|QueryBuilder $query A Doctrine ORM query or query builder. |
|
| 60 | + * @param Query $query A Doctrine ORM query or query builder. |
|
| 61 | 61 | * @param boolean $fetchJoinCollection Whether the query joins a collection (true by default). |
| 62 | 62 | */ |
| 63 | 63 | public function __construct($query, $fetchJoinCollection = true) |
@@ -1237,7 +1237,7 @@ discard block |
||
| 1237 | 1237 | /** |
| 1238 | 1238 | * Schedules an entity for being updated. |
| 1239 | 1239 | * |
| 1240 | - * @param object $entity The entity to schedule for being updated. |
|
| 1240 | + * @param \Doctrine\Tests\Models\Forum\ForumUser $entity The entity to schedule for being updated. |
|
| 1241 | 1241 | * |
| 1242 | 1242 | * @return void |
| 1243 | 1243 | * |
@@ -1305,7 +1305,7 @@ discard block |
||
| 1305 | 1305 | /** |
| 1306 | 1306 | * Checks whether an entity is registered to be checked in the unit of work. |
| 1307 | 1307 | * |
| 1308 | - * @param object $entity |
|
| 1308 | + * @param \Doctrine\Tests\ORM\NotifyChangedEntity $entity |
|
| 1309 | 1309 | * |
| 1310 | 1310 | * @return boolean |
| 1311 | 1311 | */ |
@@ -3121,7 +3121,7 @@ discard block |
||
| 3121 | 3121 | * |
| 3122 | 3122 | * @param object $entity The entity that owns the property. |
| 3123 | 3123 | * @param string $propertyName The name of the property that changed. |
| 3124 | - * @param mixed $oldValue The old value of the property. |
|
| 3124 | + * @param null|integer $oldValue The old value of the property. |
|
| 3125 | 3125 | * @param mixed $newValue The new value of the property. |
| 3126 | 3126 | * |
| 3127 | 3127 | * @return void |
@@ -3321,7 +3321,7 @@ discard block |
||
| 3321 | 3321 | /** |
| 3322 | 3322 | * Verifies if two given entities actually are the same based on identifier comparison |
| 3323 | 3323 | * |
| 3324 | - * @param object $entity1 |
|
| 3324 | + * @param Proxy $entity1 |
|
| 3325 | 3325 | * @param object $entity2 |
| 3326 | 3326 | * |
| 3327 | 3327 | * @return bool |
@@ -460,7 +460,7 @@ discard block |
||
| 460 | 460 | $state = $this->getEntityState($entity); |
| 461 | 461 | |
| 462 | 462 | if ($state !== self::STATE_MANAGED && $state !== self::STATE_REMOVED) { |
| 463 | - throw new \InvalidArgumentException("Entity has to be managed or scheduled for removal for single computation " . self::objToStr($entity)); |
|
| 463 | + throw new \InvalidArgumentException("Entity has to be managed or scheduled for removal for single computation ".self::objToStr($entity)); |
|
| 464 | 464 | } |
| 465 | 465 | |
| 466 | 466 | $class = $this->em->getClassMetadata(get_class($entity)); |
@@ -516,7 +516,7 @@ discard block |
||
| 516 | 516 | $oid = spl_object_hash($entity); |
| 517 | 517 | $data = []; |
| 518 | 518 | |
| 519 | - if (!isset($this->entityChangeSets[$oid])) { |
|
| 519 | + if ( ! isset($this->entityChangeSets[$oid])) { |
|
| 520 | 520 | return $data; |
| 521 | 521 | } |
| 522 | 522 | |
@@ -679,7 +679,7 @@ discard block |
||
| 679 | 679 | if ($owner === null) { // cloned |
| 680 | 680 | $actualValue->setOwner($entity, $assoc); |
| 681 | 681 | } else if ($owner !== $entity) { // no clone, we have to fix |
| 682 | - if (!$actualValue->isInitialized()) { |
|
| 682 | + if ( ! $actualValue->isInitialized()) { |
|
| 683 | 683 | $actualValue->initialize(); // we have to do this otherwise the cols share state |
| 684 | 684 | } |
| 685 | 685 | $newValue = clone $actualValue; |
@@ -825,7 +825,7 @@ discard block |
||
| 825 | 825 | $targetClass = $this->em->getClassMetadata($assoc['targetEntity']); |
| 826 | 826 | |
| 827 | 827 | foreach ($unwrappedValue as $key => $entry) { |
| 828 | - if (! ($entry instanceof $targetClass->name)) { |
|
| 828 | + if ( ! ($entry instanceof $targetClass->name)) { |
|
| 829 | 829 | throw ORMInvalidArgumentException::invalidAssociation($targetClass, $assoc, $entry); |
| 830 | 830 | } |
| 831 | 831 | |
@@ -1154,7 +1154,7 @@ discard block |
||
| 1154 | 1154 | |
| 1155 | 1155 | $joinColumns = reset($assoc['joinColumns']); |
| 1156 | 1156 | |
| 1157 | - $calc->addDependency($targetClass->name, $class->name, (int)empty($joinColumns['nullable'])); |
|
| 1157 | + $calc->addDependency($targetClass->name, $class->name, (int) empty($joinColumns['nullable'])); |
|
| 1158 | 1158 | |
| 1159 | 1159 | // If the target class has mapped subclasses, these share the same dependency. |
| 1160 | 1160 | if ( ! $targetClass->subClasses) { |
@@ -1677,7 +1677,7 @@ discard block |
||
| 1677 | 1677 | throw ORMInvalidArgumentException::detachedEntityCannot($entity, "persisted"); |
| 1678 | 1678 | |
| 1679 | 1679 | default: |
| 1680 | - throw new UnexpectedValueException("Unexpected entity state: $entityState." . self::objToStr($entity)); |
|
| 1680 | + throw new UnexpectedValueException("Unexpected entity state: $entityState.".self::objToStr($entity)); |
|
| 1681 | 1681 | } |
| 1682 | 1682 | |
| 1683 | 1683 | $this->cascadePersist($entity, $visited); |
@@ -1747,7 +1747,7 @@ discard block |
||
| 1747 | 1747 | case self::STATE_DETACHED: |
| 1748 | 1748 | throw ORMInvalidArgumentException::detachedEntityCannot($entity, "removed"); |
| 1749 | 1749 | default: |
| 1750 | - throw new UnexpectedValueException("Unexpected entity state: $entityState." . self::objToStr($entity)); |
|
| 1750 | + throw new UnexpectedValueException("Unexpected entity state: $entityState.".self::objToStr($entity)); |
|
| 1751 | 1751 | } |
| 1752 | 1752 | |
| 1753 | 1753 | } |
@@ -1886,7 +1886,7 @@ discard block |
||
| 1886 | 1886 | */ |
| 1887 | 1887 | private function ensureVersionMatch(ClassMetadata $class, $entity, $managedCopy) |
| 1888 | 1888 | { |
| 1889 | - if (! ($class->isVersioned && $this->isLoaded($managedCopy) && $this->isLoaded($entity))) { |
|
| 1889 | + if ( ! ($class->isVersioned && $this->isLoaded($managedCopy) && $this->isLoaded($entity))) { |
|
| 1890 | 1890 | return; |
| 1891 | 1891 | } |
| 1892 | 1892 | |
@@ -1911,7 +1911,7 @@ discard block |
||
| 1911 | 1911 | */ |
| 1912 | 1912 | private function isLoaded($entity) |
| 1913 | 1913 | { |
| 1914 | - return !($entity instanceof Proxy) || $entity->__isInitialized(); |
|
| 1914 | + return ! ($entity instanceof Proxy) || $entity->__isInitialized(); |
|
| 1915 | 1915 | } |
| 1916 | 1916 | |
| 1917 | 1917 | /** |
@@ -2069,7 +2069,7 @@ discard block |
||
| 2069 | 2069 | |
| 2070 | 2070 | $associationMappings = array_filter( |
| 2071 | 2071 | $class->associationMappings, |
| 2072 | - function ($assoc) { return $assoc['isCascadeRefresh']; } |
|
| 2072 | + function($assoc) { return $assoc['isCascadeRefresh']; } |
|
| 2073 | 2073 | ); |
| 2074 | 2074 | |
| 2075 | 2075 | foreach ($associationMappings as $assoc) { |
@@ -2112,7 +2112,7 @@ discard block |
||
| 2112 | 2112 | |
| 2113 | 2113 | $associationMappings = array_filter( |
| 2114 | 2114 | $class->associationMappings, |
| 2115 | - function ($assoc) { return $assoc['isCascadeDetach']; } |
|
| 2115 | + function($assoc) { return $assoc['isCascadeDetach']; } |
|
| 2116 | 2116 | ); |
| 2117 | 2117 | |
| 2118 | 2118 | foreach ($associationMappings as $assoc) { |
@@ -2156,7 +2156,7 @@ discard block |
||
| 2156 | 2156 | |
| 2157 | 2157 | $associationMappings = array_filter( |
| 2158 | 2158 | $class->associationMappings, |
| 2159 | - function ($assoc) { return $assoc['isCascadeMerge']; } |
|
| 2159 | + function($assoc) { return $assoc['isCascadeMerge']; } |
|
| 2160 | 2160 | ); |
| 2161 | 2161 | |
| 2162 | 2162 | foreach ($associationMappings as $assoc) { |
@@ -2195,7 +2195,7 @@ discard block |
||
| 2195 | 2195 | |
| 2196 | 2196 | $associationMappings = array_filter( |
| 2197 | 2197 | $class->associationMappings, |
| 2198 | - function ($assoc) { return $assoc['isCascadePersist']; } |
|
| 2198 | + function($assoc) { return $assoc['isCascadePersist']; } |
|
| 2199 | 2199 | ); |
| 2200 | 2200 | |
| 2201 | 2201 | foreach ($associationMappings as $assoc) { |
@@ -2224,7 +2224,7 @@ discard block |
||
| 2224 | 2224 | break; |
| 2225 | 2225 | |
| 2226 | 2226 | case ($relatedEntities !== null): |
| 2227 | - if (! $relatedEntities instanceof $assoc['targetEntity']) { |
|
| 2227 | + if ( ! $relatedEntities instanceof $assoc['targetEntity']) { |
|
| 2228 | 2228 | throw ORMInvalidArgumentException::invalidAssociation( |
| 2229 | 2229 | $this->em->getClassMetadata($assoc['targetEntity']), |
| 2230 | 2230 | $assoc, |
@@ -2255,13 +2255,13 @@ discard block |
||
| 2255 | 2255 | |
| 2256 | 2256 | $associationMappings = array_filter( |
| 2257 | 2257 | $class->associationMappings, |
| 2258 | - function ($assoc) { return $assoc['isCascadeRemove']; } |
|
| 2258 | + function($assoc) { return $assoc['isCascadeRemove']; } |
|
| 2259 | 2259 | ); |
| 2260 | 2260 | |
| 2261 | 2261 | $entitiesToCascade = []; |
| 2262 | 2262 | |
| 2263 | 2263 | foreach ($associationMappings as $assoc) { |
| 2264 | - if ($entity instanceof Proxy && !$entity->__isInitialized__) { |
|
| 2264 | + if ($entity instanceof Proxy && ! $entity->__isInitialized__) { |
|
| 2265 | 2265 | $entity->__load(); |
| 2266 | 2266 | } |
| 2267 | 2267 | |
@@ -2325,7 +2325,7 @@ discard block |
||
| 2325 | 2325 | return; |
| 2326 | 2326 | } |
| 2327 | 2327 | |
| 2328 | - if ($entity instanceof Proxy && !$entity->__isInitialized__) { |
|
| 2328 | + if ($entity instanceof Proxy && ! $entity->__isInitialized__) { |
|
| 2329 | 2329 | $entity->__load(); |
| 2330 | 2330 | } |
| 2331 | 2331 | |
@@ -2340,7 +2340,7 @@ discard block |
||
| 2340 | 2340 | case LockMode::NONE === $lockMode: |
| 2341 | 2341 | case LockMode::PESSIMISTIC_READ === $lockMode: |
| 2342 | 2342 | case LockMode::PESSIMISTIC_WRITE === $lockMode: |
| 2343 | - if (!$this->em->getConnection()->isTransactionActive()) { |
|
| 2343 | + if ( ! $this->em->getConnection()->isTransactionActive()) { |
|
| 2344 | 2344 | throw TransactionRequiredException::transactionRequired(); |
| 2345 | 2345 | } |
| 2346 | 2346 | |
@@ -2676,7 +2676,7 @@ discard block |
||
| 2676 | 2676 | // then we can append this entity for eager loading! |
| 2677 | 2677 | if ($hints['fetchMode'][$class->name][$field] == ClassMetadata::FETCH_EAGER && |
| 2678 | 2678 | isset($hints[self::HINT_DEFEREAGERLOAD]) && |
| 2679 | - !$targetClass->isIdentifierComposite && |
|
| 2679 | + ! $targetClass->isIdentifierComposite && |
|
| 2680 | 2680 | $newValue instanceof Proxy && |
| 2681 | 2681 | $newValue->__isInitialized__ === false) { |
| 2682 | 2682 | |
@@ -3043,7 +3043,7 @@ discard block |
||
| 3043 | 3043 | public function getCollectionPersister(array $association) |
| 3044 | 3044 | { |
| 3045 | 3045 | $role = isset($association['cache']) |
| 3046 | - ? $association['sourceEntity'] . '::' . $association['fieldName'] |
|
| 3046 | + ? $association['sourceEntity'].'::'.$association['fieldName'] |
|
| 3047 | 3047 | : $association['type']; |
| 3048 | 3048 | |
| 3049 | 3049 | if (isset($this->collectionPersisters[$role])) { |
@@ -3261,7 +3261,7 @@ discard block |
||
| 3261 | 3261 | */ |
| 3262 | 3262 | private function afterTransactionComplete() |
| 3263 | 3263 | { |
| 3264 | - $this->performCallbackOnCachedPersister(function (CachedPersister $persister) { |
|
| 3264 | + $this->performCallbackOnCachedPersister(function(CachedPersister $persister) { |
|
| 3265 | 3265 | $persister->afterTransactionComplete(); |
| 3266 | 3266 | }); |
| 3267 | 3267 | } |
@@ -3271,7 +3271,7 @@ discard block |
||
| 3271 | 3271 | */ |
| 3272 | 3272 | private function afterTransactionRolledBack() |
| 3273 | 3273 | { |
| 3274 | - $this->performCallbackOnCachedPersister(function (CachedPersister $persister) { |
|
| 3274 | + $this->performCallbackOnCachedPersister(function(CachedPersister $persister) { |
|
| 3275 | 3275 | $persister->afterTransactionRolledBack(); |
| 3276 | 3276 | }); |
| 3277 | 3277 | } |
@@ -3351,11 +3351,11 @@ discard block |
||
| 3351 | 3351 | */ |
| 3352 | 3352 | private function mergeEntityStateIntoManagedCopy($entity, $managedCopy) |
| 3353 | 3353 | { |
| 3354 | - if (! $this->isLoaded($entity)) { |
|
| 3354 | + if ( ! $this->isLoaded($entity)) { |
|
| 3355 | 3355 | return; |
| 3356 | 3356 | } |
| 3357 | 3357 | |
| 3358 | - if (! $this->isLoaded($managedCopy)) { |
|
| 3358 | + if ( ! $this->isLoaded($managedCopy)) { |
|
| 3359 | 3359 | $managedCopy->__load(); |
| 3360 | 3360 | } |
| 3361 | 3361 | |
@@ -3378,7 +3378,7 @@ discard block |
||
| 3378 | 3378 | if ($other === null) { |
| 3379 | 3379 | $prop->setValue($managedCopy, null); |
| 3380 | 3380 | } else { |
| 3381 | - if ($other instanceof Proxy && !$other->__isInitialized()) { |
|
| 3381 | + if ($other instanceof Proxy && ! $other->__isInitialized()) { |
|
| 3382 | 3382 | // do not merge fields marked lazy that have not been fetched. |
| 3383 | 3383 | continue; |
| 3384 | 3384 | } |
@@ -3465,7 +3465,7 @@ discard block |
||
| 3465 | 3465 | */ |
| 3466 | 3466 | private function clearIdentityMapForEntityName($entityName) |
| 3467 | 3467 | { |
| 3468 | - if (! isset($this->identityMap[$entityName])) { |
|
| 3468 | + if ( ! isset($this->identityMap[$entityName])) { |
|
| 3469 | 3469 | return; |
| 3470 | 3470 | } |
| 3471 | 3471 | |
@@ -38,7 +38,6 @@ |
||
| 38 | 38 | * Dequeue an exception for a specific method invocation |
| 39 | 39 | * |
| 40 | 40 | * @param string $method |
| 41 | - * @param mixed $default |
|
| 42 | 41 | * |
| 43 | 42 | * @return mixed |
| 44 | 43 | */ |