@@ -38,7 +38,7 @@ discard block |
||
38 | 38 | */ |
39 | 39 | public function convertToDatabaseValueSQL($sqlExpr, AbstractPlatform $platform) |
40 | 40 | { |
41 | - return 'ABS(' . $sqlExpr . ')'; |
|
41 | + return 'ABS('.$sqlExpr.')'; |
|
42 | 42 | } |
43 | 43 | |
44 | 44 | /** |
@@ -46,6 +46,6 @@ discard block |
||
46 | 46 | */ |
47 | 47 | public function convertToPHPValueSQL($sqlExpr, $platform) |
48 | 48 | { |
49 | - return '-(' . $sqlExpr . ')'; |
|
49 | + return '-('.$sqlExpr.')'; |
|
50 | 50 | } |
51 | 51 | } |
@@ -102,7 +102,7 @@ |
||
102 | 102 | /** |
103 | 103 | * @Id @Column(name="id", type="integer") |
104 | 104 | * @GeneratedValue(strategy="AUTO") |
105 | - */ |
|
105 | + */ |
|
106 | 106 | public $id; |
107 | 107 | } |
108 | 108 |
@@ -26,7 +26,7 @@ |
||
26 | 26 | $this->_em->getClassMetadata(Address::class), |
27 | 27 | ] |
28 | 28 | ); |
29 | - } catch(\Exception $e) { |
|
29 | + } catch (\Exception $e) { |
|
30 | 30 | } |
31 | 31 | } |
32 | 32 |
@@ -45,13 +45,13 @@ |
||
45 | 45 | |
46 | 46 | for ($i = 0; $i < 42; ++$i) { |
47 | 47 | if ($i % 10 == 0) { |
48 | - $this->connection->setQueryResult(new StatementArrayMock([[(int)($i / 10) * 10]])); |
|
48 | + $this->connection->setQueryResult(new StatementArrayMock([[(int) ($i / 10) * 10]])); |
|
49 | 49 | } |
50 | 50 | |
51 | 51 | $id = $this->sequenceGenerator->generate($this->entityManager, null); |
52 | 52 | |
53 | 53 | self::assertSame($i, $id); |
54 | - self::assertSame((int)($i / 10) * 10 + 10, $this->sequenceGenerator->getCurrentMaxValue()); |
|
54 | + self::assertSame((int) ($i / 10) * 10 + 10, $this->sequenceGenerator->getCurrentMaxValue()); |
|
55 | 55 | self::assertSame($i + 1, $this->sequenceGenerator->getNextValue()); |
56 | 56 | } |
57 | 57 | } |
@@ -51,7 +51,7 @@ discard block |
||
51 | 51 | */ |
52 | 52 | public static function syntaxError($message, $previous = null) |
53 | 53 | { |
54 | - return new self('[Syntax Error] ' . $message, 0, $previous); |
|
54 | + return new self('[Syntax Error] '.$message, 0, $previous); |
|
55 | 55 | } |
56 | 56 | |
57 | 57 | /** |
@@ -62,7 +62,7 @@ discard block |
||
62 | 62 | */ |
63 | 63 | public static function semanticalError($message, $previous = null) |
64 | 64 | { |
65 | - return new self('[Semantical Error] ' . $message, 0, $previous); |
|
65 | + return new self('[Semantical Error] '.$message, 0, $previous); |
|
66 | 66 | } |
67 | 67 | |
68 | 68 | /** |
@@ -81,7 +81,7 @@ discard block |
||
81 | 81 | */ |
82 | 82 | public static function invalidParameterType($expected, $received) |
83 | 83 | { |
84 | - return new self('Invalid parameter type, ' . $received . ' given, but ' . $expected . ' expected.'); |
|
84 | + return new self('Invalid parameter type, '.$received.' given, but '.$expected.' expected.'); |
|
85 | 85 | } |
86 | 86 | |
87 | 87 | /** |
@@ -91,7 +91,7 @@ discard block |
||
91 | 91 | */ |
92 | 92 | public static function invalidParameterPosition($pos) |
93 | 93 | { |
94 | - return new self('Invalid parameter position: ' . $pos); |
|
94 | + return new self('Invalid parameter position: '.$pos); |
|
95 | 95 | } |
96 | 96 | |
97 | 97 | /** |
@@ -102,7 +102,7 @@ discard block |
||
102 | 102 | */ |
103 | 103 | public static function tooManyParameters($expected, $received) |
104 | 104 | { |
105 | - return new self('Too many parameters: the query defines ' . $expected . ' parameters and you bound ' . $received); |
|
105 | + return new self('Too many parameters: the query defines '.$expected.' parameters and you bound '.$received); |
|
106 | 106 | } |
107 | 107 | |
108 | 108 | /** |
@@ -113,7 +113,7 @@ discard block |
||
113 | 113 | */ |
114 | 114 | public static function tooFewParameters($expected, $received) |
115 | 115 | { |
116 | - return new self('Too few parameters: the query defines ' . $expected . ' parameters but you only bound ' . $received); |
|
116 | + return new self('Too few parameters: the query defines '.$expected.' parameters but you only bound '.$received); |
|
117 | 117 | } |
118 | 118 | |
119 | 119 | /** |
@@ -152,7 +152,7 @@ discard block |
||
152 | 152 | public static function invalidPathExpression($pathExpr) |
153 | 153 | { |
154 | 154 | return new self( |
155 | - "Invalid PathExpression '" . $pathExpr->identificationVariable . "." . $pathExpr->field . "'." |
|
155 | + "Invalid PathExpression '".$pathExpr->identificationVariable.".".$pathExpr->field."'." |
|
156 | 156 | ); |
157 | 157 | } |
158 | 158 | |
@@ -185,8 +185,8 @@ discard block |
||
185 | 185 | public static function partialObjectsAreDangerous() |
186 | 186 | { |
187 | 187 | return new self( |
188 | - "Loading partial objects is dangerous. Fetch full objects or consider " . |
|
189 | - "using a different fetch mode. If you really want partial objects, " . |
|
188 | + "Loading partial objects is dangerous. Fetch full objects or consider ". |
|
189 | + "using a different fetch mode. If you really want partial objects, ". |
|
190 | 190 | "set the doctrine.forcePartialLoad query hint to TRUE." |
191 | 191 | ); |
192 | 192 | } |
@@ -213,8 +213,8 @@ discard block |
||
213 | 213 | public static function associationPathInverseSideNotSupported(PathExpression $pathExpr) |
214 | 214 | { |
215 | 215 | return new self( |
216 | - 'A single-valued association path expression to an inverse side is not supported in DQL queries. ' . |
|
217 | - 'Instead of "' . $pathExpr->identificationVariable . '.' . $pathExpr->field . '" use an explicit join.' |
|
216 | + 'A single-valued association path expression to an inverse side is not supported in DQL queries. '. |
|
217 | + 'Instead of "'.$pathExpr->identificationVariable.'.'.$pathExpr->field.'" use an explicit join.' |
|
218 | 218 | ); |
219 | 219 | } |
220 | 220 | |
@@ -226,8 +226,8 @@ discard block |
||
226 | 226 | public static function iterateWithFetchJoinNotAllowed($assoc) |
227 | 227 | { |
228 | 228 | return new self( |
229 | - "Iterate with fetch join in class " . $assoc['sourceEntity'] . |
|
230 | - " using association " . $assoc['fieldName'] . " not allowed." |
|
229 | + "Iterate with fetch join in class ".$assoc['sourceEntity']. |
|
230 | + " using association ".$assoc['fieldName']." not allowed." |
|
231 | 231 | ); |
232 | 232 | } |
233 | 233 | |
@@ -251,7 +251,7 @@ discard block |
||
251 | 251 | */ |
252 | 252 | public static function instanceOfUnrelatedClass($className, $rootClass) |
253 | 253 | { |
254 | - return new self("Cannot check if a child of '" . $rootClass . "' is instanceof '" . $className . "', " . |
|
254 | + return new self("Cannot check if a child of '".$rootClass."' is instanceof '".$className."', ". |
|
255 | 255 | "inheritance hierarchy does not exists between these two classes."); |
256 | 256 | } |
257 | 257 | |
@@ -263,7 +263,7 @@ discard block |
||
263 | 263 | public static function invalidQueryComponent($dqlAlias) |
264 | 264 | { |
265 | 265 | return new self( |
266 | - "Invalid query component given for DQL alias '" . $dqlAlias . "', ". |
|
266 | + "Invalid query component given for DQL alias '".$dqlAlias."', ". |
|
267 | 267 | "requires 'metadata', 'parent', 'relation', 'map', 'nestingLevel' and 'token' keys." |
268 | 268 | ); |
269 | 269 | } |
@@ -78,7 +78,7 @@ discard block |
||
78 | 78 | public function add($sort, $order = null) |
79 | 79 | { |
80 | 80 | $order = ! $order ? 'ASC' : $order; |
81 | - $this->parts[] = $sort . ' '. $order; |
|
81 | + $this->parts[] = $sort.' '.$order; |
|
82 | 82 | } |
83 | 83 | |
84 | 84 | /** |
@@ -102,6 +102,6 @@ discard block |
||
102 | 102 | */ |
103 | 103 | public function __toString() |
104 | 104 | { |
105 | - return $this->preSeparator . implode($this->separator, $this->parts) . $this->postSeparator; |
|
105 | + return $this->preSeparator.implode($this->separator, $this->parts).$this->postSeparator; |
|
106 | 106 | } |
107 | 107 | } |
@@ -208,8 +208,8 @@ discard block |
||
208 | 208 | $sqlIdentifier = $this->getSQLIdentifier($AST); |
209 | 209 | |
210 | 210 | if ($hasOrderBy) { |
211 | - $orderGroupBy = ' GROUP BY ' . implode(', ', $sqlIdentifier); |
|
212 | - $sqlIdentifier[] = 'MIN(' . $this->walkResultVariable('dctrn_rownum') . ') AS dctrn_minrownum'; |
|
211 | + $orderGroupBy = ' GROUP BY '.implode(', ', $sqlIdentifier); |
|
212 | + $sqlIdentifier[] = 'MIN('.$this->walkResultVariable('dctrn_rownum').') AS dctrn_minrownum'; |
|
213 | 213 | } |
214 | 214 | |
215 | 215 | // Build the counter query |
@@ -220,7 +220,7 @@ discard block |
||
220 | 220 | ); |
221 | 221 | |
222 | 222 | if ($hasOrderBy) { |
223 | - $sql .= $orderGroupBy . $outerOrderBy; |
|
223 | + $sql .= $orderGroupBy.$outerOrderBy; |
|
224 | 224 | } |
225 | 225 | |
226 | 226 | // Apply the limit and offset. |
@@ -323,7 +323,7 @@ discard block |
||
323 | 323 | foreach ($orderByPathExpressions as $pathExpression) { |
324 | 324 | $idVar = $pathExpression->identificationVariable; |
325 | 325 | $field = $pathExpression->field; |
326 | - if (!isset($selects[$idVar])) { |
|
326 | + if ( ! isset($selects[$idVar])) { |
|
327 | 327 | $selects[$idVar] = []; |
328 | 328 | } |
329 | 329 | $selects[$idVar][$field] = true; |
@@ -334,7 +334,7 @@ discard block |
||
334 | 334 | foreach ($AST->selectClause->selectExpressions as $selectExpression) { |
335 | 335 | if ($selectExpression instanceof SelectExpression) { |
336 | 336 | $idVar = $selectExpression->expression; |
337 | - if (!is_string($idVar)) { |
|
337 | + if ( ! is_string($idVar)) { |
|
338 | 338 | continue; |
339 | 339 | } |
340 | 340 | $field = $selectExpression->fieldIdentificationVariable; |
@@ -367,10 +367,10 @@ discard block |
||
367 | 367 | array $sqlIdentifier, |
368 | 368 | string $innerSql, |
369 | 369 | string $sql, |
370 | - ?OrderByClause $orderByClause |
|
370 | + ? OrderByClause $orderByClause |
|
371 | 371 | ) : string { |
372 | 372 | // If the sql statement has an order by clause, we need to wrap it in a new select distinct statement |
373 | - if (! $orderByClause) { |
|
373 | + if ( ! $orderByClause) { |
|
374 | 374 | return $sql; |
375 | 375 | } |
376 | 376 | |
@@ -412,7 +412,7 @@ discard block |
||
412 | 412 | $orderByItems[] = $orderByItemString; |
413 | 413 | $identifier = \substr($orderByItemString, 0, \strrpos($orderByItemString, ' ')); |
414 | 414 | |
415 | - if (! \in_array($identifier, $identifiers, true)) { |
|
415 | + if ( ! \in_array($identifier, $identifiers, true)) { |
|
416 | 416 | $identifiers[] = $identifier; |
417 | 417 | } |
418 | 418 | } |
@@ -444,7 +444,7 @@ discard block |
||
444 | 444 | $class = $metadataList[$dqlAliasForFieldAlias]; |
445 | 445 | |
446 | 446 | // If the field is from a joined child table, we won't be ordering on it. |
447 | - if (! isset($class->fieldMappings[$fieldName])) { |
|
447 | + if ( ! isset($class->fieldMappings[$fieldName])) { |
|
448 | 448 | continue; |
449 | 449 | } |
450 | 450 | |
@@ -465,7 +465,7 @@ discard block |
||
465 | 465 | // for the joined parent table. |
466 | 466 | $otherClassMetadata = $this->em->getClassMetadata($fieldMapping['declared']); |
467 | 467 | |
468 | - if (! $otherClassMetadata->isMappedSuperclass) { |
|
468 | + if ( ! $otherClassMetadata->isMappedSuperclass) { |
|
469 | 469 | $sqlTableAliasForFieldAlias = $this->getSQLTableAlias($otherClassMetadata->getTableName(), $dqlAliasForFieldAlias); |
470 | 470 | } |
471 | 471 | } |
@@ -582,7 +582,7 @@ discard block |
||
582 | 582 | */ |
583 | 583 | public function walkPathExpression($pathExpr) |
584 | 584 | { |
585 | - if (!$this->inSubSelect && !$this->platformSupportsRowNumber() && !in_array($pathExpr, $this->orderByPathExpressions)) { |
|
585 | + if ( ! $this->inSubSelect && ! $this->platformSupportsRowNumber() && ! in_array($pathExpr, $this->orderByPathExpressions)) { |
|
586 | 586 | $this->orderByPathExpressions[] = $pathExpr; |
587 | 587 | } |
588 | 588 |
@@ -2,7 +2,6 @@ |
||
2 | 2 | |
3 | 3 | namespace Doctrine\Performance\Mock; |
4 | 4 | |
5 | -use Doctrine\ORM\Query; |
|
6 | 5 | use Doctrine\ORM\UnitOfWork; |
7 | 6 | use Doctrine\Tests\ORM\Performance\PersisterMock; |
8 | 7 |
@@ -40,8 +40,8 @@ discard block |
||
40 | 40 | for ($i = 1; $i <= 10000; ++$i) { |
41 | 41 | $user = new CMS\CmsUser; |
42 | 42 | $user->status = 'user'; |
43 | - $user->username = 'user' . $i; |
|
44 | - $user->name = 'Mr.Smith-' . $i; |
|
43 | + $user->username = 'user'.$i; |
|
44 | + $user->name = 'Mr.Smith-'.$i; |
|
45 | 45 | |
46 | 46 | $this->users[$i] = $user; |
47 | 47 | } |
@@ -52,7 +52,7 @@ discard block |
||
52 | 52 | foreach ($this->users as $key => $user) { |
53 | 53 | $this->entityManager->persist($user); |
54 | 54 | |
55 | - if (! ($key % 20)) { |
|
55 | + if ( ! ($key % 20)) { |
|
56 | 56 | $this->entityManager->flush(); |
57 | 57 | $this->entityManager->clear(); |
58 | 58 | } |