Skip to content

Commit 21b8877

Browse files
committed
refactor: Apply code quality level 27 for rector
1 parent 0d3c3b1 commit 21b8877

File tree

4 files changed

+8
-8
lines changed

4 files changed

+8
-8
lines changed

rector.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -210,4 +210,4 @@
210210
// keep '\\' prefix string on string '\Foo\Bar'
211211
StringClassNameToClassConstantRector::SHOULD_KEEP_PRE_SLASH => true,
212212
])
213-
->withCodeQualityLevel(24);
213+
->withCodeQualityLevel(27);

system/Commands/Generators/ModelGenerator.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -130,6 +130,6 @@ protected function prepare(string $class): string
130130
$return = "'{$return}'";
131131
}
132132

133-
return $this->parseTemplate($class, ['{dbGroup}', '{table}', '{return}'], [$dbGroup, $table, $return], compact('dbGroup'));
133+
return $this->parseTemplate($class, ['{dbGroup}', '{table}', '{return}'], [$dbGroup, $table, $return], ['dbGroup' => $dbGroup]);
134134
}
135135
}

system/Commands/Translation/LocalizationFinder.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -195,7 +195,7 @@ private function findTranslationsInFile($file): array
195195
preg_match_all('/lang\(\'([._a-z0-9\-]+)\'\)/ui', $fileContent, $matches);
196196

197197
if ($matches[1] === []) {
198-
return compact('foundLanguageKeys', 'badLanguageKeys');
198+
return ['foundLanguageKeys' => $foundLanguageKeys, 'badLanguageKeys' => $badLanguageKeys];
199199
}
200200

201201
foreach ($matches[1] as $phraseKey) {
@@ -228,7 +228,7 @@ private function findTranslationsInFile($file): array
228228
}
229229
}
230230

231-
return compact('foundLanguageKeys', 'badLanguageKeys');
231+
return ['foundLanguageKeys' => $foundLanguageKeys, 'badLanguageKeys' => $badLanguageKeys];
232232
}
233233

234234
private function isIgnoredFile(SplFileInfo $file): bool
@@ -384,6 +384,6 @@ private function findLanguageKeysInFiles(array $files): array
384384
$badLanguageKeys = array_merge($findInFile['badLanguageKeys'], $badLanguageKeys);
385385
}
386386

387-
return compact('foundLanguageKeys', 'badLanguageKeys', 'countFiles');
387+
return ['foundLanguageKeys' => $foundLanguageKeys, 'badLanguageKeys' => $badLanguageKeys, 'countFiles' => $countFiles];
388388
}
389389
}

system/Test/Fabricator.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -272,7 +272,7 @@ public function setOverrides(array $overrides = [], $persist = true): self
272272
*/
273273
public function setUnique(string $field, bool $reset = false, int $maxRetries = 10000): static
274274
{
275-
$this->modifiedFields['unique'][$field] = compact('reset', 'maxRetries');
275+
$this->modifiedFields['unique'][$field] = ['reset' => $reset, 'maxRetries' => $maxRetries];
276276

277277
return $this;
278278
}
@@ -284,7 +284,7 @@ public function setUnique(string $field, bool $reset = false, int $maxRetries =
284284
*/
285285
public function setOptional(string $field, float $weight = 0.5, mixed $default = null): static
286286
{
287-
$this->modifiedFields['optional'][$field] = compact('weight', 'default');
287+
$this->modifiedFields['optional'][$field] = ['weight' => $weight, 'default' => $default];
288288

289289
return $this;
290290
}
@@ -298,7 +298,7 @@ public function setOptional(string $field, float $weight = 0.5, mixed $default =
298298
*/
299299
public function setValid(string $field, ?Closure $validator = null, int $maxRetries = 10000): static
300300
{
301-
$this->modifiedFields['valid'][$field] = compact('validator', 'maxRetries');
301+
$this->modifiedFields['valid'][$field] = ['validator' => $validator, 'maxRetries' => $maxRetries];
302302

303303
return $this;
304304
}

0 commit comments

Comments
 (0)