| @@ -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); | 
| @@ -149,7 +149,7 @@ discard block | ||
| 149 | 149 | */ | 
| 150 | 150 | public function ignore($flag = true) | 
| 151 | 151 |      { | 
| 152 | - $this->statements['ignore'] = (bool)$flag; | |
| 152 | + $this->statements['ignore'] = (bool) $flag; | |
| 153 | 153 | |
| 154 | 154 | return $this; | 
| 155 | 155 | } | 
| @@ -273,7 +273,7 @@ discard block | ||
| 273 | 273 | $this->statements['offset'] = null; | 
| 274 | 274 | $this->statements['aggregate'] = ['pagination', $this->getPaginationColumns($column)]; | 
| 275 | 275 | |
| 276 | - $count = (int)$this->execute()[0]['aggregate']; | |
| 276 | + $count = (int) $this->execute()[0]['aggregate']; | |
| 277 | 277 | |
| 278 | 278 | $this->compilerState->invalidate(['columns', 'orders']); | 
| 279 | 279 | $this->statements = $statements; | 
| @@ -319,7 +319,7 @@ discard block | ||
| 319 | 319 | #[ReadOperation] | 
| 320 | 320 | public function count(?string $column = null): int | 
| 321 | 321 |      { | 
| 322 | - return (int)$this->aggregate(__FUNCTION__, $column); | |
| 322 | + return (int) $this->aggregate(__FUNCTION__, $column); | |
| 323 | 323 | } | 
| 324 | 324 | |
| 325 | 325 | /** | 
| @@ -328,7 +328,7 @@ discard block | ||
| 328 | 328 | #[ReadOperation] | 
| 329 | 329 | public function avg(?string $column = null): float | 
| 330 | 330 |      { | 
| 331 | - return (float)$this->aggregate(__FUNCTION__, $column); | |
| 331 | + return (float) $this->aggregate(__FUNCTION__, $column); | |
| 332 | 332 | } | 
| 333 | 333 | |
| 334 | 334 | /** | 
| @@ -355,7 +355,7 @@ discard block | ||
| 355 | 355 | #[ReadOperation] | 
| 356 | 356 | public function sum(?string $column = null): float | 
| 357 | 357 |      { | 
| 358 | - return (float)$this->aggregate(__FUNCTION__, $column); | |
| 358 | + return (float) $this->aggregate(__FUNCTION__, $column); | |
| 359 | 359 | } | 
| 360 | 360 | |
| 361 | 361 | /** | 
| @@ -385,7 +385,7 @@ discard block | ||
| 385 | 385 |      { | 
| 386 | 386 |          $this->compilerState->invalidate('columns'); | 
| 387 | 387 | |
| 388 | - $this->statements['distinct'] = (bool)$flag; | |
| 388 | + $this->statements['distinct'] = (bool) $flag; | |
| 389 | 389 | |
| 390 | 390 | return $this; | 
| 391 | 391 | } | 
| @@ -611,7 +611,7 @@ discard block | ||
| 611 | 611 | # build a regular expression for each parameter | 
| 612 | 612 |          foreach ($values as $key => $value) { | 
| 613 | 613 |              if (is_string($key)) { | 
| 614 | - $keys[] = '/:' . $key . '/'; | |
| 614 | + $keys[] = '/:'.$key.'/'; | |
| 615 | 615 |              } else { | 
| 616 | 616 | $keys[] = '/[?]/'; | 
| 617 | 617 | } | 
| @@ -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); | 
| @@ -40,10 +40,10 @@ | ||
| 40 | 40 | */ | 
| 41 | 41 | public function acceptSchema(Schema $schema) | 
| 42 | 42 |      { | 
| 43 | -        $this->output  = 'digraph "' . sha1((string) mt_rand()) . '" {' . "\n"; | |
| 44 | - $this->output .= 'graph [fontname="helvetica", fontsize=12];' . "\n"; | |
| 45 | - $this->output .= 'node [fontname="helvetica", fontsize=12];' . "\n"; | |
| 46 | - $this->output .= 'edge [fontname="helvetica", fontsize=12];' . "\n"; | |
| 43 | +        $this->output  = 'digraph "'.sha1((string) mt_rand()).'" {'."\n"; | |
| 44 | + $this->output .= 'graph [fontname="helvetica", fontsize=12];'."\n"; | |
| 45 | + $this->output .= 'node [fontname="helvetica", fontsize=12];'."\n"; | |
| 46 | + $this->output .= 'edge [fontname="helvetica", fontsize=12];'."\n"; | |
| 47 | 47 | // $this->output .= 'splines = true;' . "\n"; | 
| 48 | 48 | // $this->output .= 'overlap = false;' . "\n"; | 
| 49 | 49 | // $this->output .= 'outputorder=edgesfirst;'."\n"; | 
| @@ -73,7 +73,7 @@ discard block | ||
| 73 | 73 | public function diff($listDrop = true) | 
| 74 | 74 |      { | 
| 75 | 75 | $queries = $this->schema() | 
| 76 | -            ->simulate(function (SchemaManagerInterface $schema) use ($listDrop) { | |
| 76 | +            ->simulate(function(SchemaManagerInterface $schema) use ($listDrop) { | |
| 77 | 77 | $schema->useDrop($listDrop); | 
| 78 | 78 | $schema->add($this->table()); | 
| 79 | 79 | }) | 
| @@ -84,7 +84,7 @@ discard block | ||
| 84 | 84 | } | 
| 85 | 85 | |
| 86 | 86 | $sequenceQueries = $schemaSequence | 
| 87 | -            ->simulate(function (SchemaManagerInterface $schema) use ($listDrop) { | |
| 87 | +            ->simulate(function(SchemaManagerInterface $schema) use ($listDrop) { | |
| 88 | 88 | $schema->useDrop($listDrop); | 
| 89 | 89 | $schema->add($this->sequence()); | 
| 90 | 90 | }) | 
| @@ -159,7 +159,7 @@ discard block | ||
| 159 | 159 | |
| 160 | 160 | /** @var ConnectionInterface&\Doctrine\DBAL\Connection $connection */ | 
| 161 | 161 | $connection = $this->connection($this->metadata->sequence['connection']); | 
| 162 | - $table = $this->metadata->sequence['table']; | |
| 162 | + $table = $this->metadata->sequence['table']; | |
| 163 | 163 | |
| 164 | 164 | /** @psalm-suppress UndefinedInterfaceMethod */ | 
| 165 | 165 | $nb = $connection->from($table)->count(); | 
| @@ -42,7 +42,7 @@ | ||
| 42 | 42 | */ | 
| 43 | 43 | public function all() | 
| 44 | 44 |      { | 
| 45 | - $indexes = $this->extractIndexes($this->metadata->indexes); | |
| 45 | + $indexes = $this->extractIndexes($this->metadata->indexes); | |
| 46 | 46 | |
| 47 | 47 |          if ($primary = $this->primary()) { | 
| 48 | 48 | $indexes[$primary->name()] = $primary; | 
| @@ -113,7 +113,7 @@ discard block | ||
| 113 | 113 | $count = 0; | 
| 114 | 114 | |
| 115 | 115 |          foreach ($this->execute() as $result) { | 
| 116 | - $count += (int)$result['aggregate']; | |
| 116 | + $count += (int) $result['aggregate']; | |
| 117 | 117 | } | 
| 118 | 118 | |
| 119 | 119 | $this->compilerState->invalidate(['columns', 'orders']); | 
| @@ -128,7 +128,7 @@ discard block | ||
| 128 | 128 | #[ReadOperation] | 
| 129 | 129 | public function count(?string $column = null): int | 
| 130 | 130 |      { | 
| 131 | - return (int)array_sum($this->aggregate(__FUNCTION__, $column)); | |
| 131 | + return (int) array_sum($this->aggregate(__FUNCTION__, $column)); | |
| 132 | 132 | } | 
| 133 | 133 | |
| 134 | 134 | /** | 
| @@ -139,7 +139,7 @@ discard block | ||
| 139 | 139 |      { | 
| 140 | 140 | $numbers = $this->aggregate(__FUNCTION__, $column); | 
| 141 | 141 | |
| 142 | - return array_sum($numbers)/count($numbers); | |
| 142 | + return array_sum($numbers) / count($numbers); | |
| 143 | 143 | } | 
| 144 | 144 | |
| 145 | 145 | /** | 
| @@ -166,7 +166,7 @@ discard block | ||
| 166 | 166 | #[ReadOperation] | 
| 167 | 167 | public function sum(?string $column = null): float | 
| 168 | 168 |      { | 
| 169 | - return (float)array_sum($this->aggregate(__FUNCTION__, $column)); | |
| 169 | + return (float) array_sum($this->aggregate(__FUNCTION__, $column)); | |
| 170 | 170 | } | 
| 171 | 171 | |
| 172 | 172 | /** |