@@ -247,7 +247,7 @@ |
||
247 | 247 | |
248 | 248 | // 2) Build insert table records into temporary table |
249 | 249 | $dql = ' SELECT t0.' . implode(', t0.', $rootClass->getIdentifierFieldNames()) |
250 | - . ' FROM ' . $targetClass->getClassName() . ' t0 WHERE t0.' . $association->getMappedBy() . ' = :owner'; |
|
250 | + . ' FROM ' . $targetClass->getClassName() . ' t0 WHERE t0.' . $association->getMappedBy() . ' = :owner'; |
|
251 | 251 | $query = $this->em->createQuery($dql)->setParameter('owner', $collection->getOwner()); |
252 | 252 | |
253 | 253 | $statement = 'INSERT INTO ' . $tempTable . ' (' . $idColumnNameList . ') ' . $query->getSQL(); |
@@ -32,7 +32,7 @@ discard block |
||
32 | 32 | // the entire collection with a new would trigger this operation. |
33 | 33 | $association = $collection->getMapping(); |
34 | 34 | |
35 | - if (! $association->isOrphanRemoval()) { |
|
35 | + if ( ! $association->isOrphanRemoval()) { |
|
36 | 36 | // Handling non-orphan removal should never happen, as @OneToMany |
37 | 37 | // can only be inverse side. For owning side one to many, it is |
38 | 38 | // required to have a join table, which would classify as a ManyToManyPersister. |
@@ -64,7 +64,7 @@ discard block |
||
64 | 64 | { |
65 | 65 | $association = $collection->getMapping(); |
66 | 66 | |
67 | - if (! ($association instanceof ToManyAssociationMetadata && $association->getIndexedBy())) { |
|
67 | + if ( ! ($association instanceof ToManyAssociationMetadata && $association->getIndexedBy())) { |
|
68 | 68 | throw new \BadMethodCallException('Selecting a collection by index is only supported on indexed collections.'); |
69 | 69 | } |
70 | 70 | |
@@ -113,7 +113,7 @@ discard block |
||
113 | 113 | { |
114 | 114 | $association = $collection->getMapping(); |
115 | 115 | |
116 | - if (! ($association instanceof ToManyAssociationMetadata && $association->getIndexedBy())) { |
|
116 | + if ( ! ($association instanceof ToManyAssociationMetadata && $association->getIndexedBy())) { |
|
117 | 117 | throw new \BadMethodCallException('Selecting a collection by index is only supported on indexed collections.'); |
118 | 118 | } |
119 | 119 | |
@@ -135,7 +135,7 @@ discard block |
||
135 | 135 | */ |
136 | 136 | public function contains(PersistentCollection $collection, $element) |
137 | 137 | { |
138 | - if (! $this->isValidEntityState($element)) { |
|
138 | + if ( ! $this->isValidEntityState($element)) { |
|
139 | 139 | return false; |
140 | 140 | } |
141 | 141 | |
@@ -159,12 +159,12 @@ discard block |
||
159 | 159 | { |
160 | 160 | $association = $collection->getMapping(); |
161 | 161 | |
162 | - if (! $association->isOrphanRemoval()) { |
|
162 | + if ( ! $association->isOrphanRemoval()) { |
|
163 | 163 | // no-op: this is not the owning side, therefore no operations should be applied |
164 | 164 | return false; |
165 | 165 | } |
166 | 166 | |
167 | - if (! $this->isValidEntityState($element)) { |
|
167 | + if ( ! $this->isValidEntityState($element)) { |
|
168 | 168 | return false; |
169 | 169 | } |
170 | 170 | |
@@ -202,7 +202,7 @@ discard block |
||
202 | 202 | } |
203 | 203 | |
204 | 204 | $tableName = $targetClass->table->getQuotedQualifiedName($this->platform); |
205 | - $statement = 'DELETE FROM ' . $tableName . ' WHERE ' . implode(' = ? AND ', $columns) . ' = ?'; |
|
205 | + $statement = 'DELETE FROM '.$tableName.' WHERE '.implode(' = ? AND ', $columns).' = ?'; |
|
206 | 206 | |
207 | 207 | return $this->conn->executeUpdate($statement, $parameters); |
208 | 208 | } |
@@ -239,17 +239,17 @@ discard block |
||
239 | 239 | ]; |
240 | 240 | } |
241 | 241 | |
242 | - $statement = $this->platform->getCreateTemporaryTableSnippetSQL() . ' ' . $tempTable |
|
243 | - . ' (' . $this->platform->getColumnDeclarationListSQL($columnDefinitions) . ')'; |
|
242 | + $statement = $this->platform->getCreateTemporaryTableSnippetSQL().' '.$tempTable |
|
243 | + . ' ('.$this->platform->getColumnDeclarationListSQL($columnDefinitions).')'; |
|
244 | 244 | |
245 | 245 | $this->conn->executeUpdate($statement); |
246 | 246 | |
247 | 247 | // 2) Build insert table records into temporary table |
248 | - $dql = ' SELECT t0.' . implode(', t0.', $rootClass->getIdentifierFieldNames()) |
|
249 | - . ' FROM ' . $targetClass->getClassName() . ' t0 WHERE t0.' . $association->getMappedBy() . ' = :owner'; |
|
248 | + $dql = ' SELECT t0.'.implode(', t0.', $rootClass->getIdentifierFieldNames()) |
|
249 | + . ' FROM '.$targetClass->getClassName().' t0 WHERE t0.'.$association->getMappedBy().' = :owner'; |
|
250 | 250 | $query = $this->em->createQuery($dql)->setParameter('owner', $collection->getOwner()); |
251 | 251 | |
252 | - $statement = 'INSERT INTO ' . $tempTable . ' (' . $idColumnNameList . ') ' . $query->getSQL(); |
|
252 | + $statement = 'INSERT INTO '.$tempTable.' ('.$idColumnNameList.') '.$query->getSQL(); |
|
253 | 253 | $parameters = array_values($sourcePersister->getIdentifier($collection->getOwner())); |
254 | 254 | $numDeleted = $this->conn->executeUpdate($statement, $parameters); |
255 | 255 | |
@@ -264,7 +264,7 @@ discard block |
||
264 | 264 | // 4) Delete records on each table in the hierarchy |
265 | 265 | $hierarchyClasses = array_merge( |
266 | 266 | array_map( |
267 | - function ($className) { |
|
267 | + function($className) { |
|
268 | 268 | return $this->em->getClassMetadata($className); |
269 | 269 | }, |
270 | 270 | array_reverse($targetClass->getSubClasses()) |
@@ -1344,9 +1344,9 @@ discard block |
||
1344 | 1344 | private function getDQLForDelete() |
1345 | 1345 | { |
1346 | 1346 | return 'DELETE' |
1347 | - . $this->getReducedDQLQueryPart('from', ['pre' => ' ', 'separator' => ', ']) |
|
1348 | - . $this->getReducedDQLQueryPart('where', ['pre' => ' WHERE ']) |
|
1349 | - . $this->getReducedDQLQueryPart('orderBy', ['pre' => ' ORDER BY ', 'separator' => ', ']); |
|
1347 | + . $this->getReducedDQLQueryPart('from', ['pre' => ' ', 'separator' => ', ']) |
|
1348 | + . $this->getReducedDQLQueryPart('where', ['pre' => ' WHERE ']) |
|
1349 | + . $this->getReducedDQLQueryPart('orderBy', ['pre' => ' ORDER BY ', 'separator' => ', ']); |
|
1350 | 1350 | } |
1351 | 1351 | |
1352 | 1352 | /** |
@@ -1355,10 +1355,10 @@ discard block |
||
1355 | 1355 | private function getDQLForUpdate() |
1356 | 1356 | { |
1357 | 1357 | return 'UPDATE' |
1358 | - . $this->getReducedDQLQueryPart('from', ['pre' => ' ', 'separator' => ', ']) |
|
1359 | - . $this->getReducedDQLQueryPart('set', ['pre' => ' SET ', 'separator' => ', ']) |
|
1360 | - . $this->getReducedDQLQueryPart('where', ['pre' => ' WHERE ']) |
|
1361 | - . $this->getReducedDQLQueryPart('orderBy', ['pre' => ' ORDER BY ', 'separator' => ', ']); |
|
1358 | + . $this->getReducedDQLQueryPart('from', ['pre' => ' ', 'separator' => ', ']) |
|
1359 | + . $this->getReducedDQLQueryPart('set', ['pre' => ' SET ', 'separator' => ', ']) |
|
1360 | + . $this->getReducedDQLQueryPart('where', ['pre' => ' WHERE ']) |
|
1361 | + . $this->getReducedDQLQueryPart('orderBy', ['pre' => ' ORDER BY ', 'separator' => ', ']); |
|
1362 | 1362 | } |
1363 | 1363 | |
1364 | 1364 | /** |
@@ -1367,8 +1367,8 @@ discard block |
||
1367 | 1367 | private function getDQLForSelect() |
1368 | 1368 | { |
1369 | 1369 | $dql = 'SELECT' |
1370 | - . ($this->dqlParts['distinct']===true ? ' DISTINCT' : '') |
|
1371 | - . $this->getReducedDQLQueryPart('select', ['pre' => ' ', 'separator' => ', ']); |
|
1370 | + . ($this->dqlParts['distinct']===true ? ' DISTINCT' : '') |
|
1371 | + . $this->getReducedDQLQueryPart('select', ['pre' => ' ', 'separator' => ', ']); |
|
1372 | 1372 | |
1373 | 1373 | $fromParts = $this->getDQLPart('from'); |
1374 | 1374 | $joinParts = $this->getDQLPart('join'); |
@@ -1392,10 +1392,10 @@ discard block |
||
1392 | 1392 | } |
1393 | 1393 | |
1394 | 1394 | $dql .= implode(', ', $fromClauses) |
1395 | - . $this->getReducedDQLQueryPart('where', ['pre' => ' WHERE ']) |
|
1396 | - . $this->getReducedDQLQueryPart('groupBy', ['pre' => ' GROUP BY ', 'separator' => ', ']) |
|
1397 | - . $this->getReducedDQLQueryPart('having', ['pre' => ' HAVING ']) |
|
1398 | - . $this->getReducedDQLQueryPart('orderBy', ['pre' => ' ORDER BY ', 'separator' => ', ']); |
|
1395 | + . $this->getReducedDQLQueryPart('where', ['pre' => ' WHERE ']) |
|
1396 | + . $this->getReducedDQLQueryPart('groupBy', ['pre' => ' GROUP BY ', 'separator' => ', ']) |
|
1397 | + . $this->getReducedDQLQueryPart('having', ['pre' => ' HAVING ']) |
|
1398 | + . $this->getReducedDQLQueryPart('orderBy', ['pre' => ' ORDER BY ', 'separator' => ', ']); |
|
1399 | 1399 | |
1400 | 1400 | return $dql; |
1401 | 1401 | } |
@@ -1415,8 +1415,8 @@ discard block |
||
1415 | 1415 | } |
1416 | 1416 | |
1417 | 1417 | return ($options['pre'] ?? '') |
1418 | - . (is_array($queryPart) ? implode($options['separator'], $queryPart) : $queryPart) |
|
1419 | - . ($options['post'] ?? ''); |
|
1418 | + . (is_array($queryPart) ? implode($options['separator'], $queryPart) : $queryPart) |
|
1419 | + . ($options['post'] ?? ''); |
|
1420 | 1420 | } |
1421 | 1421 | |
1422 | 1422 | /** |
@@ -414,7 +414,7 @@ discard block |
||
414 | 414 | { |
415 | 415 | $aliases = $this->getRootAliases(); |
416 | 416 | |
417 | - if (! isset($aliases[0])) { |
|
417 | + if ( ! isset($aliases[0])) { |
|
418 | 418 | throw new \RuntimeException('No alias was set before invoking getRootAlias().'); |
419 | 419 | } |
420 | 420 | |
@@ -597,7 +597,7 @@ discard block |
||
597 | 597 | public function getParameter($key) |
598 | 598 | { |
599 | 599 | $filteredParameters = $this->parameters->filter( |
600 | - function (Query\Parameter $parameter) use ($key) : bool { |
|
600 | + function(Query\Parameter $parameter) use ($key) : bool { |
|
601 | 601 | $parameterName = $parameter->getName(); |
602 | 602 | |
603 | 603 | return $key === $parameterName || (string) $key === (string) $parameterName; |
@@ -673,7 +673,7 @@ discard block |
||
673 | 673 | { |
674 | 674 | if ($append && ($dqlPartName === 'where' || $dqlPartName === 'having')) { |
675 | 675 | throw new \InvalidArgumentException( |
676 | - "Using \$append = true does not have an effect with 'where' or 'having' " . |
|
676 | + "Using \$append = true does not have an effect with 'where' or 'having' ". |
|
677 | 677 | 'parts. See QueryBuilder#andWhere() for an example for correct usage.' |
678 | 678 | ); |
679 | 679 | } |
@@ -814,7 +814,7 @@ discard block |
||
814 | 814 | { |
815 | 815 | $this->type = self::DELETE; |
816 | 816 | |
817 | - if (! $delete) { |
|
817 | + if ( ! $delete) { |
|
818 | 818 | return $this; |
819 | 819 | } |
820 | 820 | |
@@ -841,7 +841,7 @@ discard block |
||
841 | 841 | { |
842 | 842 | $this->type = self::UPDATE; |
843 | 843 | |
844 | - if (! $update) { |
|
844 | + if ( ! $update) { |
|
845 | 845 | return $this; |
846 | 846 | } |
847 | 847 | |
@@ -896,7 +896,7 @@ discard block |
||
896 | 896 | { |
897 | 897 | $rootAliases = $this->getRootAliases(); |
898 | 898 | |
899 | - if (! in_array($alias, $rootAliases, true)) { |
|
899 | + if ( ! in_array($alias, $rootAliases, true)) { |
|
900 | 900 | throw new Query\QueryException( |
901 | 901 | sprintf('Specified root alias %s must be set before invoking indexBy().', $alias) |
902 | 902 | ); |
@@ -1057,7 +1057,7 @@ discard block |
||
1057 | 1057 | */ |
1058 | 1058 | public function where($predicates) |
1059 | 1059 | { |
1060 | - if (! (func_num_args() === 1 && $predicates instanceof Expr\Composite)) { |
|
1060 | + if ( ! (func_num_args() === 1 && $predicates instanceof Expr\Composite)) { |
|
1061 | 1061 | $predicates = new Expr\Andx(func_get_args()); |
1062 | 1062 | } |
1063 | 1063 | |
@@ -1176,7 +1176,7 @@ discard block |
||
1176 | 1176 | */ |
1177 | 1177 | public function having($having) |
1178 | 1178 | { |
1179 | - if (! (func_num_args() === 1 && ($having instanceof Expr\Andx || $having instanceof Expr\Orx))) { |
|
1179 | + if ( ! (func_num_args() === 1 && ($having instanceof Expr\Andx || $having instanceof Expr\Orx))) { |
|
1180 | 1180 | $having = new Expr\Andx(func_get_args()); |
1181 | 1181 | } |
1182 | 1182 | |
@@ -1274,7 +1274,7 @@ discard block |
||
1274 | 1274 | public function addCriteria(Criteria $criteria) |
1275 | 1275 | { |
1276 | 1276 | $allAliases = $this->getAllAliases(); |
1277 | - if (! isset($allAliases[0])) { |
|
1277 | + if ( ! isset($allAliases[0])) { |
|
1278 | 1278 | throw new Query\QueryException('No aliases are set before invoking addCriteria().'); |
1279 | 1279 | } |
1280 | 1280 | |
@@ -1292,14 +1292,14 @@ discard block |
||
1292 | 1292 | foreach ($criteria->getOrderings() as $sort => $order) { |
1293 | 1293 | $hasValidAlias = false; |
1294 | 1294 | foreach ($allAliases as $alias) { |
1295 | - if (strpos($sort . '.', $alias . '.') === 0) { |
|
1295 | + if (strpos($sort.'.', $alias.'.') === 0) { |
|
1296 | 1296 | $hasValidAlias = true; |
1297 | 1297 | break; |
1298 | 1298 | } |
1299 | 1299 | } |
1300 | 1300 | |
1301 | - if (! $hasValidAlias) { |
|
1302 | - $sort = $allAliases[0] . '.' . $sort; |
|
1301 | + if ( ! $hasValidAlias) { |
|
1302 | + $sort = $allAliases[0].'.'.$sort; |
|
1303 | 1303 | } |
1304 | 1304 | |
1305 | 1305 | $this->addOrderBy($sort, $order); |
@@ -1373,7 +1373,7 @@ discard block |
||
1373 | 1373 | private function getDQLForSelect() |
1374 | 1374 | { |
1375 | 1375 | $dql = 'SELECT' |
1376 | - . ($this->dqlParts['distinct']===true ? ' DISTINCT' : '') |
|
1376 | + . ($this->dqlParts['distinct'] === true ? ' DISTINCT' : '') |
|
1377 | 1377 | . $this->getReducedDQLQueryPart('select', ['pre' => ' ', 'separator' => ', ']); |
1378 | 1378 | |
1379 | 1379 | $fromParts = $this->getDQLPart('from'); |
@@ -1381,7 +1381,7 @@ discard block |
||
1381 | 1381 | $fromClauses = []; |
1382 | 1382 | |
1383 | 1383 | // Loop through all FROM clauses |
1384 | - if (! empty($fromParts)) { |
|
1384 | + if ( ! empty($fromParts)) { |
|
1385 | 1385 | $dql .= ' FROM '; |
1386 | 1386 | |
1387 | 1387 | foreach ($fromParts as $from) { |
@@ -1389,7 +1389,7 @@ discard block |
||
1389 | 1389 | |
1390 | 1390 | if ($from instanceof Expr\From && isset($joinParts[$from->getAlias()])) { |
1391 | 1391 | foreach ($joinParts[$from->getAlias()] as $join) { |
1392 | - $fromClause .= ' ' . ((string) $join); |
|
1392 | + $fromClause .= ' '.((string) $join); |
|
1393 | 1393 | } |
1394 | 1394 | } |
1395 | 1395 |
@@ -46,7 +46,7 @@ |
||
46 | 46 | $this->em->flush(); |
47 | 47 | |
48 | 48 | $asset->getAttributes() |
49 | - ->removeElement($attribute1); |
|
49 | + ->removeElement($attribute1); |
|
50 | 50 | |
51 | 51 | $idToBeRemoved = $attribute1->id; |
52 | 52 |
@@ -39,7 +39,7 @@ |
||
39 | 39 | $this->em->clear(); |
40 | 40 | |
41 | 41 | $history = $this->em->createQuery('SELECT h FROM ' . __NAMESPACE__ . '\\DDC1250ClientHistory h WHERE h.id = ?1') |
42 | - ->setParameter(1, $c2->id)->getSingleResult(); |
|
42 | + ->setParameter(1, $c2->id)->getSingleResult(); |
|
43 | 43 | |
44 | 44 | self::assertInstanceOf(DDC1250ClientHistory::class, $history); |
45 | 45 | } |
@@ -36,7 +36,7 @@ |
||
36 | 36 | $this->em->flush(); |
37 | 37 | $this->em->clear(); |
38 | 38 | |
39 | - $history = $this->em->createQuery('SELECT h FROM ' . __NAMESPACE__ . '\\DDC1250ClientHistory h WHERE h.id = ?1') |
|
39 | + $history = $this->em->createQuery('SELECT h FROM '.__NAMESPACE__.'\\DDC1250ClientHistory h WHERE h.id = ?1') |
|
40 | 40 | ->setParameter(1, $c2->id)->getSingleResult(); |
41 | 41 | |
42 | 42 | self::assertInstanceOf(DDC1250ClientHistory::class, $history); |
@@ -51,7 +51,7 @@ discard block |
||
51 | 51 | foreach ($props as $name => $prop) { |
52 | 52 | $ident += 4; |
53 | 53 | $str .= str_repeat(' ', $ident) . '"' . $name . '": ' |
54 | - . $this->dump($prop) . ',' . PHP_EOL; |
|
54 | + . $this->dump($prop) . ',' . PHP_EOL; |
|
55 | 55 | $ident -= 4; |
56 | 56 | } |
57 | 57 | |
@@ -63,7 +63,7 @@ discard block |
||
63 | 63 | |
64 | 64 | foreach ($obj as $k => $v) { |
65 | 65 | $str .= PHP_EOL . str_repeat(' ', $ident) . '"' |
66 | - . $k . '" => ' . $this->dump($v) . ','; |
|
66 | + . $k . '" => ' . $this->dump($v) . ','; |
|
67 | 67 | $some = true; |
68 | 68 | } |
69 | 69 |
@@ -54,32 +54,32 @@ |
||
54 | 54 | $str = ''; |
55 | 55 | |
56 | 56 | if ($obj instanceof Node) { |
57 | - $str .= get_class($obj) . '(' . PHP_EOL; |
|
57 | + $str .= get_class($obj).'('.PHP_EOL; |
|
58 | 58 | $props = get_object_vars($obj); |
59 | 59 | |
60 | 60 | foreach ($props as $name => $prop) { |
61 | 61 | $ident += 4; |
62 | - $str .= str_repeat(' ', $ident) . '"' . $name . '": ' |
|
63 | - . $this->dump($prop) . ',' . PHP_EOL; |
|
62 | + $str .= str_repeat(' ', $ident).'"'.$name.'": ' |
|
63 | + . $this->dump($prop).','.PHP_EOL; |
|
64 | 64 | $ident -= 4; |
65 | 65 | } |
66 | 66 | |
67 | - $str .= str_repeat(' ', $ident) . ')'; |
|
67 | + $str .= str_repeat(' ', $ident).')'; |
|
68 | 68 | } elseif (is_array($obj)) { |
69 | 69 | $ident += 4; |
70 | 70 | $str .= 'array('; |
71 | 71 | $some = false; |
72 | 72 | |
73 | 73 | foreach ($obj as $k => $v) { |
74 | - $str .= PHP_EOL . str_repeat(' ', $ident) . '"' |
|
75 | - . $k . '" => ' . $this->dump($v) . ','; |
|
74 | + $str .= PHP_EOL.str_repeat(' ', $ident).'"' |
|
75 | + . $k.'" => '.$this->dump($v).','; |
|
76 | 76 | $some = true; |
77 | 77 | } |
78 | 78 | |
79 | 79 | $ident -= 4; |
80 | - $str .= ($some ? PHP_EOL . str_repeat(' ', $ident) : '') . ')'; |
|
80 | + $str .= ($some ? PHP_EOL . str_repeat(' ', $ident) : '').')'; |
|
81 | 81 | } elseif (is_object($obj)) { |
82 | - $str .= 'instanceof(' . get_class($obj) . ')'; |
|
82 | + $str .= 'instanceof('.get_class($obj).')'; |
|
83 | 83 | } else { |
84 | 84 | $str .= var_export($obj, true); |
85 | 85 | } |
@@ -291,8 +291,8 @@ discard block |
||
291 | 291 | |
292 | 292 | // FIXME: Order with composite keys might not be correct |
293 | 293 | $sql = 'SELECT ' . $columnName |
294 | - . ' FROM ' . $tableName |
|
295 | - . ' WHERE ' . implode(' = ? AND ', $identifier) . ' = ?'; |
|
294 | + . ' FROM ' . $tableName |
|
295 | + . ' WHERE ' . implode(' = ? AND ', $identifier) . ' = ?'; |
|
296 | 296 | |
297 | 297 | $flattenedId = $this->em->getIdentifierFlattener()->flattenIdentifier($versionedClass, $id); |
298 | 298 | $versionType = $versionProperty->getType(); |
@@ -506,8 +506,8 @@ discard block |
||
506 | 506 | } |
507 | 507 | |
508 | 508 | $sql = 'UPDATE ' . $quotedTableName |
509 | - . ' SET ' . implode(', ', $set) |
|
510 | - . ' WHERE ' . implode(' = ? AND ', $where) . ' = ?'; |
|
509 | + . ' SET ' . implode(', ', $set) |
|
510 | + . ' WHERE ' . implode(' = ? AND ', $where) . ' = ?'; |
|
511 | 511 | |
512 | 512 | $result = $this->conn->executeUpdate($sql, $params, $types); |
513 | 513 | |
@@ -1633,9 +1633,9 @@ discard block |
||
1633 | 1633 | $lock = $this->getLockTablesSql($lockMode); |
1634 | 1634 | $where = ($conditionSql ? ' WHERE ' . $conditionSql : '') . ' '; |
1635 | 1635 | $sql = 'SELECT 1 ' |
1636 | - . $lock |
|
1637 | - . $where |
|
1638 | - . $lockSql; |
|
1636 | + . $lock |
|
1637 | + . $where |
|
1638 | + . $lockSql; |
|
1639 | 1639 | |
1640 | 1640 | list($params, $types) = $this->expandParameters($criteria); |
1641 | 1641 | |
@@ -2104,8 +2104,8 @@ discard block |
||
2104 | 2104 | $alias = $this->getSQLTableAlias($this->class->getTableName()); |
2105 | 2105 | |
2106 | 2106 | $sql = 'SELECT 1 ' |
2107 | - . $this->getLockTablesSql(null) |
|
2108 | - . ' WHERE ' . $this->getSelectConditionSQL($criteria); |
|
2107 | + . $this->getLockTablesSql(null) |
|
2108 | + . ' WHERE ' . $this->getSelectConditionSQL($criteria); |
|
2109 | 2109 | |
2110 | 2110 | list($params, $types) = $this->expandParameters($criteria); |
2111 | 2111 |
@@ -298,16 +298,16 @@ discard block |
||
298 | 298 | $tableName = $versionedClass->table->getQuotedQualifiedName($this->platform); |
299 | 299 | $columnName = $this->platform->quoteIdentifier($versionProperty->getColumnName()); |
300 | 300 | $identifier = array_map( |
301 | - function ($columnName) { |
|
301 | + function($columnName) { |
|
302 | 302 | return $this->platform->quoteIdentifier($columnName); |
303 | 303 | }, |
304 | 304 | array_keys($versionedClass->getIdentifierColumns($this->em)) |
305 | 305 | ); |
306 | 306 | |
307 | 307 | // FIXME: Order with composite keys might not be correct |
308 | - $sql = 'SELECT ' . $columnName |
|
309 | - . ' FROM ' . $tableName |
|
310 | - . ' WHERE ' . implode(' = ? AND ', $identifier) . ' = ?'; |
|
308 | + $sql = 'SELECT '.$columnName |
|
309 | + . ' FROM '.$tableName |
|
310 | + . ' WHERE '.implode(' = ? AND ', $identifier).' = ?'; |
|
311 | 311 | |
312 | 312 | $flattenedId = $this->em->getIdentifierFlattener()->flattenIdentifier($versionedClass, $id); |
313 | 313 | $versionType = $versionProperty->getType(); |
@@ -346,13 +346,13 @@ discard block |
||
346 | 346 | $tableName = $this->class->getTableName(); |
347 | 347 | $updateData = $this->prepareUpdateData($entity); |
348 | 348 | |
349 | - if (! isset($updateData[$tableName])) { |
|
349 | + if ( ! isset($updateData[$tableName])) { |
|
350 | 350 | return; |
351 | 351 | } |
352 | 352 | |
353 | 353 | $data = $updateData[$tableName]; |
354 | 354 | |
355 | - if (! $data) { |
|
355 | + if ( ! $data) { |
|
356 | 356 | return; |
357 | 357 | } |
358 | 358 | |
@@ -405,7 +405,7 @@ discard block |
||
405 | 405 | |
406 | 406 | if ($value !== null) { |
407 | 407 | // @todo guilhermeblanco Make sure we do not have flat association values. |
408 | - if (! is_array($value)) { |
|
408 | + if ( ! is_array($value)) { |
|
409 | 409 | $value = [$targetClass->identifier[0] => $value]; |
410 | 410 | } |
411 | 411 | |
@@ -418,7 +418,7 @@ discard block |
||
418 | 418 | $referencedColumnName = $joinColumn->getReferencedColumnName(); |
419 | 419 | $targetField = $targetClass->fieldNames[$referencedColumnName]; |
420 | 420 | |
421 | - if (! $joinColumn->getType()) { |
|
421 | + if ( ! $joinColumn->getType()) { |
|
422 | 422 | $joinColumn->setType(PersisterHelper::getTypeOfColumn($referencedColumnName, $targetClass, $this->em)); |
423 | 423 | } |
424 | 424 | |
@@ -484,7 +484,7 @@ discard block |
||
484 | 484 | $quotedColumnName = $this->platform->quoteIdentifier($joinColumn->getColumnName()); |
485 | 485 | $referencedColumnName = $joinColumn->getReferencedColumnName(); |
486 | 486 | |
487 | - if (! $joinColumn->getType()) { |
|
487 | + if ( ! $joinColumn->getType()) { |
|
488 | 488 | $joinColumn->setType(PersisterHelper::getTypeOfColumn($referencedColumnName, $targetClass, $this->em)); |
489 | 489 | } |
490 | 490 | |
@@ -511,18 +511,18 @@ discard block |
||
511 | 511 | case Type::SMALLINT: |
512 | 512 | case Type::INTEGER: |
513 | 513 | case Type::BIGINT: |
514 | - $set[] = $versionColumnName . ' = ' . $versionColumnName . ' + 1'; |
|
514 | + $set[] = $versionColumnName.' = '.$versionColumnName.' + 1'; |
|
515 | 515 | break; |
516 | 516 | |
517 | 517 | case Type::DATETIME: |
518 | - $set[] = $versionColumnName . ' = CURRENT_TIMESTAMP'; |
|
518 | + $set[] = $versionColumnName.' = CURRENT_TIMESTAMP'; |
|
519 | 519 | break; |
520 | 520 | } |
521 | 521 | } |
522 | 522 | |
523 | - $sql = 'UPDATE ' . $quotedTableName |
|
524 | - . ' SET ' . implode(', ', $set) |
|
525 | - . ' WHERE ' . implode(' = ? AND ', $where) . ' = ?'; |
|
523 | + $sql = 'UPDATE '.$quotedTableName |
|
524 | + . ' SET '.implode(', ', $set) |
|
525 | + . ' WHERE '.implode(' = ? AND ', $where).' = ?'; |
|
526 | 526 | |
527 | 527 | $result = $this->conn->executeUpdate($sql, $params, $types); |
528 | 528 | |
@@ -539,7 +539,7 @@ discard block |
||
539 | 539 | protected function deleteJoinTableRecords($identifier) |
540 | 540 | { |
541 | 541 | foreach ($this->class->getDeclaredPropertiesIterator() as $association) { |
542 | - if (! ($association instanceof ManyToManyAssociationMetadata)) { |
|
542 | + if ( ! ($association instanceof ManyToManyAssociationMetadata)) { |
|
543 | 543 | continue; |
544 | 544 | } |
545 | 545 | |
@@ -551,7 +551,7 @@ discard block |
||
551 | 551 | $otherKeys = []; |
552 | 552 | $keys = []; |
553 | 553 | |
554 | - if (! $owningAssociation->isOwningSide()) { |
|
554 | + if ( ! $owningAssociation->isOwningSide()) { |
|
555 | 555 | $class = $this->em->getClassMetadata($association->getTargetEntity()); |
556 | 556 | $owningAssociation = $class->getProperty($association->getMappedBy()); |
557 | 557 | } |
@@ -664,7 +664,7 @@ discard block |
||
664 | 664 | } |
665 | 665 | |
666 | 666 | // Only owning side of x-1 associations can have a FK column. |
667 | - if (! $property instanceof ToOneAssociationMetadata || ! $property->isOwningSide()) { |
|
667 | + if ( ! $property instanceof ToOneAssociationMetadata || ! $property->isOwningSide()) { |
|
668 | 668 | continue; |
669 | 669 | } |
670 | 670 | |
@@ -684,7 +684,7 @@ discard block |
||
684 | 684 | /** @var JoinColumnMetadata $joinColumn */ |
685 | 685 | $referencedColumnName = $joinColumn->getReferencedColumnName(); |
686 | 686 | |
687 | - if (! $joinColumn->getType()) { |
|
687 | + if ( ! $joinColumn->getType()) { |
|
688 | 688 | $joinColumn->setType(PersisterHelper::getTypeOfColumn($referencedColumnName, $targetClass, $this->em)); |
689 | 689 | } |
690 | 690 | |
@@ -712,7 +712,7 @@ discard block |
||
712 | 712 | $propertyName = $this->class->fieldNames[$columnName]; |
713 | 713 | $property = $this->class->getProperty($propertyName); |
714 | 714 | |
715 | - if (! $property) { |
|
715 | + if ( ! $property) { |
|
716 | 716 | return null; |
717 | 717 | } |
718 | 718 | |
@@ -731,7 +731,7 @@ discard block |
||
731 | 731 | /** @var JoinColumnMetadata $joinColumn */ |
732 | 732 | $referencedColumnName = $joinColumn->getReferencedColumnName(); |
733 | 733 | |
734 | - if (! $joinColumn->getType()) { |
|
734 | + if ( ! $joinColumn->getType()) { |
|
735 | 735 | $joinColumn->setType(PersisterHelper::getTypeOfColumn($referencedColumnName, $targetClass, $this->em)); |
736 | 736 | } |
737 | 737 | |
@@ -836,7 +836,7 @@ discard block |
||
836 | 836 | $sourceKeyColumn = $joinColumn->getReferencedColumnName(); |
837 | 837 | $targetKeyColumn = $joinColumn->getColumnName(); |
838 | 838 | |
839 | - if (! isset($sourceClass->fieldNames[$sourceKeyColumn])) { |
|
839 | + if ( ! isset($sourceClass->fieldNames[$sourceKeyColumn])) { |
|
840 | 840 | throw MappingException::joinColumnMustPointToMappedField( |
841 | 841 | $sourceClass->getClassName(), |
842 | 842 | $sourceKeyColumn |
@@ -1063,7 +1063,7 @@ discard block |
||
1063 | 1063 | $criteria = []; |
1064 | 1064 | $parameters = []; |
1065 | 1065 | |
1066 | - if (! $association->isOwningSide()) { |
|
1066 | + if ( ! $association->isOwningSide()) { |
|
1067 | 1067 | $class = $this->em->getClassMetadata($association->getTargetEntity()); |
1068 | 1068 | $owningAssoc = $class->getProperty($association->getMappedBy()); |
1069 | 1069 | } |
@@ -1092,7 +1092,7 @@ discard block |
||
1092 | 1092 | $value = $value[$targetClass->identifier[0]]; |
1093 | 1093 | } |
1094 | 1094 | |
1095 | - $criteria[$joinTableName . '.' . $quotedColumnName] = $value; |
|
1095 | + $criteria[$joinTableName.'.'.$quotedColumnName] = $value; |
|
1096 | 1096 | $parameters[] = [ |
1097 | 1097 | 'value' => $value, |
1098 | 1098 | 'field' => $fieldName, |
@@ -1142,11 +1142,11 @@ discard block |
||
1142 | 1142 | |
1143 | 1143 | switch ($lockMode) { |
1144 | 1144 | case LockMode::PESSIMISTIC_READ: |
1145 | - $lockSql = ' ' . $this->platform->getReadLockSQL(); |
|
1145 | + $lockSql = ' '.$this->platform->getReadLockSQL(); |
|
1146 | 1146 | break; |
1147 | 1147 | |
1148 | 1148 | case LockMode::PESSIMISTIC_WRITE: |
1149 | - $lockSql = ' ' . $this->platform->getWriteLockSQL(); |
|
1149 | + $lockSql = ' '.$this->platform->getWriteLockSQL(); |
|
1150 | 1150 | break; |
1151 | 1151 | } |
1152 | 1152 | |
@@ -1157,14 +1157,14 @@ discard block |
||
1157 | 1157 | |
1158 | 1158 | if ($filterSql !== '') { |
1159 | 1159 | $conditionSql = $conditionSql |
1160 | - ? $conditionSql . ' AND ' . $filterSql |
|
1160 | + ? $conditionSql.' AND '.$filterSql |
|
1161 | 1161 | : $filterSql; |
1162 | 1162 | } |
1163 | 1163 | |
1164 | - $select = 'SELECT ' . $columnList; |
|
1165 | - $from = ' FROM ' . $tableName . ' ' . $tableAlias; |
|
1166 | - $join = $this->currentPersisterContext->selectJoinSql . $joinSql; |
|
1167 | - $where = ($conditionSql ? ' WHERE ' . $conditionSql : ''); |
|
1164 | + $select = 'SELECT '.$columnList; |
|
1165 | + $from = ' FROM '.$tableName.' '.$tableAlias; |
|
1166 | + $join = $this->currentPersisterContext->selectJoinSql.$joinSql; |
|
1167 | + $where = ($conditionSql ? ' WHERE '.$conditionSql : ''); |
|
1168 | 1168 | $lock = $this->platform->appendLockHint($from, $lockMode); |
1169 | 1169 | $query = $select |
1170 | 1170 | . $lock |
@@ -1172,7 +1172,7 @@ discard block |
||
1172 | 1172 | . $where |
1173 | 1173 | . $orderBySql; |
1174 | 1174 | |
1175 | - return $this->platform->modifyLimitQuery($query, $limit, $offset) . $lockSql; |
|
1175 | + return $this->platform->modifyLimitQuery($query, $limit, $offset).$lockSql; |
|
1176 | 1176 | } |
1177 | 1177 | |
1178 | 1178 | /** |
@@ -1191,13 +1191,13 @@ discard block |
||
1191 | 1191 | |
1192 | 1192 | if ($filterSql !== '') { |
1193 | 1193 | $conditionSql = $conditionSql |
1194 | - ? $conditionSql . ' AND ' . $filterSql |
|
1194 | + ? $conditionSql.' AND '.$filterSql |
|
1195 | 1195 | : $filterSql; |
1196 | 1196 | } |
1197 | 1197 | |
1198 | 1198 | $sql = 'SELECT COUNT(*) ' |
1199 | - . 'FROM ' . $tableName . ' ' . $tableAlias |
|
1200 | - . (empty($conditionSql) ? '' : ' WHERE ' . $conditionSql); |
|
1199 | + . 'FROM '.$tableName.' '.$tableAlias |
|
1200 | + . (empty($conditionSql) ? '' : ' WHERE '.$conditionSql); |
|
1201 | 1201 | |
1202 | 1202 | return $sql; |
1203 | 1203 | } |
@@ -1214,7 +1214,7 @@ discard block |
||
1214 | 1214 | */ |
1215 | 1215 | final protected function getOrderBySQL(array $orderBy, $baseTableAlias) |
1216 | 1216 | { |
1217 | - if (! $orderBy) { |
|
1217 | + if ( ! $orderBy) { |
|
1218 | 1218 | return ''; |
1219 | 1219 | } |
1220 | 1220 | |
@@ -1223,7 +1223,7 @@ discard block |
||
1223 | 1223 | foreach ($orderBy as $fieldName => $orientation) { |
1224 | 1224 | $orientation = strtoupper(trim($orientation)); |
1225 | 1225 | |
1226 | - if (! in_array($orientation, ['ASC', 'DESC'], true)) { |
|
1226 | + if ( ! in_array($orientation, ['ASC', 'DESC'], true)) { |
|
1227 | 1227 | throw InvalidOrientation::fromClassNameAndField($this->class->getClassName(), $fieldName); |
1228 | 1228 | } |
1229 | 1229 | |
@@ -1233,11 +1233,11 @@ discard block |
||
1233 | 1233 | $tableAlias = $this->getSQLTableAlias($property->getTableName()); |
1234 | 1234 | $columnName = $this->platform->quoteIdentifier($property->getColumnName()); |
1235 | 1235 | |
1236 | - $orderByList[] = $tableAlias . '.' . $columnName . ' ' . $orientation; |
|
1236 | + $orderByList[] = $tableAlias.'.'.$columnName.' '.$orientation; |
|
1237 | 1237 | |
1238 | 1238 | continue; |
1239 | 1239 | } elseif ($property instanceof AssociationMetadata) { |
1240 | - if (! $property->isOwningSide()) { |
|
1240 | + if ( ! $property->isOwningSide()) { |
|
1241 | 1241 | throw InvalidFindByCall::fromInverseSideUsage( |
1242 | 1242 | $this->class->getClassName(), |
1243 | 1243 | $fieldName |
@@ -1253,7 +1253,7 @@ discard block |
||
1253 | 1253 | /** @var JoinColumnMetadata $joinColumn */ |
1254 | 1254 | $quotedColumnName = $this->platform->quoteIdentifier($joinColumn->getColumnName()); |
1255 | 1255 | |
1256 | - $orderByList[] = $tableAlias . '.' . $quotedColumnName . ' ' . $orientation; |
|
1256 | + $orderByList[] = $tableAlias.'.'.$quotedColumnName.' '.$orientation; |
|
1257 | 1257 | } |
1258 | 1258 | |
1259 | 1259 | continue; |
@@ -1262,7 +1262,7 @@ discard block |
||
1262 | 1262 | throw UnrecognizedField::byName($fieldName); |
1263 | 1263 | } |
1264 | 1264 | |
1265 | - return ' ORDER BY ' . implode(', ', $orderByList); |
|
1265 | + return ' ORDER BY '.implode(', ', $orderByList); |
|
1266 | 1266 | } |
1267 | 1267 | |
1268 | 1268 | /** |
@@ -1304,7 +1304,7 @@ discard block |
||
1304 | 1304 | $isAssocToOneInverseSide = $property instanceof ToOneAssociationMetadata && ! $property->isOwningSide(); |
1305 | 1305 | $isAssocFromOneEager = ! $property instanceof ManyToManyAssociationMetadata && $property->getFetchMode() === FetchMode::EAGER; |
1306 | 1306 | |
1307 | - if (! ($isAssocFromOneEager || $isAssocToOneInverseSide)) { |
|
1307 | + if ( ! ($isAssocFromOneEager || $isAssocToOneInverseSide)) { |
|
1308 | 1308 | break; |
1309 | 1309 | } |
1310 | 1310 | |
@@ -1319,7 +1319,7 @@ discard block |
||
1319 | 1319 | break; // now this is why you shouldn't use inheritance |
1320 | 1320 | } |
1321 | 1321 | |
1322 | - $assocAlias = 'e' . ($eagerAliasCounter++); |
|
1322 | + $assocAlias = 'e'.($eagerAliasCounter++); |
|
1323 | 1323 | |
1324 | 1324 | $this->currentPersisterContext->rsm->addJoinedEntityResult($targetEntity, $assocAlias, 'r', $fieldName); |
1325 | 1325 | |
@@ -1347,14 +1347,14 @@ discard block |
||
1347 | 1347 | $this->currentPersisterContext->rsm->addIndexBy($assocAlias, $property->getIndexedBy()); |
1348 | 1348 | } |
1349 | 1349 | |
1350 | - if (! $property->isOwningSide()) { |
|
1350 | + if ( ! $property->isOwningSide()) { |
|
1351 | 1351 | $owningAssociation = $eagerEntity->getProperty($property->getMappedBy()); |
1352 | 1352 | } |
1353 | 1353 | |
1354 | 1354 | $joinTableAlias = $this->getSQLTableAlias($eagerEntity->getTableName(), $assocAlias); |
1355 | 1355 | $joinTableName = $eagerEntity->table->getQuotedQualifiedName($this->platform); |
1356 | 1356 | |
1357 | - $this->currentPersisterContext->selectJoinSql .= ' ' . $this->getJoinSQLForAssociation($property); |
|
1357 | + $this->currentPersisterContext->selectJoinSql .= ' '.$this->getJoinSQLForAssociation($property); |
|
1358 | 1358 | |
1359 | 1359 | $sourceClass = $this->em->getClassMetadata($owningAssociation->getSourceEntity()); |
1360 | 1360 | $targetClass = $this->em->getClassMetadata($owningAssociation->getTargetEntity()); |
@@ -1378,7 +1378,7 @@ discard block |
||
1378 | 1378 | $joinCondition[] = $filterSql; |
1379 | 1379 | } |
1380 | 1380 | |
1381 | - $this->currentPersisterContext->selectJoinSql .= ' ' . $joinTableName . ' ' . $joinTableAlias . ' ON '; |
|
1381 | + $this->currentPersisterContext->selectJoinSql .= ' '.$joinTableName.' '.$joinTableAlias.' ON '; |
|
1382 | 1382 | $this->currentPersisterContext->selectJoinSql .= implode(' AND ', $joinCondition); |
1383 | 1383 | |
1384 | 1384 | break; |
@@ -1400,7 +1400,7 @@ discard block |
||
1400 | 1400 | */ |
1401 | 1401 | protected function getSelectColumnAssociationSQL($field, AssociationMetadata $association, ClassMetadata $class, $alias = 'r') |
1402 | 1402 | { |
1403 | - if (! ($association->isOwningSide() && $association instanceof ToOneAssociationMetadata)) { |
|
1403 | + if ( ! ($association->isOwningSide() && $association instanceof ToOneAssociationMetadata)) { |
|
1404 | 1404 | return ''; |
1405 | 1405 | } |
1406 | 1406 | |
@@ -1415,7 +1415,7 @@ discard block |
||
1415 | 1415 | $referencedColumnName = $joinColumn->getReferencedColumnName(); |
1416 | 1416 | $resultColumnName = $this->getSQLColumnAlias(); |
1417 | 1417 | |
1418 | - if (! $joinColumn->getType()) { |
|
1418 | + if ( ! $joinColumn->getType()) { |
|
1419 | 1419 | $joinColumn->setType(PersisterHelper::getTypeOfColumn($referencedColumnName, $targetClass, $this->em)); |
1420 | 1420 | } |
1421 | 1421 | |
@@ -1445,7 +1445,7 @@ discard block |
||
1445 | 1445 | $owningAssociation = $association; |
1446 | 1446 | $sourceTableAlias = $this->getSQLTableAlias($this->class->getTableName()); |
1447 | 1447 | |
1448 | - if (! $association->isOwningSide()) { |
|
1448 | + if ( ! $association->isOwningSide()) { |
|
1449 | 1449 | $targetEntity = $this->em->getClassMetadata($association->getTargetEntity()); |
1450 | 1450 | $owningAssociation = $targetEntity->getProperty($association->getMappedBy()); |
1451 | 1451 | } |
@@ -1467,7 +1467,7 @@ discard block |
||
1467 | 1467 | ); |
1468 | 1468 | } |
1469 | 1469 | |
1470 | - return ' INNER JOIN ' . $joinTableName . ' ON ' . implode(' AND ', $conditions); |
|
1470 | + return ' INNER JOIN '.$joinTableName.' ON '.implode(' AND ', $conditions); |
|
1471 | 1471 | } |
1472 | 1472 | |
1473 | 1473 | /** |
@@ -1562,7 +1562,7 @@ discard block |
||
1562 | 1562 | $columnName = $joinColumn->getColumnName(); |
1563 | 1563 | $referencedColumnName = $joinColumn->getReferencedColumnName(); |
1564 | 1564 | |
1565 | - if (! $joinColumn->getType()) { |
|
1565 | + if ( ! $joinColumn->getType()) { |
|
1566 | 1566 | $joinColumn->setType(PersisterHelper::getTypeOfColumn($referencedColumnName, $targetClass, $this->em)); |
1567 | 1567 | } |
1568 | 1568 | |
@@ -1601,7 +1601,7 @@ discard block |
||
1601 | 1601 | |
1602 | 1602 | $this->currentPersisterContext->rsm->addFieldResult($alias, $columnAlias, $field, $class->getClassName()); |
1603 | 1603 | |
1604 | - return $property->getType()->convertToPHPValueSQL($sql, $this->platform) . ' AS ' . $columnAlias; |
|
1604 | + return $property->getType()->convertToPHPValueSQL($sql, $this->platform).' AS '.$columnAlias; |
|
1605 | 1605 | } |
1606 | 1606 | |
1607 | 1607 | /** |
@@ -1615,14 +1615,14 @@ discard block |
||
1615 | 1615 | protected function getSQLTableAlias($tableName, $assocName = '') |
1616 | 1616 | { |
1617 | 1617 | if ($tableName) { |
1618 | - $tableName .= '#' . $assocName; |
|
1618 | + $tableName .= '#'.$assocName; |
|
1619 | 1619 | } |
1620 | 1620 | |
1621 | 1621 | if (isset($this->currentPersisterContext->sqlTableAliases[$tableName])) { |
1622 | 1622 | return $this->currentPersisterContext->sqlTableAliases[$tableName]; |
1623 | 1623 | } |
1624 | 1624 | |
1625 | - $tableAlias = 't' . $this->currentPersisterContext->sqlAliasCounter++; |
|
1625 | + $tableAlias = 't'.$this->currentPersisterContext->sqlAliasCounter++; |
|
1626 | 1626 | |
1627 | 1627 | $this->currentPersisterContext->sqlTableAliases[$tableName] = $tableAlias; |
1628 | 1628 | |
@@ -1648,7 +1648,7 @@ discard block |
||
1648 | 1648 | } |
1649 | 1649 | |
1650 | 1650 | $lock = $this->getLockTablesSql($lockMode); |
1651 | - $where = ($conditionSql ? ' WHERE ' . $conditionSql : '') . ' '; |
|
1651 | + $where = ($conditionSql ? ' WHERE '.$conditionSql : '').' '; |
|
1652 | 1652 | $sql = 'SELECT 1 ' |
1653 | 1653 | . $lock |
1654 | 1654 | . $where |
@@ -1671,7 +1671,7 @@ discard block |
||
1671 | 1671 | $tableName = $this->class->table->getQuotedQualifiedName($this->platform); |
1672 | 1672 | |
1673 | 1673 | return $this->platform->appendLockHint( |
1674 | - 'FROM ' . $tableName . ' ' . $this->getSQLTableAlias($this->class->getTableName()), |
|
1674 | + 'FROM '.$tableName.' '.$this->getSQLTableAlias($this->class->getTableName()), |
|
1675 | 1675 | $lockMode |
1676 | 1676 | ); |
1677 | 1677 | } |
@@ -1721,19 +1721,19 @@ discard block |
||
1721 | 1721 | |
1722 | 1722 | if ($comparison !== null) { |
1723 | 1723 | // special case null value handling |
1724 | - if (($comparison === Comparison::EQ || $comparison === Comparison::IS) && $value ===null) { |
|
1725 | - $selectedColumns[] = $column . ' IS NULL'; |
|
1724 | + if (($comparison === Comparison::EQ || $comparison === Comparison::IS) && $value === null) { |
|
1725 | + $selectedColumns[] = $column.' IS NULL'; |
|
1726 | 1726 | |
1727 | 1727 | continue; |
1728 | 1728 | } |
1729 | 1729 | |
1730 | 1730 | if ($comparison === Comparison::NEQ && $value === null) { |
1731 | - $selectedColumns[] = $column . ' IS NOT NULL'; |
|
1731 | + $selectedColumns[] = $column.' IS NOT NULL'; |
|
1732 | 1732 | |
1733 | 1733 | continue; |
1734 | 1734 | } |
1735 | 1735 | |
1736 | - $selectedColumns[] = $column . ' ' . sprintf(self::$comparisonMap[$comparison], $placeholder); |
|
1736 | + $selectedColumns[] = $column.' '.sprintf(self::$comparisonMap[$comparison], $placeholder); |
|
1737 | 1737 | |
1738 | 1738 | continue; |
1739 | 1739 | } |
@@ -1781,7 +1781,7 @@ discard block |
||
1781 | 1781 | $tableAlias = $this->getSQLTableAlias($property->getTableName()); |
1782 | 1782 | $columnName = $this->platform->quoteIdentifier($property->getColumnName()); |
1783 | 1783 | |
1784 | - return [$tableAlias . '.' . $columnName]; |
|
1784 | + return [$tableAlias.'.'.$columnName]; |
|
1785 | 1785 | } |
1786 | 1786 | |
1787 | 1787 | if ($property instanceof AssociationMetadata) { |
@@ -1790,7 +1790,7 @@ discard block |
||
1790 | 1790 | |
1791 | 1791 | // Many-To-Many requires join table check for joinColumn |
1792 | 1792 | if ($owningAssociation instanceof ManyToManyAssociationMetadata) { |
1793 | - if (! $owningAssociation->isOwningSide()) { |
|
1793 | + if ( ! $owningAssociation->isOwningSide()) { |
|
1794 | 1794 | $owningAssociation = $association; |
1795 | 1795 | } |
1796 | 1796 | |
@@ -1804,17 +1804,17 @@ discard block |
||
1804 | 1804 | foreach ($joinColumns as $joinColumn) { |
1805 | 1805 | $quotedColumnName = $this->platform->quoteIdentifier($joinColumn->getColumnName()); |
1806 | 1806 | |
1807 | - $columns[] = $joinTableName . '.' . $quotedColumnName; |
|
1807 | + $columns[] = $joinTableName.'.'.$quotedColumnName; |
|
1808 | 1808 | } |
1809 | 1809 | } else { |
1810 | - if (! $owningAssociation->isOwningSide()) { |
|
1810 | + if ( ! $owningAssociation->isOwningSide()) { |
|
1811 | 1811 | throw InvalidFindByCall::fromInverseSideUsage( |
1812 | 1812 | $this->class->getClassName(), |
1813 | 1813 | $field |
1814 | 1814 | ); |
1815 | 1815 | } |
1816 | 1816 | |
1817 | - $class = $this->class->isInheritedProperty($field) |
|
1817 | + $class = $this->class->isInheritedProperty($field) |
|
1818 | 1818 | ? $owningAssociation->getDeclaringClass() |
1819 | 1819 | : $this->class |
1820 | 1820 | ; |
@@ -1823,7 +1823,7 @@ discard block |
||
1823 | 1823 | foreach ($owningAssociation->getJoinColumns() as $joinColumn) { |
1824 | 1824 | $quotedColumnName = $this->platform->quoteIdentifier($joinColumn->getColumnName()); |
1825 | 1825 | |
1826 | - $columns[] = $tableAlias . '.' . $quotedColumnName; |
|
1826 | + $columns[] = $tableAlias.'.'.$quotedColumnName; |
|
1827 | 1827 | } |
1828 | 1828 | } |
1829 | 1829 | |
@@ -1932,7 +1932,7 @@ discard block |
||
1932 | 1932 | $value = $value[$targetClass->identifier[0]]; |
1933 | 1933 | } |
1934 | 1934 | |
1935 | - $criteria[$tableAlias . '.' . $quotedColumnName] = $value; |
|
1935 | + $criteria[$tableAlias.'.'.$quotedColumnName] = $value; |
|
1936 | 1936 | $parameters[] = [ |
1937 | 1937 | 'value' => $value, |
1938 | 1938 | 'field' => $fieldName, |
@@ -2017,7 +2017,7 @@ discard block |
||
2017 | 2017 | case ($property instanceof AssociationMetadata): |
2018 | 2018 | $class = $this->em->getClassMetadata($property->getTargetEntity()); |
2019 | 2019 | |
2020 | - if (! $property->isOwningSide()) { |
|
2020 | + if ( ! $property->isOwningSide()) { |
|
2021 | 2021 | $property = $class->getProperty($property->getMappedBy()); |
2022 | 2022 | $class = $this->em->getClassMetadata($property->getTargetEntity()); |
2023 | 2023 | } |
@@ -2031,7 +2031,7 @@ discard block |
||
2031 | 2031 | /** @var JoinColumnMetadata $joinColumn */ |
2032 | 2032 | $referencedColumnName = $joinColumn->getReferencedColumnName(); |
2033 | 2033 | |
2034 | - if (! $joinColumn->getType()) { |
|
2034 | + if ( ! $joinColumn->getType()) { |
|
2035 | 2035 | $joinColumn->setType(PersisterHelper::getTypeOfColumn($referencedColumnName, $class, $this->em)); |
2036 | 2036 | } |
2037 | 2037 | |
@@ -2046,7 +2046,7 @@ discard block |
||
2046 | 2046 | } |
2047 | 2047 | |
2048 | 2048 | if (is_array($value)) { |
2049 | - return array_map(function ($type) { |
|
2049 | + return array_map(function($type) { |
|
2050 | 2050 | return $type->getBindingType() + Connection::ARRAY_PARAM_OFFSET; |
2051 | 2051 | }, $types); |
2052 | 2052 | } |
@@ -2103,7 +2103,7 @@ discard block |
||
2103 | 2103 | */ |
2104 | 2104 | private function getIndividualValue($value) |
2105 | 2105 | { |
2106 | - if (! is_object($value) || ! $this->em->getMetadataFactory()->hasMetadataFor(StaticClassNameConverter::getClass($value))) { |
|
2106 | + if ( ! is_object($value) || ! $this->em->getMetadataFactory()->hasMetadataFor(StaticClassNameConverter::getClass($value))) { |
|
2107 | 2107 | return $value; |
2108 | 2108 | } |
2109 | 2109 | |
@@ -2117,7 +2117,7 @@ discard block |
||
2117 | 2117 | { |
2118 | 2118 | $criteria = $this->getIdentifier($entity); |
2119 | 2119 | |
2120 | - if (! $criteria) { |
|
2120 | + if ( ! $criteria) { |
|
2121 | 2121 | return false; |
2122 | 2122 | } |
2123 | 2123 | |
@@ -2125,12 +2125,12 @@ discard block |
||
2125 | 2125 | |
2126 | 2126 | $sql = 'SELECT 1 ' |
2127 | 2127 | . $this->getLockTablesSql(null) |
2128 | - . ' WHERE ' . $this->getSelectConditionSQL($criteria); |
|
2128 | + . ' WHERE '.$this->getSelectConditionSQL($criteria); |
|
2129 | 2129 | |
2130 | 2130 | list($params, $types) = $this->expandParameters($criteria); |
2131 | 2131 | |
2132 | 2132 | if ($extraConditions !== null) { |
2133 | - $sql .= ' AND ' . $this->getSelectConditionCriteriaSQL($extraConditions); |
|
2133 | + $sql .= ' AND '.$this->getSelectConditionCriteriaSQL($extraConditions); |
|
2134 | 2134 | list($criteriaParams, $criteriaTypes) = $this->expandCriteriaParameters($extraConditions); |
2135 | 2135 | |
2136 | 2136 | $params = array_merge($params, $criteriaParams); |
@@ -2140,7 +2140,7 @@ discard block |
||
2140 | 2140 | $filterSql = $this->generateFilterConditionSQL($this->class, $alias); |
2141 | 2141 | |
2142 | 2142 | if ($filterSql) { |
2143 | - $sql .= ' AND ' . $filterSql; |
|
2143 | + $sql .= ' AND '.$filterSql; |
|
2144 | 2144 | } |
2145 | 2145 | |
2146 | 2146 | return (bool) $this->conn->fetchColumn($sql, $params, 0, $types); |
@@ -2153,13 +2153,13 @@ discard block |
||
2153 | 2153 | */ |
2154 | 2154 | protected function getJoinSQLForAssociation(AssociationMetadata $association) |
2155 | 2155 | { |
2156 | - if (! $association->isOwningSide()) { |
|
2156 | + if ( ! $association->isOwningSide()) { |
|
2157 | 2157 | return 'LEFT JOIN'; |
2158 | 2158 | } |
2159 | 2159 | |
2160 | 2160 | // if one of the join columns is nullable, return left join |
2161 | 2161 | foreach ($association->getJoinColumns() as $joinColumn) { |
2162 | - if (! $joinColumn->isNullable()) { |
|
2162 | + if ( ! $joinColumn->isNullable()) { |
|
2163 | 2163 | continue; |
2164 | 2164 | } |
2165 | 2165 | |
@@ -2176,7 +2176,7 @@ discard block |
||
2176 | 2176 | */ |
2177 | 2177 | public function getSQLColumnAlias() |
2178 | 2178 | { |
2179 | - return $this->platform->getSQLResultCasing('c' . $this->currentPersisterContext->sqlAliasCounter++); |
|
2179 | + return $this->platform->getSQLResultCasing('c'.$this->currentPersisterContext->sqlAliasCounter++); |
|
2180 | 2180 | } |
2181 | 2181 | |
2182 | 2182 | /** |
@@ -2195,13 +2195,13 @@ discard block |
||
2195 | 2195 | $filterExpr = $filter->addFilterConstraint($targetEntity, $targetTableAlias); |
2196 | 2196 | |
2197 | 2197 | if ($filterExpr !== '') { |
2198 | - $filterClauses[] = '(' . $filterExpr . ')'; |
|
2198 | + $filterClauses[] = '('.$filterExpr.')'; |
|
2199 | 2199 | } |
2200 | 2200 | } |
2201 | 2201 | |
2202 | 2202 | $sql = implode(' AND ', $filterClauses); |
2203 | 2203 | |
2204 | - return $sql ? '(' . $sql . ')' : ''; // Wrap again to avoid "X or Y and FilterConditionSQL" |
|
2204 | + return $sql ? '('.$sql.')' : ''; // Wrap again to avoid "X or Y and FilterConditionSQL" |
|
2205 | 2205 | } |
2206 | 2206 | |
2207 | 2207 | /** |
@@ -30,9 +30,9 @@ discard block |
||
30 | 30 | protected function configure() |
31 | 31 | { |
32 | 32 | $this->setName('orm:mapping:describe') |
33 | - ->addArgument('entityName', InputArgument::REQUIRED, 'Full or partial name of entity') |
|
34 | - ->setDescription('Display information about mapped objects') |
|
35 | - ->setHelp(<<<'EOT' |
|
33 | + ->addArgument('entityName', InputArgument::REQUIRED, 'Full or partial name of entity') |
|
34 | + ->setDescription('Display information about mapped objects') |
|
35 | + ->setHelp(<<<'EOT' |
|
36 | 36 | The %command.full_name% command describes the metadata for the given full or partial entity class name. |
37 | 37 | |
38 | 38 | <info>%command.full_name%</info> My\Namespace\Entity\MyEntity |
@@ -41,7 +41,7 @@ discard block |
||
41 | 41 | |
42 | 42 | <info>%command.full_name%</info> MyEntity |
43 | 43 | EOT |
44 | - ); |
|
44 | + ); |
|
45 | 45 | } |
46 | 46 | |
47 | 47 | /** |
@@ -121,8 +121,8 @@ discard block |
||
121 | 121 | private function getMappedEntities(EntityManagerInterface $entityManager) |
122 | 122 | { |
123 | 123 | $entityClassNames = $entityManager->getConfiguration() |
124 | - ->getMetadataDriverImpl() |
|
125 | - ->getAllClassNames(); |
|
124 | + ->getMetadataDriverImpl() |
|
125 | + ->getAllClassNames(); |
|
126 | 126 | |
127 | 127 | if (! $entityClassNames) { |
128 | 128 | throw new \InvalidArgumentException( |
@@ -141,9 +141,9 @@ discard block |
||
141 | 141 | ->getMetadataDriverImpl() |
142 | 142 | ->getAllClassNames(); |
143 | 143 | |
144 | - if (! $entityClassNames) { |
|
144 | + if ( ! $entityClassNames) { |
|
145 | 145 | throw new \InvalidArgumentException( |
146 | - 'You do not have any mapped Doctrine ORM entities according to the current configuration. ' . |
|
146 | + 'You do not have any mapped Doctrine ORM entities according to the current configuration. '. |
|
147 | 147 | 'If you have entities or mapping files you should check your mapping configuration for errors.' |
148 | 148 | ); |
149 | 149 | } |
@@ -168,12 +168,12 @@ discard block |
||
168 | 168 | |
169 | 169 | $matches = array_filter( |
170 | 170 | $this->getMappedEntities($entityManager), |
171 | - function ($mappedEntity) use ($entityName) { |
|
172 | - return preg_match('{' . preg_quote($entityName) . '}', $mappedEntity); |
|
171 | + function($mappedEntity) use ($entityName) { |
|
172 | + return preg_match('{'.preg_quote($entityName).'}', $mappedEntity); |
|
173 | 173 | } |
174 | 174 | ); |
175 | 175 | |
176 | - if (! $matches) { |
|
176 | + if ( ! $matches) { |
|
177 | 177 | throw new \InvalidArgumentException(sprintf( |
178 | 178 | 'Could not find any mapped Entity classes matching "%s"', |
179 | 179 | $entityName |
@@ -225,7 +225,7 @@ discard block |
||
225 | 225 | |
226 | 226 | $output[] = $this->formatField( |
227 | 227 | sprintf(' %s', $parentClass->getParent()), |
228 | - ($parentClass->isRootEntity() ? '(Root) ' : '') . $this->formatValue($attributes) |
|
228 | + ($parentClass->isRootEntity() ? '(Root) ' : '').$this->formatValue($attributes) |
|
229 | 229 | ); |
230 | 230 | } |
231 | 231 | |
@@ -250,7 +250,7 @@ discard block |
||
250 | 250 | } |
251 | 251 | |
252 | 252 | if (is_bool($value)) { |
253 | - return '<comment>' . ($value ? 'True' : 'False') . '</comment>'; |
|
253 | + return '<comment>'.($value ? 'True' : 'False').'</comment>'; |
|
254 | 254 | } |
255 | 255 | |
256 | 256 | if (empty($value)) { |
@@ -21,13 +21,13 @@ discard block |
||
21 | 21 | protected function configure() |
22 | 22 | { |
23 | 23 | $this->setName('orm:info') |
24 | - ->setDescription('Show basic information about all mapped entities') |
|
25 | - ->setHelp(<<<'EOT' |
|
24 | + ->setDescription('Show basic information about all mapped entities') |
|
25 | + ->setHelp(<<<'EOT' |
|
26 | 26 | The <info>%command.name%</info> shows basic information about which |
27 | 27 | entities exist and possibly if their mapping information contains errors or |
28 | 28 | not. |
29 | 29 | EOT |
30 | - ); |
|
30 | + ); |
|
31 | 31 | } |
32 | 32 | |
33 | 33 | /** |
@@ -41,8 +41,8 @@ discard block |
||
41 | 41 | $entityManager = $this->getHelper('em')->getEntityManager(); |
42 | 42 | |
43 | 43 | $entityClassNames = $entityManager->getConfiguration() |
44 | - ->getMetadataDriverImpl() |
|
45 | - ->getAllClassNames(); |
|
44 | + ->getMetadataDriverImpl() |
|
45 | + ->getAllClassNames(); |
|
46 | 46 | |
47 | 47 | if (! $entityClassNames) { |
48 | 48 | $ui->caution( |
@@ -47,7 +47,7 @@ |
||
47 | 47 | ->getMetadataDriverImpl() |
48 | 48 | ->getAllClassNames(); |
49 | 49 | |
50 | - if (! $entityClassNames) { |
|
50 | + if ( ! $entityClassNames) { |
|
51 | 51 | $ui->caution( |
52 | 52 | [ |
53 | 53 | 'You do not have any mapped Doctrine ORM entities according to the current configuration.', |
@@ -33,10 +33,10 @@ discard block |
||
33 | 33 | $rsm->setDiscriminatorColumn('p', 'discr'); |
34 | 34 | |
35 | 35 | $resultSet = [ |
36 | - [ |
|
37 | - 'u__id' => '1', |
|
38 | - 'u__name' => 'Fabio B. Silva', |
|
39 | - ], |
|
36 | + [ |
|
37 | + 'u__id' => '1', |
|
38 | + 'u__name' => 'Fabio B. Silva', |
|
39 | + ], |
|
40 | 40 | ]; |
41 | 41 | |
42 | 42 | $stmt = new HydratorMockStatement($resultSet); |
@@ -89,11 +89,11 @@ discard block |
||
89 | 89 | $rsm->setDiscriminatorColumn('p', 'discr'); |
90 | 90 | |
91 | 91 | $resultSet = [ |
92 | - [ |
|
93 | - 'p__id' => '1', |
|
94 | - 'p__name' => 'Fabio B. Silva', |
|
95 | - 'discr' => 'subworker', |
|
96 | - ], |
|
92 | + [ |
|
93 | + 'p__id' => '1', |
|
94 | + 'p__name' => 'Fabio B. Silva', |
|
95 | + 'discr' => 'subworker', |
|
96 | + ], |
|
97 | 97 | ]; |
98 | 98 | |
99 | 99 | $stmt = new HydratorMockStatement($resultSet); |