@@ -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 | |
@@ -1478,7 +1478,7 @@ discard block |
||
1478 | 1478 | foreach ($this->dqlParts as $part => $elements) { |
1479 | 1479 | if (is_array($this->dqlParts[$part])) { |
1480 | 1480 | foreach ($this->dqlParts[$part] as $idx => $element) { |
1481 | - if (! is_object($element)) { |
|
1481 | + if ( ! is_object($element)) { |
|
1482 | 1482 | continue; |
1483 | 1483 | } |
1484 | 1484 |
@@ -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 |
@@ -300,16 +300,16 @@ discard block |
||
300 | 300 | $tableName = $versionedClass->table->getQuotedQualifiedName($this->platform); |
301 | 301 | $columnName = $this->platform->quoteIdentifier($versionProperty->getColumnName()); |
302 | 302 | $identifier = array_map( |
303 | - function ($columnName) { |
|
303 | + function($columnName) { |
|
304 | 304 | return $this->platform->quoteIdentifier($columnName); |
305 | 305 | }, |
306 | 306 | array_keys($versionedClass->getIdentifierColumns($this->em)) |
307 | 307 | ); |
308 | 308 | |
309 | 309 | // FIXME: Order with composite keys might not be correct |
310 | - $sql = 'SELECT ' . $columnName |
|
311 | - . ' FROM ' . $tableName |
|
312 | - . ' WHERE ' . implode(' = ? AND ', $identifier) . ' = ?'; |
|
310 | + $sql = 'SELECT '.$columnName |
|
311 | + . ' FROM '.$tableName |
|
312 | + . ' WHERE '.implode(' = ? AND ', $identifier).' = ?'; |
|
313 | 313 | |
314 | 314 | $flattenedId = $this->em->getIdentifierFlattener()->flattenIdentifier($versionedClass, $id); |
315 | 315 | $versionType = $versionProperty->getType(); |
@@ -348,13 +348,13 @@ discard block |
||
348 | 348 | $tableName = $this->class->getTableName(); |
349 | 349 | $updateData = $this->prepareUpdateData($entity); |
350 | 350 | |
351 | - if (! isset($updateData[$tableName])) { |
|
351 | + if ( ! isset($updateData[$tableName])) { |
|
352 | 352 | return; |
353 | 353 | } |
354 | 354 | |
355 | 355 | $data = $updateData[$tableName]; |
356 | 356 | |
357 | - if (! $data) { |
|
357 | + if ( ! $data) { |
|
358 | 358 | return; |
359 | 359 | } |
360 | 360 | |
@@ -363,7 +363,7 @@ discard block |
||
363 | 363 | |
364 | 364 | $this->updateTable($entity, $quotedTableName, $data, $isVersioned); |
365 | 365 | |
366 | - if (! $isVersioned) { |
|
366 | + if ( ! $isVersioned) { |
|
367 | 367 | return; |
368 | 368 | } |
369 | 369 | |
@@ -409,7 +409,7 @@ discard block |
||
409 | 409 | |
410 | 410 | if ($value !== null) { |
411 | 411 | // @todo guilhermeblanco Make sure we do not have flat association values. |
412 | - if (! is_array($value)) { |
|
412 | + if ( ! is_array($value)) { |
|
413 | 413 | $value = [$targetClass->identifier[0] => $value]; |
414 | 414 | } |
415 | 415 | |
@@ -422,7 +422,7 @@ discard block |
||
422 | 422 | $referencedColumnName = $joinColumn->getReferencedColumnName(); |
423 | 423 | $targetField = $targetClass->fieldNames[$referencedColumnName]; |
424 | 424 | |
425 | - if (! $joinColumn->getType()) { |
|
425 | + if ( ! $joinColumn->getType()) { |
|
426 | 426 | $joinColumn->setType(PersisterHelper::getTypeOfColumn($referencedColumnName, $targetClass, $this->em)); |
427 | 427 | } |
428 | 428 | |
@@ -488,7 +488,7 @@ discard block |
||
488 | 488 | $quotedColumnName = $this->platform->quoteIdentifier($joinColumn->getColumnName()); |
489 | 489 | $referencedColumnName = $joinColumn->getReferencedColumnName(); |
490 | 490 | |
491 | - if (! $joinColumn->getType()) { |
|
491 | + if ( ! $joinColumn->getType()) { |
|
492 | 492 | $joinColumn->setType(PersisterHelper::getTypeOfColumn($referencedColumnName, $targetClass, $this->em)); |
493 | 493 | } |
494 | 494 | |
@@ -515,18 +515,18 @@ discard block |
||
515 | 515 | case Type::SMALLINT: |
516 | 516 | case Type::INTEGER: |
517 | 517 | case Type::BIGINT: |
518 | - $set[] = $versionColumnName . ' = ' . $versionColumnName . ' + 1'; |
|
518 | + $set[] = $versionColumnName.' = '.$versionColumnName.' + 1'; |
|
519 | 519 | break; |
520 | 520 | |
521 | 521 | case Type::DATETIME: |
522 | - $set[] = $versionColumnName . ' = CURRENT_TIMESTAMP'; |
|
522 | + $set[] = $versionColumnName.' = CURRENT_TIMESTAMP'; |
|
523 | 523 | break; |
524 | 524 | } |
525 | 525 | } |
526 | 526 | |
527 | - $sql = 'UPDATE ' . $quotedTableName |
|
528 | - . ' SET ' . implode(', ', $set) |
|
529 | - . ' WHERE ' . implode(' = ? AND ', $where) . ' = ?'; |
|
527 | + $sql = 'UPDATE '.$quotedTableName |
|
528 | + . ' SET '.implode(', ', $set) |
|
529 | + . ' WHERE '.implode(' = ? AND ', $where).' = ?'; |
|
530 | 530 | |
531 | 531 | $result = $this->conn->executeUpdate($sql, $params, $types); |
532 | 532 | |
@@ -543,7 +543,7 @@ discard block |
||
543 | 543 | protected function deleteJoinTableRecords($identifier) |
544 | 544 | { |
545 | 545 | foreach ($this->class->getDeclaredPropertiesIterator() as $association) { |
546 | - if (! ($association instanceof ManyToManyAssociationMetadata)) { |
|
546 | + if ( ! ($association instanceof ManyToManyAssociationMetadata)) { |
|
547 | 547 | continue; |
548 | 548 | } |
549 | 549 | |
@@ -555,7 +555,7 @@ discard block |
||
555 | 555 | $otherKeys = []; |
556 | 556 | $keys = []; |
557 | 557 | |
558 | - if (! $owningAssociation->isOwningSide()) { |
|
558 | + if ( ! $owningAssociation->isOwningSide()) { |
|
559 | 559 | $class = $this->em->getClassMetadata($association->getTargetEntity()); |
560 | 560 | $owningAssociation = $class->getProperty($association->getMappedBy()); |
561 | 561 | } |
@@ -579,7 +579,7 @@ discard block |
||
579 | 579 | foreach ($joinColumns as $joinColumn) { |
580 | 580 | $keys[] = $this->platform->quoteIdentifier($joinColumn->getColumnName()); |
581 | 581 | |
582 | - if (! $joinColumn->isOnDeleteCascade()) { |
|
582 | + if ( ! $joinColumn->isOnDeleteCascade()) { |
|
583 | 583 | continue; |
584 | 584 | } |
585 | 585 | |
@@ -589,7 +589,7 @@ discard block |
||
589 | 589 | foreach ($otherColumns as $joinColumn) { |
590 | 590 | $otherKeys[] = $this->platform->quoteIdentifier($joinColumn->getColumnName()); |
591 | 591 | |
592 | - if (! $joinColumn->isOnDeleteCascade()) { |
|
592 | + if ( ! $joinColumn->isOnDeleteCascade()) { |
|
593 | 593 | continue; |
594 | 594 | } |
595 | 595 | |
@@ -602,7 +602,7 @@ discard block |
||
602 | 602 | |
603 | 603 | $this->conn->delete($joinTableName, array_combine($keys, $identifier)); |
604 | 604 | |
605 | - if (! $selfReferential) { |
|
605 | + if ( ! $selfReferential) { |
|
606 | 606 | continue; |
607 | 607 | } |
608 | 608 | |
@@ -674,7 +674,7 @@ discard block |
||
674 | 674 | } |
675 | 675 | |
676 | 676 | // Only owning side of x-1 associations can have a FK column. |
677 | - if (! $property instanceof ToOneAssociationMetadata || ! $property->isOwningSide()) { |
|
677 | + if ( ! $property instanceof ToOneAssociationMetadata || ! $property->isOwningSide()) { |
|
678 | 678 | continue; |
679 | 679 | } |
680 | 680 | |
@@ -694,7 +694,7 @@ discard block |
||
694 | 694 | /** @var JoinColumnMetadata $joinColumn */ |
695 | 695 | $referencedColumnName = $joinColumn->getReferencedColumnName(); |
696 | 696 | |
697 | - if (! $joinColumn->getType()) { |
|
697 | + if ( ! $joinColumn->getType()) { |
|
698 | 698 | $joinColumn->setType(PersisterHelper::getTypeOfColumn($referencedColumnName, $targetClass, $this->em)); |
699 | 699 | } |
700 | 700 | |
@@ -722,7 +722,7 @@ discard block |
||
722 | 722 | $propertyName = $this->class->fieldNames[$columnName]; |
723 | 723 | $property = $this->class->getProperty($propertyName); |
724 | 724 | |
725 | - if (! $property) { |
|
725 | + if ( ! $property) { |
|
726 | 726 | return null; |
727 | 727 | } |
728 | 728 | |
@@ -741,7 +741,7 @@ discard block |
||
741 | 741 | /** @var JoinColumnMetadata $joinColumn */ |
742 | 742 | $referencedColumnName = $joinColumn->getReferencedColumnName(); |
743 | 743 | |
744 | - if (! $joinColumn->getType()) { |
|
744 | + if ( ! $joinColumn->getType()) { |
|
745 | 745 | $joinColumn->setType(PersisterHelper::getTypeOfColumn($referencedColumnName, $targetClass, $this->em)); |
746 | 746 | } |
747 | 747 | |
@@ -846,7 +846,7 @@ discard block |
||
846 | 846 | $sourceKeyColumn = $joinColumn->getReferencedColumnName(); |
847 | 847 | $targetKeyColumn = $joinColumn->getColumnName(); |
848 | 848 | |
849 | - if (! isset($sourceClass->fieldNames[$sourceKeyColumn])) { |
|
849 | + if ( ! isset($sourceClass->fieldNames[$sourceKeyColumn])) { |
|
850 | 850 | throw MappingException::joinColumnMustPointToMappedField( |
851 | 851 | $sourceClass->getClassName(), |
852 | 852 | $sourceKeyColumn |
@@ -1073,7 +1073,7 @@ discard block |
||
1073 | 1073 | $criteria = []; |
1074 | 1074 | $parameters = []; |
1075 | 1075 | |
1076 | - if (! $association->isOwningSide()) { |
|
1076 | + if ( ! $association->isOwningSide()) { |
|
1077 | 1077 | $class = $this->em->getClassMetadata($association->getTargetEntity()); |
1078 | 1078 | $owningAssoc = $class->getProperty($association->getMappedBy()); |
1079 | 1079 | } |
@@ -1102,7 +1102,7 @@ discard block |
||
1102 | 1102 | $value = $value[$targetClass->identifier[0]]; |
1103 | 1103 | } |
1104 | 1104 | |
1105 | - $criteria[$joinTableName . '.' . $quotedColumnName] = $value; |
|
1105 | + $criteria[$joinTableName.'.'.$quotedColumnName] = $value; |
|
1106 | 1106 | $parameters[] = [ |
1107 | 1107 | 'value' => $value, |
1108 | 1108 | 'field' => $fieldName, |
@@ -1152,11 +1152,11 @@ discard block |
||
1152 | 1152 | |
1153 | 1153 | switch ($lockMode) { |
1154 | 1154 | case LockMode::PESSIMISTIC_READ: |
1155 | - $lockSql = ' ' . $this->platform->getReadLockSQL(); |
|
1155 | + $lockSql = ' '.$this->platform->getReadLockSQL(); |
|
1156 | 1156 | break; |
1157 | 1157 | |
1158 | 1158 | case LockMode::PESSIMISTIC_WRITE: |
1159 | - $lockSql = ' ' . $this->platform->getWriteLockSQL(); |
|
1159 | + $lockSql = ' '.$this->platform->getWriteLockSQL(); |
|
1160 | 1160 | break; |
1161 | 1161 | } |
1162 | 1162 | |
@@ -1167,14 +1167,14 @@ discard block |
||
1167 | 1167 | |
1168 | 1168 | if ($filterSql !== '') { |
1169 | 1169 | $conditionSql = $conditionSql |
1170 | - ? $conditionSql . ' AND ' . $filterSql |
|
1170 | + ? $conditionSql.' AND '.$filterSql |
|
1171 | 1171 | : $filterSql; |
1172 | 1172 | } |
1173 | 1173 | |
1174 | - $select = 'SELECT ' . $columnList; |
|
1175 | - $from = ' FROM ' . $tableName . ' ' . $tableAlias; |
|
1176 | - $join = $this->currentPersisterContext->selectJoinSql . $joinSql; |
|
1177 | - $where = ($conditionSql ? ' WHERE ' . $conditionSql : ''); |
|
1174 | + $select = 'SELECT '.$columnList; |
|
1175 | + $from = ' FROM '.$tableName.' '.$tableAlias; |
|
1176 | + $join = $this->currentPersisterContext->selectJoinSql.$joinSql; |
|
1177 | + $where = ($conditionSql ? ' WHERE '.$conditionSql : ''); |
|
1178 | 1178 | $lock = $this->platform->appendLockHint($from, $lockMode); |
1179 | 1179 | $query = $select |
1180 | 1180 | . $lock |
@@ -1182,7 +1182,7 @@ discard block |
||
1182 | 1182 | . $where |
1183 | 1183 | . $orderBySql; |
1184 | 1184 | |
1185 | - return $this->platform->modifyLimitQuery($query, $limit, $offset) . $lockSql; |
|
1185 | + return $this->platform->modifyLimitQuery($query, $limit, $offset).$lockSql; |
|
1186 | 1186 | } |
1187 | 1187 | |
1188 | 1188 | /** |
@@ -1201,13 +1201,13 @@ discard block |
||
1201 | 1201 | |
1202 | 1202 | if ($filterSql !== '') { |
1203 | 1203 | $conditionSql = $conditionSql |
1204 | - ? $conditionSql . ' AND ' . $filterSql |
|
1204 | + ? $conditionSql.' AND '.$filterSql |
|
1205 | 1205 | : $filterSql; |
1206 | 1206 | } |
1207 | 1207 | |
1208 | 1208 | $sql = 'SELECT COUNT(*) ' |
1209 | - . 'FROM ' . $tableName . ' ' . $tableAlias |
|
1210 | - . (empty($conditionSql) ? '' : ' WHERE ' . $conditionSql); |
|
1209 | + . 'FROM '.$tableName.' '.$tableAlias |
|
1210 | + . (empty($conditionSql) ? '' : ' WHERE '.$conditionSql); |
|
1211 | 1211 | |
1212 | 1212 | return $sql; |
1213 | 1213 | } |
@@ -1224,7 +1224,7 @@ discard block |
||
1224 | 1224 | */ |
1225 | 1225 | final protected function getOrderBySQL(array $orderBy, $baseTableAlias) |
1226 | 1226 | { |
1227 | - if (! $orderBy) { |
|
1227 | + if ( ! $orderBy) { |
|
1228 | 1228 | return ''; |
1229 | 1229 | } |
1230 | 1230 | |
@@ -1233,7 +1233,7 @@ discard block |
||
1233 | 1233 | foreach ($orderBy as $fieldName => $orientation) { |
1234 | 1234 | $orientation = strtoupper(trim($orientation)); |
1235 | 1235 | |
1236 | - if (! in_array($orientation, ['ASC', 'DESC'], true)) { |
|
1236 | + if ( ! in_array($orientation, ['ASC', 'DESC'], true)) { |
|
1237 | 1237 | throw InvalidOrientation::fromClassNameAndField($this->class->getClassName(), $fieldName); |
1238 | 1238 | } |
1239 | 1239 | |
@@ -1243,11 +1243,11 @@ discard block |
||
1243 | 1243 | $tableAlias = $this->getSQLTableAlias($property->getTableName()); |
1244 | 1244 | $columnName = $this->platform->quoteIdentifier($property->getColumnName()); |
1245 | 1245 | |
1246 | - $orderByList[] = $tableAlias . '.' . $columnName . ' ' . $orientation; |
|
1246 | + $orderByList[] = $tableAlias.'.'.$columnName.' '.$orientation; |
|
1247 | 1247 | |
1248 | 1248 | continue; |
1249 | 1249 | } elseif ($property instanceof AssociationMetadata) { |
1250 | - if (! $property->isOwningSide()) { |
|
1250 | + if ( ! $property->isOwningSide()) { |
|
1251 | 1251 | throw InvalidFindByCall::fromInverseSideUsage( |
1252 | 1252 | $this->class->getClassName(), |
1253 | 1253 | $fieldName |
@@ -1263,7 +1263,7 @@ discard block |
||
1263 | 1263 | /** @var JoinColumnMetadata $joinColumn */ |
1264 | 1264 | $quotedColumnName = $this->platform->quoteIdentifier($joinColumn->getColumnName()); |
1265 | 1265 | |
1266 | - $orderByList[] = $tableAlias . '.' . $quotedColumnName . ' ' . $orientation; |
|
1266 | + $orderByList[] = $tableAlias.'.'.$quotedColumnName.' '.$orientation; |
|
1267 | 1267 | } |
1268 | 1268 | |
1269 | 1269 | continue; |
@@ -1272,7 +1272,7 @@ discard block |
||
1272 | 1272 | throw UnrecognizedField::byName($fieldName); |
1273 | 1273 | } |
1274 | 1274 | |
1275 | - return ' ORDER BY ' . implode(', ', $orderByList); |
|
1275 | + return ' ORDER BY '.implode(', ', $orderByList); |
|
1276 | 1276 | } |
1277 | 1277 | |
1278 | 1278 | /** |
@@ -1314,7 +1314,7 @@ discard block |
||
1314 | 1314 | $isAssocToOneInverseSide = $property instanceof ToOneAssociationMetadata && ! $property->isOwningSide(); |
1315 | 1315 | $isAssocFromOneEager = ! $property instanceof ManyToManyAssociationMetadata && $property->getFetchMode() === FetchMode::EAGER; |
1316 | 1316 | |
1317 | - if (! ($isAssocFromOneEager || $isAssocToOneInverseSide)) { |
|
1317 | + if ( ! ($isAssocFromOneEager || $isAssocToOneInverseSide)) { |
|
1318 | 1318 | break; |
1319 | 1319 | } |
1320 | 1320 | |
@@ -1329,7 +1329,7 @@ discard block |
||
1329 | 1329 | break; // now this is why you shouldn't use inheritance |
1330 | 1330 | } |
1331 | 1331 | |
1332 | - $assocAlias = 'e' . ($eagerAliasCounter++); |
|
1332 | + $assocAlias = 'e'.($eagerAliasCounter++); |
|
1333 | 1333 | |
1334 | 1334 | $this->currentPersisterContext->rsm->addJoinedEntityResult($targetEntity, $assocAlias, 'r', $fieldName); |
1335 | 1335 | |
@@ -1357,14 +1357,14 @@ discard block |
||
1357 | 1357 | $this->currentPersisterContext->rsm->addIndexBy($assocAlias, $property->getIndexedBy()); |
1358 | 1358 | } |
1359 | 1359 | |
1360 | - if (! $property->isOwningSide()) { |
|
1360 | + if ( ! $property->isOwningSide()) { |
|
1361 | 1361 | $owningAssociation = $eagerEntity->getProperty($property->getMappedBy()); |
1362 | 1362 | } |
1363 | 1363 | |
1364 | 1364 | $joinTableAlias = $this->getSQLTableAlias($eagerEntity->getTableName(), $assocAlias); |
1365 | 1365 | $joinTableName = $eagerEntity->table->getQuotedQualifiedName($this->platform); |
1366 | 1366 | |
1367 | - $this->currentPersisterContext->selectJoinSql .= ' ' . $this->getJoinSQLForAssociation($property); |
|
1367 | + $this->currentPersisterContext->selectJoinSql .= ' '.$this->getJoinSQLForAssociation($property); |
|
1368 | 1368 | |
1369 | 1369 | $sourceClass = $this->em->getClassMetadata($owningAssociation->getSourceEntity()); |
1370 | 1370 | $targetClass = $this->em->getClassMetadata($owningAssociation->getTargetEntity()); |
@@ -1388,7 +1388,7 @@ discard block |
||
1388 | 1388 | $joinCondition[] = $filterSql; |
1389 | 1389 | } |
1390 | 1390 | |
1391 | - $this->currentPersisterContext->selectJoinSql .= ' ' . $joinTableName . ' ' . $joinTableAlias . ' ON '; |
|
1391 | + $this->currentPersisterContext->selectJoinSql .= ' '.$joinTableName.' '.$joinTableAlias.' ON '; |
|
1392 | 1392 | $this->currentPersisterContext->selectJoinSql .= implode(' AND ', $joinCondition); |
1393 | 1393 | |
1394 | 1394 | break; |
@@ -1410,7 +1410,7 @@ discard block |
||
1410 | 1410 | */ |
1411 | 1411 | protected function getSelectColumnAssociationSQL($field, AssociationMetadata $association, ClassMetadata $class, $alias = 'r') |
1412 | 1412 | { |
1413 | - if (! ($association->isOwningSide() && $association instanceof ToOneAssociationMetadata)) { |
|
1413 | + if ( ! ($association->isOwningSide() && $association instanceof ToOneAssociationMetadata)) { |
|
1414 | 1414 | return ''; |
1415 | 1415 | } |
1416 | 1416 | |
@@ -1425,7 +1425,7 @@ discard block |
||
1425 | 1425 | $referencedColumnName = $joinColumn->getReferencedColumnName(); |
1426 | 1426 | $resultColumnName = $this->getSQLColumnAlias(); |
1427 | 1427 | |
1428 | - if (! $joinColumn->getType()) { |
|
1428 | + if ( ! $joinColumn->getType()) { |
|
1429 | 1429 | $joinColumn->setType(PersisterHelper::getTypeOfColumn($referencedColumnName, $targetClass, $this->em)); |
1430 | 1430 | } |
1431 | 1431 | |
@@ -1455,7 +1455,7 @@ discard block |
||
1455 | 1455 | $owningAssociation = $association; |
1456 | 1456 | $sourceTableAlias = $this->getSQLTableAlias($this->class->getTableName()); |
1457 | 1457 | |
1458 | - if (! $association->isOwningSide()) { |
|
1458 | + if ( ! $association->isOwningSide()) { |
|
1459 | 1459 | $targetEntity = $this->em->getClassMetadata($association->getTargetEntity()); |
1460 | 1460 | $owningAssociation = $targetEntity->getProperty($association->getMappedBy()); |
1461 | 1461 | } |
@@ -1477,7 +1477,7 @@ discard block |
||
1477 | 1477 | ); |
1478 | 1478 | } |
1479 | 1479 | |
1480 | - return ' INNER JOIN ' . $joinTableName . ' ON ' . implode(' AND ', $conditions); |
|
1480 | + return ' INNER JOIN '.$joinTableName.' ON '.implode(' AND ', $conditions); |
|
1481 | 1481 | } |
1482 | 1482 | |
1483 | 1483 | /** |
@@ -1572,7 +1572,7 @@ discard block |
||
1572 | 1572 | $columnName = $joinColumn->getColumnName(); |
1573 | 1573 | $referencedColumnName = $joinColumn->getReferencedColumnName(); |
1574 | 1574 | |
1575 | - if (! $joinColumn->getType()) { |
|
1575 | + if ( ! $joinColumn->getType()) { |
|
1576 | 1576 | $joinColumn->setType(PersisterHelper::getTypeOfColumn($referencedColumnName, $targetClass, $this->em)); |
1577 | 1577 | } |
1578 | 1578 | |
@@ -1611,7 +1611,7 @@ discard block |
||
1611 | 1611 | |
1612 | 1612 | $this->currentPersisterContext->rsm->addFieldResult($alias, $columnAlias, $field, $class->getClassName()); |
1613 | 1613 | |
1614 | - return $property->getType()->convertToPHPValueSQL($sql, $this->platform) . ' AS ' . $columnAlias; |
|
1614 | + return $property->getType()->convertToPHPValueSQL($sql, $this->platform).' AS '.$columnAlias; |
|
1615 | 1615 | } |
1616 | 1616 | |
1617 | 1617 | /** |
@@ -1625,14 +1625,14 @@ discard block |
||
1625 | 1625 | protected function getSQLTableAlias($tableName, $assocName = '') |
1626 | 1626 | { |
1627 | 1627 | if ($tableName) { |
1628 | - $tableName .= '#' . $assocName; |
|
1628 | + $tableName .= '#'.$assocName; |
|
1629 | 1629 | } |
1630 | 1630 | |
1631 | 1631 | if (isset($this->currentPersisterContext->sqlTableAliases[$tableName])) { |
1632 | 1632 | return $this->currentPersisterContext->sqlTableAliases[$tableName]; |
1633 | 1633 | } |
1634 | 1634 | |
1635 | - $tableAlias = 't' . $this->currentPersisterContext->sqlAliasCounter++; |
|
1635 | + $tableAlias = 't'.$this->currentPersisterContext->sqlAliasCounter++; |
|
1636 | 1636 | |
1637 | 1637 | $this->currentPersisterContext->sqlTableAliases[$tableName] = $tableAlias; |
1638 | 1638 | |
@@ -1658,7 +1658,7 @@ discard block |
||
1658 | 1658 | } |
1659 | 1659 | |
1660 | 1660 | $lock = $this->getLockTablesSql($lockMode); |
1661 | - $where = ($conditionSql ? ' WHERE ' . $conditionSql : '') . ' '; |
|
1661 | + $where = ($conditionSql ? ' WHERE '.$conditionSql : '').' '; |
|
1662 | 1662 | $sql = 'SELECT 1 ' |
1663 | 1663 | . $lock |
1664 | 1664 | . $where |
@@ -1681,7 +1681,7 @@ discard block |
||
1681 | 1681 | $tableName = $this->class->table->getQuotedQualifiedName($this->platform); |
1682 | 1682 | |
1683 | 1683 | return $this->platform->appendLockHint( |
1684 | - 'FROM ' . $tableName . ' ' . $this->getSQLTableAlias($this->class->getTableName()), |
|
1684 | + 'FROM '.$tableName.' '.$this->getSQLTableAlias($this->class->getTableName()), |
|
1685 | 1685 | $lockMode |
1686 | 1686 | ); |
1687 | 1687 | } |
@@ -1731,19 +1731,19 @@ discard block |
||
1731 | 1731 | |
1732 | 1732 | if ($comparison !== null) { |
1733 | 1733 | // special case null value handling |
1734 | - if (($comparison === Comparison::EQ || $comparison === Comparison::IS) && $value ===null) { |
|
1735 | - $selectedColumns[] = $column . ' IS NULL'; |
|
1734 | + if (($comparison === Comparison::EQ || $comparison === Comparison::IS) && $value === null) { |
|
1735 | + $selectedColumns[] = $column.' IS NULL'; |
|
1736 | 1736 | |
1737 | 1737 | continue; |
1738 | 1738 | } |
1739 | 1739 | |
1740 | 1740 | if ($comparison === Comparison::NEQ && $value === null) { |
1741 | - $selectedColumns[] = $column . ' IS NOT NULL'; |
|
1741 | + $selectedColumns[] = $column.' IS NOT NULL'; |
|
1742 | 1742 | |
1743 | 1743 | continue; |
1744 | 1744 | } |
1745 | 1745 | |
1746 | - $selectedColumns[] = $column . ' ' . sprintf(self::$comparisonMap[$comparison], $placeholder); |
|
1746 | + $selectedColumns[] = $column.' '.sprintf(self::$comparisonMap[$comparison], $placeholder); |
|
1747 | 1747 | |
1748 | 1748 | continue; |
1749 | 1749 | } |
@@ -1791,7 +1791,7 @@ discard block |
||
1791 | 1791 | $tableAlias = $this->getSQLTableAlias($property->getTableName()); |
1792 | 1792 | $columnName = $this->platform->quoteIdentifier($property->getColumnName()); |
1793 | 1793 | |
1794 | - return [$tableAlias . '.' . $columnName]; |
|
1794 | + return [$tableAlias.'.'.$columnName]; |
|
1795 | 1795 | } |
1796 | 1796 | |
1797 | 1797 | if ($property instanceof AssociationMetadata) { |
@@ -1800,7 +1800,7 @@ discard block |
||
1800 | 1800 | |
1801 | 1801 | // Many-To-Many requires join table check for joinColumn |
1802 | 1802 | if ($owningAssociation instanceof ManyToManyAssociationMetadata) { |
1803 | - if (! $owningAssociation->isOwningSide()) { |
|
1803 | + if ( ! $owningAssociation->isOwningSide()) { |
|
1804 | 1804 | $owningAssociation = $association; |
1805 | 1805 | } |
1806 | 1806 | |
@@ -1814,17 +1814,17 @@ discard block |
||
1814 | 1814 | foreach ($joinColumns as $joinColumn) { |
1815 | 1815 | $quotedColumnName = $this->platform->quoteIdentifier($joinColumn->getColumnName()); |
1816 | 1816 | |
1817 | - $columns[] = $joinTableName . '.' . $quotedColumnName; |
|
1817 | + $columns[] = $joinTableName.'.'.$quotedColumnName; |
|
1818 | 1818 | } |
1819 | 1819 | } else { |
1820 | - if (! $owningAssociation->isOwningSide()) { |
|
1820 | + if ( ! $owningAssociation->isOwningSide()) { |
|
1821 | 1821 | throw InvalidFindByCall::fromInverseSideUsage( |
1822 | 1822 | $this->class->getClassName(), |
1823 | 1823 | $field |
1824 | 1824 | ); |
1825 | 1825 | } |
1826 | 1826 | |
1827 | - $class = $this->class->isInheritedProperty($field) |
|
1827 | + $class = $this->class->isInheritedProperty($field) |
|
1828 | 1828 | ? $owningAssociation->getDeclaringClass() |
1829 | 1829 | : $this->class |
1830 | 1830 | ; |
@@ -1833,7 +1833,7 @@ discard block |
||
1833 | 1833 | foreach ($owningAssociation->getJoinColumns() as $joinColumn) { |
1834 | 1834 | $quotedColumnName = $this->platform->quoteIdentifier($joinColumn->getColumnName()); |
1835 | 1835 | |
1836 | - $columns[] = $tableAlias . '.' . $quotedColumnName; |
|
1836 | + $columns[] = $tableAlias.'.'.$quotedColumnName; |
|
1837 | 1837 | } |
1838 | 1838 | } |
1839 | 1839 | |
@@ -1942,7 +1942,7 @@ discard block |
||
1942 | 1942 | $value = $value[$targetClass->identifier[0]]; |
1943 | 1943 | } |
1944 | 1944 | |
1945 | - $criteria[$tableAlias . '.' . $quotedColumnName] = $value; |
|
1945 | + $criteria[$tableAlias.'.'.$quotedColumnName] = $value; |
|
1946 | 1946 | $parameters[] = [ |
1947 | 1947 | 'value' => $value, |
1948 | 1948 | 'field' => $fieldName, |
@@ -2027,7 +2027,7 @@ discard block |
||
2027 | 2027 | case ($property instanceof AssociationMetadata): |
2028 | 2028 | $class = $this->em->getClassMetadata($property->getTargetEntity()); |
2029 | 2029 | |
2030 | - if (! $property->isOwningSide()) { |
|
2030 | + if ( ! $property->isOwningSide()) { |
|
2031 | 2031 | $property = $class->getProperty($property->getMappedBy()); |
2032 | 2032 | $class = $this->em->getClassMetadata($property->getTargetEntity()); |
2033 | 2033 | } |
@@ -2041,7 +2041,7 @@ discard block |
||
2041 | 2041 | /** @var JoinColumnMetadata $joinColumn */ |
2042 | 2042 | $referencedColumnName = $joinColumn->getReferencedColumnName(); |
2043 | 2043 | |
2044 | - if (! $joinColumn->getType()) { |
|
2044 | + if ( ! $joinColumn->getType()) { |
|
2045 | 2045 | $joinColumn->setType(PersisterHelper::getTypeOfColumn($referencedColumnName, $class, $this->em)); |
2046 | 2046 | } |
2047 | 2047 | |
@@ -2056,7 +2056,7 @@ discard block |
||
2056 | 2056 | } |
2057 | 2057 | |
2058 | 2058 | if (is_array($value)) { |
2059 | - return array_map(function ($type) { |
|
2059 | + return array_map(function($type) { |
|
2060 | 2060 | return $type->getBindingType() + Connection::ARRAY_PARAM_OFFSET; |
2061 | 2061 | }, $types); |
2062 | 2062 | } |
@@ -2113,7 +2113,7 @@ discard block |
||
2113 | 2113 | */ |
2114 | 2114 | private function getIndividualValue($value) |
2115 | 2115 | { |
2116 | - if (! is_object($value) || ! $this->em->getMetadataFactory()->hasMetadataFor(StaticClassNameConverter::getClass($value))) { |
|
2116 | + if ( ! is_object($value) || ! $this->em->getMetadataFactory()->hasMetadataFor(StaticClassNameConverter::getClass($value))) { |
|
2117 | 2117 | return $value; |
2118 | 2118 | } |
2119 | 2119 | |
@@ -2127,7 +2127,7 @@ discard block |
||
2127 | 2127 | { |
2128 | 2128 | $criteria = $this->getIdentifier($entity); |
2129 | 2129 | |
2130 | - if (! $criteria) { |
|
2130 | + if ( ! $criteria) { |
|
2131 | 2131 | return false; |
2132 | 2132 | } |
2133 | 2133 | |
@@ -2135,12 +2135,12 @@ discard block |
||
2135 | 2135 | |
2136 | 2136 | $sql = 'SELECT 1 ' |
2137 | 2137 | . $this->getLockTablesSql(null) |
2138 | - . ' WHERE ' . $this->getSelectConditionSQL($criteria); |
|
2138 | + . ' WHERE '.$this->getSelectConditionSQL($criteria); |
|
2139 | 2139 | |
2140 | 2140 | list($params, $types) = $this->expandParameters($criteria); |
2141 | 2141 | |
2142 | 2142 | if ($extraConditions !== null) { |
2143 | - $sql .= ' AND ' . $this->getSelectConditionCriteriaSQL($extraConditions); |
|
2143 | + $sql .= ' AND '.$this->getSelectConditionCriteriaSQL($extraConditions); |
|
2144 | 2144 | list($criteriaParams, $criteriaTypes) = $this->expandCriteriaParameters($extraConditions); |
2145 | 2145 | |
2146 | 2146 | $params = array_merge($params, $criteriaParams); |
@@ -2150,7 +2150,7 @@ discard block |
||
2150 | 2150 | $filterSql = $this->generateFilterConditionSQL($this->class, $alias); |
2151 | 2151 | |
2152 | 2152 | if ($filterSql) { |
2153 | - $sql .= ' AND ' . $filterSql; |
|
2153 | + $sql .= ' AND '.$filterSql; |
|
2154 | 2154 | } |
2155 | 2155 | |
2156 | 2156 | return (bool) $this->conn->fetchColumn($sql, $params, 0, $types); |
@@ -2163,13 +2163,13 @@ discard block |
||
2163 | 2163 | */ |
2164 | 2164 | protected function getJoinSQLForAssociation(AssociationMetadata $association) |
2165 | 2165 | { |
2166 | - if (! $association->isOwningSide()) { |
|
2166 | + if ( ! $association->isOwningSide()) { |
|
2167 | 2167 | return 'LEFT JOIN'; |
2168 | 2168 | } |
2169 | 2169 | |
2170 | 2170 | // if one of the join columns is nullable, return left join |
2171 | 2171 | foreach ($association->getJoinColumns() as $joinColumn) { |
2172 | - if (! $joinColumn->isNullable()) { |
|
2172 | + if ( ! $joinColumn->isNullable()) { |
|
2173 | 2173 | continue; |
2174 | 2174 | } |
2175 | 2175 | |
@@ -2186,7 +2186,7 @@ discard block |
||
2186 | 2186 | */ |
2187 | 2187 | public function getSQLColumnAlias() |
2188 | 2188 | { |
2189 | - return $this->platform->getSQLResultCasing('c' . $this->currentPersisterContext->sqlAliasCounter++); |
|
2189 | + return $this->platform->getSQLResultCasing('c'.$this->currentPersisterContext->sqlAliasCounter++); |
|
2190 | 2190 | } |
2191 | 2191 | |
2192 | 2192 | /** |
@@ -2208,12 +2208,12 @@ discard block |
||
2208 | 2208 | continue; |
2209 | 2209 | } |
2210 | 2210 | |
2211 | - $filterClauses[] = '(' . $filterExpr . ')'; |
|
2211 | + $filterClauses[] = '('.$filterExpr.')'; |
|
2212 | 2212 | } |
2213 | 2213 | |
2214 | 2214 | $sql = implode(' AND ', $filterClauses); |
2215 | 2215 | |
2216 | - return $sql ? '(' . $sql . ')' : ''; // Wrap again to avoid "X or Y and FilterConditionSQL" |
|
2216 | + return $sql ? '('.$sql.')' : ''; // Wrap again to avoid "X or Y and FilterConditionSQL" |
|
2217 | 2217 | } |
2218 | 2218 | |
2219 | 2219 | /** |
@@ -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); |