diff --git a/src/Config.php b/src/Config.php index 86573e48a0832e95f7b6eb9aabe0b5295c061253..4417ca948e41940931a2ea62ce59dde8ee18a9ab 100644 --- a/src/Config.php +++ b/src/Config.php @@ -1,4 +1,5 @@ -<?php declare(strict_types=1); +<?php +declare(strict_types=1); /* * irstea/php-cs-fixer-config - Jeux de règles pour php-cs-fixer. * Copyright (C) 2018-2020 IRSTEA @@ -74,19 +75,30 @@ final class Config extends PhpCsFixerConfig private function ruleSets(float $phpVersion, bool $risky): array { $sets = [ - '@PSR2' => true, - '@Symfony' => true, - '@Symfony:risky' => $risky, - '@PHP56Migration' => true, - '@PHP56Migration:risky' => $risky, - '@PHP70Migration' => true, - '@PHP70Migration:risky' => $risky, - '@PHP71Migration' => true, - '@PHP71Migration:risky' => $risky, + '@PSR2' => true, + '@PSR12' => true, + '@Symfony' => true, + '@Symfony:risky' => $risky, ]; - if ($phpVersion >= 7.3) { + if ($phpVersion >= 8.0) { + $sets['@PHP80Migration'] = true; + } elseif ($phpVersion >= 7.4) { + $sets['@PHP74Migration'] = true; + $sets['@PHP74Migration:risky'] = $risky; + } elseif ($phpVersion >= 7.3) { $sets['@PHP73Migration'] = true; + } elseif ($phpVersion >= 7.1) { + $sets['@PHP71Migration'] = true; + $sets['@PHP71Migration:risky'] = $risky; + } elseif ($phpVersion >= 7.0) { + $sets['@PHP70Migration'] = true; + $sets['@PHP70Migration:risky'] = $risky; + } elseif ($phpVersion >= 5.6) { + $sets['@PHP56Migration'] = true; + $sets['@PHP56Migration:risky'] = $risky; + } elseif ($phpVersion >= 5.4) { + $sets['@PHP54Migration'] = true; } return $sets; @@ -101,6 +113,7 @@ final class Config extends PhpCsFixerConfig 'concat_space' => ['spacing' => 'one'], 'method_argument_space' => ['ensure_fully_multiline' => true], 'declare_strict_types' => $phpVersion >= 7.0, + 'blank_line_after_opening_tag' => false, // Safe 'align_multiline_comment' => true,