Commit 334170bf authored by Guillaume Perréal's avatar Guillaume Perréal
Browse files

Pas de référence à @PHP73Migration sur les versions minimales.

Showing with 26 additions and 13 deletions
+26 -13
......@@ -90,7 +90,7 @@ final class ComposerPackage implements ComposerPackageInterface
$data = $this->getComposerJson();
return \array_key_exists($key, $data) ? $data[$key] : $default;
return array_key_exists($key, $data) ? $data[$key] : $default;
}
private function getComposerJson(): array
......
......@@ -73,20 +73,31 @@ final class Config extends PhpCsFixerConfig
);
}
/**
* @param float $phpVersion
* @param bool $risky
*
* @return array
*/
private function ruleSets(float $phpVersion, bool $risky): array
{
return [
$sets = [
'@PSR2' => true,
'@Symfony' => true,
'@Symfony:risky' => $risky,
'@PHP56Migration' => $phpVersion >= 5.6,
'@PHP56Migration:risky' => $risky && $phpVersion >= 5.6,
'@PHP70Migration' => $phpVersion >= 7.0,
'@PHP70Migration:risky' => $risky && $phpVersion >= 7.0,
'@PHP71Migration' => $phpVersion >= 7.1,
'@PHP71Migration:risky' => $risky && $phpVersion >= 7.1,
'@PHP73Migration' => $phpVersion >= 7.3,
'@PHP56Migration' => true,
'@PHP56Migration:risky' => $risky,
'@PHP70Migration' => true,
'@PHP70Migration:risky' => $risky,
'@PHP71Migration' => true,
'@PHP71Migration:risky' => $risky,
];
if ($phpVersion >= 7.3) {
$sets['@PHP73Migration'] = true;
}
return $sets;
}
public function baseRules(float $phpVersion, bool $risky): array
......@@ -169,10 +180,12 @@ final class Config extends PhpCsFixerConfig
$gitRepository = new CachedGitRepository($backendGitRepository, $cache);
$headerProvider = new FormattedHeaderProvider(
new ChainTemplateProvider([
new UserDefinedTemplateProvider($fileLocator),
new LicenseTemplateProvider($composerPackage),
]),
new ChainTemplateProvider(
[
new UserDefinedTemplateProvider($fileLocator),
new LicenseTemplateProvider($composerPackage),
]
),
new TemplateFormatter($gitRepository, $composerPackage)
);
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment