Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for running phpstan and generating the baseline #37

Merged
merged 4 commits into from
Feb 3, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ endif

ifneq ("$(shell whoami)", "skpr")
EXEC=$(DOCKER_COMPOSE) exec -T php-cli
EXEC_APP=$(DOCKER_COMPOSE) exec -w /data/app -T php-cli
endif

DRUSH=$(EXEC) ./bin/drush
Expand Down Expand Up @@ -45,6 +46,12 @@ login:
switch:
$(GIT_SWITCH) $(BRANCH)

phpstan:
$(EXEC_APP) /data/bin/phpstan --configuration=./core/phpstan.neon.dist --memory-limit=1G

phpstan-baseline:
$(EXEC_APP) /data/bin/phpstan --configuration=./core/phpstan.neon.dist --generate-baseline=./core/.phpstan-baseline.php --memory-limit=1G

9.3: php8.0
$(GIT_SWITCH) 9.3.x
make clean
Expand Down
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,8 @@ Make commands should be executed on the host machine.
* `umami` - installs Drupal with the demo_umami profile
* `login` - gets a one-time login link
* `switch` - switches branch, e.g. `make BRANCH=9.3 switch`
* `phpstan` - runs phpstan for core
* `phpstan-baseline` - generates phpstan baseline for core
* `10.2|10.3|10.4|10.5|11.0|11.1|11.x` - provides a clean environment with the specified Drupal version
* `php8.1|php8.2|php8.3` - starts the stack with the specified php version

Expand Down
5 changes: 5 additions & 0 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,11 @@
"mstrelan\\DrupalContrib\\": "src/"
}
},
"autoload-dev": {
"psr-4": {
"Drupal\\PHPStan\\Rules\\": "app/core/tests/PHPStan/Rules"
}
},
"extra": {
"drupal-scaffold": {
"locations": {
Expand Down