@@ -61,28 +61,28 @@ discard block |
||
61 | 61 | $fh = fopen($this->file, 'xb+'); |
62 | 62 | |
63 | 63 | if (count($identityMap) === 0) { |
64 | - fwrite($fh, 'Flush Operation [' . $this->context . "] - Empty identity map.\n"); |
|
64 | + fwrite($fh, 'Flush Operation ['.$this->context."] - Empty identity map.\n"); |
|
65 | 65 | |
66 | 66 | return; |
67 | 67 | } |
68 | 68 | |
69 | - fwrite($fh, 'Flush Operation [' . $this->context . "] - Dumping identity map:\n"); |
|
69 | + fwrite($fh, 'Flush Operation ['.$this->context."] - Dumping identity map:\n"); |
|
70 | 70 | |
71 | 71 | foreach ($identityMap as $className => $map) { |
72 | - fwrite($fh, 'Class: ' . $className . "\n"); |
|
72 | + fwrite($fh, 'Class: '.$className."\n"); |
|
73 | 73 | |
74 | 74 | foreach ($map as $entity) { |
75 | - fwrite($fh, ' Entity: ' . $this->getIdString($entity, $uow) . ' ' . spl_object_id($entity) . "\n"); |
|
75 | + fwrite($fh, ' Entity: '.$this->getIdString($entity, $uow).' '.spl_object_id($entity)."\n"); |
|
76 | 76 | fwrite($fh, " Associations:\n"); |
77 | 77 | |
78 | 78 | $cm = $em->getClassMetadata($className); |
79 | 79 | |
80 | 80 | foreach ($cm->getDeclaredPropertiesIterator() as $field => $association) { |
81 | - if (! ($association instanceof AssociationMetadata)) { |
|
81 | + if ( ! ($association instanceof AssociationMetadata)) { |
|
82 | 82 | continue; |
83 | 83 | } |
84 | 84 | |
85 | - fwrite($fh, ' ' . $field . ' '); |
|
85 | + fwrite($fh, ' '.$field.' '); |
|
86 | 86 | |
87 | 87 | $value = $association->getValue($entity); |
88 | 88 | |
@@ -97,21 +97,21 @@ discard block |
||
97 | 97 | fwrite($fh, '[PROXY] '); |
98 | 98 | } |
99 | 99 | |
100 | - fwrite($fh, $this->getIdString($value, $uow) . ' ' . spl_object_id($value) . "\n"); |
|
100 | + fwrite($fh, $this->getIdString($value, $uow).' '.spl_object_id($value)."\n"); |
|
101 | 101 | } else { |
102 | 102 | $initialized = ! ($value instanceof PersistentCollection) || $value->isInitialized(); |
103 | 103 | |
104 | 104 | if ($initialized) { |
105 | - fwrite($fh, '[INITIALIZED] ' . $this->getType($value) . ' ' . count($value) . " elements\n"); |
|
105 | + fwrite($fh, '[INITIALIZED] '.$this->getType($value).' '.count($value)." elements\n"); |
|
106 | 106 | |
107 | 107 | foreach ($value as $obj) { |
108 | - fwrite($fh, ' ' . $this->getIdString($obj, $uow) . ' ' . spl_object_id($obj) . "\n"); |
|
108 | + fwrite($fh, ' '.$this->getIdString($obj, $uow).' '.spl_object_id($obj)."\n"); |
|
109 | 109 | } |
110 | 110 | } else { |
111 | - fwrite($fh, '[PROXY] ' . $this->getType($value) . " unknown element size\n"); |
|
111 | + fwrite($fh, '[PROXY] '.$this->getType($value)." unknown element size\n"); |
|
112 | 112 | |
113 | 113 | foreach ($value->unwrap() as $obj) { |
114 | - fwrite($fh, ' ' . $this->getIdString($obj, $uow) . ' ' . spl_object_id($obj) . "\n"); |
|
114 | + fwrite($fh, ' '.$this->getIdString($obj, $uow).' '.spl_object_id($obj)."\n"); |
|
115 | 115 | } |
116 | 116 | } |
117 | 117 | } |
@@ -150,7 +150,7 @@ discard block |
||
150 | 150 | $idstring = ''; |
151 | 151 | |
152 | 152 | foreach ($ids as $k => $v) { |
153 | - $idstring .= $k . '=' . $v; |
|
153 | + $idstring .= $k.'='.$v; |
|
154 | 154 | } |
155 | 155 | } else { |
156 | 156 | $idstring = 'NEWOBJECT '; |
@@ -79,7 +79,7 @@ discard block |
||
79 | 79 | $ce = []; |
80 | 80 | |
81 | 81 | foreach ($class->getDeclaredPropertiesIterator() as $fieldName => $association) { |
82 | - if (! ($association instanceof AssociationMetadata)) { |
|
82 | + if ( ! ($association instanceof AssociationMetadata)) { |
|
83 | 83 | continue; |
84 | 84 | } |
85 | 85 | |
@@ -87,7 +87,7 @@ discard block |
||
87 | 87 | } |
88 | 88 | |
89 | 89 | foreach ($class->getSubClasses() as $subClass) { |
90 | - if (! in_array($class->getClassName(), class_parents($subClass), true)) { |
|
90 | + if ( ! in_array($class->getClassName(), class_parents($subClass), true)) { |
|
91 | 91 | $message = "According to the discriminator map class, '%s' has to be a child of '%s', but these entities are not related through inheritance."; |
92 | 92 | |
93 | 93 | $ce[] = sprintf($message, $subClass, $class->getClassName()); |
@@ -106,7 +106,7 @@ discard block |
||
106 | 106 | $fieldName = $association->getName(); |
107 | 107 | $targetEntity = $association->getTargetEntity(); |
108 | 108 | |
109 | - if (! class_exists($targetEntity) || $metadataFactory->isTransient($targetEntity)) { |
|
109 | + if ( ! class_exists($targetEntity) || $metadataFactory->isTransient($targetEntity)) { |
|
110 | 110 | $message = "The target entity '%s' specified on %s#%s is unknown or not an entity."; |
111 | 111 | |
112 | 112 | return [sprintf($message, $targetEntity, $class->getClassName(), $fieldName)]; |
@@ -125,7 +125,7 @@ discard block |
||
125 | 125 | |
126 | 126 | /** @var ClassMetadata $targetMetadata */ |
127 | 127 | $targetMetadata = $metadataFactory->getMetadataFor($targetEntity); |
128 | - $containsForeignId = array_filter($targetMetadata->identifier, function ($identifier) use ($targetMetadata) { |
|
128 | + $containsForeignId = array_filter($targetMetadata->identifier, function($identifier) use ($targetMetadata) { |
|
129 | 129 | $targetProperty = $targetMetadata->getProperty($identifier); |
130 | 130 | |
131 | 131 | return $targetProperty instanceof AssociationMetadata; |
@@ -141,7 +141,7 @@ discard block |
||
141 | 141 | /** @var AssociationMetadata $targetAssociation */ |
142 | 142 | $targetAssociation = $targetMetadata->getProperty($mappedBy); |
143 | 143 | |
144 | - if (! $targetAssociation) { |
|
144 | + if ( ! $targetAssociation) { |
|
145 | 145 | $message = 'The association %s#%s refers to the owning side property %s#%s which does not exist.'; |
146 | 146 | |
147 | 147 | $ce[] = sprintf($message, $class->getClassName(), $fieldName, $targetEntity, $mappedBy); |
@@ -165,7 +165,7 @@ discard block |
||
165 | 165 | /** @var AssociationMetadata $targetAssociation */ |
166 | 166 | $targetAssociation = $targetMetadata->getProperty($inversedBy); |
167 | 167 | |
168 | - if (! $targetAssociation) { |
|
168 | + if ( ! $targetAssociation) { |
|
169 | 169 | $message = 'The association %s#%s refers to the inverse side property %s#%s which does not exist.'; |
170 | 170 | |
171 | 171 | $ce[] = sprintf($message, $class->getClassName(), $fieldName, $targetEntity, $inversedBy); |
@@ -209,7 +209,7 @@ discard block |
||
209 | 209 | $joinTable = $association->getJoinTable(); |
210 | 210 | |
211 | 211 | foreach ($joinTable->getJoinColumns() as $joinColumn) { |
212 | - if (! in_array($joinColumn->getReferencedColumnName(), $classIdentifierColumns, true)) { |
|
212 | + if ( ! in_array($joinColumn->getReferencedColumnName(), $classIdentifierColumns, true)) { |
|
213 | 213 | $message = "The referenced column name '%s' has to be a primary key column on the target entity class '%s'."; |
214 | 214 | |
215 | 215 | $ce[] = sprintf($message, $joinColumn->getReferencedColumnName(), $class->getClassName()); |
@@ -218,7 +218,7 @@ discard block |
||
218 | 218 | } |
219 | 219 | |
220 | 220 | foreach ($joinTable->getInverseJoinColumns() as $inverseJoinColumn) { |
221 | - if (! in_array($inverseJoinColumn->getReferencedColumnName(), $targetIdentifierColumns, true)) { |
|
221 | + if ( ! in_array($inverseJoinColumn->getReferencedColumnName(), $targetIdentifierColumns, true)) { |
|
222 | 222 | $message = "The referenced column name '%s' has to be a primary key column on the target entity class '%s'."; |
223 | 223 | |
224 | 224 | $ce[] = sprintf($message, $inverseJoinColumn->getReferencedColumnName(), $targetMetadata->getClassName()); |
@@ -228,7 +228,7 @@ discard block |
||
228 | 228 | |
229 | 229 | if (count($targetIdentifierColumns) !== count($joinTable->getInverseJoinColumns())) { |
230 | 230 | $columnNames = array_map( |
231 | - function (JoinColumnMetadata $joinColumn) { |
|
231 | + function(JoinColumnMetadata $joinColumn) { |
|
232 | 232 | return $joinColumn->getReferencedColumnName(); |
233 | 233 | }, |
234 | 234 | $joinTable->getInverseJoinColumns() |
@@ -243,7 +243,7 @@ discard block |
||
243 | 243 | |
244 | 244 | if (count($classIdentifierColumns) !== count($joinTable->getJoinColumns())) { |
245 | 245 | $columnNames = array_map( |
246 | - function (JoinColumnMetadata $joinColumn) { |
|
246 | + function(JoinColumnMetadata $joinColumn) { |
|
247 | 247 | return $joinColumn->getReferencedColumnName(); |
248 | 248 | }, |
249 | 249 | $joinTable->getJoinColumns() |
@@ -260,7 +260,7 @@ discard block |
||
260 | 260 | $joinColumns = $association->getJoinColumns(); |
261 | 261 | |
262 | 262 | foreach ($joinColumns as $joinColumn) { |
263 | - if (! in_array($joinColumn->getReferencedColumnName(), $identifierColumns, true)) { |
|
263 | + if ( ! in_array($joinColumn->getReferencedColumnName(), $identifierColumns, true)) { |
|
264 | 264 | $message = "The referenced column name '%s' has to be a primary key column on the target entity class '%s'."; |
265 | 265 | |
266 | 266 | $ce[] = sprintf($message, $joinColumn->getReferencedColumnName(), $targetMetadata->getClassName()); |
@@ -291,7 +291,7 @@ discard block |
||
291 | 291 | continue; |
292 | 292 | } |
293 | 293 | |
294 | - if (! ($targetProperty instanceof AssociationMetadata)) { |
|
294 | + if ( ! ($targetProperty instanceof AssociationMetadata)) { |
|
295 | 295 | $message = "The association %s#%s is ordered by a property '%s' that is non-existing field on the target entity '%s'."; |
296 | 296 | |
297 | 297 | $ce[] = sprintf($message, $class->getClassName(), $fieldName, $orderField, $targetMetadata->getClassName()); |
@@ -56,7 +56,7 @@ |
||
56 | 56 | $metadata = $it->current(); |
57 | 57 | |
58 | 58 | foreach ($this->filter as $filter) { |
59 | - $pregResult = preg_match('/' . $filter . '/', $metadata->getClassName()); |
|
59 | + $pregResult = preg_match('/'.$filter.'/', $metadata->getClassName()); |
|
60 | 60 | |
61 | 61 | if ($pregResult === false) { |
62 | 62 | throw new \RuntimeException( |
@@ -221,7 +221,7 @@ discard block |
||
221 | 221 | /** @var Query $countQuery */ |
222 | 222 | $countQuery = $this->cloneQuery($this->query); |
223 | 223 | |
224 | - if (! $countQuery->hasHint(CountWalker::HINT_DISTINCT)) { |
|
224 | + if ( ! $countQuery->hasHint(CountWalker::HINT_DISTINCT)) { |
|
225 | 225 | $countQuery->setHint(CountWalker::HINT_DISTINCT, true); |
226 | 226 | } |
227 | 227 | |
@@ -248,7 +248,7 @@ discard block |
||
248 | 248 | foreach ($parameters as $key => $parameter) { |
249 | 249 | $parameterName = $parameter->getName(); |
250 | 250 | |
251 | - if (! (isset($parameterMappings[$parameterName]) || array_key_exists($parameterName, $parameterMappings))) { |
|
251 | + if ( ! (isset($parameterMappings[$parameterName]) || array_key_exists($parameterName, $parameterMappings))) { |
|
252 | 252 | unset($parameters[$key]); |
253 | 253 | } |
254 | 254 | } |
@@ -28,9 +28,9 @@ |
||
28 | 28 | */ |
29 | 29 | public function getSql(SqlWalker $sqlWalker) |
30 | 30 | { |
31 | - return 'ROW_NUMBER() OVER(' . trim($sqlWalker->walkOrderByClause( |
|
31 | + return 'ROW_NUMBER() OVER('.trim($sqlWalker->walkOrderByClause( |
|
32 | 32 | $this->orderByClause |
33 | - )) . ')'; |
|
33 | + )).')'; |
|
34 | 34 | } |
35 | 35 | |
36 | 36 | /** |
@@ -53,7 +53,7 @@ discard block |
||
53 | 53 | |
54 | 54 | if ($property instanceof AssociationMetadata) { |
55 | 55 | throw new \RuntimeException( |
56 | - 'Paginating an entity with foreign key as identifier only works when using the Output Walkers. ' . |
|
56 | + 'Paginating an entity with foreign key as identifier only works when using the Output Walkers. '. |
|
57 | 57 | 'Call Paginator#setUseOutputWalkers(true) before iterating the paginator.' |
58 | 58 | ); |
59 | 59 | } |
@@ -71,7 +71,7 @@ discard block |
||
71 | 71 | $AST->selectClause->selectExpressions = [new SelectExpression($pathExpression, '_dctrn_id')]; |
72 | 72 | $AST->selectClause->isDistinct = true; |
73 | 73 | |
74 | - if (! isset($AST->orderByClause)) { |
|
74 | + if ( ! isset($AST->orderByClause)) { |
|
75 | 75 | return; |
76 | 76 | } |
77 | 77 | |
@@ -79,7 +79,7 @@ discard block |
||
79 | 79 | if ($item->expression instanceof PathExpression) { |
80 | 80 | $AST->selectClause->selectExpressions[] = new SelectExpression( |
81 | 81 | $this->createSelectExpressionItem($item->expression), |
82 | - '_dctrn_ord' . $this->aliasCounter++ |
|
82 | + '_dctrn_ord'.$this->aliasCounter++ |
|
83 | 83 | ); |
84 | 84 | |
85 | 85 | continue; |
@@ -191,13 +191,13 @@ discard block |
||
191 | 191 | |
192 | 192 | $innerSql = $this->getInnerSQL($AST); |
193 | 193 | $sqlIdentifier = $this->getSQLIdentifier($AST); |
194 | - $sqlAliasIdentifier = array_map(function ($info) { |
|
194 | + $sqlAliasIdentifier = array_map(function($info) { |
|
195 | 195 | return $info['alias']; |
196 | 196 | }, $sqlIdentifier); |
197 | 197 | |
198 | 198 | if ($hasOrderBy) { |
199 | - $orderGroupBy = ' GROUP BY ' . implode(', ', $sqlAliasIdentifier); |
|
200 | - $sqlPiece = 'MIN(' . $this->walkResultVariable('dctrn_rownum') . ') AS dctrn_minrownum'; |
|
199 | + $orderGroupBy = ' GROUP BY '.implode(', ', $sqlAliasIdentifier); |
|
200 | + $sqlPiece = 'MIN('.$this->walkResultVariable('dctrn_rownum').') AS dctrn_minrownum'; |
|
201 | 201 | |
202 | 202 | $sqlAliasIdentifier[] = $sqlPiece; |
203 | 203 | $sqlIdentifier[] = [ |
@@ -210,7 +210,7 @@ discard block |
||
210 | 210 | $sql = sprintf('SELECT DISTINCT %s FROM (%s) dctrn_result', implode(', ', $sqlAliasIdentifier), $innerSql); |
211 | 211 | |
212 | 212 | if ($hasOrderBy) { |
213 | - $sql .= $orderGroupBy . $outerOrderBy; |
|
213 | + $sql .= $orderGroupBy.$outerOrderBy; |
|
214 | 214 | } |
215 | 215 | |
216 | 216 | // Apply the limit and offset. |
@@ -254,7 +254,7 @@ discard block |
||
254 | 254 | |
255 | 255 | $innerSql = $this->getInnerSQL($AST); |
256 | 256 | $sqlIdentifier = $this->getSQLIdentifier($AST); |
257 | - $sqlAliasIdentifier = array_map(function ($info) { |
|
257 | + $sqlAliasIdentifier = array_map(function($info) { |
|
258 | 258 | return $info['alias']; |
259 | 259 | }, $sqlIdentifier); |
260 | 260 | |
@@ -312,7 +312,7 @@ discard block |
||
312 | 312 | $idVar = $pathExpression->identificationVariable; |
313 | 313 | $field = $pathExpression->field; |
314 | 314 | |
315 | - if (! isset($selects[$idVar])) { |
|
315 | + if ( ! isset($selects[$idVar])) { |
|
316 | 316 | $selects[$idVar] = []; |
317 | 317 | } |
318 | 318 | |
@@ -325,7 +325,7 @@ discard block |
||
325 | 325 | if ($selectExpression instanceof SelectExpression) { |
326 | 326 | $idVar = $selectExpression->expression; |
327 | 327 | |
328 | - if (! is_string($idVar)) { |
|
328 | + if ( ! is_string($idVar)) { |
|
329 | 329 | continue; |
330 | 330 | } |
331 | 331 | |
@@ -360,7 +360,7 @@ discard block |
||
360 | 360 | ?OrderByClause $orderByClause |
361 | 361 | ) : string { |
362 | 362 | // If the sql statement has an order by clause, we need to wrap it in a new select distinct statement |
363 | - if (! $orderByClause) { |
|
363 | + if ( ! $orderByClause) { |
|
364 | 364 | return $sql; |
365 | 365 | } |
366 | 366 | |
@@ -398,7 +398,7 @@ discard block |
||
398 | 398 | $orderByItems[] = $orderByItemString; |
399 | 399 | $identifier = substr($orderByItemString, 0, strrpos($orderByItemString, ' ')); |
400 | 400 | |
401 | - if (! in_array($identifier, $identifiers, true)) { |
|
401 | + if ( ! in_array($identifier, $identifiers, true)) { |
|
402 | 402 | $identifiers[] = $identifier; |
403 | 403 | } |
404 | 404 | } |
@@ -551,7 +551,7 @@ discard block |
||
551 | 551 | */ |
552 | 552 | public function walkPathExpression($pathExpr) |
553 | 553 | { |
554 | - if (! $this->inSubSelect && ! $this->platformSupportsRowNumber() && ! in_array($pathExpr, $this->orderByPathExpressions, true)) { |
|
554 | + if ( ! $this->inSubSelect && ! $this->platformSupportsRowNumber() && ! in_array($pathExpr, $this->orderByPathExpressions, true)) { |
|
555 | 555 | $this->orderByPathExpressions[] = $pathExpr; |
556 | 556 | } |
557 | 557 |
@@ -89,7 +89,7 @@ |
||
89 | 89 | [$pathExpression] |
90 | 90 | ); |
91 | 91 | $expression = new InExpression($arithmeticExpression); |
92 | - $expression->literals[] = new InputParameter(':' . self::PAGINATOR_ID_ALIAS); |
|
92 | + $expression->literals[] = new InputParameter(':'.self::PAGINATOR_ID_ALIAS); |
|
93 | 93 | } else { |
94 | 94 | $expression = new NullComparisonExpression($pathExpression); |
95 | 95 | $expression->not = false; |
@@ -42,7 +42,7 @@ |
||
42 | 42 | /** @var ClassMetadata $metadata */ |
43 | 43 | $metadata = $event->getClassMetadata(); |
44 | 44 | |
45 | - if (! isset($this->entityListeners[$metadata->getClassName()])) { |
|
45 | + if ( ! isset($this->entityListeners[$metadata->getClassName()])) { |
|
46 | 46 | return; |
47 | 47 | } |
48 | 48 |