Skip to content
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
24 changes: 23 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -149,6 +149,28 @@ security-check: check-environment check-container-running
$(EXEC_PHP) ./vendor/bin/security-checker security:check
@echo "${GREEN}${CHECK_MARK} Security check completed!${NC}"

## stan-src: Run PHPStan static analysis on src/
stan-src: check-environment check-container-running
@echo "${GREEN}${INFO} Running PHPStan on src/...${NC}"
$(EXEC_PHP) ./vendor/bin/phpstan analyse src --memory-limit=1G --ansi
@echo "${GREEN}${CHECK_MARK} PHPStan (src/) analysis completed!${NC}"

## stan-tests: Run PHPStan static analysis on tests/
stan-tests: check-environment check-container-running
@echo "${GREEN}${INFO} Running PHPStan on tests/...${NC}"
$(EXEC_PHP) ./vendor/bin/phpstan analyse tests --memory-limit=1G --ansi
@echo "${GREEN}${CHECK_MARK} PHPStan (tests/) analysis completed!${NC}"

## stan-file: Run PHPStan analysis on a specific file. Usage: make stan-file FILE=path/to/file.php
stan-file: check-environment check-container-running
@if [ -z "$(FILE)" ]; then \
echo "${RED}${WARNING} You must specify a file. Usage: make stan-file FILE=path/to/file.php${NC}"; \
else \
echo "${GREEN}${INFO} Running PHPStan on file: $(FILE)...${NC}"; \
$(EXEC_PHP) ./vendor/bin/phpstan analyse $(FILE) --memory-limit=1G --ansi; \
echo "${GREEN}${CHECK_MARK} PHPStan analysis completed for $(FILE)!${NC}"; \
fi

## quality: Run all quality commands
quality: check-environment check-container-running cs-check test security-check
@echo "${GREEN}${CHECK_MARK} All quality commands executed!${NC}"
Expand All @@ -171,4 +193,4 @@ help:
@echo "\n${GREEN}Available commands:${NC}"
@sed -n 's/^##//p' $(MAKEFILE_LIST) | sort | awk 'BEGIN {FS = ": "}; {printf "${YELLOW}%-30s${NC} %s\n", $$1, $$2}'

.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
.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
1 change: 1 addition & 0 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@
"require-dev": {
"friendsofphp/php-cs-fixer": "^3.58",
"nunomaduro/phpinsights": "^2.11",
"phpstan/phpstan": "^1.10",
"phpunit/phpunit": "^10.5",
"squizlabs/php_codesniffer": "^3.10",
"mockery/mockery": "^1.6",
Expand Down
Loading