Commit 7598796f authored by Guillaume Perréal's avatar Guillaume Perréal
Browse files

Supporte PHP 8.0 dans les règles.

No related merge requests found
Showing with 24 additions and 11 deletions
+24 -11
<?php declare(strict_types=1); <?php
declare(strict_types=1);
/* /*
* irstea/php-cs-fixer-config - Jeux de règles pour php-cs-fixer. * irstea/php-cs-fixer-config - Jeux de règles pour php-cs-fixer.
* Copyright (C) 2018-2020 IRSTEA * Copyright (C) 2018-2020 IRSTEA
...@@ -74,19 +75,30 @@ final class Config extends PhpCsFixerConfig ...@@ -74,19 +75,30 @@ final class Config extends PhpCsFixerConfig
private function ruleSets(float $phpVersion, bool $risky): array private function ruleSets(float $phpVersion, bool $risky): array
{ {
$sets = [ $sets = [
'@PSR2' => true, '@PSR2' => true,
'@Symfony' => true, '@PSR12' => true,
'@Symfony:risky' => $risky, '@Symfony' => true,
'@PHP56Migration' => true, '@Symfony:risky' => $risky,
'@PHP56Migration:risky' => $risky,
'@PHP70Migration' => true,
'@PHP70Migration:risky' => $risky,
'@PHP71Migration' => true,
'@PHP71Migration: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; $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; return $sets;
...@@ -101,6 +113,7 @@ final class Config extends PhpCsFixerConfig ...@@ -101,6 +113,7 @@ final class Config extends PhpCsFixerConfig
'concat_space' => ['spacing' => 'one'], 'concat_space' => ['spacing' => 'one'],
'method_argument_space' => ['ensure_fully_multiline' => true], 'method_argument_space' => ['ensure_fully_multiline' => true],
'declare_strict_types' => $phpVersion >= 7.0, 'declare_strict_types' => $phpVersion >= 7.0,
'blank_line_after_opening_tag' => false,
// Safe // Safe
'align_multiline_comment' => true, 'align_multiline_comment' => true,
......
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