mirror of
https://github.com/codeigniter4/CodeIgniter4.git
synced 2025-02-20 11:44:28 +08:00
refactor: skip CompactToVariablesRector
This commit is contained in:
parent
21b8877620
commit
37e63299f5
@ -17,6 +17,7 @@ use Rector\CodeQuality\Rector\Empty_\SimplifyEmptyCheckOnEmptyArrayRector;
|
||||
use Rector\CodeQuality\Rector\Expression\InlineIfToExplicitIfRector;
|
||||
use Rector\CodeQuality\Rector\Foreach_\UnusedForeachValueToArrayKeysRector;
|
||||
use Rector\CodeQuality\Rector\FuncCall\ChangeArrayPushToArrayAssignRector;
|
||||
use Rector\CodeQuality\Rector\FuncCall\CompactToVariablesRector;
|
||||
use Rector\CodeQuality\Rector\FunctionLike\SimplifyUselessVariableRector;
|
||||
use Rector\CodeQuality\Rector\Identical\FlipTypeControlToUseExclusiveTypeRector;
|
||||
use Rector\CodeQuality\Rector\If_\ShortenElseIfRector;
|
||||
@ -171,6 +172,8 @@ return RectorConfig::configure()
|
||||
|
||||
// Unnecessary (string) is inserted
|
||||
NullToStrictStringFuncCallArgRector::class,
|
||||
|
||||
CompactToVariablesRector::class,
|
||||
])
|
||||
// auto import fully qualified class names
|
||||
->withImportNames(removeUnusedImports: true)
|
||||
|
@ -130,6 +130,6 @@ class ModelGenerator extends BaseCommand
|
||||
$return = "'{$return}'";
|
||||
}
|
||||
|
||||
return $this->parseTemplate($class, ['{dbGroup}', '{table}', '{return}'], [$dbGroup, $table, $return], ['dbGroup' => $dbGroup]);
|
||||
return $this->parseTemplate($class, ['{dbGroup}', '{table}', '{return}'], [$dbGroup, $table, $return], compact('dbGroup'));
|
||||
}
|
||||
}
|
||||
|
@ -195,7 +195,7 @@ class LocalizationFinder extends BaseCommand
|
||||
preg_match_all('/lang\(\'([._a-z0-9\-]+)\'\)/ui', $fileContent, $matches);
|
||||
|
||||
if ($matches[1] === []) {
|
||||
return ['foundLanguageKeys' => $foundLanguageKeys, 'badLanguageKeys' => $badLanguageKeys];
|
||||
return compact('foundLanguageKeys', 'badLanguageKeys');
|
||||
}
|
||||
|
||||
foreach ($matches[1] as $phraseKey) {
|
||||
@ -228,7 +228,7 @@ class LocalizationFinder extends BaseCommand
|
||||
}
|
||||
}
|
||||
|
||||
return ['foundLanguageKeys' => $foundLanguageKeys, 'badLanguageKeys' => $badLanguageKeys];
|
||||
return compact('foundLanguageKeys', 'badLanguageKeys');
|
||||
}
|
||||
|
||||
private function isIgnoredFile(SplFileInfo $file): bool
|
||||
@ -384,6 +384,6 @@ class LocalizationFinder extends BaseCommand
|
||||
$badLanguageKeys = array_merge($findInFile['badLanguageKeys'], $badLanguageKeys);
|
||||
}
|
||||
|
||||
return ['foundLanguageKeys' => $foundLanguageKeys, 'badLanguageKeys' => $badLanguageKeys, 'countFiles' => $countFiles];
|
||||
return compact('foundLanguageKeys', 'badLanguageKeys', 'countFiles');
|
||||
}
|
||||
}
|
||||
|
@ -272,7 +272,7 @@ class Fabricator
|
||||
*/
|
||||
public function setUnique(string $field, bool $reset = false, int $maxRetries = 10000): static
|
||||
{
|
||||
$this->modifiedFields['unique'][$field] = ['reset' => $reset, 'maxRetries' => $maxRetries];
|
||||
$this->modifiedFields['unique'][$field] = compact('reset', 'maxRetries');
|
||||
|
||||
return $this;
|
||||
}
|
||||
@ -284,7 +284,7 @@ class Fabricator
|
||||
*/
|
||||
public function setOptional(string $field, float $weight = 0.5, mixed $default = null): static
|
||||
{
|
||||
$this->modifiedFields['optional'][$field] = ['weight' => $weight, 'default' => $default];
|
||||
$this->modifiedFields['optional'][$field] = compact('weight', 'default');
|
||||
|
||||
return $this;
|
||||
}
|
||||
@ -298,7 +298,7 @@ class Fabricator
|
||||
*/
|
||||
public function setValid(string $field, ?Closure $validator = null, int $maxRetries = 10000): static
|
||||
{
|
||||
$this->modifiedFields['valid'][$field] = ['validator' => $validator, 'maxRetries' => $maxRetries];
|
||||
$this->modifiedFields['valid'][$field] = compact('validator', 'maxRetries');
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user