@@ -299,7 +299,7 @@ discard block |
||
| 299 | 299 | */ |
| 300 | 300 | public function loadRelations($entity, $relations) |
| 301 | 301 | { |
| 302 | - foreach (Relation::sanitizeRelations((array)$relations) as $relationName => $meta) { |
|
| 302 | + foreach (Relation::sanitizeRelations((array) $relations) as $relationName => $meta) { |
|
| 303 | 303 | $this->relation($relationName)->loadIfNotLoaded( |
| 304 | 304 | new SingleEntityIndexer($this->mapper, $entity), |
| 305 | 305 | $meta['relations'], |
@@ -320,7 +320,7 @@ discard block |
||
| 320 | 320 | */ |
| 321 | 321 | public function reloadRelations($entity, $relations) |
| 322 | 322 | { |
| 323 | - foreach (Relation::sanitizeRelations((array)$relations) as $relationName => $meta) { |
|
| 323 | + foreach (Relation::sanitizeRelations((array) $relations) as $relationName => $meta) { |
|
| 324 | 324 | $this->relation($relationName)->load( |
| 325 | 325 | new SingleEntityIndexer($this->mapper, $entity), |
| 326 | 326 | $meta['relations'], |
@@ -364,12 +364,12 @@ discard block |
||
| 364 | 364 | */ |
| 365 | 365 | public function saveAll($entity, $relations) |
| 366 | 366 | { |
| 367 | - $relations = Relation::sanitizeRelations((array)$relations); |
|
| 367 | + $relations = Relation::sanitizeRelations((array) $relations); |
|
| 368 | 368 | |
| 369 | 369 | return $this->transaction(function() use($entity, $relations) { |
| 370 | 370 | $nb = $this->save($entity); |
| 371 | 371 | |
| 372 | - foreach ((array)$relations as $relationName => $info) { |
|
| 372 | + foreach ((array) $relations as $relationName => $info) { |
|
| 373 | 373 | $nb += $this->relation($relationName)->saveAll($entity, $info['relations']); |
| 374 | 374 | } |
| 375 | 375 | |
@@ -387,12 +387,12 @@ discard block |
||
| 387 | 387 | */ |
| 388 | 388 | public function deleteAll($entity, $relations) |
| 389 | 389 | { |
| 390 | - $relations = Relation::sanitizeRelations((array)$relations); |
|
| 390 | + $relations = Relation::sanitizeRelations((array) $relations); |
|
| 391 | 391 | |
| 392 | 392 | return $this->transaction(function() use($entity, $relations) { |
| 393 | 393 | $nb = $this->delete($entity); |
| 394 | 394 | |
| 395 | - foreach ((array)$relations as $relationName => $info) { |
|
| 395 | + foreach ((array) $relations as $relationName => $info) { |
|
| 396 | 396 | $nb += $this->relation($relationName)->deleteAll($entity, $info['relations']); |
| 397 | 397 | } |
| 398 | 398 | |
@@ -186,7 +186,7 @@ |
||
| 186 | 186 | $this->statements['offset'] = null; |
| 187 | 187 | $this->statements['aggregate'] = ['count', $columns ?: '*']; |
| 188 | 188 | |
| 189 | - $count = (int)$this->execute()[0]['aggregate']; |
|
| 189 | + $count = (int) $this->execute()[0]['aggregate']; |
|
| 190 | 190 | |
| 191 | 191 | $this->compilerState->invalidate(); |
| 192 | 192 | $this->statements = $statements; |
@@ -126,7 +126,7 @@ discard block |
||
| 126 | 126 | return $entity; |
| 127 | 127 | } |
| 128 | 128 | |
| 129 | - throw new EntityNotFoundException('Cannot resolve entity identifier "'.implode('", "', (array)$id).'"'); |
|
| 129 | + throw new EntityNotFoundException('Cannot resolve entity identifier "'.implode('", "', (array) $id).'"'); |
|
| 130 | 130 | } |
| 131 | 131 | |
| 132 | 132 | /** |
@@ -172,7 +172,7 @@ discard block |
||
| 172 | 172 | */ |
| 173 | 173 | public function with(ReadCommandInterface $query, $relations) |
| 174 | 174 | { |
| 175 | - $this->withRelations = Relation::sanitizeRelations((array)$relations); |
|
| 175 | + $this->withRelations = Relation::sanitizeRelations((array) $relations); |
|
| 176 | 176 | |
| 177 | 177 | return $query; |
| 178 | 178 | } |
@@ -187,7 +187,7 @@ discard block |
||
| 187 | 187 | */ |
| 188 | 188 | public function without(ReadCommandInterface $query, $relations) |
| 189 | 189 | { |
| 190 | - $this->withoutRelations = Relation::sanitizeWithoutRelations((array)$relations); |
|
| 190 | + $this->withoutRelations = Relation::sanitizeWithoutRelations((array) $relations); |
|
| 191 | 191 | |
| 192 | 192 | return $query; |
| 193 | 193 | } |
@@ -285,7 +285,7 @@ discard block |
||
| 285 | 285 | $scopes = $this->repository->scopes(); |
| 286 | 286 | |
| 287 | 287 | if (!isset($scopes[$name])) { |
| 288 | - throw new BadMethodCallException('Method "' . get_class($this->repository) . '::' . $name . '" not found'); |
|
| 288 | + throw new BadMethodCallException('Method "'.get_class($this->repository).'::'.$name.'" not found'); |
|
| 289 | 289 | } |
| 290 | 290 | |
| 291 | 291 | return $scopes[$name](...$arguments); |
@@ -126,7 +126,7 @@ |
||
| 126 | 126 | $this->buildRaw($statement, $value, $glue); |
| 127 | 127 | } else { |
| 128 | 128 | // Column with operator |
| 129 | - $key = explode(' ', trim($key), 2); |
|
| 129 | + $key = explode(' ', trim($key), 2); |
|
| 130 | 130 | $parts[] = [ |
| 131 | 131 | 'column' => $key[0], |
| 132 | 132 | 'operator' => isset($key[1]) ? $key[1] : '=', |
@@ -33,7 +33,7 @@ |
||
| 33 | 33 | */ |
| 34 | 34 | public function __toString() |
| 35 | 35 | {
|
| 36 | - return (string)$this->value; |
|
| 36 | + return (string) $this->value; |
|
| 37 | 37 | } |
| 38 | 38 | |
| 39 | 39 | /** |
@@ -57,7 +57,7 @@ |
||
| 57 | 57 | |
| 58 | 58 | //TODO quand doit on unset l'index '0' ? |
| 59 | 59 | |
| 60 | - foreach ((array)$parts as $part) { |
|
| 60 | + foreach ((array) $parts as $part) { |
|
| 61 | 61 | unset($this->bindings[$part]); |
| 62 | 62 | unset($this->compiledParts[$part]); |
| 63 | 63 | } |
@@ -398,7 +398,7 @@ |
||
| 398 | 398 | } |
| 399 | 399 | |
| 400 | 400 | // If we have polymophism, add to alias |
| 401 | - $relation->join($this->query, $alias . (isset($relationName[1]) ? '#' . $relationName[1] : '')); |
|
| 401 | + $relation->join($this->query, $alias.(isset($relationName[1]) ? '#'.$relationName[1] : '')); |
|
| 402 | 402 | $relation->setLocalAlias(null); |
| 403 | 403 | } |
| 404 | 404 | |
@@ -173,7 +173,7 @@ discard block |
||
| 173 | 173 | |
| 174 | 174 | return $query->state()->compiled = 'UPDATE ' |
| 175 | 175 | . $this->quoteIdentifier($query, $query->statements['tables'][0]['table']) |
| 176 | - . ' SET ' . implode(', ', $values) |
|
| 176 | + . ' SET '.implode(', ', $values) |
|
| 177 | 177 | . $this->compileWhere($query); |
| 178 | 178 | } |
| 179 | 179 | |
@@ -435,7 +435,7 @@ discard block |
||
| 435 | 435 | if ($from['alias'] === null) { |
| 436 | 436 | $sql[$from['table']] = $this->quoteIdentifier($query, $from['table']); |
| 437 | 437 | } else { |
| 438 | - $sql[$from['alias']] = $this->quoteIdentifier($query, $from['table']) . ' ' . $this->quoteIdentifier($query, $from['alias']); |
|
| 438 | + $sql[$from['alias']] = $this->quoteIdentifier($query, $from['table']).' '.$this->quoteIdentifier($query, $from['alias']); |
|
| 439 | 439 | } |
| 440 | 440 | } |
| 441 | 441 | |
@@ -460,12 +460,12 @@ discard block |
||
| 460 | 460 | |
| 461 | 461 | if ($join['alias'] === null) { |
| 462 | 462 | $sql[$join['table']] = $join['type'] |
| 463 | - . ' JOIN ' . $this->quoteIdentifier($query, $join['table']) |
|
| 464 | - . ' ON ' . $this->compileCompilableClauses($query, $join['on']); |
|
| 463 | + . ' JOIN '.$this->quoteIdentifier($query, $join['table']) |
|
| 464 | + . ' ON '.$this->compileCompilableClauses($query, $join['on']); |
|
| 465 | 465 | } else { |
| 466 | 466 | $sql[$join['alias']] = $join['type'] |
| 467 | - . ' JOIN ' . $this->quoteIdentifier($query, $join['table']).' '.$this->quoteIdentifier($query, $join['alias']) |
|
| 468 | - . ' ON ' . $this->compileCompilableClauses($query, $join['on']); |
|
| 467 | + . ' JOIN '.$this->quoteIdentifier($query, $join['table']).' '.$this->quoteIdentifier($query, $join['alias']) |
|
| 468 | + . ' ON '.$this->compileCompilableClauses($query, $join['on']); |
|
| 469 | 469 | } |
| 470 | 470 | } |
| 471 | 471 | |
@@ -616,7 +616,7 @@ discard block |
||
| 616 | 616 | if (is_array($value)) { |
| 617 | 617 | return $this->compileIntoExpression($query, $value, $column, 'REGEXP', $converted); |
| 618 | 618 | } |
| 619 | - return $this->quoteIdentifier($query, $column).' REGEXP '.$this->compileExpressionValue($query, (string)$value, $converted ? false : null); |
|
| 619 | + return $this->quoteIdentifier($query, $column).' REGEXP '.$this->compileExpressionValue($query, (string) $value, $converted ? false : null); |
|
| 620 | 620 | |
| 621 | 621 | // LIKE |
| 622 | 622 | case ':like': |
@@ -689,7 +689,7 @@ discard block |
||
| 689 | 689 | |
| 690 | 690 | // Unsupported operator |
| 691 | 691 | default: |
| 692 | - throw new UnexpectedValueException("Unsupported operator '" . $operator . "' in WHERE clause"); |
|
| 692 | + throw new UnexpectedValueException("Unsupported operator '".$operator."' in WHERE clause"); |
|
| 693 | 693 | } |
| 694 | 694 | } |
| 695 | 695 | |
@@ -751,7 +751,7 @@ discard block |
||
| 751 | 751 | $sql = '('.$this->compileSelect($query).')'; |
| 752 | 752 | |
| 753 | 753 | if ($alias) { |
| 754 | - $sql = $sql . ' as ' . $this->quoteIdentifier($clause, $alias); |
|
| 754 | + $sql = $sql.' as '.$this->quoteIdentifier($clause, $alias); |
|
| 755 | 755 | } |
| 756 | 756 | |
| 757 | 757 | $this->addQueryBindings($clause, $query); |
@@ -903,12 +903,12 @@ discard block |
||
| 903 | 903 | if ($lock !== null && !$query->statements['aggregate']) { |
| 904 | 904 | // Lock for update |
| 905 | 905 | if ($lock === LockMode::PESSIMISTIC_WRITE) { |
| 906 | - return ' ' . $this->platform()->grammar()->getWriteLockSQL(); |
|
| 906 | + return ' '.$this->platform()->grammar()->getWriteLockSQL(); |
|
| 907 | 907 | } |
| 908 | 908 | |
| 909 | 909 | // Shared Lock: other process can read the row but not update it. |
| 910 | 910 | if ($lock === LockMode::PESSIMISTIC_READ) { |
| 911 | - return ' ' . $this->platform()->grammar()->getReadLockSQL(); |
|
| 911 | + return ' '.$this->platform()->grammar()->getReadLockSQL(); |
|
| 912 | 912 | } |
| 913 | 913 | } |
| 914 | 914 | |
@@ -138,7 +138,7 @@ discard block |
||
| 138 | 138 | */ |
| 139 | 139 | public function ignore($flag = true) |
| 140 | 140 | { |
| 141 | - $this->statements['ignore'] = (bool)$flag; |
|
| 141 | + $this->statements['ignore'] = (bool) $flag; |
|
| 142 | 142 | |
| 143 | 143 | return $this; |
| 144 | 144 | } |
@@ -269,7 +269,7 @@ discard block |
||
| 269 | 269 | $this->statements['offset'] = null; |
| 270 | 270 | $this->statements['aggregate'] = ['pagination', $this->getPaginationColumns($columns)]; |
| 271 | 271 | |
| 272 | - $count = (int)$this->execute()[0]['aggregate']; |
|
| 272 | + $count = (int) $this->execute()[0]['aggregate']; |
|
| 273 | 273 | |
| 274 | 274 | $this->compilerState->invalidate(['columns', 'orders']); |
| 275 | 275 | $this->statements = $statements; |
@@ -313,7 +313,7 @@ discard block |
||
| 313 | 313 | */ |
| 314 | 314 | public function count($column = null) |
| 315 | 315 | { |
| 316 | - return (int)$this->aggregate(__FUNCTION__, $column); |
|
| 316 | + return (int) $this->aggregate(__FUNCTION__, $column); |
|
| 317 | 317 | } |
| 318 | 318 | |
| 319 | 319 | /** |
@@ -321,7 +321,7 @@ discard block |
||
| 321 | 321 | */ |
| 322 | 322 | public function avg($column = null) |
| 323 | 323 | { |
| 324 | - return (float)$this->aggregate(__FUNCTION__, $column); |
|
| 324 | + return (float) $this->aggregate(__FUNCTION__, $column); |
|
| 325 | 325 | } |
| 326 | 326 | |
| 327 | 327 | /** |
@@ -329,7 +329,7 @@ discard block |
||
| 329 | 329 | */ |
| 330 | 330 | public function min($column = null) |
| 331 | 331 | { |
| 332 | - return (float)$this->aggregate(__FUNCTION__, $column); |
|
| 332 | + return (float) $this->aggregate(__FUNCTION__, $column); |
|
| 333 | 333 | } |
| 334 | 334 | |
| 335 | 335 | /** |
@@ -337,7 +337,7 @@ discard block |
||
| 337 | 337 | */ |
| 338 | 338 | public function max($column = null) |
| 339 | 339 | { |
| 340 | - return (float)$this->aggregate(__FUNCTION__, $column); |
|
| 340 | + return (float) $this->aggregate(__FUNCTION__, $column); |
|
| 341 | 341 | } |
| 342 | 342 | |
| 343 | 343 | /** |
@@ -345,7 +345,7 @@ discard block |
||
| 345 | 345 | */ |
| 346 | 346 | public function sum($column = null) |
| 347 | 347 | { |
| 348 | - return (float)$this->aggregate(__FUNCTION__, $column); |
|
| 348 | + return (float) $this->aggregate(__FUNCTION__, $column); |
|
| 349 | 349 | } |
| 350 | 350 | |
| 351 | 351 | /** |
@@ -374,7 +374,7 @@ discard block |
||
| 374 | 374 | { |
| 375 | 375 | $this->compilerState->invalidate('columns'); |
| 376 | 376 | |
| 377 | - $this->statements['distinct'] = (bool)$flag; |
|
| 377 | + $this->statements['distinct'] = (bool) $flag; |
|
| 378 | 378 | |
| 379 | 379 | return $this; |
| 380 | 380 | } |
@@ -559,7 +559,7 @@ discard block |
||
| 559 | 559 | # build a regular expression for each parameter |
| 560 | 560 | foreach ($values as $key => $value) { |
| 561 | 561 | if (is_string($key)) { |
| 562 | - $keys[] = '/:' . $key . '/'; |
|
| 562 | + $keys[] = '/:'.$key.'/'; |
|
| 563 | 563 | } else { |
| 564 | 564 | $keys[] = '/[?]/'; |
| 565 | 565 | } |