@@ -3,10 +3,13 @@ SHELL=bash
33
44.PHONY : *
55
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}")
79SLIM_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";')
811PHP_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")
1013COMPOSER_CACHE_DIR =$(shell composer config --global cache-dir -q || echo ${HOME}/.composer-php/cache)
1114COMPOSER_CONTAINER_CACHE_DIR =$(shell docker run --rm -it ${CONTAINER_NAME} composer config --global cache-dir -q || echo ${HOME}/.composer-php/cache)
1215
2326 -v "`pwd`:`pwd`" \
2427 -v "${COMPOSER_CACHE_DIR}:${COMPOSER_CONTAINER_CACHE_DIR}" \
2528 -w "`pwd`" \
29+ -e OTEL_PHP_FIBERS_ENABLED="true" \
2630 "${CONTAINER_NAME}"
2731endif
2832
@@ -35,18 +39,20 @@ endif
3539all : # # Runs everything ####
3640 @grep -E ' ^[a-zA-Z0-9_-]+:.*?## .*$$' $(MAKEFILE_LIST ) | grep -v " ####" | awk ' BEGIN {FS = ":.*?## "}; {printf "%s\n", $$1}' | xargs --open-tty $(MAKE )
3741
38-
3942syntax-php : # # Lint PHP syntax ##*LH*##
4043 $(DOCKER_RUN ) vendor/bin/parallel-lint --exclude vendor .
4144
45+ rector-upgrade : # # Upgrade any automatically upgradable old code ###
46+ $(DOCKER_RUN ) vendor/bin/rector -c ./etc/qa/rector.php
47+
4248cs-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
4450
4551cs : # # 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
4753
4854stan : # # 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
5056
5157unit-testing : # # Run tests ##*A*##
5258 $(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*## ####
5763 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
5864
5965mutation-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)
6167
6268mutation-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)
6470
6571composer-require-checker : # # Ensure we require every package used in this package directly ##*C*##
6672 $(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 ####
8995shell : # # Provides Shell access in the expected environment ####
9096 $(DOCKER_RUN ) bash
9197
98+
9299help : # # Show this help ####
93100 @printf " \033[33mUsage:\033[0m\n make [target]\n\n\033[33mTargets:\033[0m\n"
94101 @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