Skip to content

Commit

Permalink
feat: added phpcs fixer
Browse files Browse the repository at this point in the history
  • Loading branch information
benborla committed Nov 17, 2023
1 parent adb514f commit a8a8523
Show file tree
Hide file tree
Showing 10 changed files with 468 additions and 65 deletions.
5 changes: 5 additions & 0 deletions api/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -28,3 +28,8 @@ phpstan.neon
/.phpcs-cache
/phpcs.xml
###< squizlabs/php_codesniffer ###

###> friendsofphp/php-cs-fixer ###
/.php-cs-fixer.php
/.php-cs-fixer.cache
###< friendsofphp/php-cs-fixer ###
13 changes: 13 additions & 0 deletions api/.php-cs-fixer.dist.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
<?php

$finder = (new PhpCsFixer\Finder())
->in(__DIR__)
->exclude('var')
;

return (new PhpCsFixer\Config())
->setRules([
'@Symfony' => true,
])
->setFinder($finder)
;
7 changes: 6 additions & 1 deletion api/composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
},
"require-dev": {
"doctrine/doctrine-fixtures-bundle": "^3.5",
"friendsofphp/php-cs-fixer": "^3.38",
"phpstan/phpstan-symfony": "^1.3",
"phpunit/phpunit": "^9.5",
"squizlabs/php_codesniffer": "^3.7",
Expand Down Expand Up @@ -69,7 +70,11 @@
],
"test_setup_db": "php bin/console doctrine:fixtures:load --env=test",
"test": "php bin/phpunit",
"lint": "./vendor/bin/phpcs --standard=PSR12"
"lint": "./vendor/bin/phpcs --standard=PSR12 -p --colors",
"fix": [
"./vendor/bin/php-cs-fixer fix ./src",
"./vendor/bin/php-cs-fixer fix ./tests"
]
},
"conflict": {
"symfony/symfony": "*"
Expand Down
Loading

0 comments on commit a8a8523

Please sign in to comment.