@@ -77,7 +77,7 @@ |
||
| 77 | 77 | * |
| 78 | 78 | * @return int|numeric-string |
| 79 | 79 | */ |
| 80 | - public static function exec(string $sql): int|string |
|
| 80 | + public static function exec(string $sql): int | string |
|
| 81 | 81 | { |
| 82 | 82 | return self::getDB()->exec($sql); |
| 83 | 83 | } |
@@ -53,7 +53,7 @@ |
||
| 53 | 53 | * |
| 54 | 54 | * @return int|numeric-string |
| 55 | 55 | */ |
| 56 | - public function exec(string $sql, array $params = []): int|string |
|
| 56 | + public function exec(string $sql, array $params = []): int | string |
|
| 57 | 57 | { |
| 58 | 58 | return $this->connection->executeStatement($sql, $params); |
| 59 | 59 | } |
@@ -6,10 +6,10 @@ |
||
| 6 | 6 | |
| 7 | 7 | return RectorConfig::configure() |
| 8 | 8 | ->withPaths([ |
| 9 | - __DIR__ . '/src', |
|
| 10 | - __DIR__ . '/tests', |
|
| 9 | + __DIR__.'/src', |
|
| 10 | + __DIR__.'/tests', |
|
| 11 | 11 | ]) |
| 12 | 12 | // uncomment to reach your current PHP version |
| 13 | 13 | ->withPhpSets(php83:true) |
| 14 | 14 | ->withAttributesSets() |
| 15 | - ->withPreparedSets(deadCode:true,typeDeclarations:true,codeQuality:true); |
|
| 15 | + ->withPreparedSets(deadCode:true, typeDeclarations:true, codeQuality:true); |
|
@@ -39,7 +39,7 @@ discard block |
||
| 39 | 39 | * |
| 40 | 40 | * @throws InvalidIdException |
| 41 | 41 | */ |
| 42 | - public function save(Model $model): string|int |
|
| 42 | + public function save(Model $model): string | int |
|
| 43 | 43 | { |
| 44 | 44 | if ($model->hasForeign(self::RELATION_ONE_TO_ONE)) { |
| 45 | 45 | $this->saveForeignOneToOne($model); |
@@ -47,7 +47,7 @@ discard block |
||
| 47 | 47 | |
| 48 | 48 | $this->ensureTableExists($model); |
| 49 | 49 | |
| 50 | - $id = $this->executeInTransaction(function () use ($model) { |
|
| 50 | + $id = $this->executeInTransaction(function() use ($model) { |
|
| 51 | 51 | $id = $this->createRecords($model); |
| 52 | 52 | $model->set(self::ID_FIELD, $id); |
| 53 | 53 | |
@@ -190,7 +190,7 @@ discard block |
||
| 190 | 190 | $this->createTable($foreign); |
| 191 | 191 | } |
| 192 | 192 | |
| 193 | - $this->executeInTransaction(function () use ($model) { |
|
| 193 | + $this->executeInTransaction(function() use ($model) { |
|
| 194 | 194 | foreach ($model->getForeignModels(self::RELATION_ONE_TO_ONE) as $foreign) { |
| 195 | 195 | $id = $this->createRecords($foreign); |
| 196 | 196 | $this->finalizeModel($foreign); |
@@ -212,7 +212,7 @@ discard block |
||
| 212 | 212 | $this->createTable($foreign, $this->createConstraintsOtm($model)); |
| 213 | 213 | } |
| 214 | 214 | |
| 215 | - $this->executeInTransaction(function () use ($model) { |
|
| 215 | + $this->executeInTransaction(function() use ($model) { |
|
| 216 | 216 | foreach ($model->getForeignModels(self::RELATION_ONE_TO_MANY) as $foreign) { |
| 217 | 217 | $this->createRecords($foreign); |
| 218 | 218 | $this->finalizeModel($foreign); |
@@ -244,7 +244,7 @@ discard block |
||
| 244 | 244 | ); |
| 245 | 245 | } |
| 246 | 246 | |
| 247 | - $this->executeInTransaction(function () use ($model, $id) { |
|
| 247 | + $this->executeInTransaction(function() use ($model, $id) { |
|
| 248 | 248 | foreach ($model->getForeignModels(self::RELATION_MANY_TO_MANY) as $foreign) { |
| 249 | 249 | $rel_id = $this->createRecords($foreign); |
| 250 | 250 | $this->finalizeModel($foreign); |
@@ -72,7 +72,7 @@ discard block |
||
| 72 | 72 | */ |
| 73 | 73 | public function insert(Model $model): mixed |
| 74 | 74 | { |
| 75 | - return $this->executeInTransaction(function () use ($model) { |
|
| 75 | + return $this->executeInTransaction(function() use ($model) { |
|
| 76 | 76 | if ($this->config->isUsingUUID()) { |
| 77 | 77 | $model->set(self::ID_COLUMN, Uuid::uuid4()->toString()); |
| 78 | 78 | } |
@@ -95,7 +95,7 @@ discard block |
||
| 95 | 95 | */ |
| 96 | 96 | public function update(Model $model): mixed |
| 97 | 97 | { |
| 98 | - return $this->executeInTransaction(function () use ($model) { |
|
| 98 | + return $this->executeInTransaction(function() use ($model) { |
|
| 99 | 99 | $this->connection->update( |
| 100 | 100 | $model->getName(), |
| 101 | 101 | $model->getSelfProperties(), |
@@ -111,7 +111,7 @@ discard block |
||
| 111 | 111 | */ |
| 112 | 112 | public function delete(Model $model): mixed |
| 113 | 113 | { |
| 114 | - return $this->executeInTransaction(function () use ($model) { |
|
| 114 | + return $this->executeInTransaction(function() use ($model) { |
|
| 115 | 115 | $this->connection->delete( |
| 116 | 116 | $model->getName(), |
| 117 | 117 | [self::ID_COLUMN => $model->getId()] |
@@ -126,7 +126,7 @@ discard block |
||
| 126 | 126 | */ |
| 127 | 127 | public function getById(string $table, mixed $id): ?Model |
| 128 | 128 | { |
| 129 | - return $this->executeInTransaction(function () use ($table, $id) { |
|
| 129 | + return $this->executeInTransaction(function() use ($table, $id) { |
|
| 130 | 130 | return $this->createQueryBuilder() |
| 131 | 131 | ->select(self::ALL_COLUMNS) |
| 132 | 132 | ->from($table, self::DEFAULT_ALIAS) |
@@ -141,7 +141,7 @@ discard block |
||
| 141 | 141 | */ |
| 142 | 142 | public function getAll(string $tableName): Collection |
| 143 | 143 | { |
| 144 | - return $this->executeInTransaction(function () use ($tableName) { |
|
| 144 | + return $this->executeInTransaction(function() use ($tableName) { |
|
| 145 | 145 | return $this->createQueryBuilder() |
| 146 | 146 | ->select(self::ALL_COLUMNS) |
| 147 | 147 | ->from($tableName, self::DEFAULT_ALIAS) |
@@ -319,7 +319,7 @@ discard block |
||
| 319 | 319 | */ |
| 320 | 320 | private function extractRelationIds(Collection $relations, string $targetTable): array |
| 321 | 321 | { |
| 322 | - return $relations->map(function ($relation) use ($targetTable) { |
|
| 322 | + return $relations->map(function($relation) use ($targetTable) { |
|
| 323 | 323 | $key = $targetTable.'_id'; |
| 324 | 324 | |
| 325 | 325 | return $relation->$key; |
@@ -507,7 +507,7 @@ discard block |
||
| 507 | 507 | * |
| 508 | 508 | * @throws Exception\InvalidModelException |
| 509 | 509 | */ |
| 510 | - private function createCollection(?Collection $collection, array|Collection $models): Collection |
|
| 510 | + private function createCollection(?Collection $collection, array | Collection $models): Collection |
|
| 511 | 511 | { |
| 512 | 512 | if (is_null($collection)) { |
| 513 | 513 | $collection = Collection::fromIterable([]); |
@@ -588,7 +588,7 @@ discard block |
||
| 588 | 588 | /** |
| 589 | 589 | * Determines the ParameterType for an ID value. |
| 590 | 590 | */ |
| 591 | - private function determineIdType(int|string $id): ParameterType |
|
| 591 | + private function determineIdType(int | string $id): ParameterType |
|
| 592 | 592 | { |
| 593 | 593 | return is_int($id) ? ParameterType::INTEGER : ParameterType::STRING; |
| 594 | 594 | } |