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 ...@@ -90,7 +90,7 @@ final class ComposerPackage implements ComposerPackageInterface
$data = $this->getComposerJson(); $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 private function getComposerJson(): array
......
...@@ -73,20 +73,31 @@ final class Config extends PhpCsFixerConfig ...@@ -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 private function ruleSets(float $phpVersion, bool $risky): array
{ {
return [ $sets = [
'@PSR2' => true, '@PSR2' => true,
'@Symfony' => true, '@Symfony' => true,
'@Symfony:risky' => $risky, '@Symfony:risky' => $risky,
'@PHP56Migration' => $phpVersion >= 5.6, '@PHP56Migration' => true,
'@PHP56Migration:risky' => $risky && $phpVersion >= 5.6, '@PHP56Migration:risky' => $risky,
'@PHP70Migration' => $phpVersion >= 7.0, '@PHP70Migration' => true,
'@PHP70Migration:risky' => $risky && $phpVersion >= 7.0, '@PHP70Migration:risky' => $risky,
'@PHP71Migration' => $phpVersion >= 7.1, '@PHP71Migration' => true,
'@PHP71Migration:risky' => $risky && $phpVersion >= 7.1, '@PHP71Migration:risky' => $risky,
'@PHP73Migration' => $phpVersion >= 7.3,
]; ];
if ($phpVersion >= 7.3) {
$sets['@PHP73Migration'] = true;
}
return $sets;
} }
public function baseRules(float $phpVersion, bool $risky): array public function baseRules(float $phpVersion, bool $risky): array
...@@ -169,10 +180,12 @@ final class Config extends PhpCsFixerConfig ...@@ -169,10 +180,12 @@ final class Config extends PhpCsFixerConfig
$gitRepository = new CachedGitRepository($backendGitRepository, $cache); $gitRepository = new CachedGitRepository($backendGitRepository, $cache);
$headerProvider = new FormattedHeaderProvider( $headerProvider = new FormattedHeaderProvider(
new ChainTemplateProvider([ new ChainTemplateProvider(
new UserDefinedTemplateProvider($fileLocator), [
new LicenseTemplateProvider($composerPackage), new UserDefinedTemplateProvider($fileLocator),
]), new LicenseTemplateProvider($composerPackage),
]
),
new TemplateFormatter($gitRepository, $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