Skip to content

Commit b51f883

Browse files
committed
added PHPStan
1 parent f7f1682 commit b51f883

File tree

9 files changed

+318
-58
lines changed

9 files changed

+318
-58
lines changed

.github/workflows/ci.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,3 +24,6 @@ jobs:
2424

2525
- name: Run tests (PHPUnit)
2626
run: vendor/bin/phpunit
27+
28+
- name: Run static type checks (PHPStan)
29+
run: vendor/bin/phpstan analyse src/ tests/

.gitignore

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,3 +23,7 @@
2323
/.php-cs-fixer.php
2424
/.php-cs-fixer.cache
2525
###< friendsofphp/php-cs-fixer ###
26+
27+
###> phpstan/phpstan ###
28+
phpstan.neon
29+
###< phpstan/phpstan ###

README.md

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -173,5 +173,18 @@ Ensure all tests pass successfully.
173173

174174
---
175175

176+
## 10. Run PHPStan check
177+
178+
```bash
179+
composer require --dev phpstan/phpstan
180+
composer require --dev phpstan/phpstan-doctrine
181+
composer require --dev phpstan/phpstan-symfony
182+
vendor/bin/phpstan analyse src --level=max
183+
```
184+
185+
if you encounter issues, you may need to fix them, ignore them on /phpstan.dist.neon config , or lower the level.
186+
187+
---
188+
176189
Your Symfony setup on WSL2 is now complete, including GitHub management and
177190
automated testing with GitHub Actions.

composer.json

Lines changed: 16 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -7,43 +7,43 @@
77
"php": ">=8.2",
88
"ext-ctype": "*",
99
"ext-iconv": "*",
10-
"doctrine/dbal": "^3",
11-
"doctrine/doctrine-bundle": "^2.14",
12-
"doctrine/doctrine-migrations-bundle": "^3.4",
13-
"doctrine/orm": "^3.3",
14-
"phpdocumentor/reflection-docblock": "^5.6",
10+
"doctrine/dbal": "^3.9.4",
11+
"doctrine/doctrine-bundle": "^2.14.1",
12+
"doctrine/doctrine-migrations-bundle": "^3.4.2",
13+
"doctrine/orm": "^3.4",
14+
"phpdocumentor/reflection-docblock": "^5.6.2",
1515
"phpstan/phpdoc-parser": "^2.1",
1616
"symfony/asset": "7.3.*",
1717
"symfony/asset-mapper": "7.3.*",
1818
"symfony/console": "7.3.*",
1919
"symfony/doctrine-messenger": "7.3.*",
2020
"symfony/dotenv": "7.3.*",
2121
"symfony/expression-language": "7.3.*",
22-
"symfony/flex": "^2",
22+
"symfony/flex": "^2.7.1",
2323
"symfony/form": "7.3.*",
2424
"symfony/framework-bundle": "7.3.*",
2525
"symfony/http-client": "7.3.*",
2626
"symfony/intl": "7.3.*",
2727
"symfony/mailer": "7.3.*",
2828
"symfony/mime": "7.3.*",
29-
"symfony/monolog-bundle": "^3.0",
29+
"symfony/monolog-bundle": "^3.10",
3030
"symfony/notifier": "7.3.*",
3131
"symfony/process": "7.3.*",
3232
"symfony/property-access": "7.3.*",
3333
"symfony/property-info": "7.3.*",
3434
"symfony/runtime": "7.3.*",
3535
"symfony/security-bundle": "7.3.*",
3636
"symfony/serializer": "7.3.*",
37-
"symfony/stimulus-bundle": "^2.25",
37+
"symfony/stimulus-bundle": "^2.26.1",
3838
"symfony/string": "7.3.*",
3939
"symfony/translation": "7.3.*",
4040
"symfony/twig-bundle": "7.3.*",
41-
"symfony/ux-turbo": "^2.25",
41+
"symfony/ux-turbo": "^2.26.1",
4242
"symfony/validator": "7.3.*",
4343
"symfony/web-link": "7.3.*",
4444
"symfony/yaml": "7.3.*",
45-
"twig/extra-bundle": "^2.12|^3.0",
46-
"twig/twig": "^2.12|^3.0"
45+
"twig/extra-bundle": "^2.12|^3.21",
46+
"twig/twig": "^2.12|^3.21.1"
4747
},
4848
"config": {
4949
"allow-plugins": {
@@ -98,11 +98,14 @@
9898
},
9999
"require-dev": {
100100
"friendsofphp/php-cs-fixer": "^3.75",
101-
"phpunit/phpunit": "^12.1",
101+
"phpstan/phpstan": "^2.1.17",
102+
"phpstan/phpstan-doctrine": "^2.0.3",
103+
"phpstan/phpstan-symfony": "^2.0.6",
104+
"phpunit/phpunit": "^12.2.2",
102105
"symfony/browser-kit": "7.3.*",
103106
"symfony/css-selector": "7.3.*",
104107
"symfony/debug-bundle": "7.3.*",
105-
"symfony/maker-bundle": "^1.0",
108+
"symfony/maker-bundle": "^1.63",
106109
"symfony/stopwatch": "7.3.*",
107110
"symfony/web-profiler-bundle": "7.3.*"
108111
}

0 commit comments

Comments
 (0)