Skip to content

Commit

Permalink
refactor: Apply code quality level 27 for rector
Browse files Browse the repository at this point in the history
  • Loading branch information
samsonasik committed Dec 5, 2024
1 parent 0d3c3b1 commit 21b8877
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 8 deletions.
2 changes: 1 addition & 1 deletion rector.php
Original file line number Diff line number Diff line change
Expand Up @@ -210,4 +210,4 @@
// keep '\\' prefix string on string '\Foo\Bar'
StringClassNameToClassConstantRector::SHOULD_KEEP_PRE_SLASH => true,
])
->withCodeQualityLevel(24);
->withCodeQualityLevel(27);
2 changes: 1 addition & 1 deletion system/Commands/Generators/ModelGenerator.php
Original file line number Diff line number Diff line change
Expand Up @@ -130,6 +130,6 @@ protected function prepare(string $class): string
$return = "'{$return}'";
}

return $this->parseTemplate($class, ['{dbGroup}', '{table}', '{return}'], [$dbGroup, $table, $return], compact('dbGroup'));
return $this->parseTemplate($class, ['{dbGroup}', '{table}', '{return}'], [$dbGroup, $table, $return], ['dbGroup' => $dbGroup]);
}
}
6 changes: 3 additions & 3 deletions system/Commands/Translation/LocalizationFinder.php
Original file line number Diff line number Diff line change
Expand Up @@ -195,7 +195,7 @@ private function findTranslationsInFile($file): array
preg_match_all('/lang\(\'([._a-z0-9\-]+)\'\)/ui', $fileContent, $matches);

if ($matches[1] === []) {
return compact('foundLanguageKeys', 'badLanguageKeys');
return ['foundLanguageKeys' => $foundLanguageKeys, 'badLanguageKeys' => $badLanguageKeys];
}

foreach ($matches[1] as $phraseKey) {
Expand Down Expand Up @@ -228,7 +228,7 @@ private function findTranslationsInFile($file): array
}
}

return compact('foundLanguageKeys', 'badLanguageKeys');
return ['foundLanguageKeys' => $foundLanguageKeys, 'badLanguageKeys' => $badLanguageKeys];
}

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

return compact('foundLanguageKeys', 'badLanguageKeys', 'countFiles');
return ['foundLanguageKeys' => $foundLanguageKeys, 'badLanguageKeys' => $badLanguageKeys, 'countFiles' => $countFiles];
}
}
6 changes: 3 additions & 3 deletions system/Test/Fabricator.php
Original file line number Diff line number Diff line change
Expand Up @@ -272,7 +272,7 @@ public function setOverrides(array $overrides = [], $persist = true): self
*/
public function setUnique(string $field, bool $reset = false, int $maxRetries = 10000): static
{
$this->modifiedFields['unique'][$field] = compact('reset', 'maxRetries');
$this->modifiedFields['unique'][$field] = ['reset' => $reset, 'maxRetries' => $maxRetries];

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

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

return $this;
}
Expand Down

0 comments on commit 21b8877

Please sign in to comment.