@@ -724,13 +724,13 @@ |
||
| 724 | 724 | } |
| 725 | 725 | |
| 726 | 726 | $replacements = array( |
| 727 | - '<description>' => ucfirst($type).' '.$variableName, |
|
| 728 | - '<methodTypeHint>' => $methodTypeHint, |
|
| 729 | - '<variableType>' => $variableType, |
|
| 730 | - '<variableName>' => $variableName, |
|
| 731 | - '<methodName>' => $methodName, |
|
| 732 | - '<fieldName>' => $fieldName, |
|
| 733 | - '<variableDefault>' => ($defaultValue !== null ) ? (' = '.$defaultValue) : '' |
|
| 727 | + '<description>' => ucfirst($type).' '.$variableName, |
|
| 728 | + '<methodTypeHint>' => $methodTypeHint, |
|
| 729 | + '<variableType>' => $variableType, |
|
| 730 | + '<variableName>' => $variableName, |
|
| 731 | + '<methodName>' => $methodName, |
|
| 732 | + '<fieldName>' => $fieldName, |
|
| 733 | + '<variableDefault>' => ($defaultValue !== null ) ? (' = '.$defaultValue) : '' |
|
| 734 | 734 | ); |
| 735 | 735 | |
| 736 | 736 | $method = str_replace( |
@@ -386,7 +386,7 @@ discard block |
||
| 386 | 386 | $body = str_replace('<spaces>', $this->spaces, $body); |
| 387 | 387 | $last = strrpos($currentCode, '}'); |
| 388 | 388 | |
| 389 | - return substr($currentCode, 0, $last) . $body . (strlen($body) > 0 ? "\n" : '') . "}\n"; |
|
| 389 | + return substr($currentCode, 0, $last).$body.(strlen($body) > 0 ? "\n" : '')."}\n"; |
|
| 390 | 390 | } |
| 391 | 391 | |
| 392 | 392 | /** |
@@ -395,7 +395,7 @@ discard block |
||
| 395 | 395 | protected function generateEntityNamespace(): string |
| 396 | 396 | { |
| 397 | 397 | if ($this->hasNamespace($this->mapperInfo->className())) { |
| 398 | - return 'namespace ' . $this->getNamespace($this->mapperInfo->className()) .';' . "\n\n"; |
|
| 398 | + return 'namespace '.$this->getNamespace($this->mapperInfo->className()).';'."\n\n"; |
|
| 399 | 399 | } |
| 400 | 400 | |
| 401 | 401 | return ''; |
@@ -411,18 +411,18 @@ discard block |
||
| 411 | 411 | $use = []; |
| 412 | 412 | |
| 413 | 413 | if (($parentClass = $this->getClassToExtend()) && $this->hasNamespace($parentClass)) { |
| 414 | - $use[$parentClass] = 'use ' . $parentClass . ';'; |
|
| 414 | + $use[$parentClass] = 'use '.$parentClass.';'; |
|
| 415 | 415 | } |
| 416 | 416 | |
| 417 | 417 | foreach ($this->interfaces as $interface) { |
| 418 | 418 | if ($this->hasNamespace($interface)) { |
| 419 | - $use[$interface] = 'use ' . $interface . ';'; |
|
| 419 | + $use[$interface] = 'use '.$interface.';'; |
|
| 420 | 420 | } |
| 421 | 421 | } |
| 422 | 422 | |
| 423 | 423 | foreach ($this->traits as $trait) { |
| 424 | 424 | if ($this->hasNamespace($trait)) { |
| 425 | - $use[$trait] = 'use ' . $trait . ';'; |
|
| 425 | + $use[$trait] = 'use '.$trait.';'; |
|
| 426 | 426 | } |
| 427 | 427 | } |
| 428 | 428 | |
@@ -452,7 +452,7 @@ discard block |
||
| 452 | 452 | |
| 453 | 453 | sort($use); |
| 454 | 454 | |
| 455 | - return implode("\n", $use) . "\n\n"; |
|
| 455 | + return implode("\n", $use)."\n\n"; |
|
| 456 | 456 | } |
| 457 | 457 | |
| 458 | 458 | /** |
@@ -460,9 +460,9 @@ discard block |
||
| 460 | 460 | */ |
| 461 | 461 | protected function generateEntityClassName() |
| 462 | 462 | { |
| 463 | - return 'class ' . $this->getClassName($this->mapperInfo->className()) . |
|
| 464 | - ($this->classToExtend ? ' extends ' . $this->getClassToExtendName() : null) . |
|
| 465 | - ($this->interfaces ? ' implements ' . $this->getInterfacesToImplement() : null); |
|
| 463 | + return 'class '.$this->getClassName($this->mapperInfo->className()). |
|
| 464 | + ($this->classToExtend ? ' extends '.$this->getClassToExtendName() : null). |
|
| 465 | + ($this->interfaces ? ' implements '.$this->getInterfacesToImplement() : null); |
|
| 466 | 466 | } |
| 467 | 467 | |
| 468 | 468 | /** |
@@ -477,10 +477,10 @@ discard block |
||
| 477 | 477 | $traits = ''; |
| 478 | 478 | |
| 479 | 479 | foreach ($this->traits as $trait) { |
| 480 | - $traits .= $this->spaces . 'use ' . $this->getRelativeClassName($trait) . ';' . "\n"; |
|
| 480 | + $traits .= $this->spaces.'use '.$this->getRelativeClassName($trait).';'."\n"; |
|
| 481 | 481 | } |
| 482 | 482 | |
| 483 | - return $traits . "\n"; |
|
| 483 | + return $traits."\n"; |
|
| 484 | 484 | } |
| 485 | 485 | |
| 486 | 486 | /** |
@@ -585,7 +585,7 @@ discard block |
||
| 585 | 585 | { |
| 586 | 586 | $lines = array(); |
| 587 | 587 | $lines[] = '/**'; |
| 588 | - $lines[] = ' * ' . $this->getClassName($this->mapperInfo->className()); |
|
| 588 | + $lines[] = ' * '.$this->getClassName($this->mapperInfo->className()); |
|
| 589 | 589 | $lines[] = ' */'; |
| 590 | 590 | |
| 591 | 591 | return implode("\n", $lines); |
@@ -685,7 +685,7 @@ discard block |
||
| 685 | 685 | |
| 686 | 686 | if (!$property->isRelation()) { |
| 687 | 687 | $lines[] = $this->generateEmbeddedPropertyDocBlock($property); |
| 688 | - $lines[] = $this->spaces . $this->fieldVisibility . $this->getPropertyTypeHintForObject($property) . ' $'.$property->name().";\n"; |
|
| 688 | + $lines[] = $this->spaces.$this->fieldVisibility.$this->getPropertyTypeHintForObject($property).' $'.$property->name().";\n"; |
|
| 689 | 689 | } else { |
| 690 | 690 | $name = $property->name(); |
| 691 | 691 | $default = ''; |
@@ -701,7 +701,7 @@ discard block |
||
| 701 | 701 | } |
| 702 | 702 | |
| 703 | 703 | $lines[] = $this->generateEmbeddedPropertyDocBlock($property); |
| 704 | - $lines[] = $this->spaces . $this->fieldVisibility . $this->getPropertyTypeHintForObject($property) . ' $' . $name . $default .";\n"; |
|
| 704 | + $lines[] = $this->spaces.$this->fieldVisibility.$this->getPropertyTypeHintForObject($property).' $'.$name.$default.";\n"; |
|
| 705 | 705 | } |
| 706 | 706 | } |
| 707 | 707 | |
@@ -729,7 +729,7 @@ discard block |
||
| 729 | 729 | $variableName = $this->inflector->camelize($fieldName); |
| 730 | 730 | $methodName = $variableName; |
| 731 | 731 | } else { |
| 732 | - $methodName = $type . $this->inflector->classify($fieldName); |
|
| 732 | + $methodName = $type.$this->inflector->classify($fieldName); |
|
| 733 | 733 | $variableName = $this->inflector->camelize($fieldName); |
| 734 | 734 | } |
| 735 | 735 | |
@@ -747,7 +747,7 @@ discard block |
||
| 747 | 747 | if ($propertyInfo->isObject()) { |
| 748 | 748 | /** @var ObjectPropertyInfo $propertyInfo */ |
| 749 | 749 | $variableType = $this->getRelativeClassName($propertyInfo->className()); |
| 750 | - $methodTypeHint = $variableType.' '; |
|
| 750 | + $methodTypeHint = $variableType.' '; |
|
| 751 | 751 | } else { |
| 752 | 752 | /** @var PropertyInfo $propertyInfo */ |
| 753 | 753 | $variableType = $propertyInfo->phpType(); |
@@ -778,7 +778,7 @@ discard block |
||
| 778 | 778 | '<variableName>' => $variableName, |
| 779 | 779 | '<methodName>' => $methodName, |
| 780 | 780 | '<fieldName>' => $fieldName, |
| 781 | - '<variableDefault>' => ($defaultValue !== null ) ? (' = '.$defaultValue) : '' |
|
| 781 | + '<variableDefault>' => ($defaultValue !== null) ? (' = '.$defaultValue) : '' |
|
| 782 | 782 | ); |
| 783 | 783 | |
| 784 | 784 | $method = str_replace( |
@@ -854,9 +854,9 @@ discard block |
||
| 854 | 854 | protected function generateFieldMappingPropertyDocBlock($property) |
| 855 | 855 | { |
| 856 | 856 | $lines = array(); |
| 857 | - $lines[] = $this->spaces . '/**'; |
|
| 858 | - $lines[] = $this->spaces . ' * @var '.$property->phpType(); |
|
| 859 | - $lines[] = $this->spaces . ' */'; |
|
| 857 | + $lines[] = $this->spaces.'/**'; |
|
| 858 | + $lines[] = $this->spaces.' * @var '.$property->phpType(); |
|
| 859 | + $lines[] = $this->spaces.' */'; |
|
| 860 | 860 | |
| 861 | 861 | return implode("\n", $lines); |
| 862 | 862 | } |
@@ -885,9 +885,9 @@ discard block |
||
| 885 | 885 | } |
| 886 | 886 | |
| 887 | 887 | $lines = array(); |
| 888 | - $lines[] = $this->spaces . '/**'; |
|
| 889 | - $lines[] = $this->spaces . ' * @var '.$className; |
|
| 890 | - $lines[] = $this->spaces . ' */'; |
|
| 888 | + $lines[] = $this->spaces.'/**'; |
|
| 889 | + $lines[] = $this->spaces.' * @var '.$className; |
|
| 890 | + $lines[] = $this->spaces.' */'; |
|
| 891 | 891 | |
| 892 | 892 | return implode("\n", $lines); |
| 893 | 893 | } |
@@ -928,7 +928,7 @@ discard block |
||
| 928 | 928 | |
| 929 | 929 | if ($inClass) { |
| 930 | 930 | $inClass = false; |
| 931 | - $lastSeenClass = $lastSeenNamespace . ($lastSeenNamespace ? '\\' : '') . $token[1]; |
|
| 931 | + $lastSeenClass = $lastSeenNamespace.($lastSeenNamespace ? '\\' : '').$token[1]; |
|
| 932 | 932 | $this->staticReflection[$lastSeenClass]['properties'] = array(); |
| 933 | 933 | $this->staticReflection[$lastSeenClass]['methods'] = array(); |
| 934 | 934 | } |
@@ -936,16 +936,16 @@ discard block |
||
| 936 | 936 | if ($token[0] == T_NAMESPACE) { |
| 937 | 937 | $lastSeenNamespace = ""; |
| 938 | 938 | $inNamespace = true; |
| 939 | - } elseif ($token[0] == T_CLASS && $tokens[$i-1][0] != T_DOUBLE_COLON) { |
|
| 939 | + } elseif ($token[0] == T_CLASS && $tokens[$i - 1][0] != T_DOUBLE_COLON) { |
|
| 940 | 940 | $inClass = true; |
| 941 | 941 | } elseif ($token[0] == T_FUNCTION) { |
| 942 | - if ($tokens[$i+2][0] == T_STRING) { |
|
| 943 | - $this->staticReflection[$lastSeenClass]['methods'][] = strtolower($tokens[$i+2][1]); |
|
| 944 | - } elseif ($tokens[$i+2] == "&" && $tokens[$i+3][0] == T_STRING) { |
|
| 945 | - $this->staticReflection[$lastSeenClass]['methods'][] = strtolower($tokens[$i+3][1]); |
|
| 942 | + if ($tokens[$i + 2][0] == T_STRING) { |
|
| 943 | + $this->staticReflection[$lastSeenClass]['methods'][] = strtolower($tokens[$i + 2][1]); |
|
| 944 | + } elseif ($tokens[$i + 2] == "&" && $tokens[$i + 3][0] == T_STRING) { |
|
| 945 | + $this->staticReflection[$lastSeenClass]['methods'][] = strtolower($tokens[$i + 3][1]); |
|
| 946 | 946 | } |
| 947 | - } elseif (in_array($token[0], array(T_VAR, T_PUBLIC, T_PRIVATE, T_PROTECTED)) && $tokens[$i+2][0] != T_FUNCTION) { |
|
| 948 | - $this->staticReflection[$lastSeenClass]['properties'][] = substr($tokens[$i+2][1], 1); |
|
| 947 | + } elseif (in_array($token[0], array(T_VAR, T_PUBLIC, T_PRIVATE, T_PROTECTED)) && $tokens[$i + 2][0] != T_FUNCTION) { |
|
| 948 | + $this->staticReflection[$lastSeenClass]['properties'][] = substr($tokens[$i + 2][1], 1); |
|
| 949 | 949 | } |
| 950 | 950 | } |
| 951 | 951 | } |
@@ -1020,7 +1020,7 @@ discard block |
||
| 1020 | 1020 | if ($this->hasNamespace($className)) { |
| 1021 | 1021 | return $this->getClassName($className); |
| 1022 | 1022 | } else { |
| 1023 | - return '\\' . $className; |
|
| 1023 | + return '\\'.$className; |
|
| 1024 | 1024 | } |
| 1025 | 1025 | } |
| 1026 | 1026 | |
@@ -1121,8 +1121,8 @@ discard block |
||
| 1121 | 1121 | $lines = explode("\n", $code); |
| 1122 | 1122 | |
| 1123 | 1123 | foreach ($lines as $key => $value) { |
| 1124 | - if ( ! empty($value)) { |
|
| 1125 | - $lines[$key] = str_repeat($this->spaces, $num) . $lines[$key]; |
|
| 1124 | + if (!empty($value)) { |
|
| 1125 | + $lines[$key] = str_repeat($this->spaces, $num).$lines[$key]; |
|
| 1126 | 1126 | } |
| 1127 | 1127 | } |
| 1128 | 1128 | |
@@ -1151,7 +1151,7 @@ discard block |
||
| 1151 | 1151 | } |
| 1152 | 1152 | |
| 1153 | 1153 | if (is_string($value)) { |
| 1154 | - return "'" . $value . "'"; |
|
| 1154 | + return "'".$value."'"; |
|
| 1155 | 1155 | } |
| 1156 | 1156 | |
| 1157 | 1157 | if (is_bool($value)) { |
@@ -1184,7 +1184,7 @@ discard block |
||
| 1184 | 1184 | $type = self::PROPERTY_TYPE_MAP[$type] ?? $type; |
| 1185 | 1185 | } |
| 1186 | 1186 | |
| 1187 | - return ($nullable ? '?' : '') . $type; |
|
| 1187 | + return ($nullable ? '?' : '').$type; |
|
| 1188 | 1188 | } |
| 1189 | 1189 | |
| 1190 | 1190 | /** |
@@ -1203,7 +1203,7 @@ discard block |
||
| 1203 | 1203 | return ''; |
| 1204 | 1204 | } |
| 1205 | 1205 | |
| 1206 | - return ' ' . $this->getPropertyTypeHint($property->phpType(), $property->isNullable()); |
|
| 1206 | + return ' '.$this->getPropertyTypeHint($property->phpType(), $property->isNullable()); |
|
| 1207 | 1207 | } |
| 1208 | 1208 | |
| 1209 | 1209 | /** |
@@ -1237,7 +1237,7 @@ discard block |
||
| 1237 | 1237 | } |
| 1238 | 1238 | } |
| 1239 | 1239 | |
| 1240 | - return ' ' . $this->getPropertyTypeHint($type, $property->isRelation()); |
|
| 1240 | + return ' '.$this->getPropertyTypeHint($type, $property->isRelation()); |
|
| 1241 | 1241 | } |
| 1242 | 1242 | |
| 1243 | 1243 | //---------------------- mutators |
@@ -1371,7 +1371,7 @@ discard block |
||
| 1371 | 1371 | public function setFieldVisibility(string $visibility): void |
| 1372 | 1372 | { |
| 1373 | 1373 | if ($visibility !== static::FIELD_VISIBLE_PRIVATE && $visibility !== static::FIELD_VISIBLE_PROTECTED) { |
| 1374 | - throw new \InvalidArgumentException('Invalid provided visibility (only private and protected are allowed): ' . $visibility); |
|
| 1374 | + throw new \InvalidArgumentException('Invalid provided visibility (only private and protected are allowed): '.$visibility); |
|
| 1375 | 1375 | } |
| 1376 | 1376 | |
| 1377 | 1377 | $this->fieldVisibility = $visibility; |
@@ -39,7 +39,7 @@ |
||
| 39 | 39 | * |
| 40 | 40 | * @param string $type |
| 41 | 41 | */ |
| 42 | - public function declare(string $type): void |
|
| 42 | + public function declare(string$type): void |
|
| 43 | 43 | { |
| 44 | 44 | if (isset($this->declaredTypes[$type])) { |
| 45 | 45 | return; |
@@ -64,7 +64,7 @@ |
||
| 64 | 64 | |
| 65 | 65 | // Replace 'adapter' with 'driver' and add 'pdo_' |
| 66 | 66 | if (isset($parameters['adapter'])) { |
| 67 | - $parameters['driver'] = 'pdo_' . $parameters['adapter']; |
|
| 67 | + $parameters['driver'] = 'pdo_'.$parameters['adapter']; |
|
| 68 | 68 | unset($parameters['adapter']); |
| 69 | 69 | } |
| 70 | 70 | |
@@ -44,8 +44,8 @@ |
||
| 44 | 44 | { |
| 45 | 45 | if ($this->cacheKey === null) { |
| 46 | 46 | $this->cacheKey = new CacheKey( |
| 47 | - function () { return $this->cacheNamespace(); }, |
|
| 48 | - $key ?? function () { return $this->cacheKey(); }, |
|
| 47 | + function() { return $this->cacheNamespace(); }, |
|
| 48 | + $key ?? function() { return $this->cacheKey(); }, |
|
| 49 | 49 | $lifetime |
| 50 | 50 | ); |
| 51 | 51 | |
@@ -186,7 +186,7 @@ discard block |
||
| 186 | 186 | foreach ($query->statements['tables'] as $table) { |
| 187 | 187 | return $query->state()->compiled = 'UPDATE ' |
| 188 | 188 | . $this->quoteIdentifier($query, $table['table']) |
| 189 | - . ' SET ' . implode(', ', $values) |
|
| 189 | + . ' SET '.implode(', ', $values) |
|
| 190 | 190 | . $this->compileWhere($query) |
| 191 | 191 | ; |
| 192 | 192 | } |
@@ -524,7 +524,7 @@ discard block |
||
| 524 | 524 | $from['sql'] = $this->quoteIdentifier($query, $databasePrefix.$from['table']); |
| 525 | 525 | $compiled[$from['table']] = $from; |
| 526 | 526 | } else { |
| 527 | - $from['sql'] = $this->quoteIdentifier($query, $databasePrefix.$from['table']) . ' ' . $this->quoteIdentifier($query, $from['alias']); |
|
| 527 | + $from['sql'] = $this->quoteIdentifier($query, $databasePrefix.$from['table']).' '.$this->quoteIdentifier($query, $from['alias']); |
|
| 528 | 528 | $compiled[$from['alias']] = $from; |
| 529 | 529 | } |
| 530 | 530 | } |
@@ -697,7 +697,7 @@ discard block |
||
| 697 | 697 | if (is_array($value)) { |
| 698 | 698 | return $this->compileIntoExpression($query, $value, $column, 'REGEXP', $converted); |
| 699 | 699 | } |
| 700 | - return $this->quoteIdentifier($query, $column).' REGEXP '.$this->compileExpressionValue($query, (string)$value, $converted); |
|
| 700 | + return $this->quoteIdentifier($query, $column).' REGEXP '.$this->compileExpressionValue($query, (string) $value, $converted); |
|
| 701 | 701 | |
| 702 | 702 | // LIKE |
| 703 | 703 | case ':like': |
@@ -770,7 +770,7 @@ discard block |
||
| 770 | 770 | |
| 771 | 771 | // Unsupported operator |
| 772 | 772 | default: |
| 773 | - throw new UnexpectedValueException("Unsupported operator '" . $operator . "' in WHERE clause"); |
|
| 773 | + throw new UnexpectedValueException("Unsupported operator '".$operator."' in WHERE clause"); |
|
| 774 | 774 | } |
| 775 | 775 | } |
| 776 | 776 | |
@@ -858,7 +858,7 @@ discard block |
||
| 858 | 858 | $sql = '('.$this->compileSelect($query).')'; |
| 859 | 859 | |
| 860 | 860 | if ($alias) { |
| 861 | - $sql = $sql . ' as ' . $this->quoteIdentifier($clause, $alias); |
|
| 861 | + $sql = $sql.' as '.$this->quoteIdentifier($clause, $alias); |
|
| 862 | 862 | } |
| 863 | 863 | |
| 864 | 864 | $this->addQueryBindings($clause, $query); |
@@ -1016,12 +1016,12 @@ discard block |
||
| 1016 | 1016 | if ($lock !== null && !$query->statements['aggregate']) { |
| 1017 | 1017 | // Lock for update |
| 1018 | 1018 | if ($lock === LockMode::PESSIMISTIC_WRITE) { |
| 1019 | - return ' ' . $this->platform()->grammar()->getWriteLockSQL(); |
|
| 1019 | + return ' '.$this->platform()->grammar()->getWriteLockSQL(); |
|
| 1020 | 1020 | } |
| 1021 | 1021 | |
| 1022 | 1022 | // Shared Lock: other process can read the row but not update it. |
| 1023 | 1023 | if ($lock === LockMode::PESSIMISTIC_READ) { |
| 1024 | - return ' ' . $this->platform()->grammar()->getReadLockSQL(); |
|
| 1024 | + return ' '.$this->platform()->grammar()->getReadLockSQL(); |
|
| 1025 | 1025 | } |
| 1026 | 1026 | } |
| 1027 | 1027 | |
@@ -77,7 +77,7 @@ discard block |
||
| 77 | 77 | #[ReadOperation] |
| 78 | 78 | public function load($relations) |
| 79 | 79 | { |
| 80 | - foreach (Relation::sanitizeRelations((array)$relations) as $relationName => $meta) { |
|
| 80 | + foreach (Relation::sanitizeRelations((array) $relations) as $relationName => $meta) { |
|
| 81 | 81 | $this->repository->relation($relationName)->load( |
| 82 | 82 | EntityIndexer::fromArray($this->repository->mapper(), $this->storage->all()), |
| 83 | 83 | $meta['relations'], |
@@ -142,7 +142,7 @@ discard block |
||
| 142 | 142 | #[WriteOperation] |
| 143 | 143 | public function delete() |
| 144 | 144 | { |
| 145 | - $this->repository->transaction(function (RepositoryInterface $repository) { |
|
| 145 | + $this->repository->transaction(function(RepositoryInterface $repository) { |
|
| 146 | 146 | /** @var RepositoryInterface&RepositoryEventsSubscriberInterface $repository */ |
| 147 | 147 | $writer = new BufferedWriter($repository); |
| 148 | 148 | |
@@ -165,7 +165,7 @@ discard block |
||
| 165 | 165 | #[WriteOperation] |
| 166 | 166 | public function save() |
| 167 | 167 | { |
| 168 | - $this->repository->transaction(function (RepositoryInterface $repository) { |
|
| 168 | + $this->repository->transaction(function(RepositoryInterface $repository) { |
|
| 169 | 169 | foreach ($this as $entity) { |
| 170 | 170 | $repository->save($entity); |
| 171 | 171 | } |
@@ -186,7 +186,7 @@ discard block |
||
| 186 | 186 | #[WriteOperation] |
| 187 | 187 | public function saveAll($relations) |
| 188 | 188 | { |
| 189 | - $relations = Relation::sanitizeRelations((array)$relations); |
|
| 189 | + $relations = Relation::sanitizeRelations((array) $relations); |
|
| 190 | 190 | |
| 191 | 191 | return $this->repository->transaction(function(RepositoryInterface $repository) use($relations) { |
| 192 | 192 | $nb = 0; |
@@ -215,7 +215,7 @@ discard block |
||
| 215 | 215 | #[WriteOperation] |
| 216 | 216 | public function deleteAll($relations) |
| 217 | 217 | { |
| 218 | - $relations = Relation::sanitizeRelations((array)$relations); |
|
| 218 | + $relations = Relation::sanitizeRelations((array) $relations); |
|
| 219 | 219 | |
| 220 | 220 | return $this->repository->transaction(function(RepositoryInterface $repository) use($relations) { |
| 221 | 221 | $nb = 0; |
@@ -132,7 +132,7 @@ discard block |
||
| 132 | 132 | return $entity; |
| 133 | 133 | } |
| 134 | 134 | |
| 135 | - throw new EntityNotFoundException('Cannot resolve entity identifier "'.implode('", "', (array)$id).'"'); |
|
| 135 | + throw new EntityNotFoundException('Cannot resolve entity identifier "'.implode('", "', (array) $id).'"'); |
|
| 136 | 136 | } |
| 137 | 137 | |
| 138 | 138 | /** |
@@ -178,7 +178,7 @@ discard block |
||
| 178 | 178 | */ |
| 179 | 179 | public function with(ReadCommandInterface $query, $relations) |
| 180 | 180 | { |
| 181 | - $this->withRelations = Relation::sanitizeRelations((array)$relations); |
|
| 181 | + $this->withRelations = Relation::sanitizeRelations((array) $relations); |
|
| 182 | 182 | |
| 183 | 183 | return $query; |
| 184 | 184 | } |
@@ -193,7 +193,7 @@ discard block |
||
| 193 | 193 | */ |
| 194 | 194 | public function without(ReadCommandInterface $query, $relations) |
| 195 | 195 | { |
| 196 | - $this->withoutRelations = Relation::sanitizeWithoutRelations((array)$relations); |
|
| 196 | + $this->withoutRelations = Relation::sanitizeWithoutRelations((array) $relations); |
|
| 197 | 197 | |
| 198 | 198 | return $query; |
| 199 | 199 | } |
@@ -296,7 +296,7 @@ discard block |
||
| 296 | 296 | $scopes = $this->repository->scopes(); |
| 297 | 297 | |
| 298 | 298 | if (!isset($scopes[$name])) { |
| 299 | - throw new BadMethodCallException('Scope "' . get_class($this->mapper) . '::' . $name . '" not found'); |
|
| 299 | + throw new BadMethodCallException('Scope "'.get_class($this->mapper).'::'.$name.'" not found'); |
|
| 300 | 300 | } |
| 301 | 301 | |
| 302 | 302 | return $scopes[$name](...$arguments); |
@@ -210,7 +210,7 @@ discard block |
||
| 210 | 210 | #[WriteOperation] |
| 211 | 211 | public function saveAll($relations = []): int |
| 212 | 212 | { |
| 213 | - return $this->relation->saveAll($this->owner, (array)$relations); |
|
| 213 | + return $this->relation->saveAll($this->owner, (array) $relations); |
|
| 214 | 214 | } |
| 215 | 215 | |
| 216 | 216 | /** |
@@ -226,7 +226,7 @@ discard block |
||
| 226 | 226 | #[WriteOperation] |
| 227 | 227 | public function deleteAll($relations = []): int |
| 228 | 228 | { |
| 229 | - return $this->relation->deleteAll($this->owner, (array)$relations); |
|
| 229 | + return $this->relation->deleteAll($this->owner, (array) $relations); |
|
| 230 | 230 | } |
| 231 | 231 | |
| 232 | 232 | /** |
@@ -245,7 +245,7 @@ |
||
| 245 | 245 | break; |
| 246 | 246 | |
| 247 | 247 | default: |
| 248 | - throw new RuntimeException('Unknown type from relation "' . $relationName . '" in ' . $repository->entityName()); |
|
| 248 | + throw new RuntimeException('Unknown type from relation "'.$relationName.'" in '.$repository->entityName()); |
|
| 249 | 249 | } |
| 250 | 250 | |
| 251 | 251 | return $relation->setOptions($relationMeta); |