add php-cs-fixer

This commit is contained in:
Daniel Seifert 2024-12-04 14:41:56 +01:00
parent b7398da253
commit 03119b8da9
2 changed files with 9 additions and 4 deletions

View File

@ -18,12 +18,13 @@
* @license https://www.gnu.org/licenses/gpl-3.0 GNU General Public License 3 (GPLv3) * @license https://www.gnu.org/licenses/gpl-3.0 GNU General Public License 3 (GPLv3)
*/ */
$finder = PhpCsFixer\Finder::create()->in(__DIR__); $finder = PhpCsFixer\Finder::create()
->in(__DIR__);
$config = new PhpCsFixer\Config(); $config = new PhpCsFixer\Config();
return $config return $config
->setRules([ ->setRules([
'@PHP74Migration' => true, '@PHP80Migration' => true,
'@PSR12' => true '@PSR12' => true
]) ])
->setFinder($finder); ->setFinder($finder);

View File

@ -30,7 +30,8 @@
"d3/oxid-twig-extensions": "^1.3" "d3/oxid-twig-extensions": "^1.3"
}, },
"require-dev": { "require-dev": {
"phpstan/phpstan": "^2.0" "phpstan/phpstan": "^2.0",
"friendsofphp/php-cs-fixer": "^3.64.0"
}, },
"autoload": { "autoload": {
"psr-4": { "psr-4": {
@ -38,6 +39,9 @@
} }
}, },
"scripts": { "scripts": {
"php-cs-fixer_audit": "./vendor/bin/php-cs-fixer list-files --config=./vendor/d3/tinymce-editor/.php-cs-fixer.php",
"php-cs-fixer_fix": "./vendor/bin/php-cs-fixer fix --config=./vendor/d3/tinymce-editor/.php-cs-fixer.php",
"phpstan": "./vendor/bin/phpstan analyse -c./vendor/d3/tinymce-editor/phpstan.neon" "phpstan": "./vendor/bin/phpstan analyse -c./vendor/d3/tinymce-editor/phpstan.neon"
} }
} }