@@ -212,12 +212,12 @@ discard block |
||
| 212 | 212 | |
| 213 | 213 | if ( ! $this->fileLockRegionDirectory) { |
| 214 | 214 | throw new \LogicException( |
| 215 | - 'If you want to use a "READ_WRITE" cache an implementation of "Doctrine\ORM\Cache\ConcurrentRegion" is required, ' . |
|
| 215 | + 'If you want to use a "READ_WRITE" cache an implementation of "Doctrine\ORM\Cache\ConcurrentRegion" is required, '. |
|
| 216 | 216 | 'The default implementation provided by doctrine is "Doctrine\ORM\Cache\Region\FileLockRegion" if you want to use it please provide a valid directory, DefaultCacheFactory#setFileLockRegionDirectory(). ' |
| 217 | 217 | ); |
| 218 | 218 | } |
| 219 | 219 | |
| 220 | - $directory = $this->fileLockRegionDirectory . DIRECTORY_SEPARATOR . $cache['region']; |
|
| 220 | + $directory = $this->fileLockRegionDirectory.DIRECTORY_SEPARATOR.$cache['region']; |
|
| 221 | 221 | $region = new FileLockRegion($region, $directory, $this->regionsConfig->getLockLifetime($cache['region'])); |
| 222 | 222 | } |
| 223 | 223 | |
@@ -233,7 +233,7 @@ discard block |
||
| 233 | 233 | { |
| 234 | 234 | $cacheAdapter = clone $this->cache; |
| 235 | 235 | |
| 236 | - if (!$cacheAdapter instanceof CacheProvider) { |
|
| 236 | + if ( ! $cacheAdapter instanceof CacheProvider) { |
|
| 237 | 237 | return $cacheAdapter; |
| 238 | 238 | } |
| 239 | 239 | |
@@ -243,7 +243,7 @@ discard block |
||
| 243 | 243 | $namespace .= ':'; |
| 244 | 244 | } |
| 245 | 245 | |
| 246 | - $cacheAdapter->setNamespace($namespace . $name); |
|
| 246 | + $cacheAdapter->setNamespace($namespace.$name); |
|
| 247 | 247 | |
| 248 | 248 | return $cacheAdapter; |
| 249 | 249 | } |
@@ -20,10 +20,8 @@ |
||
| 20 | 20 | namespace Doctrine\ORM\Persisters\Entity; |
| 21 | 21 | |
| 22 | 22 | use Doctrine\ORM\Mapping\ClassMetadata; |
| 23 | - |
|
| 24 | 23 | use Doctrine\DBAL\LockMode; |
| 25 | 24 | use Doctrine\DBAL\Types\Type; |
| 26 | - |
|
| 27 | 25 | use Doctrine\Common\Collections\Criteria; |
| 28 | 26 | use Doctrine\ORM\Utility\PersisterHelper; |
| 29 | 27 | |
@@ -207,7 +207,7 @@ discard block |
||
| 207 | 207 | } |
| 208 | 208 | |
| 209 | 209 | foreach ($data as $columnName => $value) { |
| 210 | - if (!is_array($id) || !isset($id[$columnName])) { |
|
| 210 | + if ( ! is_array($id) || ! isset($id[$columnName])) { |
|
| 211 | 211 | $stmt->bindValue($paramIndex++, $value, $this->columnTypes[$columnName]); |
| 212 | 212 | } |
| 213 | 213 | } |
@@ -322,7 +322,7 @@ discard block |
||
| 322 | 322 | // If the current class in the root entity, add the filters |
| 323 | 323 | if ($filterSql = $this->generateFilterConditionSQL($this->em->getClassMetadata($this->class->rootEntityName), $this->getSQLTableAlias($this->class->rootEntityName))) { |
| 324 | 324 | $conditionSql .= $conditionSql |
| 325 | - ? ' AND ' . $filterSql |
|
| 325 | + ? ' AND '.$filterSql |
|
| 326 | 326 | : $filterSql; |
| 327 | 327 | } |
| 328 | 328 | |
@@ -341,29 +341,29 @@ discard block |
||
| 341 | 341 | switch ($lockMode) { |
| 342 | 342 | case LockMode::PESSIMISTIC_READ: |
| 343 | 343 | |
| 344 | - $lockSql = ' ' . $this->platform->getReadLockSql(); |
|
| 344 | + $lockSql = ' '.$this->platform->getReadLockSql(); |
|
| 345 | 345 | |
| 346 | 346 | break; |
| 347 | 347 | |
| 348 | 348 | case LockMode::PESSIMISTIC_WRITE: |
| 349 | 349 | |
| 350 | - $lockSql = ' ' . $this->platform->getWriteLockSql(); |
|
| 350 | + $lockSql = ' '.$this->platform->getWriteLockSql(); |
|
| 351 | 351 | |
| 352 | 352 | break; |
| 353 | 353 | } |
| 354 | 354 | |
| 355 | 355 | $tableName = $this->quoteStrategy->getTableName($this->class, $this->platform); |
| 356 | - $from = ' FROM ' . $tableName . ' ' . $baseTableAlias; |
|
| 357 | - $where = $conditionSql != '' ? ' WHERE ' . $conditionSql : ''; |
|
| 356 | + $from = ' FROM '.$tableName.' '.$baseTableAlias; |
|
| 357 | + $where = $conditionSql != '' ? ' WHERE '.$conditionSql : ''; |
|
| 358 | 358 | $lock = $this->platform->appendLockHint($from, $lockMode); |
| 359 | 359 | $columnList = $this->getSelectColumnsSQL(); |
| 360 | - $query = 'SELECT ' . $columnList |
|
| 360 | + $query = 'SELECT '.$columnList |
|
| 361 | 361 | . $lock |
| 362 | 362 | . $joinSql |
| 363 | 363 | . $where |
| 364 | 364 | . $orderBySql; |
| 365 | 365 | |
| 366 | - return $this->platform->modifyLimitQuery($query, $limit, $offset) . $lockSql; |
|
| 366 | + return $this->platform->modifyLimitQuery($query, $limit, $offset).$lockSql; |
|
| 367 | 367 | } |
| 368 | 368 | |
| 369 | 369 | /** |
@@ -383,14 +383,14 @@ discard block |
||
| 383 | 383 | |
| 384 | 384 | if ('' !== $filterSql) { |
| 385 | 385 | $conditionSql = $conditionSql |
| 386 | - ? $conditionSql . ' AND ' . $filterSql |
|
| 386 | + ? $conditionSql.' AND '.$filterSql |
|
| 387 | 387 | : $filterSql; |
| 388 | 388 | } |
| 389 | 389 | |
| 390 | 390 | $sql = 'SELECT COUNT(*) ' |
| 391 | - . 'FROM ' . $tableName . ' ' . $baseTableAlias |
|
| 391 | + . 'FROM '.$tableName.' '.$baseTableAlias |
|
| 392 | 392 | . $joinSql |
| 393 | - . (empty($conditionSql) ? '' : ' WHERE ' . $conditionSql); |
|
| 393 | + . (empty($conditionSql) ? '' : ' WHERE '.$conditionSql); |
|
| 394 | 394 | |
| 395 | 395 | return $sql; |
| 396 | 396 | } |
@@ -409,16 +409,16 @@ discard block |
||
| 409 | 409 | $conditions = []; |
| 410 | 410 | $tableAlias = $this->getSQLTableAlias($parentClassName); |
| 411 | 411 | $parentClass = $this->em->getClassMetadata($parentClassName); |
| 412 | - $joinSql .= ' INNER JOIN ' . $this->quoteStrategy->getTableName($parentClass, $this->platform) . ' ' . $tableAlias . ' ON '; |
|
| 412 | + $joinSql .= ' INNER JOIN '.$this->quoteStrategy->getTableName($parentClass, $this->platform).' '.$tableAlias.' ON '; |
|
| 413 | 413 | |
| 414 | 414 | foreach ($identifierColumns as $idColumn) { |
| 415 | - $conditions[] = $baseTableAlias . '.' . $idColumn . ' = ' . $tableAlias . '.' . $idColumn; |
|
| 415 | + $conditions[] = $baseTableAlias.'.'.$idColumn.' = '.$tableAlias.'.'.$idColumn; |
|
| 416 | 416 | } |
| 417 | 417 | |
| 418 | 418 | $joinSql .= implode(' AND ', $conditions); |
| 419 | 419 | } |
| 420 | 420 | |
| 421 | - return parent::getLockTablesSql($lockMode) . $joinSql; |
|
| 421 | + return parent::getLockTablesSql($lockMode).$joinSql; |
|
| 422 | 422 | } |
| 423 | 423 | |
| 424 | 424 | /** |
@@ -486,7 +486,7 @@ discard block |
||
| 486 | 486 | ? $baseTableAlias |
| 487 | 487 | : $this->getSQLTableAlias($this->class->rootEntityName); |
| 488 | 488 | |
| 489 | - $columnList[] = $tableAlias . '.' . $discrColumn; |
|
| 489 | + $columnList[] = $tableAlias.'.'.$discrColumn; |
|
| 490 | 490 | |
| 491 | 491 | // sub tables |
| 492 | 492 | foreach ($this->class->subClasses as $subClassName) { |
@@ -600,11 +600,11 @@ discard block |
||
| 600 | 600 | $conditions = []; |
| 601 | 601 | $parentClass = $this->em->getClassMetadata($parentClassName); |
| 602 | 602 | $tableAlias = $this->getSQLTableAlias($parentClassName); |
| 603 | - $joinSql .= ' INNER JOIN ' . $this->quoteStrategy->getTableName($parentClass, $this->platform) . ' ' . $tableAlias . ' ON '; |
|
| 603 | + $joinSql .= ' INNER JOIN '.$this->quoteStrategy->getTableName($parentClass, $this->platform).' '.$tableAlias.' ON '; |
|
| 604 | 604 | |
| 605 | 605 | |
| 606 | 606 | foreach ($identifierColumn as $idColumn) { |
| 607 | - $conditions[] = $baseTableAlias . '.' . $idColumn . ' = ' . $tableAlias . '.' . $idColumn; |
|
| 607 | + $conditions[] = $baseTableAlias.'.'.$idColumn.' = '.$tableAlias.'.'.$idColumn; |
|
| 608 | 608 | } |
| 609 | 609 | |
| 610 | 610 | $joinSql .= implode(' AND ', $conditions); |
@@ -615,10 +615,10 @@ discard block |
||
| 615 | 615 | $conditions = []; |
| 616 | 616 | $subClass = $this->em->getClassMetadata($subClassName); |
| 617 | 617 | $tableAlias = $this->getSQLTableAlias($subClassName); |
| 618 | - $joinSql .= ' LEFT JOIN ' . $this->quoteStrategy->getTableName($subClass, $this->platform) . ' ' . $tableAlias . ' ON '; |
|
| 618 | + $joinSql .= ' LEFT JOIN '.$this->quoteStrategy->getTableName($subClass, $this->platform).' '.$tableAlias.' ON '; |
|
| 619 | 619 | |
| 620 | 620 | foreach ($identifierColumn as $idColumn) { |
| 621 | - $conditions[] = $baseTableAlias . '.' . $idColumn . ' = ' . $tableAlias . '.' . $idColumn; |
|
| 621 | + $conditions[] = $baseTableAlias.'.'.$idColumn.' = '.$tableAlias.'.'.$idColumn; |
|
| 622 | 622 | } |
| 623 | 623 | |
| 624 | 624 | $joinSql .= implode(' AND ', $conditions); |
@@ -31,6 +31,7 @@ |
||
| 31 | 31 | |
| 32 | 32 | /** |
| 33 | 33 | * {@inheritdoc} |
| 34 | + * @param \Doctrine\Tests\ORM\NotifyChangedEntity $entity |
|
| 34 | 35 | */ |
| 35 | 36 | public function & getEntityChangeSet($entity) |
| 36 | 37 | { |
@@ -4,13 +4,12 @@ |
||
| 4 | 4 | |
| 5 | 5 | use Doctrine\ORM\PersistentCollection; |
| 6 | 6 | use Doctrine\ORM\Proxy\Proxy; |
| 7 | -use Doctrine\Tests\Models\Company\CompanyPerson, |
|
| 8 | - Doctrine\Tests\Models\Company\CompanyEmployee, |
|
| 9 | - Doctrine\Tests\Models\Company\CompanyManager, |
|
| 10 | - Doctrine\Tests\Models\Company\CompanyOrganization, |
|
| 11 | - Doctrine\Tests\Models\Company\CompanyAuction, |
|
| 12 | - Doctrine\Tests\Models\Company\CompanyRaffle; |
|
| 13 | - |
|
| 7 | +use Doctrine\Tests\Models\Company\CompanyPerson; |
|
| 8 | +use Doctrine\Tests\Models\Company\CompanyEmployee; |
|
| 9 | +use Doctrine\Tests\Models\Company\CompanyManager; |
|
| 10 | +use Doctrine\Tests\Models\Company\CompanyOrganization; |
|
| 11 | +use Doctrine\Tests\Models\Company\CompanyAuction; |
|
| 12 | +use Doctrine\Tests\Models\Company\CompanyRaffle; |
|
| 14 | 13 | use Doctrine\Common\Collections\Criteria; |
| 15 | 14 | use Doctrine\Tests\OrmFunctionalTestCase; |
| 16 | 15 | |
@@ -146,6 +146,12 @@ discard block |
||
| 146 | 146 | return [$user1, $user2, $user3]; |
| 147 | 147 | } |
| 148 | 148 | |
| 149 | + /** |
|
| 150 | + * @param string $name |
|
| 151 | + * @param string $username |
|
| 152 | + * @param string $status |
|
| 153 | + * @param CmsAddress $address |
|
| 154 | + */ |
|
| 149 | 155 | public function buildUser($name, $username, $status, $address) |
| 150 | 156 | { |
| 151 | 157 | $user = new CmsUser(); |
@@ -160,6 +166,12 @@ discard block |
||
| 160 | 166 | return $user; |
| 161 | 167 | } |
| 162 | 168 | |
| 169 | + /** |
|
| 170 | + * @param string $country |
|
| 171 | + * @param string $city |
|
| 172 | + * @param string $street |
|
| 173 | + * @param string $zip |
|
| 174 | + */ |
|
| 163 | 175 | public function buildAddress($country, $city, $street, $zip) |
| 164 | 176 | { |
| 165 | 177 | $address = new CmsAddress(); |
@@ -3,14 +3,13 @@ |
||
| 3 | 3 | namespace Doctrine\Tests\ORM\Functional; |
| 4 | 4 | |
| 5 | 5 | use Doctrine\Common\Collections\ArrayCollection; |
| 6 | - |
|
| 7 | 6 | use Doctrine\ORM\NonUniqueResultException; |
| 8 | 7 | use Doctrine\ORM\Proxy\Proxy; |
| 9 | 8 | use Doctrine\ORM\Query\QueryException; |
| 10 | 9 | use Doctrine\ORM\UnexpectedResultException; |
| 11 | -use Doctrine\Tests\Models\CMS\CmsUser, |
|
| 12 | - Doctrine\Tests\Models\CMS\CmsArticle, |
|
| 13 | - Doctrine\Tests\Models\CMS\CmsPhonenumber; |
|
| 10 | +use Doctrine\Tests\Models\CMS\CmsUser; |
|
| 11 | +use Doctrine\Tests\Models\CMS\CmsArticle; |
|
| 12 | +use Doctrine\Tests\Models\CMS\CmsPhonenumber; |
|
| 14 | 13 | use Doctrine\ORM\Mapping\ClassMetadata; |
| 15 | 14 | use Doctrine\ORM\Query; |
| 16 | 15 | use Doctrine\ORM\Query\Parameter; |
@@ -173,6 +173,10 @@ discard block |
||
| 173 | 173 | */ |
| 174 | 174 | public $phones; |
| 175 | 175 | |
| 176 | + /** |
|
| 177 | + * @param string $email |
|
| 178 | + * @param string $name |
|
| 179 | + */ |
|
| 176 | 180 | public function __construct($email, $name, array $numbers = []) |
| 177 | 181 | { |
| 178 | 182 | $this->name = $name; |
@@ -208,6 +212,9 @@ discard block |
||
| 208 | 212 | */ |
| 209 | 213 | public $user; |
| 210 | 214 | |
| 215 | + /** |
|
| 216 | + * @param DDC1335User $user |
|
| 217 | + */ |
|
| 211 | 218 | public function __construct($user, $number) |
| 212 | 219 | { |
| 213 | 220 | $this->user = $user; |
@@ -119,6 +119,10 @@ discard block |
||
| 119 | 119 | */ |
| 120 | 120 | public $driverRides; |
| 121 | 121 | |
| 122 | + /** |
|
| 123 | + * @param integer $id |
|
| 124 | + * @param string $name |
|
| 125 | + */ |
|
| 122 | 126 | public function __construct($id, $name) |
| 123 | 127 | { |
| 124 | 128 | $this->driverRides = new ArrayCollection(); |
@@ -181,6 +185,10 @@ discard block |
||
| 181 | 185 | */ |
| 182 | 186 | public $carRides; |
| 183 | 187 | |
| 188 | + /** |
|
| 189 | + * @param string $brand |
|
| 190 | + * @param string $model |
|
| 191 | + */ |
|
| 184 | 192 | public function __construct($brand, $model) |
| 185 | 193 | { |
| 186 | 194 | $this->carRides = new ArrayCollection(); |
@@ -227,6 +227,9 @@ discard block |
||
| 227 | 227 | $this->assertEquals([], $metadata); |
| 228 | 228 | } |
| 229 | 229 | |
| 230 | + /** |
|
| 231 | + * @param \PHPUnit_Framework_MockObject_MockObject $conn |
|
| 232 | + */ |
|
| 230 | 233 | protected function _createEntityManager($metadataDriver, $conn = null) |
| 231 | 234 | { |
| 232 | 235 | $driverMock = new DriverMock(); |
@@ -255,7 +258,6 @@ discard block |
||
| 255 | 258 | } |
| 256 | 259 | |
| 257 | 260 | /** |
| 258 | - * @param string $class |
|
| 259 | 261 | * @return ClassMetadata |
| 260 | 262 | */ |
| 261 | 263 | protected function _createValidClassMetadata() |
@@ -469,6 +471,10 @@ discard block |
||
| 469 | 471 | return $this->mockMetadata[$className]; |
| 470 | 472 | } |
| 471 | 473 | |
| 474 | + /** |
|
| 475 | + * @param string $className |
|
| 476 | + * @param ClassMetadata $metadata |
|
| 477 | + */ |
|
| 472 | 478 | public function setMetadataForClass($className, $metadata) |
| 473 | 479 | { |
| 474 | 480 | $this->mockMetadata[$className] = $metadata; |