@@ -3,10 +3,13 @@ SHELL=bash
3
3
4
4
.PHONY : *
5
5
6
- COMPOSER_SHOW_EXTENSION_LIST =$(shell composer show -t | grep -o "\-\-\(ext-\) .\+" | sort | uniq | cut -d- -f4- | tr -d '\n' | grep . | sed '/^$$/d' | xargs | sed -e 's/ /, /g' | tr -cd '[:alnum:],' | sed 's/.$$//')
6
+ COMPOSER_SHOW_EXTENSION_LIST_PROD =$(shell composer show -t | grep -o "\-\-\(ext-\) .\+" | sort | uniq | cut -d- -f4- | tr -d '\n' | grep . | sed '/^$$/d' | xargs | sed -e 's/ /, /g' | tr -cd '[:alnum:],' | sed 's/.$$//')
7
+ COMPOSER_SHOW_EXTENSION_LIST_DEV =$(shell composer show -s | grep -o "\(ext-\) .\+" | sort | uniq | cut -d- -f2- | cut -d" " -f1 | xargs | sed -e 's/ /, /g' | tr -cd '[:alnum:],')
8
+ COMPOSER_SHOW_EXTENSION_LIST =$(shell echo "${COMPOSER_SHOW_EXTENSION_LIST_PROD},${COMPOSER_SHOW_EXTENSION_LIST_DEV}")
7
9
SLIM_DOCKER_IMAGE =$(shell php -r 'echo count(array_intersect(["gd", "vips"], explode(",", "${COMPOSER_SHOW_EXTENSION_LIST}") )) > 0 ? "" : "-slim";')
10
+ NTS_OR_ZTS_DOCKER_IMAGE =$(shell php -r 'echo count(array_intersect(["parallel"], explode(",", "${COMPOSER_SHOW_EXTENSION_LIST}") )) > 0 ? "zts" : "nts";')
8
11
PHP_VERSION: =$(shell docker run --rm -v "`pwd`:`pwd`" jess/jq jq -r -c '.config.platform.php' "`pwd`/composer.json" | php -r "echo str_replace('|', '.', explode('.', implode('|', explode('.', stream_get_contents(STDIN) , 2)), 2)[0]);")
9
- CONTAINER_NAME =$(shell echo "ghcr.io/wyrihaximusnet/php:${PHP_VERSION}-nts -alpine${SLIM_DOCKER_IMAGE}-dev")
12
+ CONTAINER_NAME =$(shell echo "ghcr.io/wyrihaximusnet/php:${PHP_VERSION}-${NTS_OR_ZTS_DOCKER_IMAGE} -alpine${SLIM_DOCKER_IMAGE}-dev")
10
13
COMPOSER_CACHE_DIR =$(shell composer config --global cache-dir -q || echo ${HOME}/.composer-php/cache)
11
14
COMPOSER_CONTAINER_CACHE_DIR =$(shell docker run --rm -it ${CONTAINER_NAME} composer config --global cache-dir -q || echo ${HOME}/.composer-php/cache)
12
15
23
26
-v "`pwd`:`pwd`" \
24
27
-v "${COMPOSER_CACHE_DIR}:${COMPOSER_CONTAINER_CACHE_DIR}" \
25
28
-w "`pwd`" \
29
+ -e OTEL_PHP_FIBERS_ENABLED="true" \
26
30
"${CONTAINER_NAME}"
27
31
endif
28
32
@@ -35,18 +39,20 @@ endif
35
39
all : # # Runs everything ####
36
40
@grep -E ' ^[a-zA-Z0-9_-]+:.*?## .*$$' $(MAKEFILE_LIST ) | grep -v " ####" | awk ' BEGIN {FS = ":.*?## "}; {printf "%s\n", $$1}' | xargs --open-tty $(MAKE )
37
41
38
-
39
42
syntax-php : # # Lint PHP syntax ##*LH*##
40
43
$(DOCKER_RUN ) vendor/bin/parallel-lint --exclude vendor .
41
44
45
+ rector-upgrade : # # Upgrade any automatically upgradable old code ###
46
+ $(DOCKER_RUN ) vendor/bin/rector -c ./etc/qa/rector.php
47
+
42
48
cs-fix : # # Fix any automatically fixable code style issues ###
43
- $(DOCKER_RUN ) vendor/bin/phpcbf --parallel=$( THREADS ) --cache=./var/.phpcs.cache.json --standard=./etc/qa/phpcs.xml || $(DOCKER_RUN ) vendor/bin/phpcbf --parallel=$( THREADS ) --cache=./var/.phpcs.cache.json --standard=./etc/qa/phpcs.xml || $(DOCKER_RUN ) vendor/bin/phpcbf --parallel=$( THREADS ) --cache=./var/.phpcs.cache.json --standard=./etc/qa/phpcs.xml -vvvv
49
+ $(DOCKER_RUN ) vendor/bin/phpcbf --parallel=1 --cache=./var/.phpcs.cache.json --standard=./etc/qa/phpcs.xml || $(DOCKER_RUN ) vendor/bin/phpcbf --parallel=1 --cache=./var/.phpcs.cache.json --standard=./etc/qa/phpcs.xml || $(DOCKER_RUN ) vendor/bin/phpcbf --parallel=1 --cache=./var/.phpcs.cache.json --standard=./etc/qa/phpcs.xml -vvvv
44
50
45
51
cs : # # Check the code for code style issues ##*LCH*##
46
- $(DOCKER_RUN ) vendor/bin/phpcs --parallel=$( THREADS ) --cache=./var/.phpcs.cache.json --standard=./etc/qa/phpcs.xml
52
+ $(DOCKER_RUN ) vendor/bin/phpcs --parallel=1 --cache=./var/.phpcs.cache.json --standard=./etc/qa/phpcs.xml
47
53
48
54
stan : # # Run static analysis (PHPStan) ##*LCH*##
49
- $(DOCKER_RUN ) vendor/bin/phpstan analyse src tests --level max --ansi -c ./etc/qa/phpstan.neon
55
+ $(DOCKER_RUN ) vendor/bin/phpstan analyse etc src tests --level max --ansi -c ./etc/qa/phpstan.neon
50
56
51
57
unit-testing : # # Run tests ##*A*##
52
58
$(DOCKER_RUN ) vendor/bin/phpunit --colors=always -c ./etc/qa/phpunit.xml --coverage-text --coverage-html ./var/tests-unit-coverage-html --coverage-clover ./var/tests-unit-clover-coverage.xml
@@ -57,10 +63,10 @@ unit-testing-raw: ## Run tests ##*D*## ####
57
63
test -n " $( COVERALLS_REPO_TOKEN) " && test -n " $( COVERALLS_RUN_LOCALLY) " && test -f ./var/tests-unit-clover-coverage.xml && ./vendor/bin/php-coveralls -v --coverage_clover ./build/logs/clover.xml --json_path ./var/tests-unit-clover-coverage-upload.json || true
58
64
59
65
mutation-testing : # # Run mutation testing ##*LCH*##
60
- $(DOCKER_RUN ) vendor/bin/infection --ansi --log-verbosity=all --threads=$(THREADS ) || (cat ./var/infection.log && false)
66
+ $(DOCKER_RUN ) vendor/bin/infection --ansi --log-verbosity=all --ignore-msi-with-no-mutations -- threads=$(THREADS ) || (cat ./var/infection.log && false)
61
67
62
68
mutation-testing-raw : # # Run mutation testing ####
63
- vendor/bin/infection --ansi --log-verbosity=all --threads=$(THREADS ) || (cat ./var/infection.log && false)
69
+ vendor/bin/infection --ansi --log-verbosity=all --ignore-msi-with-no-mutations -- threads=$(THREADS ) || (cat ./var/infection.log && false)
64
70
65
71
composer-require-checker : # # Ensure we require every package used in this package directly ##*C*##
66
72
$(DOCKER_RUN ) vendor/bin/composer-require-checker --ignore-parse-errors --ansi -vvv --config-file=./etc/qa/composer-require-checker.json
@@ -89,6 +95,7 @@ outdated: ### Show outdated dependencies ####
89
95
shell : # # Provides Shell access in the expected environment ####
90
96
$(DOCKER_RUN ) bash
91
97
98
+
92
99
help : # # Show this help ####
93
100
@printf " \033[33mUsage:\033[0m\n make [target]\n\n\033[33mTargets:\033[0m\n"
94
101
@grep -E ' ^[a-zA-Z0-9_-]+:.*?## .*$$' $(MAKEFILE_LIST ) | sort | awk ' BEGIN {FS = ":.*?## "}; {printf " \033[32m%-32s\033[0m %s\n", $$1, $$2}' | tr -d ' #'
0 commit comments