Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commitf45eadf

Browse files
authored
Merge pull request#11 from MammatusPHP/PHP-8.4PLUS
Bump to PHP 8.4+
2 parents67bc4d6 +e813ac6 commitf45eadf

File tree

5 files changed

+1100
-1704
lines changed

5 files changed

+1100
-1704
lines changed

‎Makefile‎

Lines changed: 44 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -3,15 +3,17 @@ SHELL=bash
33

44
.PHONY:*
55

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:],')
6+
DOCKER_AVAILABLE=$(shell ((command -v docker >/dev/null 2>&1) && echo 0 || echo 1))
7+
CONTAINER_REGISTRY_REPO="ghcr.io/wyrihaximusnet/php"
8+
COMPOSER_SHOW_EXTENSION_LIST_PROD=$(shell (((command -v composer >/dev/null 2>&1) && composer show -t --no-plugins) || docker run --rm -v "`pwd`:`pwd`" -w`pwd` ${CONTAINER_REGISTRY_REPO}:8.4-nts-alpine-slim-dev composer show -t --no-plugins) | grep -o "\-\-\(ext-\).\+" | sort | uniq | cut -d- -f4- | tr -d '\n' | grep . | sed '/^$$/d' | xargs | sed -e 's/ /, /g' | tr -cd '[:alnum:],' | sed 's/.$$//')
9+
COMPOSER_SHOW_EXTENSION_LIST_DEV=$(shell (((command -v composer >/dev/null 2>&1) && composer show -s --no-plugins) || docker run --rm -v "`pwd`:`pwd`" -w`pwd` ${CONTAINER_REGISTRY_REPO}:8.4-nts-alpine-slim-dev composer show -s --no-plugins) | grep -o "\(ext-\).\+" | sort | uniq | cut -d- -f2- | cut -d" " -f1 | xargs | sed -e 's/ /, /g' | tr -cd '[:alnum:],')
810
COMPOSER_SHOW_EXTENSION_LIST=$(shell echo "${COMPOSER_SHOW_EXTENSION_LIST_PROD},${COMPOSER_SHOW_EXTENSION_LIST_DEV}")
911
SLIM_DOCKER_IMAGE=$(shell php -r 'echo count(array_intersect(["gd", "vips"], explode(",", "${COMPOSER_SHOW_EXTENSION_LIST}"))) > 0 ? "" : "-slim";')
1012
NTS_OR_ZTS_DOCKER_IMAGE=$(shell php -r 'echo count(array_intersect(["parallel"], explode(",", "${COMPOSER_SHOW_EXTENSION_LIST}"))) > 0 ? "zts" : "nts";')
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]);")
12-
CONTAINER_NAME=$(shell echo "ghcr.io/wyrihaximusnet/php:${PHP_VERSION}-${NTS_OR_ZTS_DOCKER_IMAGE}-alpine${SLIM_DOCKER_IMAGE}-dev")
13-
COMPOSER_CACHE_DIR=$(shell composer config --global cache-dir -q || echo ${HOME}/.composer-php/cache)
14-
COMPOSER_CONTAINER_CACHE_DIR=$(shell docker run --rm -it ${CONTAINER_NAME} composer config --global cache-dir -q || echo ${HOME}/.composer-php/cache)
13+
PHP_VERSION:=$(shell(((command -vdocker>/dev/null 2>&1) && dockerrun --rm -v "`pwd`:`pwd`"${CONTAINER_REGISTRY_REPO}:8.4-nts-alpine-slim php -r"echo json_decode(file_get_contents('`pwd`/composer.json'), true)['config']['platform']['php'];") || echo "8.3") | php -r "echo str_replace('|', '.', explode('.', implode('|', explode('.', stream_get_contents(STDIN), 2)), 2)[0]);")
14+
CONTAINER_NAME=$(shell echo "${CONTAINER_REGISTRY_REPO}:${PHP_VERSION}-${NTS_OR_ZTS_DOCKER_IMAGE}-alpine${SLIM_DOCKER_IMAGE}-dev")
15+
COMPOSER_CACHE_DIR=$(shell(command -v composer >/dev/null 2>&1) &&composer config --global cache-dir -q || echo ${HOME}/.composer-php/cache)
16+
COMPOSER_CONTAINER_CACHE_DIR=$(shell((command -vdocker>/dev/null 2>&1) && dockerrun --rm -it ${CONTAINER_NAME} composer config --global cache-dir -q) || echo ${HOME}/.composer-php/cache)
1517

1618
ifneq ("$(wildcard /.you-are-in-a-wyrihaximus.net-php-docker-image)","")
1719
IN_DOCKER=TRUE
@@ -22,11 +24,16 @@ endif
2224
ifeq ("$(IN_DOCKER)","TRUE")
2325
DOCKER_RUN:=
2426
else
25-
DOCKER_RUN:=docker run --rm -it \
26-
-v "`pwd`:`pwd`" \
27-
-v "${COMPOSER_CACHE_DIR}:${COMPOSER_CONTAINER_CACHE_DIR}" \
28-
-w "`pwd`" \
29-
"${CONTAINER_NAME}"
27+
ifeq ($(DOCKER_AVAILABLE),0)
28+
DOCKER_RUN:=docker run --rm -it\
29+
-v "`pwd`:`pwd`"\
30+
-v "${COMPOSER_CACHE_DIR}:${COMPOSER_CONTAINER_CACHE_DIR}"\
31+
-w "`pwd`"\
32+
-e OTEL_PHP_FIBERS_ENABLED="true"\
33+
"${CONTAINER_NAME}"
34+
else
35+
DOCKER_RUN:=
36+
endif
3037
endif
3138

3239
ifneq (,$(findstring icrosoft,$(shell cat /proc/version)))
@@ -36,46 +43,48 @@ else
3643
endif
3744

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

41-
syntax-php:## Lint PHP syntax ##*LH*##
48+
on-install-or-update:## Runs everything ####
49+
@grep -E'^[a-zA-Z0-9_-]+:.*?## .*$$'$(MAKEFILE_LIST)| grep -E"##\*(I|ILH)\*##"| awk'BEGIN {FS = ":.*?## "}; {printf "%s\n", $$1}'| xargs -o$(MAKE)
50+
51+
syntax-php:## Lint PHP syntax ##*ILH*##
4252
$(DOCKER_RUN) vendor/bin/parallel-lint --exclude vendor.
4353

44-
rector-upgrade:## Upgrade any automatically upgradable old code ###
54+
composer-normalize:### Normalize composer.json ##*I*##
55+
$(DOCKER_RUN) composer normalize
56+
$(DOCKER_RUN) composer update --lock --no-scripts
57+
58+
rector-upgrade:## Upgrade any automatically upgradable old code ##*I*##
4559
$(DOCKER_RUN) vendor/bin/rector -c ./etc/qa/rector.php
4660

47-
cs-fix:## Fix any automatically fixable code style issues ###
48-
$(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
61+
cs-fix:## Fix any automatically fixable code style issues ##*I*##
62+
$(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
4963

5064
cs:## Check the code for code style issues ##*LCH*##
51-
$(DOCKER_RUN) vendor/bin/phpcs --parallel=$(THREADS) --cache=./var/.phpcs.cache.json --standard=./etc/qa/phpcs.xml
65+
$(DOCKER_RUN) vendor/bin/phpcs --parallel=1 --cache=./var/.phpcs.cache.json --standard=./etc/qa/phpcs.xml
5266

5367
stan:## Run static analysis (PHPStan) ##*LCH*##
5468
$(DOCKER_RUN) vendor/bin/phpstan analyse etc src tests --level max --ansi -c ./etc/qa/phpstan.neon
5569

5670
unit-testing:## Run tests ##*A*##
5771
$(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
58-
$(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
5972

6073
unit-testing-raw:## Run tests ##*D*## ####
6174
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
62-
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
6375

6476
mutation-testing:## Run mutation testing ##*LCH*##
65-
$(DOCKER_RUN) vendor/bin/infection --ansi --log-verbosity=all --ignore-msi-with-no-mutations --threads=$(THREADS)|| (cat ./var/infection.log&& false)
77+
$(DOCKER_RUN) vendor/bin/infection --ansi --log-verbosity=all --ignore-msi-with-no-mutations --configuration=./etc/qa/infection.json5 --threads=$(THREADS)|| (cat ./var/infection.log&& false)
6678

6779
mutation-testing-raw:## Run mutation testing ####
68-
vendor/bin/infection --ansi --log-verbosity=all --ignore-msi-with-no-mutations --threads=$(THREADS)|| (cat ./var/infection.log&& false)
80+
vendor/bin/infection --ansi --log-verbosity=all --ignore-msi-with-no-mutations --configuration=./etc/qa/infection.json5 --threads=$(THREADS)|| (cat ./var/infection.log&& false)
6981

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

7385
composer-unused:## Ensure we don't require any package we don't use in this package directly ##*C*##
7486
$(DOCKER_RUN) vendor/bin/composer-unused --ansi --configuration=./etc/qa/composer-unused.php
7587

76-
libyear:### Calculate how many libyear this package is behind with dependencies
77-
$(DOCKER_RUN) vendor/bin/libyear
78-
7988
backward-compatibility-check:## Check code for backwards incompatible changes ##*C*##
8089
$(MAKE) backward-compatibility-check-raw||true
8190

@@ -114,3 +123,14 @@ task-list-ci-locked: ## CI: Generate a JSON array of jobs to run against the loc
114123
task-list-ci-high:## CI: Generate a JSON array of jobs to run against the highest dependencies on the primary threading target
115124
@grep -E'^[a-zA-Z0-9_-]+:.*?## .*$$'$(MAKEFILE_LIST)| grep -E"##\*(H|LH|LCH|LC)\*##"| grep -v"###"| sort| awk'BEGIN {FS = ":.*?## "}; {printf "%s\n", $$1}'| jq --raw-input --slurp -c'split("\n")| .[0:-1]'
116125

126+
127+
## Temporary set of migrations to get all my repos in shape
128+
php-migrations-move-infection:#### Move infection.json.dist to etc/qa/infection.json5 ##*I*##
129+
($(DOCKER_RUN) mv infection.json.dist etc/qa/infection.json5|| true)
130+
131+
php-migrations-remove-phpunit-config-dir-from-infection:#### Drop XXX from etc/qa/infection.json5 ##*I*##
132+
($(DOCKER_RUN) php -r'$$infectionFile = "etc/qa/infection.json5"; if (!file_exists($$infectionFile)) {exit;} $$json = json_decode(file_get_contents($$infectionFile), true); if (!is_array($$json)) {exit;} if (!array_key_exists("phpUnit", $$json)) {exit;} unset($$json["phpUnit"]); file_put_contents($$infectionFile, json_encode($$json, JSON_PRETTY_PRINT | JSON_UNESCAPED_SLASHES) . "\r\n");'|| true)
133+
134+
php-migrations-fix-logs-relative-paths-for-infection:#### Fix logs paths in etc/qa/infection.json5 ##*I*##
135+
($(DOCKER_RUN) php -r'$$infectionFile = "etc/qa/infection.json5"; if (!file_exists($$infectionFile)) {exit;} $$json = json_decode(file_get_contents($$infectionFile), true); if (!is_array($$json)) {exit;} if (!array_key_exists("logs", $$json)) {exit;} foreach ($$json["logs"] as $$logsKey => $$logsPath) { if (is_string($$json["logs"][$$logsKey]) && str_starts_with($$json["logs"][$$logsKey], "./var/infection")) { $$json["logs"][$$logsKey] = str_replace("./var/infection", "../../var/infection", $$json["logs"][$$logsKey]); } } file_put_contents($$infectionFile, json_encode($$json, JSON_PRETTY_PRINT | JSON_UNESCAPED_SLASHES) . "\r\n");'|| true)
136+

‎composer.json‎

Lines changed: 10 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,17 @@
11
{
22
"name":"mammatus/kubernetes",
3-
"description":"⏱️ Cron manager",
3+
"description":"\u23f1\ufe0f Cron manager",
44
"license":"MIT",
55
"require": {
6-
"php":"^8.3",
7-
"ext-json":"^8.3",
6+
"php":"^8.4",
7+
"ext-json":"^8.4",
88
"mammatus/app":"dev-master",
99
"mammatus/kubernetes-events":"^1",
1010
"psr/event-dispatcher":"^1"
1111
},
1212
"require-dev": {
13-
"wyrihaximus/async-test-utilities":"^9.1.0",
14-
"wyrihaximus/makefiles":"^0.4.2"
13+
"wyrihaximus/async-test-utilities":"^10.1.0",
14+
"wyrihaximus/makefiles":"^0.7.5"
1515
},
1616
"autoload": {
1717
"psr-4": {
@@ -38,10 +38,11 @@
3838
"mindplay/composer-locator":true,
3939
"phpstan/extension-installer":true,
4040
"wyrihaximus/broadcast":true,
41-
"wyrihaximus/makefiles":true
41+
"wyrihaximus/makefiles":true,
42+
"wyrihaximus/test-utilities":true
4243
},
4344
"platform": {
44-
"php":"8.3.13"
45+
"php":"8.4.13"
4546
},
4647
"sort-packages":true
4748
},
@@ -59,12 +60,10 @@
5960
},
6061
"scripts": {
6162
"post-install-cmd": [
62-
"composer normalize",
63-
"composer update --lock --no-scripts"
63+
"make on-install-or-update || true"
6464
],
6565
"post-update-cmd": [
66-
"composer normalize",
67-
"composer update --lock --no-scripts"
66+
"make on-install-or-update || true"
6867
]
6968
}
7069
}

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp