From fca403b49bbee1ac7af7f99d34706d44eb8d3afc Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sun, 3 Dec 2023 20:57:54 +0100 Subject: [PATCH] Debug php-cs-fixer --- .php-cs-fixer.dist.php | 10 +++++++++- dev/tools/php-cs-fixer/.gitignore | 1 + dev/tools/{ => php-cs-fixer}/run-php-cs-fixer.sh | 2 +- dev/tools/rector/README.md | 1 + 4 files changed, 12 insertions(+), 2 deletions(-) create mode 100644 dev/tools/php-cs-fixer/.gitignore rename dev/tools/{ => php-cs-fixer}/run-php-cs-fixer.sh (97%) diff --git a/.php-cs-fixer.dist.php b/.php-cs-fixer.dist.php index b8709b88a33..1a713128d4a 100644 --- a/.php-cs-fixer.dist.php +++ b/.php-cs-fixer.dist.php @@ -16,11 +16,19 @@ return (new PhpCsFixer\Config()) ->setRules([ // Apply PSR-12 as per https://wiki.dolibarr.org/index.php?title=Langages_et_normes#PHP:~:text=utiliser%20est%20le-,PSR%2D12,-(https%3A//www // '@PSR12' => true, // Disabled for now to limit number of changes + // Minimum version Dolibarr v18.0.0 - '@PHP71Migration' => true, + // Compatibility with min 7.1 is announced with Dolibarr18.0 but + // app is still working with 7.0 so no reason to abandon compatiblity with this target for the moment. + // So we use target PHP70 for the moment. + '@PHP70Migration' => true, + //'@PHP71Migration' => true, + //'strict_param' => true, //'array_syntax' => ['syntax' => 'short'], + //'list_syntax' => false, 'array_syntax' => false, + 'ternary_to_null_coalescing' => false ]) ->setFinder($finder) // TAB Indent violates PSR-12 "must" rule, but used in code diff --git a/dev/tools/php-cs-fixer/.gitignore b/dev/tools/php-cs-fixer/.gitignore new file mode 100644 index 00000000000..57872d0f1e5 --- /dev/null +++ b/dev/tools/php-cs-fixer/.gitignore @@ -0,0 +1 @@ +/vendor/ diff --git a/dev/tools/run-php-cs-fixer.sh b/dev/tools/php-cs-fixer/run-php-cs-fixer.sh similarity index 97% rename from dev/tools/run-php-cs-fixer.sh rename to dev/tools/php-cs-fixer/run-php-cs-fixer.sh index 8bd52e34da9..96a3b69cd8f 100755 --- a/dev/tools/run-php-cs-fixer.sh +++ b/dev/tools/php-cs-fixer/run-php-cs-fixer.sh @@ -49,7 +49,7 @@ if [ "x$1" = "x" ]; then fi ( - cd "${MYDIR}/../.." || exit + cd "${MYDIR}/../../.." || exit CMD= # If no argument, run check by default [[ "$1" == "" ]] && CMD=check diff --git a/dev/tools/rector/README.md b/dev/tools/rector/README.md index 859f4bf03c0..c28f7a8d6c5 100644 --- a/dev/tools/rector/README.md +++ b/dev/tools/rector/README.md @@ -13,6 +13,7 @@ Install rector with composer composer install ``` + #### Usage ##### To make changes (Add --dry-run for test mode only)