Skip to content

Commit f486dbb

Browse files
committed
[2.x] Drop PHP 8.1 support
1 parent 8bd9ec8 commit f486dbb

File tree

4 files changed

+2196
-1320
lines changed

4 files changed

+2196
-1320
lines changed

Makefile

+24-17
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,10 @@ SHELL=bash
55

66
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/.$$//')
77
SLIM_DOCKER_IMAGE=$(shell php -r 'echo count(array_intersect(["gd", "vips"], explode(",", "${COMPOSER_SHOW_EXTENSION_LIST}"))) > 0 ? "" : "-slim";')
8-
COMPOSER_CACHE_DIR=$(shell composer config --global cache-dir -q || echo ${HOME}/.composer-php/cache)
98
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]);")
10-
COMPOSER_CONTAINER_CACHE_DIR=$(shell docker run --rm -it "ghcr.io/wyrihaximusnet/php:${PHP_VERSION}-nts-alpine${SLIM_DOCKER_IMAGE}-dev" composer config --global cache-dir -q || echo ${HOME}/.composer-php/cache)
9+
CONTAINER_NAME=$(shell echo "ghcr.io/wyrihaximusnet/php:${PHP_VERSION}-zts-alpine${SLIM_DOCKER_IMAGE}-dev")
10+
COMPOSER_CACHE_DIR=$(shell composer config --global cache-dir -q || echo ${HOME}/.composer-php/cache)
11+
COMPOSER_CONTAINER_CACHE_DIR=$(shell docker run --rm -it ${CONTAINER_NAME} composer config --global cache-dir -q || echo ${HOME}/.composer-php/cache)
1112

1213
ifneq ("$(wildcard /.you-are-in-a-wyrihaximus.net-php-docker-image)","")
1314
IN_DOCKER=TRUE
@@ -22,7 +23,7 @@ else
2223
-v "`pwd`:`pwd`" \
2324
-v "${COMPOSER_CACHE_DIR}:${COMPOSER_CONTAINER_CACHE_DIR}" \
2425
-w "`pwd`" \
25-
"ghcr.io/wyrihaximusnet/php:${PHP_VERSION}-zts-alpine${SLIM_DOCKER_IMAGE}-dev"
26+
${CONTAINER_NAME}
2627
endif
2728

2829
ifneq (,$(findstring icrosoft,$(shell cat /proc/version)))
@@ -31,43 +32,40 @@ else
3132
THREADS=$(shell nproc)
3233
endif
3334

34-
all: ## Runs everything ###
35-
@grep -E '^[a-zA-Z0-9_-]+:.*?## .*$$' $(MAKEFILE_LIST) | grep -v "###" | awk 'BEGIN {FS = ":.*?## "}; {printf "%s\n", $$1}' | xargs --open-tty $(MAKE)
35+
all: ## Runs everything ####
36+
@grep -E '^[a-zA-Z0-9_-]+:.*?## .*$$' $(MAKEFILE_LIST) | grep -v "####" | awk 'BEGIN {FS = ":.*?## "}; {printf "%s\n", $$1}' | xargs --open-tty $(MAKE)
3637

3738
syntax-php: ## Lint PHP syntax
3839
$(DOCKER_RUN) vendor/bin/parallel-lint --exclude vendor .
3940

40-
cs-fix: ## Fix any automatically fixable code style issues
41+
cs-fix: ## Fix any automatically fixable code style issues ###
4142
$(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
4243

4344
cs: ## Check the code for code style issues
4445
$(DOCKER_RUN) vendor/bin/phpcs --parallel=$(THREADS) --cache=./var/.phpcs.cache.json --standard=./etc/qa/phpcs.xml
4546

4647
stan: ## Run static analysis (PHPStan)
47-
$(DOCKER_RUN) vendor/bin/phpstan analyse src tests --ansi -c ./etc/qa/phpstan.neon
48-
49-
psalm: ## Run static analysis (Psalm)
50-
$(DOCKER_RUN) vendor/bin/psalm --threads=$(THREADS) --shepherd --stats --config=./etc/qa/psalm.xml
48+
$(DOCKER_RUN) vendor/bin/phpstan analyse src tests --level max --ansi -c ./etc/qa/phpstan.neon
5149

5250
unit-testing: ## Run tests
5351
$(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
5452
$(DOCKER_RUN) 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
5553

56-
unit-testing-raw: ## Run tests ###
54+
unit-testing-raw: ## Run tests ####
5755
php vendor/phpunit/phpunit/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
5856
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
5957

6058
mutation-testing: ## Run mutation testing
6159
$(DOCKER_RUN) vendor/bin/roave-infection-static-analysis-plugin --ansi --log-verbosity=all --threads=$(THREADS) --psalm-config etc/qa/psalm.xml || (cat ./var/infection.log && false)
6260

63-
mutation-testing-raw: ## Run mutation testing ###
61+
mutation-testing-raw: ## Run mutation testing ####
6462
php vendor/roave/infection-static-analysis-plugin/bin/roave-infection-static-analysis-plugin --ansi --log-verbosity=all --threads=$(THREADS) --psalm-config etc/qa/psalm.xml || (cat ./var/infection.log && false)
6563

6664
composer-require-checker: ## Ensure we require every package used in this package directly
6765
$(DOCKER_RUN) vendor/bin/composer-require-checker --ignore-parse-errors --ansi -vvv --config-file=./etc/qa/composer-require-checker.json
6866

6967
composer-unused: ## Ensure we don't require any package we don't use in this package directly
70-
$(DOCKER_RUN) vendor/bin/composer-unused --ansi
68+
$(DOCKER_RUN) vendor/bin/composer-unused --ansi --configuration=./etc/qa/composer-unused.php
7169

7270
composer-install: ## Install dependencies
7371
$(DOCKER_RUN) composer install --no-progress --ansi --no-interaction --prefer-dist -o
@@ -78,12 +76,21 @@ backward-compatibility-check: ## Check code for backwards incompatible changes
7876
backward-compatibility-check-raw: ## Check code for backwards incompatible changes, doesn't ignore the failure ###
7977
$(DOCKER_RUN) vendor/bin/roave-backward-compatibility-check
8078

81-
shell: ## Provides Shell access in the expected environment ###
82-
$(DOCKER_RUN) ash
79+
shell: ## Provides Shell access in the expected environment ####
80+
$(DOCKER_RUN) bash
81+
82+
install: ## Install dependencies ####
83+
$(DOCKER_RUN) composer install
84+
85+
update: ## Update dependencies ####
86+
$(DOCKER_RUN) composer update -W
87+
88+
outdated: ## Show outdated dependencies ####
89+
$(DOCKER_RUN) composer outdated
8390

84-
task-list-ci: ## CI: Generate a JSON array of jobs to run, matches the commands run when running `make (|all)` ###
91+
task-list-ci: ## CI: Generate a JSON array of jobs to run, matches the commands run when running `make (|all)` ####
8592
@grep -E '^[a-zA-Z0-9_-]+:.*?## .*$$' $(MAKEFILE_LIST) | grep -v "###" | sort | awk 'BEGIN {FS = ":.*?## "}; {printf "%s\n", $$1}' | jq --raw-input --slurp -c 'split("\n")| .[0:-1]'
8693

87-
help: ## Show this help ###
94+
help: ## Show this help ####
8895
@printf "\033[33mUsage:\033[0m\n make [target]\n\n\033[33mTargets:\033[0m\n"
8996
@grep -E '^[a-zA-Z0-9_-]+:.*?## .*$$' $(MAKEFILE_LIST) | sort | awk 'BEGIN {FS = ":.*?## "}; {printf " \033[32m%-32s\033[0m %s\n", $$1, $$2}' | tr -d '#'

composer.json

+6-6
Original file line numberDiff line numberDiff line change
@@ -10,17 +10,17 @@
1010
}
1111
],
1212
"require": {
13-
"php": "^8.1",
13+
"php": "^8.2",
1414
"ext-parallel": "*",
15-
"react/async": "^4.2",
15+
"react/async": "^4.3",
1616
"react/event-loop": "^1.5",
17-
"react/promise": "^2.11 || ^3.2",
17+
"react/promise": "^3.2",
1818
"wyrihaximus/constants": "^1.6.0",
1919
"wyrihaximus/metrics": "^2.1"
2020
},
2121
"require-dev": {
22-
"react-parallel/stubs": "^1.1",
23-
"wyrihaximus/async-test-utilities": "^5.0.25 || ^8.0.5"
22+
"react-parallel/stubs": "^1.2",
23+
"wyrihaximus/async-test-utilities": "^8.0.5"
2424
},
2525
"autoload": {
2626
"psr-4": {
@@ -40,7 +40,7 @@
4040
"infection/extension-installer": true
4141
},
4242
"platform": {
43-
"php": "8.1.13"
43+
"php": "8.2.13"
4444
},
4545
"sort-packages": true
4646
},

0 commit comments

Comments
 (0)