Skip to content

Commit

Permalink
[dx] keep tooling in one place
Browse files Browse the repository at this point in the history
- `composer tools:run` runs `php-cs-fixer` & `phpstan`
- `composer tools:run:php-cs-fixer` run only `php-cs-fixer` (works for `phpstan` as well).
- `composer tools:upgrade` upgrades / installs all of the `tools/*`
- `composer tools:upgrade:php-cs-fixer` Upgrades / installs only `php-cs-fixer` (works for `phpstan` as well)
  • Loading branch information
jrushlow committed Jun 11, 2024
1 parent 6dbf6b6 commit 09c35b9
Show file tree
Hide file tree
Showing 4 changed files with 25 additions and 3 deletions.
16 changes: 13 additions & 3 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,7 @@
"league/oauth2-facebook": "^1.1|^2.0",
"symfony/phpunit-bridge": "^5.3.1|^6.0|^7.0",
"symfony/security-guard": "^4.4|^5.0|^6.0|^7.0",
"symfony/yaml": "^4.4|^5.0|^6.0|^7.0",
"phpstan/phpstan": "^1.0"
"symfony/yaml": "^4.4|^5.0|^6.0|^7.0"
},
"autoload": {
"psr-4": { "KnpU\\OAuth2ClientBundle\\": "src/" }
Expand All @@ -37,6 +36,17 @@
"symfony/security-guard": "For integration with Symfony's Guard Security layer"
},
"scripts": {
"test": "simple-phpunit && phpstan analyze"
"tools:upgrade": [
"@tools:upgrade:php-cs-fixer",
"@tools:upgrade:phpstan"
],
"tools:upgrade:php-cs-fixer": "composer upgrade -W -d tools/php-cs-fixer",
"tools:upgrade:phpstan": "composer upgrade -W -d tools/phpstan",
"tools:run": [
"@tools:run:php-cs-fixer",
"@tools:run:phpstan"
],
"tools:run:php-cs-fixer": "tools/php-cs-fixer/vendor/bin/php-cs-fixer fix",
"tools:run:phpstan": "tools/phpstan/vendor/bin/phpstan --memory-limit=1G"
}
}
2 changes: 2 additions & 0 deletions tools/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
**/vendor
**/composer.lock
5 changes: 5 additions & 0 deletions tools/php-cs-fixer/composer.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"require": {
"friendsofphp/php-cs-fixer": "^3"
}
}
5 changes: 5 additions & 0 deletions tools/phpstan/composer.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"require": {
"phpstan/phpstan": "^1"
}
}

0 comments on commit 09c35b9

Please sign in to comment.