Repository navigation
Expand file tree
/
Copy pathMakefile
More file actions
61 lines (42 loc) · 1.51 KB
/
Copy pathMakefile
File metadata and controls
61 lines (42 loc) · 1.51 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
# Constants
EXEC = "docker-compose exec -u$(user) workspace"
EXEC_NON_TTY = "docker-compose exec -u$(user) -T workspace"
# Default variables
user := "user"
db := "app"
##@ Build environment
start: up build ## Start and build environment
stop:
docker-compose stop
up:
docker-compose up -d
build: composer-install
composer-install: ## Installs composer dependencies
"$(EXEC)" composer install
generate: ## Generates request classes based on API definition
"$(EXEC)" php generate.php
make rector
make cs-fix
make docs
docs: ## Generates the endpoint reference in docs/endpoints
"$(EXEC)" composer generate-endpoint-docs
##@ Analyze
analyze: phpstan cs ## Run code analyzers
phpstan: ## Runs PHPStan static analyzer
"$(EXEC)" composer phpstan
phpstan-dir: ## <target=src/Foo> Run static analysis of a specific target
"$(EXEC_NON_TTY)" vendor/bin/phpstan analyse $(target) -c phpstan.neon --no-progress --memory-limit=2G --ansi
cs: ## Runs PHP-CS-Fixer analyzer
"$(EXEC)" vendor/bin/php-cs-fixer fix --dry-run --stop-on-violation
cs-fix: ## Runs PHP-CS-Fixer and fixes all problems
"$(EXEC_NON_TTY)" vendor/bin/php-cs-fixer fix --config=.php-cs-fixer.dist.php $(target)
rector: ## Runs PHP-CS-Fixer and fixes all problems
"$(EXEC_NON_TTY)" vendor/bin/rector process --no-diffs --ansi --memory-limit=2G
##@ Test
test: ## Run test suite
"$(EXEC)" vendor/bin/phpunit
test-all: ## Run composer test
"$(EXEC)" composer test
##@ Workspace
cmd: ## [user=user] Open workspace shell
clear && "$(EXEC)" bash || true && clear