@@ -149,6 +149,28 @@ security-check: check-environment check-container-running
149149 $(EXEC_PHP ) ./vendor/bin/security-checker security:check
150150 @echo " ${GREEN}${CHECK_MARK} Security check completed!${NC} "
151151
152+ # # stan-src: Run PHPStan static analysis on src/
153+ stan-src : check-environment check-container-running
154+ @echo " ${GREEN}${INFO} Running PHPStan on src/...${NC} "
155+ $(EXEC_PHP ) ./vendor/bin/phpstan analyse src --memory-limit=1G --ansi
156+ @echo " ${GREEN}${CHECK_MARK} PHPStan (src/) analysis completed!${NC} "
157+
158+ # # stan-tests: Run PHPStan static analysis on tests/
159+ stan-tests : check-environment check-container-running
160+ @echo " ${GREEN}${INFO} Running PHPStan on tests/...${NC} "
161+ $(EXEC_PHP ) ./vendor/bin/phpstan analyse tests --memory-limit=1G --ansi
162+ @echo " ${GREEN}${CHECK_MARK} PHPStan (tests/) analysis completed!${NC} "
163+
164+ # # stan-file: Run PHPStan analysis on a specific file. Usage: make stan-file FILE=path/to/file.php
165+ stan-file : check-environment check-container-running
166+ @if [ -z " $( FILE) " ]; then \
167+ echo " ${RED}${WARNING} You must specify a file. Usage: make stan-file FILE=path/to/file.php${NC} " ; \
168+ else \
169+ echo " ${GREEN}${INFO} Running PHPStan on file: $( FILE) ...${NC} " ; \
170+ $(EXEC_PHP ) ./vendor/bin/phpstan analyse $(FILE ) --memory-limit=1G --ansi; \
171+ echo " ${GREEN}${CHECK_MARK} PHPStan analysis completed for $( FILE) !${NC} " ; \
172+ fi
173+
152174# # quality: Run all quality commands
153175quality : check-environment check-container-running cs-check test security-check
154176 @echo " ${GREEN}${CHECK_MARK} All quality commands executed!${NC} "
@@ -171,4 +193,4 @@ help:
171193 @echo " \n${GREEN} Available commands:${NC} "
172194 @sed -n ' s/^##//p' $(MAKEFILE_LIST ) | sort | awk ' BEGIN {FS = ": "}; {printf "${YELLOW}%-30s${NC} %s\n", $$1, $$2}'
173195
174- .PHONY : setup-env up down build logs re-build shell composer-install composer-remove composer-update test test-file coverage coverage-html run-script cs-check cs-fix security-check quality help
196+ .PHONY : setup-env up down build logs re-build shell composer-install composer-remove composer-update test test-file coverage coverage-html run-script cs-check cs-fix security-check stan-src stan-tests stan-file quality help
0 commit comments