@@ -84,7 +84,7 @@ |
||
| 84 | 84 | $this->entityManager->getConnection()->setDatabasePlatform(new PostgreSqlPlatform); |
| 85 | 85 | |
| 86 | 86 | $query = $this->entityManager->createQuery( |
| 87 | - 'SELECT u, g, COUNT(g.id) AS hidden g_quantity FROM Doctrine\Tests\ORM\Tools\Pagination\User u JOIN u.groups g ORDER BY g_quantity, u.id DESC' |
|
| 87 | + 'SELECT u, g, COUNT(g.id) AS hidden g_quantity FROM Doctrine\Tests\ORM\Tools\Pagination\User u JOIN u.groups g ORDER BY g_quantity, u.id DESC' |
|
| 88 | 88 | ); |
| 89 | 89 | $limitQuery = clone $query; |
| 90 | 90 | $limitQuery->setHint(Query::HINT_CUSTOM_OUTPUT_WALKER, LimitSubqueryOutputWalker::class); |
@@ -1,6 +1,6 @@ |
||
| 1 | 1 | <?php |
| 2 | 2 | |
| 3 | -declare(strict_types=1); |
|
| 3 | +declare(strict_types = 1); |
|
| 4 | 4 | |
| 5 | 5 | namespace Doctrine\Tests\ORM\Tools\Pagination; |
| 6 | 6 | |
@@ -130,7 +130,7 @@ |
||
| 130 | 130 | { |
| 131 | 131 | $this->expectException(MappingException::class); |
| 132 | 132 | $this->expectExceptionMessage( |
| 133 | - 'Entity \'Doctrine\Tests\ORM\Mapping\HierarchyBEntity\' has to be part of the discriminator map' |
|
| 133 | + 'Entity \'Doctrine\Tests\ORM\Mapping\HierarchyBEntity\' has to be part of the discriminator map' |
|
| 134 | 134 | . ' of \'Doctrine\Tests\ORM\Mapping\HierarchyBase\' to be properly mapped in the inheritance hierarchy.' |
| 135 | 135 | . ' Alternatively you can make \'Doctrine\Tests\ORM\Mapping\HierarchyBEntity\' an abstract class to' |
| 136 | 136 | . ' avoid this exception from occurring.' |
@@ -1,6 +1,6 @@ |
||
| 1 | 1 | <?php |
| 2 | 2 | |
| 3 | -declare(strict_types=1); |
|
| 3 | +declare(strict_types = 1); |
|
| 4 | 4 | |
| 5 | 5 | namespace Doctrine\Tests\ORM\Mapping; |
| 6 | 6 | |
@@ -24,18 +24,18 @@ |
||
| 24 | 24 | public $avatar; |
| 25 | 25 | |
| 26 | 26 | public function getId() { |
| 27 | - return $this->id; |
|
| 27 | + return $this->id; |
|
| 28 | 28 | } |
| 29 | 29 | |
| 30 | 30 | public function getUsername() { |
| 31 | - return $this->username; |
|
| 31 | + return $this->username; |
|
| 32 | 32 | } |
| 33 | 33 | |
| 34 | 34 | public function getAvatar() { |
| 35 | - return $this->avatar; |
|
| 35 | + return $this->avatar; |
|
| 36 | 36 | } |
| 37 | 37 | |
| 38 | 38 | public function setAvatar(ForumAvatar $avatar) { |
| 39 | - $this->avatar = $avatar; |
|
| 39 | + $this->avatar = $avatar; |
|
| 40 | 40 | } |
| 41 | 41 | } |
@@ -1,6 +1,6 @@ |
||
| 1 | 1 | <?php |
| 2 | 2 | |
| 3 | -declare(strict_types=1); |
|
| 3 | +declare(strict_types = 1); |
|
| 4 | 4 | |
| 5 | 5 | namespace Doctrine\Tests\Models\Forum; |
| 6 | 6 | |
@@ -25,12 +25,12 @@ |
||
| 25 | 25 | |
| 26 | 26 | if ($this->maxRunningTime != 0 && $time > $this->maxRunningTime) { |
| 27 | 27 | $this->fail( |
| 28 | - sprintf( |
|
| 28 | + sprintf( |
|
| 29 | 29 | 'expected running time: <= %s but was: %s', |
| 30 | 30 | |
| 31 | 31 | $this->maxRunningTime, |
| 32 | 32 | $time |
| 33 | - ) |
|
| 33 | + ) |
|
| 34 | 34 | ); |
| 35 | 35 | } |
| 36 | 36 | } |
@@ -1,6 +1,6 @@ discard block |
||
| 1 | 1 | <?php |
| 2 | 2 | |
| 3 | -declare(strict_types=1); |
|
| 3 | +declare(strict_types = 1); |
|
| 4 | 4 | |
| 5 | 5 | namespace Doctrine\Tests; |
| 6 | 6 | |
@@ -48,7 +48,7 @@ discard block |
||
| 48 | 48 | */ |
| 49 | 49 | public function setMaxRunningTime($maxRunningTime) |
| 50 | 50 | { |
| 51 | - if (! (is_int($maxRunningTime) && $maxRunningTime >= 0)) { |
|
| 51 | + if ( ! (is_int($maxRunningTime) && $maxRunningTime >= 0)) { |
|
| 52 | 52 | throw new \InvalidArgumentException; |
| 53 | 53 | } |
| 54 | 54 | |
@@ -75,7 +75,7 @@ discard block |
||
| 75 | 75 | /** |
| 76 | 76 | * Creates an ASCending order expression. |
| 77 | 77 | * |
| 78 | - * @param mixed $expr |
|
| 78 | + * @param string $expr |
|
| 79 | 79 | * |
| 80 | 80 | * @return Expr\OrderBy |
| 81 | 81 | */ |
@@ -87,7 +87,7 @@ discard block |
||
| 87 | 87 | /** |
| 88 | 88 | * Creates a DESCending order expression. |
| 89 | 89 | * |
| 90 | - * @param mixed $expr |
|
| 90 | + * @param string $expr |
|
| 91 | 91 | * |
| 92 | 92 | * @return Expr\OrderBy |
| 93 | 93 | */ |
@@ -125,8 +125,8 @@ discard block |
||
| 125 | 125 | * // u.id <> ?1 |
| 126 | 126 | * $q->where($q->expr()->neq('u.id', '?1')); |
| 127 | 127 | * |
| 128 | - * @param mixed $x Left expression. |
|
| 129 | - * @param mixed $y Right expression. |
|
| 128 | + * @param string $x Left expression. |
|
| 129 | + * @param string $y Right expression. |
|
| 130 | 130 | * |
| 131 | 131 | * @return Expr\Comparison |
| 132 | 132 | */ |
@@ -214,7 +214,7 @@ discard block |
||
| 214 | 214 | /** |
| 215 | 215 | * Creates an instance of AVG() function, with the given argument. |
| 216 | 216 | * |
| 217 | - * @param mixed $x Argument to be used in AVG() function. |
|
| 217 | + * @param string $x Argument to be used in AVG() function. |
|
| 218 | 218 | * |
| 219 | 219 | * @return Expr\Func |
| 220 | 220 | */ |
@@ -226,7 +226,7 @@ discard block |
||
| 226 | 226 | /** |
| 227 | 227 | * Creates an instance of MAX() function, with the given argument. |
| 228 | 228 | * |
| 229 | - * @param mixed $x Argument to be used in MAX() function. |
|
| 229 | + * @param string $x Argument to be used in MAX() function. |
|
| 230 | 230 | * |
| 231 | 231 | * @return Expr\Func |
| 232 | 232 | */ |
@@ -238,7 +238,7 @@ discard block |
||
| 238 | 238 | /** |
| 239 | 239 | * Creates an instance of MIN() function, with the given argument. |
| 240 | 240 | * |
| 241 | - * @param mixed $x Argument to be used in MIN() function. |
|
| 241 | + * @param string $x Argument to be used in MIN() function. |
|
| 242 | 242 | * |
| 243 | 243 | * @return Expr\Func |
| 244 | 244 | */ |
@@ -250,7 +250,7 @@ discard block |
||
| 250 | 250 | /** |
| 251 | 251 | * Creates an instance of COUNT() function, with the given argument. |
| 252 | 252 | * |
| 253 | - * @param mixed $x Argument to be used in COUNT() function. |
|
| 253 | + * @param string $x Argument to be used in COUNT() function. |
|
| 254 | 254 | * |
| 255 | 255 | * @return Expr\Func |
| 256 | 256 | */ |
@@ -262,7 +262,7 @@ discard block |
||
| 262 | 262 | /** |
| 263 | 263 | * Creates an instance of COUNT(DISTINCT) function, with the given argument. |
| 264 | 264 | * |
| 265 | - * @param mixed $x Argument to be used in COUNT(DISTINCT) function. |
|
| 265 | + * @param string $x Argument to be used in COUNT(DISTINCT) function. |
|
| 266 | 266 | * |
| 267 | 267 | * @return string |
| 268 | 268 | */ |
@@ -274,7 +274,7 @@ discard block |
||
| 274 | 274 | /** |
| 275 | 275 | * Creates an instance of EXISTS() function, with the given DQL Subquery. |
| 276 | 276 | * |
| 277 | - * @param mixed $subquery DQL Subquery to be used in EXISTS() function. |
|
| 277 | + * @param \Doctrine\ORM\QueryBuilder $subquery DQL Subquery to be used in EXISTS() function. |
|
| 278 | 278 | * |
| 279 | 279 | * @return Expr\Func |
| 280 | 280 | */ |
@@ -298,7 +298,7 @@ discard block |
||
| 298 | 298 | /** |
| 299 | 299 | * Creates a SOME() function expression with the given DQL subquery. |
| 300 | 300 | * |
| 301 | - * @param mixed $subquery DQL Subquery to be used in SOME() function. |
|
| 301 | + * @param \Doctrine\ORM\QueryBuilder $subquery DQL Subquery to be used in SOME() function. |
|
| 302 | 302 | * |
| 303 | 303 | * @return Expr\Func |
| 304 | 304 | */ |
@@ -310,7 +310,7 @@ discard block |
||
| 310 | 310 | /** |
| 311 | 311 | * Creates an ANY() function expression with the given DQL subquery. |
| 312 | 312 | * |
| 313 | - * @param mixed $subquery DQL Subquery to be used in ANY() function. |
|
| 313 | + * @param \Doctrine\ORM\QueryBuilder $subquery DQL Subquery to be used in ANY() function. |
|
| 314 | 314 | * |
| 315 | 315 | * @return Expr\Func |
| 316 | 316 | */ |
@@ -334,7 +334,7 @@ discard block |
||
| 334 | 334 | /** |
| 335 | 335 | * Creates an ABS() function expression with the given argument. |
| 336 | 336 | * |
| 337 | - * @param mixed $x Argument to be used in ABS() function. |
|
| 337 | + * @param integer $x Argument to be used in ABS() function. |
|
| 338 | 338 | * |
| 339 | 339 | * @return Expr\Func |
| 340 | 340 | */ |
@@ -353,8 +353,8 @@ discard block |
||
| 353 | 353 | * // u.salary * u.percentAnnualSalaryIncrease |
| 354 | 354 | * $q->expr()->prod('u.salary', 'u.percentAnnualSalaryIncrease') |
| 355 | 355 | * |
| 356 | - * @param mixed $x Left expression. |
|
| 357 | - * @param mixed $y Right expression. |
|
| 356 | + * @param integer $x Left expression. |
|
| 357 | + * @param integer $y Right expression. |
|
| 358 | 358 | * |
| 359 | 359 | * @return Expr\Math |
| 360 | 360 | */ |
@@ -372,7 +372,7 @@ discard block |
||
| 372 | 372 | * // u.monthlySubscriptionCount - 1 |
| 373 | 373 | * $q->expr()->diff('u.monthlySubscriptionCount', '1') |
| 374 | 374 | * |
| 375 | - * @param mixed $x Left expression. |
|
| 375 | + * @param integer $x Left expression. |
|
| 376 | 376 | * @param mixed $y Right expression. |
| 377 | 377 | * |
| 378 | 378 | * @return Expr\Math |
@@ -391,8 +391,8 @@ discard block |
||
| 391 | 391 | * // u.numChildren + 1 |
| 392 | 392 | * $q->expr()->sum('u.numChildren', '1') |
| 393 | 393 | * |
| 394 | - * @param mixed $x Left expression. |
|
| 395 | - * @param mixed $y Right expression. |
|
| 394 | + * @param integer $x Left expression. |
|
| 395 | + * @param integer $y Right expression. |
|
| 396 | 396 | * |
| 397 | 397 | * @return Expr\Math |
| 398 | 398 | */ |
@@ -411,7 +411,7 @@ discard block |
||
| 411 | 411 | * $expr->quot('u.total', 'u.period') |
| 412 | 412 | * |
| 413 | 413 | * @param mixed $x Left expression. |
| 414 | - * @param mixed $y Right expression. |
|
| 414 | + * @param integer $y Right expression. |
|
| 415 | 415 | * |
| 416 | 416 | * @return Expr\Math |
| 417 | 417 | */ |
@@ -423,7 +423,7 @@ discard block |
||
| 423 | 423 | /** |
| 424 | 424 | * Creates a SQRT() function expression with the given argument. |
| 425 | 425 | * |
| 426 | - * @param mixed $x Argument to be used in SQRT() function. |
|
| 426 | + * @param integer $x Argument to be used in SQRT() function. |
|
| 427 | 427 | * |
| 428 | 428 | * @return Expr\Func |
| 429 | 429 | */ |
@@ -502,7 +502,7 @@ discard block |
||
| 502 | 502 | * Creates a LIKE() comparison expression with the given arguments. |
| 503 | 503 | * |
| 504 | 504 | * @param string $x Field in string format to be inspected by LIKE() comparison. |
| 505 | - * @param mixed $y Argument to be used in LIKE() comparison. |
|
| 505 | + * @param string $y Argument to be used in LIKE() comparison. |
|
| 506 | 506 | * |
| 507 | 507 | * @return Expr\Comparison |
| 508 | 508 | */ |
@@ -515,7 +515,7 @@ discard block |
||
| 515 | 515 | * Creates a NOT LIKE() comparison expression with the given arguments. |
| 516 | 516 | * |
| 517 | 517 | * @param string $x Field in string format to be inspected by LIKE() comparison. |
| 518 | - * @param mixed $y Argument to be used in LIKE() comparison. |
|
| 518 | + * @param string $y Argument to be used in LIKE() comparison. |
|
| 519 | 519 | * |
| 520 | 520 | * @return Expr\Comparison |
| 521 | 521 | */ |
@@ -527,8 +527,8 @@ discard block |
||
| 527 | 527 | /** |
| 528 | 528 | * Creates a CONCAT() function expression with the given arguments. |
| 529 | 529 | * |
| 530 | - * @param mixed $x First argument to be used in CONCAT() function. |
|
| 531 | - * @param mixed $y,... Other arguments to be used in CONCAT() function. |
|
| 530 | + * @param string $x First argument to be used in CONCAT() function. |
|
| 531 | + * @param string $y |
|
| 532 | 532 | * |
| 533 | 533 | * @return Expr\Func |
| 534 | 534 | */ |
@@ -540,7 +540,7 @@ discard block |
||
| 540 | 540 | /** |
| 541 | 541 | * Creates a SUBSTRING() function expression with the given arguments. |
| 542 | 542 | * |
| 543 | - * @param mixed $x Argument to be used as string to be cropped by SUBSTRING() function. |
|
| 543 | + * @param string $x Argument to be used as string to be cropped by SUBSTRING() function. |
|
| 544 | 544 | * @param int $from Initial offset to start cropping string. May accept negative values. |
| 545 | 545 | * @param int|null $len Length of crop. May accept negative values. |
| 546 | 546 | * |
@@ -559,7 +559,7 @@ discard block |
||
| 559 | 559 | /** |
| 560 | 560 | * Creates a LOWER() function expression with the given argument. |
| 561 | 561 | * |
| 562 | - * @param mixed $x Argument to be used in LOWER() function. |
|
| 562 | + * @param string $x Argument to be used in LOWER() function. |
|
| 563 | 563 | * |
| 564 | 564 | * @return Expr\Func A LOWER function expression. |
| 565 | 565 | */ |
@@ -571,7 +571,7 @@ discard block |
||
| 571 | 571 | /** |
| 572 | 572 | * Creates an UPPER() function expression with the given argument. |
| 573 | 573 | * |
| 574 | - * @param mixed $x Argument to be used in UPPER() function. |
|
| 574 | + * @param string $x Argument to be used in UPPER() function. |
|
| 575 | 575 | * |
| 576 | 576 | * @return Expr\Func An UPPER function expression. |
| 577 | 577 | */ |
@@ -583,7 +583,7 @@ discard block |
||
| 583 | 583 | /** |
| 584 | 584 | * Creates a LENGTH() function expression with the given argument. |
| 585 | 585 | * |
| 586 | - * @param mixed $x Argument to be used as argument of LENGTH() function. |
|
| 586 | + * @param string $x Argument to be used as argument of LENGTH() function. |
|
| 587 | 587 | * |
| 588 | 588 | * @return Expr\Func A LENGTH function expression. |
| 589 | 589 | */ |
@@ -625,11 +625,11 @@ discard block |
||
| 625 | 625 | /** |
| 626 | 626 | * Creates an instance of BETWEEN() function, with the given argument. |
| 627 | 627 | * |
| 628 | - * @param mixed $val Valued to be inspected by range values. |
|
| 629 | - * @param integer|string $x Starting range value to be used in BETWEEN() function. |
|
| 630 | - * @param integer|string $y End point value to be used in BETWEEN() function. |
|
| 628 | + * @param string $val Valued to be inspected by range values. |
|
| 629 | + * @param integer $x Starting range value to be used in BETWEEN() function. |
|
| 630 | + * @param integer $y End point value to be used in BETWEEN() function. |
|
| 631 | 631 | * |
| 632 | - * @return Expr\Func A BETWEEN expression. |
|
| 632 | + * @return string A BETWEEN expression. |
|
| 633 | 633 | */ |
| 634 | 634 | public function between($val, $x, $y) |
| 635 | 635 | { |
@@ -639,7 +639,7 @@ discard block |
||
| 639 | 639 | /** |
| 640 | 640 | * Creates an instance of TRIM() function, with the given argument. |
| 641 | 641 | * |
| 642 | - * @param mixed $x Argument to be used as argument of TRIM() function. |
|
| 642 | + * @param string $x Argument to be used as argument of TRIM() function. |
|
| 643 | 643 | * |
| 644 | 644 | * @return Expr\Func a TRIM expression. |
| 645 | 645 | */ |
@@ -1,6 +1,6 @@ discard block |
||
| 1 | 1 | <?php |
| 2 | 2 | |
| 3 | -declare(strict_types=1); |
|
| 3 | +declare(strict_types = 1); |
|
| 4 | 4 | |
| 5 | 5 | namespace Doctrine\ORM\Query; |
| 6 | 6 | |
@@ -253,7 +253,7 @@ discard block |
||
| 253 | 253 | */ |
| 254 | 254 | public function countDistinct($x) |
| 255 | 255 | { |
| 256 | - return 'COUNT(DISTINCT ' . implode(', ', func_get_args()) . ')'; |
|
| 256 | + return 'COUNT(DISTINCT '.implode(', ', func_get_args()).')'; |
|
| 257 | 257 | } |
| 258 | 258 | |
| 259 | 259 | /** |
@@ -435,7 +435,7 @@ discard block |
||
| 435 | 435 | } |
| 436 | 436 | } |
| 437 | 437 | |
| 438 | - return new Expr\Func($x . ' IN', (array) $y); |
|
| 438 | + return new Expr\Func($x.' IN', (array) $y); |
|
| 439 | 439 | } |
| 440 | 440 | |
| 441 | 441 | /** |
@@ -456,7 +456,7 @@ discard block |
||
| 456 | 456 | } |
| 457 | 457 | } |
| 458 | 458 | |
| 459 | - return new Expr\Func($x . ' NOT IN', (array) $y); |
|
| 459 | + return new Expr\Func($x.' NOT IN', (array) $y); |
|
| 460 | 460 | } |
| 461 | 461 | |
| 462 | 462 | /** |
@@ -468,7 +468,7 @@ discard block |
||
| 468 | 468 | */ |
| 469 | 469 | public function isNull($x) |
| 470 | 470 | { |
| 471 | - return $x . ' IS NULL'; |
|
| 471 | + return $x.' IS NULL'; |
|
| 472 | 472 | } |
| 473 | 473 | |
| 474 | 474 | /** |
@@ -480,7 +480,7 @@ discard block |
||
| 480 | 480 | */ |
| 481 | 481 | public function isNotNull($x) |
| 482 | 482 | { |
| 483 | - return $x . ' IS NOT NULL'; |
|
| 483 | + return $x.' IS NOT NULL'; |
|
| 484 | 484 | } |
| 485 | 485 | |
| 486 | 486 | /** |
@@ -598,12 +598,12 @@ discard block |
||
| 598 | 598 | */ |
| 599 | 599 | private function quoteLiteral($literal) |
| 600 | 600 | { |
| 601 | - if (is_numeric($literal) && !is_string($literal)) { |
|
| 601 | + if (is_numeric($literal) && ! is_string($literal)) { |
|
| 602 | 602 | return (string) $literal; |
| 603 | 603 | } else if (is_bool($literal)) { |
| 604 | 604 | return $literal ? "true" : "false"; |
| 605 | 605 | } else { |
| 606 | - return "'" . str_replace("'", "''", $literal) . "'"; |
|
| 606 | + return "'".str_replace("'", "''", $literal)."'"; |
|
| 607 | 607 | } |
| 608 | 608 | } |
| 609 | 609 | |
@@ -618,7 +618,7 @@ discard block |
||
| 618 | 618 | */ |
| 619 | 619 | public function between($val, $x, $y) |
| 620 | 620 | { |
| 621 | - return $val . ' BETWEEN ' . $x . ' AND ' . $y; |
|
| 621 | + return $val.' BETWEEN '.$x.' AND '.$y; |
|
| 622 | 622 | } |
| 623 | 623 | |
| 624 | 624 | /** |
@@ -45,6 +45,7 @@ |
||
| 45 | 45 | * {@inheritDoc} |
| 46 | 46 | * |
| 47 | 47 | * @param MultiGetCache $cache |
| 48 | + * @param string $name |
|
| 48 | 49 | */ |
| 49 | 50 | public function __construct($name, MultiGetCache $cache, $lifetime = 0) |
| 50 | 51 | { |
@@ -1,7 +1,7 @@ |
||
| 1 | 1 | <?php |
| 2 | 2 | |
| 3 | 3 | |
| 4 | -declare(strict_types=1); |
|
| 4 | +declare(strict_types = 1); |
|
| 5 | 5 | |
| 6 | 6 | namespace Doctrine\ORM\Cache\Region; |
| 7 | 7 | |
@@ -23,7 +23,6 @@ |
||
| 23 | 23 | |
| 24 | 24 | use Doctrine\ORM\Mapping\ToOneAssociationMetadata; |
| 25 | 25 | use PDO; |
| 26 | -use Doctrine\ORM\Mapping\ClassMetadata; |
|
| 27 | 26 | |
| 28 | 27 | /** |
| 29 | 28 | * The ArrayHydrator produces a nested array "graph" that is often (not always) |
@@ -1,6 +1,6 @@ discard block |
||
| 1 | 1 | <?php |
| 2 | 2 | |
| 3 | -declare(strict_types=1); |
|
| 3 | +declare(strict_types = 1); |
|
| 4 | 4 | |
| 5 | 5 | namespace Doctrine\ORM\Internal\Hydration; |
| 6 | 6 | |
@@ -97,10 +97,10 @@ discard block |
||
| 97 | 97 | // It's a joined result |
| 98 | 98 | |
| 99 | 99 | $parent = $this->rsm->parentAliasMap[$dqlAlias]; |
| 100 | - $path = $parent . '.' . $dqlAlias; |
|
| 100 | + $path = $parent.'.'.$dqlAlias; |
|
| 101 | 101 | |
| 102 | 102 | // missing parent data, skipping as RIGHT JOIN hydration is not supported. |
| 103 | - if ( ! isset($nonemptyComponents[$parent]) ) { |
|
| 103 | + if ( ! isset($nonemptyComponents[$parent])) { |
|
| 104 | 104 | continue; |
| 105 | 105 | } |
| 106 | 106 | |
@@ -109,9 +109,9 @@ discard block |
||
| 109 | 109 | if ($this->rsm->isMixed && isset($this->rootAliases[$parent])) { |
| 110 | 110 | $first = reset($this->resultPointers); |
| 111 | 111 | // TODO: Exception if $key === null ? |
| 112 | - $baseElement =& $this->resultPointers[$parent][key($first)]; |
|
| 112 | + $baseElement = & $this->resultPointers[$parent][key($first)]; |
|
| 113 | 113 | } else if (isset($this->resultPointers[$parent])) { |
| 114 | - $baseElement =& $this->resultPointers[$parent]; |
|
| 114 | + $baseElement = & $this->resultPointers[$parent]; |
|
| 115 | 115 | } else { |
| 116 | 116 | unset($this->resultPointers[$dqlAlias]); // Ticket #1228 |
| 117 | 117 | |
@@ -123,7 +123,7 @@ discard block |
||
| 123 | 123 | $relation = $parentClass->getProperty($relationAlias); |
| 124 | 124 | |
| 125 | 125 | // Check the type of the relation (many or single-valued) |
| 126 | - if (! $relation instanceof ToOneAssociationMetadata) { |
|
| 126 | + if ( ! $relation instanceof ToOneAssociationMetadata) { |
|
| 127 | 127 | $oneToOne = false; |
| 128 | 128 | |
| 129 | 129 | if ( ! isset($baseElement[$relationAlias])) { |
@@ -162,7 +162,7 @@ discard block |
||
| 162 | 162 | } |
| 163 | 163 | } |
| 164 | 164 | |
| 165 | - $coll =& $baseElement[$relationAlias]; |
|
| 165 | + $coll = & $baseElement[$relationAlias]; |
|
| 166 | 166 | |
| 167 | 167 | if (is_array($coll)) { |
| 168 | 168 | $this->updateResultPointer($coll, $index, $dqlAlias, $oneToOne); |
@@ -174,7 +174,7 @@ discard block |
||
| 174 | 174 | $entityKey = $this->rsm->entityMappings[$dqlAlias] ?: 0; |
| 175 | 175 | |
| 176 | 176 | // if this row has a NULL value for the root result id then make it a null result. |
| 177 | - if ( ! isset($nonemptyComponents[$dqlAlias]) ) { |
|
| 177 | + if ( ! isset($nonemptyComponents[$dqlAlias])) { |
|
| 178 | 178 | $result[] = $this->rsm->isMixed |
| 179 | 179 | ? [$entityKey => null] |
| 180 | 180 | : null; |
@@ -273,13 +273,13 @@ discard block |
||
| 273 | 273 | } |
| 274 | 274 | |
| 275 | 275 | if ($oneToOne) { |
| 276 | - $this->resultPointers[$dqlAlias] =& $coll; |
|
| 276 | + $this->resultPointers[$dqlAlias] = & $coll; |
|
| 277 | 277 | |
| 278 | 278 | return; |
| 279 | 279 | } |
| 280 | 280 | |
| 281 | 281 | if ($index !== false) { |
| 282 | - $this->resultPointers[$dqlAlias] =& $coll[$index]; |
|
| 282 | + $this->resultPointers[$dqlAlias] = & $coll[$index]; |
|
| 283 | 283 | |
| 284 | 284 | return; |
| 285 | 285 | } |
@@ -289,7 +289,7 @@ discard block |
||
| 289 | 289 | } |
| 290 | 290 | |
| 291 | 291 | end($coll); |
| 292 | - $this->resultPointers[$dqlAlias] =& $coll[key($coll)]; |
|
| 292 | + $this->resultPointers[$dqlAlias] = & $coll[key($coll)]; |
|
| 293 | 293 | |
| 294 | 294 | return; |
| 295 | 295 | } |
@@ -207,7 +207,6 @@ |
||
| 207 | 207 | |
| 208 | 208 | /** |
| 209 | 209 | * @param ClassMetadata $targetClass |
| 210 | - * @param array $assoc |
|
| 211 | 210 | * @param mixed $actualValue |
| 212 | 211 | * |
| 213 | 212 | * @return self |
@@ -1,6 +1,6 @@ discard block |
||
| 1 | 1 | <?php |
| 2 | 2 | |
| 3 | -declare(strict_types=1); |
|
| 3 | +declare(strict_types = 1); |
|
| 4 | 4 | |
| 5 | 5 | namespace Doctrine\ORM; |
| 6 | 6 | use Doctrine\ORM\Mapping\AssociationMetadata; |
@@ -21,7 +21,7 @@ discard block |
||
| 21 | 21 | */ |
| 22 | 22 | static public function scheduleInsertForManagedEntity($entity) |
| 23 | 23 | { |
| 24 | - return new self("A managed+dirty entity " . self::objToStr($entity) . " can not be scheduled for insertion."); |
|
| 24 | + return new self("A managed+dirty entity ".self::objToStr($entity)." can not be scheduled for insertion."); |
|
| 25 | 25 | } |
| 26 | 26 | |
| 27 | 27 | /** |
@@ -31,7 +31,7 @@ discard block |
||
| 31 | 31 | */ |
| 32 | 32 | static public function scheduleInsertForRemovedEntity($entity) |
| 33 | 33 | { |
| 34 | - return new self("Removed entity " . self::objToStr($entity) . " can not be scheduled for insertion."); |
|
| 34 | + return new self("Removed entity ".self::objToStr($entity)." can not be scheduled for insertion."); |
|
| 35 | 35 | } |
| 36 | 36 | |
| 37 | 37 | /** |
@@ -41,7 +41,7 @@ discard block |
||
| 41 | 41 | */ |
| 42 | 42 | static public function scheduleInsertTwice($entity) |
| 43 | 43 | { |
| 44 | - return new self("Entity " . self::objToStr($entity) . " can not be scheduled for insertion twice."); |
|
| 44 | + return new self("Entity ".self::objToStr($entity)." can not be scheduled for insertion twice."); |
|
| 45 | 45 | } |
| 46 | 46 | |
| 47 | 47 | /** |
@@ -53,7 +53,7 @@ discard block |
||
| 53 | 53 | static public function entityWithoutIdentity($className, $entity) |
| 54 | 54 | { |
| 55 | 55 | return new self( |
| 56 | - "The given entity of type '" . $className . "' (".self::objToStr($entity).") has no identity/no " . |
|
| 56 | + "The given entity of type '".$className."' (".self::objToStr($entity).") has no identity/no ". |
|
| 57 | 57 | "id values set. It cannot be added to the identity map." |
| 58 | 58 | ); |
| 59 | 59 | } |
@@ -65,7 +65,7 @@ discard block |
||
| 65 | 65 | */ |
| 66 | 66 | static public function readOnlyRequiresManagedEntity($entity) |
| 67 | 67 | { |
| 68 | - return new self("Only managed entities can be marked or checked as read only. But " . self::objToStr($entity) . " is not"); |
|
| 68 | + return new self("Only managed entities can be marked or checked as read only. But ".self::objToStr($entity)." is not"); |
|
| 69 | 69 | } |
| 70 | 70 | |
| 71 | 71 | /** |
@@ -76,7 +76,7 @@ discard block |
||
| 76 | 76 | static public function newEntitiesFoundThroughRelationships($newEntitiesWithAssociations) |
| 77 | 77 | { |
| 78 | 78 | $errorMessages = array_map( |
| 79 | - function (array $newEntityWithAssociation) : string { |
|
| 79 | + function(array $newEntityWithAssociation) : string { |
|
| 80 | 80 | [$associationMetadata, $entity] = $newEntityWithAssociation; |
| 81 | 81 | |
| 82 | 82 | return self::newEntityFoundThroughRelationshipMessage($associationMetadata, $entity); |
@@ -148,7 +148,7 @@ discard block |
||
| 148 | 148 | */ |
| 149 | 149 | static public function entityNotManaged($entity) |
| 150 | 150 | { |
| 151 | - return new self("Entity " . self::objToStr($entity) . " is not managed. An entity is managed if its fetched " . |
|
| 151 | + return new self("Entity ".self::objToStr($entity)." is not managed. An entity is managed if its fetched ". |
|
| 152 | 152 | "from the database or registered as new through EntityManager#persist"); |
| 153 | 153 | } |
| 154 | 154 | |
@@ -160,7 +160,7 @@ discard block |
||
| 160 | 160 | */ |
| 161 | 161 | static public function entityHasNoIdentity($entity, $operation) |
| 162 | 162 | { |
| 163 | - return new self("Entity has no identity, therefore " . $operation ." cannot be performed. " . self::objToStr($entity)); |
|
| 163 | + return new self("Entity has no identity, therefore ".$operation." cannot be performed. ".self::objToStr($entity)); |
|
| 164 | 164 | } |
| 165 | 165 | |
| 166 | 166 | /** |
@@ -171,7 +171,7 @@ discard block |
||
| 171 | 171 | */ |
| 172 | 172 | static public function entityIsRemoved($entity, $operation) |
| 173 | 173 | { |
| 174 | - return new self("Entity is removed, therefore " . $operation ." cannot be performed. " . self::objToStr($entity)); |
|
| 174 | + return new self("Entity is removed, therefore ".$operation." cannot be performed. ".self::objToStr($entity)); |
|
| 175 | 175 | } |
| 176 | 176 | |
| 177 | 177 | /** |
@@ -182,7 +182,7 @@ discard block |
||
| 182 | 182 | */ |
| 183 | 183 | static public function detachedEntityCannot($entity, $operation) |
| 184 | 184 | { |
| 185 | - return new self("Detached entity " . self::objToStr($entity) . " cannot be " . $operation); |
|
| 185 | + return new self("Detached entity ".self::objToStr($entity)." cannot be ".$operation); |
|
| 186 | 186 | } |
| 187 | 187 | |
| 188 | 188 | /** |
@@ -194,8 +194,8 @@ discard block |
||
| 194 | 194 | */ |
| 195 | 195 | public static function invalidObject($context, $given, $parameterIndex = 1) |
| 196 | 196 | { |
| 197 | - return new self($context . ' expects parameter ' . $parameterIndex . |
|
| 198 | - ' to be an entity object, '. gettype($given) . ' given.'); |
|
| 197 | + return new self($context.' expects parameter '.$parameterIndex. |
|
| 198 | + ' to be an entity object, '.gettype($given).' given.'); |
|
| 199 | 199 | } |
| 200 | 200 | |
| 201 | 201 | /** |
@@ -203,7 +203,7 @@ discard block |
||
| 203 | 203 | */ |
| 204 | 204 | public static function invalidCompositeIdentifier() |
| 205 | 205 | { |
| 206 | - return new self("Binding an entity with a composite primary key to a query is not supported. " . |
|
| 206 | + return new self("Binding an entity with a composite primary key to a query is not supported. ". |
|
| 207 | 207 | "You should split the parameter into the explicit fields and bind them separately."); |
| 208 | 208 | } |
| 209 | 209 | |
@@ -260,15 +260,15 @@ discard block |
||
| 260 | 260 | private static function newEntityFoundThroughRelationshipMessage(AssociationMetadata $association, $entity) : string |
| 261 | 261 | { |
| 262 | 262 | return 'A new entity was found through the relationship \'' |
| 263 | - . $association->getSourceEntity() . '#' . $association->getName() . '\' that was not' |
|
| 264 | - . ' configured to cascade persist operations for entity: ' . self::objToStr($entity) . '.' |
|
| 263 | + . $association->getSourceEntity().'#'.$association->getName().'\' that was not' |
|
| 264 | + . ' configured to cascade persist operations for entity: '.self::objToStr($entity).'.' |
|
| 265 | 265 | . ' To solve this issue: Either explicitly call EntityManager#persist()' |
| 266 | 266 | . ' on this unknown entity or configure cascade persist' |
| 267 | 267 | . ' this association in the mapping for example @ManyToOne(..,cascade={"persist"}).' |
| 268 | 268 | . (method_exists($entity, '__toString') |
| 269 | 269 | ? '' |
| 270 | 270 | : ' If you cannot find out which entity causes the problem implement \'' |
| 271 | - . $association->getTargetEntity() . '#__toString()\' to get a clue.' |
|
| 271 | + . $association->getTargetEntity().'#__toString()\' to get a clue.' |
|
| 272 | 272 | ); |
| 273 | 273 | } |
| 274 | 274 | } |
@@ -120,7 +120,7 @@ discard block |
||
| 120 | 120 | * @param string $field |
| 121 | 121 | * @param array $args |
| 122 | 122 | * |
| 123 | - * @return object |
|
| 123 | + * @return PersistentObject |
|
| 124 | 124 | * |
| 125 | 125 | * @throws \BadMethodCallException When no persistent field exists by that name. |
| 126 | 126 | * @throws \InvalidArgumentException When the wrong target object type is passed to an association. |
@@ -207,7 +207,7 @@ discard block |
||
| 207 | 207 | * @param string $field |
| 208 | 208 | * @param array $args |
| 209 | 209 | * |
| 210 | - * @return object |
|
| 210 | + * @return PersistentObject |
|
| 211 | 211 | * |
| 212 | 212 | * @throws \BadMethodCallException |
| 213 | 213 | * @throws \InvalidArgumentException |
@@ -1,6 +1,6 @@ discard block |
||
| 1 | 1 | <?php |
| 2 | 2 | |
| 3 | -declare(strict_types=1); |
|
| 3 | +declare(strict_types = 1); |
|
| 4 | 4 | |
| 5 | 5 | namespace Doctrine\ORM; |
| 6 | 6 | |
@@ -89,7 +89,7 @@ discard block |
||
| 89 | 89 | { |
| 90 | 90 | if ($entityManager !== self::$entityManager) { |
| 91 | 91 | throw new \RuntimeException( |
| 92 | - "Trying to use PersistentObject with different EntityManager instances. " . |
|
| 92 | + "Trying to use PersistentObject with different EntityManager instances. ". |
|
| 93 | 93 | "Was PersistentObject::setEntityManager() called?" |
| 94 | 94 | ); |
| 95 | 95 | } |
@@ -114,7 +114,7 @@ discard block |
||
| 114 | 114 | |
| 115 | 115 | $property = $this->cm->getProperty($field); |
| 116 | 116 | |
| 117 | - if (! $property) { |
|
| 117 | + if ( ! $property) { |
|
| 118 | 118 | throw new \BadMethodCallException("no field with name '".$field."' exists on '".$this->cm->getClassName()."'"); |
| 119 | 119 | } |
| 120 | 120 | |
@@ -153,7 +153,7 @@ discard block |
||
| 153 | 153 | |
| 154 | 154 | $property = $this->cm->getProperty($field); |
| 155 | 155 | |
| 156 | - if (! $property) { |
|
| 156 | + if ( ! $property) { |
|
| 157 | 157 | throw new \BadMethodCallException("no field with name '".$field."' exists on '".$this->cm->getClassName()."'"); |
| 158 | 158 | } |
| 159 | 159 | |
@@ -179,7 +179,7 @@ discard block |
||
| 179 | 179 | $mappedByField = $property->getMappedBy(); |
| 180 | 180 | $targetMetadata = self::$entityManager->getClassMetadata($property->getTargetEntity()); |
| 181 | 181 | $targetProperty = $targetMetadata->getProperty($mappedByField); |
| 182 | - $setterMethodName = ($targetProperty instanceof ToManyAssociationMetadata ? 'add' : 'set') . $mappedByField; |
|
| 182 | + $setterMethodName = ($targetProperty instanceof ToManyAssociationMetadata ? 'add' : 'set').$mappedByField; |
|
| 183 | 183 | |
| 184 | 184 | $targetObject->$setterMethodName($this); |
| 185 | 185 | } |
@@ -201,21 +201,21 @@ discard block |
||
| 201 | 201 | |
| 202 | 202 | $property = $this->cm->getProperty($field); |
| 203 | 203 | |
| 204 | - if (! $property) { |
|
| 204 | + if ( ! $property) { |
|
| 205 | 205 | throw new \BadMethodCallException("no field with name '".$field."' exists on '".$this->cm->getClassName()."'"); |
| 206 | 206 | } |
| 207 | 207 | |
| 208 | - if (! ($property instanceof ToManyAssociationMetadata)) { |
|
| 208 | + if ( ! ($property instanceof ToManyAssociationMetadata)) { |
|
| 209 | 209 | throw new \BadMethodCallException("There is no method add".$field."() on ".$this->cm->getClassName()); |
| 210 | 210 | } |
| 211 | 211 | |
| 212 | 212 | $targetClassName = $property->getTargetEntity(); |
| 213 | 213 | |
| 214 | - if (! ($args[0] instanceof $targetClassName)) { |
|
| 214 | + if ( ! ($args[0] instanceof $targetClassName)) { |
|
| 215 | 215 | throw new \InvalidArgumentException("Expected persistent object of type '".$targetClassName."'"); |
| 216 | 216 | } |
| 217 | 217 | |
| 218 | - if (! ($this->$field instanceof Collection)) { |
|
| 218 | + if ( ! ($this->$field instanceof Collection)) { |
|
| 219 | 219 | $this->$field = new ArrayCollection($this->$field ?: []); |
| 220 | 220 | } |
| 221 | 221 | |
@@ -239,7 +239,7 @@ discard block |
||
| 239 | 239 | return; |
| 240 | 240 | } |
| 241 | 241 | |
| 242 | - if (!self::$entityManager) { |
|
| 242 | + if ( ! self::$entityManager) { |
|
| 243 | 243 | throw new \RuntimeException("No runtime entity manager set. Call PersistentObject#setEntityManager()."); |
| 244 | 244 | } |
| 245 | 245 | |