From caccf8a9fb90d17d1918eb24d8048aaca1cc74b4 Mon Sep 17 00:00:00 2001 From: MDW Date: Fri, 24 Nov 2023 13:43:59 +0100 Subject: [PATCH] Add .php-cs-fixer.dist.php configuration --- .php-cs-fixer.dist.php | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) create mode 100644 .php-cs-fixer.dist.php diff --git a/.php-cs-fixer.dist.php b/.php-cs-fixer.dist.php new file mode 100644 index 00000000000..d145f9e143d --- /dev/null +++ b/.php-cs-fixer.dist.php @@ -0,0 +1,30 @@ +in(__DIR__) + ->exclude([ + 'htdocs/includes', + ]) + ->notPath([ + 'vendor', + ]) +; + +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, + //'strict_param' => true, + //'array_syntax' => ['syntax' => 'short'], + 'array_syntax' => false, + ]) + ->setFinder($finder) + // TAB Indent violates PSR-12 "must" rule, but used in code + // (See https://www.php-fig.org/psr/psr-12/#24-indenting ) + ->setIndent("\t") + // All files MUST use the Unix LF line ending only + // https://www.php-fig.org/psr/psr-12/#22-files + ->setLineEnding("\n") +;