Skip to content

Commit 244a53c

Browse files
authored
minor #188 [dx] keep tooling in one place
- `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)
1 parent d3c4b20 commit 244a53c

File tree

4 files changed

+25
-3
lines changed

4 files changed

+25
-3
lines changed

composer.json

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,7 @@
1717
"doctrine/orm": "^2.7",
1818
"doctrine/persistence": "^2.0",
1919
"symfony/framework-bundle": "^5.4 | ^6.0 | ^7.0",
20-
"symfony/phpunit-bridge": "^5.4 | ^6.0 | ^7.0",
21-
"phpstan/phpstan": "^1.11.x-dev"
20+
"symfony/phpunit-bridge": "^5.4 | ^6.0 | ^7.0"
2221
},
2322
"autoload": {
2423
"psr-4": {
@@ -31,6 +30,17 @@
3130
}
3231
},
3332
"scripts": {
34-
"phpstan": "vendor/bin/phpstan"
33+
"tools:upgrade": [
34+
"@tools:upgrade:php-cs-fixer",
35+
"@tools:upgrade:phpstan"
36+
],
37+
"tools:upgrade:php-cs-fixer": "composer upgrade -W -d tools/php-cs-fixer",
38+
"tools:upgrade:phpstan": "composer upgrade -W -d tools/phpstan",
39+
"tools:run": [
40+
"@tools:run:php-cs-fixer",
41+
"@tools:run:phpstan"
42+
],
43+
"tools:run:php-cs-fixer": "tools/php-cs-fixer/vendor/bin/php-cs-fixer fix",
44+
"tools:run:phpstan": "tools/phpstan/vendor/bin/phpstan --memory-limit=1G"
3545
}
3646
}

tools/.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
**/vendor
2+
**/composer.lock

tools/php-cs-fixer/composer.json

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
{
2+
"require": {
3+
"friendsofphp/php-cs-fixer": "^3"
4+
}
5+
}

tools/phpstan/composer.json

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
{
2+
"require": {
3+
"phpstan/phpstan": "^1"
4+
}
5+
}

0 commit comments

Comments
 (0)