From 7598796f228e944a376202660f2db3a2da386214 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Guillaume=20Perr=C3=A9al?= <guillaume.perreal@irstea.fr> Date: Thu, 4 Mar 2021 11:21:34 +0100 Subject: [PATCH] =?UTF-8?q?Supporte=20PHP=208.0=20dans=20les=20r=C3=A8gles?= =?UTF-8?q?.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/Config.php | 35 ++++++++++++++++++++++++----------- 1 file changed, 24 insertions(+), 11 deletions(-) diff --git a/src/Config.php b/src/Config.php index 86573e4..4417ca9 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, -- GitLab