From 6915e23208f7da2aaa3cb4c943c035324a2252e9 Mon Sep 17 00:00:00 2001 From: dece Date: Sun, 25 Feb 2024 20:15:13 +0100 Subject: [PATCH] configure formatting with php-cs-fixer --- .gitignore | 5 +++ .php-cs-fixer.dist.php | 13 ++++++ composer.json | 1 + composer.lock | 94 +++++++++++++++++++++++++++++++++++++++++- symfony.lock | 12 ++++++ 5 files changed, 124 insertions(+), 1 deletion(-) create mode 100644 .php-cs-fixer.dist.php diff --git a/.gitignore b/.gitignore index d0f6419..256ebea 100644 --- a/.gitignore +++ b/.gitignore @@ -19,3 +19,8 @@ .phpunit.result.cache /phpunit.xml ###< symfony/phpunit-bridge ### + +###> friendsofphp/php-cs-fixer ### +/.php-cs-fixer.php +/.php-cs-fixer.cache +###< friendsofphp/php-cs-fixer ### diff --git a/.php-cs-fixer.dist.php b/.php-cs-fixer.dist.php new file mode 100644 index 0000000..3788194 --- /dev/null +++ b/.php-cs-fixer.dist.php @@ -0,0 +1,13 @@ +in(__DIR__) + ->exclude('var') +; + +return (new PhpCsFixer\Config()) + ->setRules([ + '@Symfony' => true, + ]) + ->setFinder($finder) +; diff --git a/composer.json b/composer.json index 99cc3ec..5ff17f2 100644 --- a/composer.json +++ b/composer.json @@ -93,6 +93,7 @@ } }, "require-dev": { + "friendsofphp/php-cs-fixer": "^3.50", "phpunit/phpunit": "^9.5", "symfony/browser-kit": "6.2.*", "symfony/css-selector": "6.2.*", diff --git a/composer.lock b/composer.lock index c8a15a2..3579db8 100644 --- a/composer.lock +++ b/composer.lock @@ -4,7 +4,7 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "This file is @generated automatically" ], - "content-hash": "24fab26692524d95cb0fec16c9be8ea6", + "content-hash": "c241853e026884d05d25f49b85867c16", "packages": [ { "name": "doctrine/annotations", @@ -7850,6 +7850,98 @@ ], "time": "2022-12-24T12:35:10+00:00" }, + { + "name": "friendsofphp/php-cs-fixer", + "version": "v3.50.0", + "source": { + "type": "git", + "url": "https://github.com/PHP-CS-Fixer/PHP-CS-Fixer.git", + "reference": "dbea11dcb6d9a1f6c8d51c0e580ab4a8876f524c" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/PHP-CS-Fixer/PHP-CS-Fixer/zipball/dbea11dcb6d9a1f6c8d51c0e580ab4a8876f524c", + "reference": "dbea11dcb6d9a1f6c8d51c0e580ab4a8876f524c", + "shasum": "" + }, + "require": { + "composer/semver": "^3.4", + "composer/xdebug-handler": "^3.0.3", + "ext-filter": "*", + "ext-json": "*", + "ext-tokenizer": "*", + "php": "^7.4 || ^8.0", + "sebastian/diff": "^4.0 || ^5.0 || ^6.0", + "symfony/console": "^5.4 || ^6.0 || ^7.0", + "symfony/event-dispatcher": "^5.4 || ^6.0 || ^7.0", + "symfony/filesystem": "^5.4 || ^6.0 || ^7.0", + "symfony/finder": "^5.4 || ^6.0 || ^7.0", + "symfony/options-resolver": "^5.4 || ^6.0 || ^7.0", + "symfony/polyfill-mbstring": "^1.28", + "symfony/polyfill-php80": "^1.28", + "symfony/polyfill-php81": "^1.28", + "symfony/process": "^5.4 || ^6.0 || ^7.0", + "symfony/stopwatch": "^5.4 || ^6.0 || ^7.0" + }, + "require-dev": { + "facile-it/paraunit": "^1.3 || ^2.0", + "justinrainbow/json-schema": "^5.2", + "keradus/cli-executor": "^2.1", + "mikey179/vfsstream": "^1.6.11", + "php-coveralls/php-coveralls": "^2.7", + "php-cs-fixer/accessible-object": "^1.1", + "php-cs-fixer/phpunit-constraint-isidenticalstring": "^1.4", + "php-cs-fixer/phpunit-constraint-xmlmatchesxsd": "^1.4", + "phpunit/phpunit": "^9.6 || ^10.5.5 || ^11.0.2", + "symfony/var-dumper": "^5.4 || ^6.0 || ^7.0", + "symfony/yaml": "^5.4 || ^6.0 || ^7.0" + }, + "suggest": { + "ext-dom": "For handling output formats in XML", + "ext-mbstring": "For handling non-UTF8 characters." + }, + "bin": [ + "php-cs-fixer" + ], + "type": "application", + "autoload": { + "psr-4": { + "PhpCsFixer\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Fabien Potencier", + "email": "fabien@symfony.com" + }, + { + "name": "Dariusz RumiƄski", + "email": "dariusz.ruminski@gmail.com" + } + ], + "description": "A tool to automatically fix PHP code style", + "keywords": [ + "Static code analysis", + "fixer", + "standards", + "static analysis" + ], + "support": { + "issues": "https://github.com/PHP-CS-Fixer/PHP-CS-Fixer/issues", + "source": "https://github.com/PHP-CS-Fixer/PHP-CS-Fixer/tree/v3.50.0" + }, + "funding": [ + { + "url": "https://github.com/keradus", + "type": "github" + } + ], + "time": "2024-02-23T23:17:45+00:00" + }, { "name": "masterminds/html5", "version": "2.8.1", diff --git a/symfony.lock b/symfony.lock index 5ef3ac8..85b3c65 100644 --- a/symfony.lock +++ b/symfony.lock @@ -35,6 +35,18 @@ "migrations/.gitignore" ] }, + "friendsofphp/php-cs-fixer": { + "version": "3.50", + "recipe": { + "repo": "github.com/symfony/recipes", + "branch": "main", + "version": "3.0", + "ref": "be2103eb4a20942e28a6dd87736669b757132435" + }, + "files": [ + ".php-cs-fixer.dist.php" + ] + }, "phpunit/phpunit": { "version": "9.6", "recipe": {