Created
February 16, 2026 09:55
-
-
Save gnugat/b5bb7ba803569d61feb5d2366dd1b41d to your computer and use it in GitHub Desktop.
Checking FQCN against filename: composer dump (check) + swiss knife (fix)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # Parameters (optional) | |
| # * `arg`: arbitrary arguments to pass to rules (default: none) | |
| # * `env`: used to set `APP_ENV` (default: `test`) | |
| arg ?= | |
| env ?= test | |
| # Docker containers | |
| QA_SERVICE = app | |
| # Executables | |
| COMPOSER = docker compose exec $(QA_SERVICE) composer | |
| SWISS_KNIFE = docker compose exec $(QA_SERVICE) php vendor/bin/swiss-knife | |
| # Misc | |
| .DEFAULT_GOAL = help | |
| .PHONY: * | |
| ## ββ π The BisouLand Makefile ββββββββββββββββββββββββββββββββββββββββββββββ | |
| ## Based on https://github.com/dunglas/symfony-docker | |
| ## (arg) denotes the possibility to pass "arg=" parameter to the target | |
| ## this allows to add command and options, example: make composer arg='dump --optimize' | |
| ## (env) denotes the possibility to pass "env=" parameter to the target | |
| ## this allows to set APP_ENV environment variable (default: test), example: make console env='prod' arg='cache:warmup' | |
| help: ## Outputs this help screen | |
| @grep -E '(^[a-zA-Z0-9\./_-]+:.*?##.*$$)|(^##)' $(MAKEFILE_LIST) \ | |
| | awk 'BEGIN {FS = ":.*?## "}{printf "\033[32m%-30s\033[0m %s\n", $$1, $$2}' \ | |
| | sed -e 's/\[32m##/[33m/' | |
| ## ββ PHP π βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ | |
| composer-dump: ## Dumps autoloader (arg, eg `arg='--classmap-authoritative'`) | |
| @$(COMPOSER) dump-autoload --optimize --strict-psr --strict-ambiguous $(arg) | |
| cs-fix: ## Fixes CS with Swiss Knife and PHP-CS-Fixer | |
| @$(SWISS_KNIFE) namespace-to-psr-4 src --namespace-root 'Bl\\Qa\\' | |
| @$(SWISS_KNIFE) namespace-to-psr-4 tests --namespace-root 'Bl\\Qa\\Tests\\' | |
| swiss-knife: ## Automated refactorings with Swiss Knife (arg, eg `arg='namespace-to-psr-4 src --namespace-root \'App\\\''`) | |
| @$(SWISS_KNIFE) $(arg) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment