Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

refactor: Apply code quality level 31 for rector #9303

Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading