@@ -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); |
|
@@ -51,7 +51,7 @@ discard block |
||
| 51 | 51 | |
| 52 | 52 | $this->ensureTableExists($model); |
| 53 | 53 | |
| 54 | - $id = $this->executeInTransaction(function () use ($model) { |
|
| 54 | + $id = $this->executeInTransaction(function() use ($model) { |
|
| 55 | 55 | $id = $this->createRecords($model); |
| 56 | 56 | $model->set(self::ID_FIELD, $id); |
| 57 | 57 | |
@@ -189,7 +189,7 @@ discard block |
||
| 189 | 189 | $this->createTable($foreign); |
| 190 | 190 | } |
| 191 | 191 | |
| 192 | - $this->executeInTransaction(function () use ($model) { |
|
| 192 | + $this->executeInTransaction(function() use ($model) { |
|
| 193 | 193 | foreach ($model->getForeignModels(self::RELATION_ONE_TO_ONE) as $foreign) { |
| 194 | 194 | $id = $this->createRecords($foreign); |
| 195 | 195 | $this->finalizeModel($foreign); |
@@ -211,7 +211,7 @@ discard block |
||
| 211 | 211 | $this->createTable($foreign, $this->createConstraintsOtm($model)); |
| 212 | 212 | } |
| 213 | 213 | |
| 214 | - $this->executeInTransaction(function () use ($model) { |
|
| 214 | + $this->executeInTransaction(function() use ($model) { |
|
| 215 | 215 | foreach ($model->getForeignModels(self::RELATION_ONE_TO_MANY) as $foreign) { |
| 216 | 216 | $this->createRecords($foreign); |
| 217 | 217 | $this->finalizeModel($foreign); |
@@ -243,7 +243,7 @@ discard block |
||
| 243 | 243 | ); |
| 244 | 244 | } |
| 245 | 245 | |
| 246 | - $this->executeInTransaction(function () use ($model, $id) { |
|
| 246 | + $this->executeInTransaction(function() use ($model, $id) { |
|
| 247 | 247 | foreach ($model->getForeignModels(self::RELATION_MANY_TO_MANY) as $foreign) { |
| 248 | 248 | $rel_id = $this->createRecords($foreign); |
| 249 | 249 | $this->finalizeModel($foreign); |
@@ -182,9 +182,9 @@ discard block |
||
| 182 | 182 | |
| 183 | 183 | $db = $this->recordManager->find(strtolower((string) $parts[1])); |
| 184 | 184 | $db->where($this->getName().'_id = :id') |
| 185 | - ->setParameter('id', $this->__meta['id'], |
|
| 186 | - $this->determineIdType($this->__meta['id']) |
|
| 187 | - ); |
|
| 185 | + ->setParameter('id', $this->__meta['id'], |
|
| 186 | + $this->determineIdType($this->__meta['id']) |
|
| 187 | + ); |
|
| 188 | 188 | |
| 189 | 189 | $result = $db->get(); |
| 190 | 190 | $this->set($key, $result); |
@@ -203,9 +203,9 @@ discard block |
||
| 203 | 203 | |
| 204 | 204 | $db = $this->recordManager->find($relTable); |
| 205 | 205 | $db->where($this->getName().'_id = :id') |
| 206 | - ->setParameter('id', $this->__meta['id'], |
|
| 207 | - $this->determineIdType($this->__meta['id']) |
|
| 208 | - ); |
|
| 206 | + ->setParameter('id', $this->__meta['id'], |
|
| 207 | + $this->determineIdType($this->__meta['id']) |
|
| 208 | + ); |
|
| 209 | 209 | |
| 210 | 210 | $relations = $db->get(); |
| 211 | 211 | $relIds = $this->extractRelationIds($relations, $targetTable); |
@@ -216,9 +216,9 @@ discard block |
||
| 216 | 216 | |
| 217 | 217 | $db = $this->recordManager->find($targetTable); |
| 218 | 218 | $db->where('id IN (:ids)') |
| 219 | - ->setParameter('ids', $relIds, |
|
| 220 | - $this->determineIdsType($relIds) |
|
| 221 | - ); |
|
| 219 | + ->setParameter('ids', $relIds, |
|
| 220 | + $this->determineIdsType($relIds) |
|
| 221 | + ); |
|
| 222 | 222 | |
| 223 | 223 | $result = $db->get(); |
| 224 | 224 | |
@@ -242,7 +242,7 @@ discard block |
||
| 242 | 242 | |
| 243 | 243 | private function extractRelationIds(Collection $relations, string $targetTable): array |
| 244 | 244 | { |
| 245 | - return $relations->map(function ($relation) use ($targetTable) { |
|
| 245 | + return $relations->map(function($relation) use ($targetTable) { |
|
| 246 | 246 | $key = $targetTable.'_id'; |
| 247 | 247 | |
| 248 | 248 | return $relation->$key; |
@@ -426,7 +426,7 @@ discard block |
||
| 426 | 426 | * |
| 427 | 427 | * @throws Exception\InvalidModelException |
| 428 | 428 | */ |
| 429 | - private function createCollection(?Collection $collection, array|Collection $models): Collection |
|
| 429 | + private function createCollection(?Collection $collection, array | Collection $models): Collection |
|
| 430 | 430 | { |
| 431 | 431 | if (is_null($collection)) { |
| 432 | 432 | $collection = Collection::fromIterable([]); |
@@ -507,7 +507,7 @@ discard block |
||
| 507 | 507 | /** |
| 508 | 508 | * Determines the ParameterType for an ID value. |
| 509 | 509 | */ |
| 510 | - private function determineIdType(int|string $id): ParameterType |
|
| 510 | + private function determineIdType(int | string $id): ParameterType |
|
| 511 | 511 | { |
| 512 | 512 | return is_int($id) ? ParameterType::INTEGER : ParameterType::STRING; |
| 513 | 513 | } |
@@ -119,7 +119,7 @@ |
||
| 119 | 119 | return $this->createQueryBuilder() |
| 120 | 120 | ->select(self::ALL_COLUMNS) |
| 121 | 121 | ->from($table, self::DEFAULT_ALIAS) |
| 122 | - ->where(self::DEFAULT_ALIAS . '.' . self::ID_COLUMN . ' = ?') |
|
| 122 | + ->where(self::DEFAULT_ALIAS.'.'.self::ID_COLUMN.' = ?') |
|
| 123 | 123 | ->setParameter(0, $id) |
| 124 | 124 | ->first(); |
| 125 | 125 | }); |