diff --git a/.gitattributes b/.gitattributes index 16226a1..672fc22 100644 --- a/.gitattributes +++ b/.gitattributes @@ -1,14 +1,36 @@ +# Set the default behavior, in case people don't have core.autocrlf set. +* text eol=lf + +# These files are binary and should be left untouched +# (binary is a macro for -text -diff) +*.png binary +*.jpg binary +*.jpeg binary +*.gif binary +*.ico binary +*.webp binary +*.bmp binary +*.ttf binary +*.blp binary +*.db2 binary + # Ignoring files for distribution archieves .github/ export-ignore -etc/ export-ignore +etc/ci/ export-ignore +etc/dev-app/ export-ignore +etc/state/ export-ignore +etc/qa/ export-ignore +examples/ export-ignore tests/ export-ignore var/ export-ignore +.devcontainer.json export-ignore .editorconfig export-ignore .gitattributes export-ignore .gitignore export-ignore CONTRIBUTING.md export-ignore composer.lock export-ignore -infection.json.dist export-ignore Makefile export-ignore -phpunit.xml.dist export-ignore README.md export-ignore + +# Diffing +*.php diff=php diff --git a/.github/renovate.json b/.github/renovate.json index c3a6d94..1c478c4 100644 --- a/.github/renovate.json +++ b/.github/renovate.json @@ -1,6 +1,10 @@ { - "$schema": "https://docs.renovatebot.com/renovate-schema.json", - "extends": [ - "github>WyriHaximus/renovate-config:php-package" - ] + "$schema": "https://docs.renovatebot.com/renovate-schema.json", + "extends": [ + "github>WyriHaximus/renovate-config:php-package" + ], + "constraints": { + "php": "8.4.x", + "composer": "2.x" + } } diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yaml similarity index 100% rename from .github/workflows/ci.yml rename to .github/workflows/ci.yaml diff --git a/.github/workflows/release-managment.yaml b/.github/workflows/release-management.yaml similarity index 94% rename from .github/workflows/release-managment.yaml rename to .github/workflows/release-management.yaml index 7f8ba22..c991328 100644 --- a/.github/workflows/release-managment.yaml +++ b/.github/workflows/release-management.yaml @@ -17,7 +17,7 @@ permissions: jobs: release-managment: name: Release Management - uses: WyriHaximus/github-workflows/.github/workflows/package-release-managment.yaml@main + uses: WyriHaximus/github-workflows/.github/workflows/package-release-management.yaml@main with: milestone: ${{ github.event.milestone.title }} description: ${{ github.event.milestone.title }} diff --git a/.gitignore b/.gitignore index 388f11c..be59746 100644 --- a/.gitignore +++ b/.gitignore @@ -1,9 +1,11 @@ etc/qa/.phpcs.cache etc/qa/.phpunit.result.cache -bin/openapi-client-generator example/etc +example/generated example/generated-github example/generated-github-subsplit example/generated-miele tests/test-app vendor +var/* +!var/.gitkeep diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md new file mode 100644 index 0000000..503c205 --- /dev/null +++ b/CONTRIBUTING.md @@ -0,0 +1,27 @@ +# Contributing + +Pull requests are highly appreciated. Here's a quick guide. + +Fork, then clone the repo: + + git clone git@github.com:your-username/openapi-client-generator.git + +Install dependencies: + + make install + +Work on the contribution and check if it passes all QA checks with: + + make + +If some of the PHPStan or other checks are to strict or intimidating that is fine, finish what you want to contribute and I'll help you with those, but please make the following command passes. It runs a subset of everything: + + make contrib + +You can list all the contrib commands with: + + make help-contrib + +Push to your fork and [submit a pull request][pr]. + +[pr]: https://docs.github.com/en/pull-requests/collaborating-with-pull-requests/proposing-changes-to-your-work-with-pull-requests/creating-a-pull-request diff --git a/LICENSE b/LICENSE new file mode 100644 index 0000000..b1b5bbe --- /dev/null +++ b/LICENSE @@ -0,0 +1,21 @@ +The MIT License (MIT) + +Copyright (c) 2026 Cees-Jan Kiewiet + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/Makefile b/Makefile index d68563d..6223989 100644 --- a/Makefile +++ b/Makefile @@ -3,77 +3,562 @@ SHELL=bash .PHONY: * -DOCKER_CGROUP:=$(shell cat /proc/1/cgroup | grep docker | wc -l) -COMPOSER_CACHE_DIR:=$(shell composer config --global cache-dir -q || echo ${HOME}/.composer/cache) +DOCKER_AVAILABLE=$(shell ((command -v docker >/dev/null 2>&1) && echo 0 || echo 1)) +TTY_AVAILABLE=$(shell (test -t 1 && echo 0) || echo 1) +CONTAINER_REGISTRY_REPO="ghcr.io/wyrihaximusnet/php" +SLIM_DOCKER_IMAGE="-slim" +NTS_OR_ZTS_DOCKER_IMAGE="nts" +OTEL_PHP_FIBERS_ENABLED=true +NEEDS_DOCKER_SOCKET=FALSE +ALL_HAS_DIRECT_DOCKER_TASKS=FALSE +CONTRIB_HAS_DIRECT_DOCKER_TASKS=FALSE +ON_INSTALL_OR_UPDATE_HAS_DIRECT_DOCKER_TASKS=FALSE +PHP_VERSION="8.4" +CONTAINER_NAME=$(shell echo "${CONTAINER_REGISTRY_REPO}:${PHP_VERSION}-${NTS_OR_ZTS_DOCKER_IMAGE}-alpine${SLIM_DOCKER_IMAGE}-dev") +CONTAINER_NAME_INTERACTIVE_SHELL=$(shell echo "${CONTAINER_REGISTRY_REPO}:${PHP_VERSION}-zts-alpine-dev") +COMPOSER_CACHE_DIR=$(shell (command -v composer >/dev/null 2>&1) && composer config --global cache-dir -q 2>/dev/null || echo ${HOME}/.composer-php/cache) +COMPOSER_CONTAINER_CACHE_DIR=$(shell ((command -v docker >/dev/null 2>&1) && docker run --rm $(if $(filter 0,$(TTY_AVAILABLE)),-it,-i) ${CONTAINER_NAME} composer config --global cache-dir -q) || echo ${HOME}/.composer-php/cache) -ifneq ("$(wildcard /.dockerenv)","") - IN_DOCKER:=TRUE -else ifneq ("$(DOCKER_CGROUP)","0") - IN_DOCKER:=TRUE +ifneq ("$(wildcard /.you-are-in-a-wyrihaximus.net-php-docker-image)","") + IN_DOCKER=TRUE else - IN_DOCKER:=FALSE + IN_DOCKER=FALSE endif ifeq ("$(IN_DOCKER)","TRUE") DOCKER_RUN:= + DOCKER_RUN_WITHOUT_NETWORK_FOR_COMPOSER:= + DOCKER_RUN_WITH_SOCKET:= + DOCKER_SHELL:= + DOCKER_INTERACTIVE_SHELL:= else - 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]);") - DOCKER_RUN:=docker run --rm -it \ - -v "`pwd`:`pwd`" \ - -v "${COMPOSER_CACHE_DIR}:/home/app/.composer/cache" \ - -w "`pwd`" \ - -e "FORCE_GENERATION=$$FORCE_GENERATION" \ - "ghcr.io/wyrihaximusnet/php:${PHP_VERSION}-nts-alpine-slim-dev" + ifeq ($(DOCKER_AVAILABLE),0) + DOCKER_DEFAULT_SECURITY_OPS=--cap-drop=ALL --security-opt="no-new-privileges=true" --user="`id -u`:`id -g`" + DOCKER_COMMON_OPS:=-v "`pwd`:`pwd`" -w "`pwd`" -v "`pwd`/.git:`pwd`/.git:ro" -v "${COMPOSER_CACHE_DIR}:${COMPOSER_CONTAINER_CACHE_DIR}" --ulimit nofile=1000000 + DOCKER_COMMON_NON_INTERACTIVE_OPS:=-e OTEL_PHP_FIBERS_ENABLED="${OTEL_PHP_FIBERS_ENABLED}" + DOCKER_COMMON_INTERACTIVE_OPS:=-e OTEL_PHP_FIBERS_ENABLED="false" + ifeq ("$(NEEDS_DOCKER_SOCKET)","TRUE") + ifneq ("$(wildcard /var/run/docker.sock)","") + DOCKER_SECURITY_OPS:= + DOCKER_SOCKET_OPS:=-v "/var/run/docker.sock:/var/run/docker.sock" + DOCKER_SOCKET_CONTAINER_NAME_SUFFIX:=-root + else + DOCKER_SECURITY_OPS:=${DOCKER_DEFAULT_SECURITY_OPS} + DOCKER_SOCKET_OPS:= + DOCKER_SOCKET_CONTAINER_NAME_SUFFIX:= + endif + else + DOCKER_SECURITY_OPS:=${DOCKER_DEFAULT_SECURITY_OPS} + DOCKER_SOCKET_OPS:= + DOCKER_SOCKET_CONTAINER_NAME_SUFFIX:= + endif + DOCKER_RUN:=docker run --rm -i ${DOCKER_SECURITY_OPS} ${DOCKER_COMMON_NON_INTERACTIVE_OPS} ${DOCKER_COMMON_OPS} "${CONTAINER_NAME}" + DOCKER_RUN_WITHOUT_NETWORK_FOR_COMPOSER:=docker run --rm -i ${DOCKER_SECURITY_OPS} ${DOCKER_COMMON_NON_INTERACTIVE_OPS} -e COMPOSER_DISABLE_NETWORK="1" ${DOCKER_COMMON_OPS} "${CONTAINER_NAME}" + DOCKER_RUN_WITH_SOCKET:=docker run --rm -i ${DOCKER_SECURITY_OPS} ${DOCKER_COMMON_NON_INTERACTIVE_OPS} ${DOCKER_COMMON_OPS} ${DOCKER_SOCKET_OPS} "${CONTAINER_NAME}${DOCKER_SOCKET_CONTAINER_NAME_SUFFIX}" + ifeq ($(TTY_AVAILABLE),0) + DOCKER_SHELL:=docker run --rm -it ${DOCKER_SECURITY_OPS} ${DOCKER_COMMON_NON_INTERACTIVE_OPS} ${DOCKER_COMMON_OPS} "${CONTAINER_NAME}" + DOCKER_INTERACTIVE_SHELL:=docker run --rm -it ${DOCKER_SECURITY_OPS} ${DOCKER_COMMON_INTERACTIVE_OPS} ${DOCKER_COMMON_OPS} "${CONTAINER_NAME_INTERACTIVE_SHELL}" + else + DOCKER_SHELL:=$(DOCKER_RUN) + DOCKER_INTERACTIVE_SHELL:=docker run --rm -i ${DOCKER_SECURITY_OPS} ${DOCKER_COMMON_INTERACTIVE_OPS} ${DOCKER_COMMON_OPS} "${CONTAINER_NAME_INTERACTIVE_SHELL}" + endif + else + DOCKER_RUN:= + DOCKER_RUN_WITHOUT_NETWORK_FOR_COMPOSER:= + DOCKER_RUN_WITH_SOCKET:= + DOCKER_SHELL:= + DOCKER_INTERACTIVE_SHELL:= + endif endif -all: ## Runs everything ### - @grep -E '^[a-zA-Z0-9_-]+:.*?## .*$$' $(MAKEFILE_LIST) | grep -v "###" | awk 'BEGIN {FS = ":.*?## "}; {printf "%s\n", $$1}' | xargs --open-tty $(MAKE) +ifneq (,$(findstring icrosoft,$(shell cat /proc/version))) + THREADS=1 +else + THREADS=$(shell nproc) +endif + +## Run everything extra points +all: ## Runs everything #### +ifeq ("$(ALL_HAS_DIRECT_DOCKER_TASKS)","TRUE") + $(MAKE) all-raw +else + $(DOCKER_RUN_WITH_SOCKET) make all-raw +endif +all-raw: ## The real runs everything, but due to sponge it has to be ran inside DOCKER_RUN ##U## + $(MAKE) composer-validate syntax-php composer-normalize rector-upgrade cs-fix cs stan unit-testing mutation-testing composer-require-checker composer-unused backward-compatibility-check ## Count: 12 -syntax-php: ## Lint PHP syntax - $(DOCKER_RUN) vendor/bin/parallel-lint --exclude vendor ./src ./tests -cs-fix: ## Fix any automatically fixable code style issues - $(DOCKER_RUN) vendor/bin/phpcbf --parallel=$(shell nproc) --standard=./etc/qa/phpcs.xml || $(DOCKER_RUN) vendor/bin/phpcbf --parallel=$(shell nproc) --standard=./etc/qa/phpcs.xml || $(DOCKER_RUN) vendor/bin/phpcbf --parallel=$(shell nproc) --standard=./etc/qa/phpcs.xml -vvv +## Run a subset of everything for those that find everything intimidating +contrib: ## Runs a subset of everything (all) #### +ifeq ("$(CONTRIB_HAS_DIRECT_DOCKER_TASKS)","TRUE") + $(MAKE) contrib-raw +else + $(DOCKER_RUN_WITH_SOCKET) make contrib-raw +endif +contrib-raw: ## The real runs everything, but due to sponge it has to be ran inside DOCKER_RUN ##U## + $(MAKE) cs-fix cs unit-testing composer-require-checker composer-unused ## Count: 5 -cs: ## Check the code for code style issues - $(DOCKER_RUN) vendor/bin/phpcs --parallel=$(shell nproc) --standard=./etc/qa/phpcs.xml -stan: ## Run static analysis (PHPStan) - $(DOCKER_RUN) vendor/bin/phpstan analyse src tests --level max --ansi -c ./etc/qa/phpstan.neon +## Temporary set of migrations to get all my repos in shape +migrations-git-enforce-gitattributes-contents: #### Enforce `.gitattributes` contents ##*I*## + ($(DOCKER_RUN) php -r 'file_put_contents(".gitattributes", base64_decode("IyBTZXQgdGhlIGRlZmF1bHQgYmVoYXZpb3IsIGluIGNhc2UgcGVvcGxlIGRvbid0IGhhdmUgY29yZS5hdXRvY3JsZiBzZXQuCiogdGV4dCBlb2w9bGYKCiMgVGhlc2UgZmlsZXMgYXJlIGJpbmFyeSBhbmQgc2hvdWxkIGJlIGxlZnQgdW50b3VjaGVkCiMgKGJpbmFyeSBpcyBhIG1hY3JvIGZvciAtdGV4dCAtZGlmZikKKi5wbmcgYmluYXJ5CiouanBnIGJpbmFyeQoqLmpwZWcgYmluYXJ5CiouZ2lmIGJpbmFyeQoqLmljbyBiaW5hcnkKKi53ZWJwIGJpbmFyeQoqLmJtcCBiaW5hcnkKKi50dGYgYmluYXJ5CiouYmxwIGJpbmFyeQoqLmRiMiBiaW5hcnkKCiMgSWdub3JpbmcgZmlsZXMgZm9yIGRpc3RyaWJ1dGlvbiBhcmNoaWV2ZXMKLmdpdGh1Yi8gZXhwb3J0LWlnbm9yZQpldGMvY2kvIGV4cG9ydC1pZ25vcmUKZXRjL2Rldi1hcHAvIGV4cG9ydC1pZ25vcmUKZXRjL3N0YXRlLyBleHBvcnQtaWdub3JlCmV0Yy9xYS8gZXhwb3J0LWlnbm9yZQpleGFtcGxlcy8gZXhwb3J0LWlnbm9yZQp0ZXN0cy8gZXhwb3J0LWlnbm9yZQp2YXIvIGV4cG9ydC1pZ25vcmUKLmRldmNvbnRhaW5lci5qc29uIGV4cG9ydC1pZ25vcmUKLmVkaXRvcmNvbmZpZyBleHBvcnQtaWdub3JlCi5naXRhdHRyaWJ1dGVzIGV4cG9ydC1pZ25vcmUKLmdpdGlnbm9yZSBleHBvcnQtaWdub3JlCkNPTlRSSUJVVElORy5tZCBleHBvcnQtaWdub3JlCmNvbXBvc2VyLmxvY2sgZXhwb3J0LWlnbm9yZQpNYWtlZmlsZSBleHBvcnQtaWdub3JlClJFQURNRS5tZCBleHBvcnQtaWdub3JlCgojIERpZmZpbmcKKi5waHAgZGlmZj1waHAK"));' || true) -psalm: ## Run static analysis (Psalm) - $(DOCKER_RUN) vendor/bin/psalm --threads=$(shell nproc) --shepherd --stats --config=./etc/qa/psalm.xml +migrations-git-make-sure-gitignore-exists: #### Make sure `.gitignore` exists ##*I*## + ($(DOCKER_RUN) touch .gitignore || true) -unit-testing: ## Run tests - $(DOCKER_RUN) vendor/bin/phpunit --colors=always -c ./etc/qa/phpunit.xml - $(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 +migrations-git-make-sure-gitignore-ignores-var: #### Make sure `.gitignore` ignores `var/*` ##*I*## + ($(DOCKER_RUN) php -r '$$gitignoreFile = ".gitignore"; if (!file_exists($$gitignoreFile)) {exit;} $$txt = file_get_contents($$gitignoreFile); if (!is_string($$txt)) {exit;} if (strpos($$txt, "var/*") !== false) {exit;} file_put_contents($$gitignoreFile, "var/*\n", FILE_APPEND);' || true) -mutation-testing: ## Run mutation testing - $(DOCKER_RUN) vendor/bin/infection --ansi --min-msi=100 --min-covered-msi=100 --threads=$(shell nproc) --ignore-msi-with-no-mutations || (cat ./var/infection.log && false) +migrations-git-make-sure-gitignore-excludes-var-gitkeep: #### Make sure `.gitignore` excludes `var/.gitkeep` ##*I*## + ($(DOCKER_RUN) php -r '$$gitignoreFile = ".gitignore"; if (!file_exists($$gitignoreFile)) {exit;} $$txt = file_get_contents($$gitignoreFile); if (!is_string($$txt)) {exit;} if (strpos($$txt, "!var/.gitkeep") !== false) {exit;} file_put_contents($$gitignoreFile, "!var/.gitkeep\n", FILE_APPEND);' || true) -backward-compatibility-check: ## Check code for backwards incompatible changes - $(DOCKER_RUN) vendor/bin/roave-backward-compatibility-check || true +migrations-docs-update-readme-copyright-c-year-to-current: #### Update readme copyright year to current ##*I*## + ($(DOCKER_RUN) php -r '$$readmeFile = "README.md"; $$copyRight = "Copyright (c) "; $$currentYear = date("Y"); if (!file_exists($$readmeFile)) {exit;} $$readmeContents = file_get_contents($$readmeFile); foreach (range(2000, 2100) as $$year) { $$readmeContents = str_replace($$copyRight . $$year, $$copyRight . $$currentYear, $$readmeContents); } file_put_contents($$readmeFile, $$readmeContents); ' || true) -shell: ## Provides Shell access in the expected environment ### - $(DOCKER_RUN) ash +migrations-docs-update-readme-copyright-year-to-current: #### Update readme copyright year to current ##*I*## + ($(DOCKER_RUN) php -r '$$readmeFile = "README.md"; $$copyRight = "Copyright "; $$currentYear = date("Y"); if (!file_exists($$readmeFile)) {exit;} $$readmeContents = file_get_contents($$readmeFile); foreach (range(2000, 2100) as $$year) { $$readmeContents = str_replace($$copyRight . $$year, $$copyRight . $$currentYear, $$readmeContents); } file_put_contents($$readmeFile, $$readmeContents); ' || true) -task-list-ci: ## CI: Generate a JSON array of jobs to run, matches the commands run when running `make (|all)` ### - @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]' +migrations-docs-update-etc-readme-template-copyright-c-year-to-current: #### Update readme template in etc/ copyright year to current ##*I*## + ($(DOCKER_RUN) php -r '$$readmeFile = "etc/README.md.twig"; $$copyRight = "Copyright (c) "; $$currentYear = date("Y"); if (!file_exists($$readmeFile)) {exit;} $$readmeContents = file_get_contents($$readmeFile); foreach (range(2000, 2100) as $$year) { $$readmeContents = str_replace($$copyRight . $$year, $$copyRight . $$currentYear, $$readmeContents); } file_put_contents($$readmeFile, $$readmeContents); ' || true) -help: ## Show this help ### - @printf "\033[33mUsage:\033[0m\n make [target]\n\n\033[33mTargets:\033[0m\n" - @grep -E '^[a-zA-Z0-9_-]+:.*?## .*$$' $(MAKEFILE_LIST) | sort | awk 'BEGIN {FS = ":.*?## "}; {printf " \033[32m%-32s\033[0m %s\n", $$1, $$2}' | tr -d '#' +migrations-docs-update-etc-readme-template-copyright-year-to-current: #### Update readme template in etc/ copyright year to current ##*I*## + ($(DOCKER_RUN) php -r '$$readmeFile = "etc/README.md.twig"; $$copyRight = "Copyright "; $$currentYear = date("Y"); if (!file_exists($$readmeFile)) {exit;} $$readmeContents = file_get_contents($$readmeFile); foreach (range(2000, 2100) as $$year) { $$readmeContents = str_replace($$copyRight . $$year, $$copyRight . $$currentYear, $$readmeContents); } file_put_contents($$readmeFile, $$readmeContents); ' || true) + +migrations-docs-create-license-when-it-doesnt-exists: #### Create license when it doesn't exists ##*I*## + ($(DOCKER_RUN) php -r '$$licenseFile = "LICENSE"; $$composerFIle = "composer.json"; if (file_exists($$licenseFile)) {exit;} if (file_exists($$composerFIle)) {$$json = json_decode(file_get_contents($$composerFIle), true); if (array_key_exists("license", $$json)) {if ($$json["license"] === "proprietary") {exit;}}} file_put_contents($$licenseFile, base64_decode("VGhlIE1JVCBMaWNlbnNlIChNSVQpCgpDb3B5cmlnaHQgKGMpIDIwMDEgQ2Vlcy1KYW4gS2lld2lldAoKUGVybWlzc2lvbiBpcyBoZXJlYnkgZ3JhbnRlZCwgZnJlZSBvZiBjaGFyZ2UsIHRvIGFueSBwZXJzb24gb2J0YWluaW5nIGEgY29weQpvZiB0aGlzIHNvZnR3YXJlIGFuZCBhc3NvY2lhdGVkIGRvY3VtZW50YXRpb24gZmlsZXMgKHRoZSAiU29mdHdhcmUiKSwgdG8gZGVhbAppbiB0aGUgU29mdHdhcmUgd2l0aG91dCByZXN0cmljdGlvbiwgaW5jbHVkaW5nIHdpdGhvdXQgbGltaXRhdGlvbiB0aGUgcmlnaHRzCnRvIHVzZSwgY29weSwgbW9kaWZ5LCBtZXJnZSwgcHVibGlzaCwgZGlzdHJpYnV0ZSwgc3VibGljZW5zZSwgYW5kL29yIHNlbGwKY29waWVzIG9mIHRoZSBTb2Z0d2FyZSwgYW5kIHRvIHBlcm1pdCBwZXJzb25zIHRvIHdob20gdGhlIFNvZnR3YXJlIGlzCmZ1cm5pc2hlZCB0byBkbyBzbywgc3ViamVjdCB0byB0aGUgZm9sbG93aW5nIGNvbmRpdGlvbnM6CgpUaGUgYWJvdmUgY29weXJpZ2h0IG5vdGljZSBhbmQgdGhpcyBwZXJtaXNzaW9uIG5vdGljZSBzaGFsbCBiZSBpbmNsdWRlZCBpbiBhbGwKY29waWVzIG9yIHN1YnN0YW50aWFsIHBvcnRpb25zIG9mIHRoZSBTb2Z0d2FyZS4KClRIRSBTT0ZUV0FSRSBJUyBQUk9WSURFRCAiQVMgSVMiLCBXSVRIT1VUIFdBUlJBTlRZIE9GIEFOWSBLSU5ELCBFWFBSRVNTIE9SCklNUExJRUQsIElOQ0xVRElORyBCVVQgTk9UIExJTUlURUQgVE8gVEhFIFdBUlJBTlRJRVMgT0YgTUVSQ0hBTlRBQklMSVRZLApGSVRORVNTIEZPUiBBIFBBUlRJQ1VMQVIgUFVSUE9TRSBBTkQgTk9OSU5GUklOR0VNRU5ULiBJTiBOTyBFVkVOVCBTSEFMTCBUSEUKQVVUSE9SUyBPUiBDT1BZUklHSFQgSE9MREVSUyBCRSBMSUFCTEUgRk9SIEFOWSBDTEFJTSwgREFNQUdFUyBPUiBPVEhFUgpMSUFCSUxJVFksIFdIRVRIRVIgSU4gQU4gQUNUSU9OIE9GIENPTlRSQUNULCBUT1JUIE9SIE9USEVSV0lTRSwgQVJJU0lORyBGUk9NLApPVVQgT0YgT1IgSU4gQ09OTkVDVElPTiBXSVRIIFRIRSBTT0ZUV0FSRSBPUiBUSEUgVVNFIE9SIE9USEVSIERFQUxJTkdTIElOIFRIRQpTT0ZUV0FSRS4K"));' || true) + +migrations-docs-update-license-copyright-c-year-to-current: #### Update license copyright year to current ##*I*## + ($(DOCKER_RUN) php -r '$$licenseFile = "LICENSE"; $$copyRight = "Copyright (c) "; $$currentYear = date("Y"); if (!file_exists($$licenseFile)) {exit;} $$licenseContents = file_get_contents($$licenseFile); foreach (range(2000, 2100) as $$year) { $$licenseContents = str_replace($$copyRight . $$year, $$copyRight . $$currentYear, $$licenseContents); } file_put_contents($$licenseFile, $$licenseContents); ' || true) + +migrations-docs-update-license-copyright-year-to-current: #### Update license copyright year to current ##*I*## + ($(DOCKER_RUN) php -r '$$licenseFile = "LICENSE"; $$copyRight = "Copyright "; $$currentYear = date("Y"); if (!file_exists($$licenseFile)) {exit;} $$licenseContents = file_get_contents($$licenseFile); foreach (range(2000, 2100) as $$year) { $$licenseContents = str_replace($$copyRight . $$year, $$copyRight . $$currentYear, $$licenseContents); } file_put_contents($$licenseFile, $$licenseContents); ' || true) + +migrations-docs-enforce-contributing-md-contents: #### Enforce CONTRIBUTING.md contents ##*I*## + ($(DOCKER_RUN) php -r '$$contributingFile = "CONTRIBUTING.md"; $$contributingContents = base64_decode("IyBDb250cmlidXRpbmcKClB1bGwgcmVxdWVzdHMgYXJlIGhpZ2hseSBhcHByZWNpYXRlZC4gSGVyZSdzIGEgcXVpY2sgZ3VpZGUuCgpGb3JrLCB0aGVuIGNsb25lIHRoZSByZXBvOgoKICAgIGdpdCBjbG9uZSBnaXRAZ2l0aHViLmNvbTp5b3VyLXVzZXJuYW1lL1tyZXBvXS5naXQKCkluc3RhbGwgZGVwZW5kZW5jaWVzOgoKICAgIG1ha2UgaW5zdGFsbAoKV29yayBvbiB0aGUgY29udHJpYnV0aW9uIGFuZCBjaGVjayBpZiBpdCBwYXNzZXMgYWxsIFFBIGNoZWNrcyB3aXRoOgoKICAgIG1ha2UKCklmIHNvbWUgb2YgdGhlIFBIUFN0YW4gb3Igb3RoZXIgY2hlY2tzIGFyZSB0byBzdHJpY3Qgb3IgaW50aW1pZGF0aW5nIHRoYXQgaXMgZmluZSwgZmluaXNoIHdoYXQgeW91IHdhbnQgdG8gY29udHJpYnV0ZSBhbmQgSSdsbCBoZWxwIHlvdSB3aXRoIHRob3NlLCBidXQgcGxlYXNlIG1ha2UgdGhlIGZvbGxvd2luZyBjb21tYW5kIHBhc3Nlcy4gSXQgcnVucyBhIHN1YnNldCBvZiBldmVyeXRoaW5nOgoKICAgIG1ha2UgY29udHJpYgoKWW91IGNhbiBsaXN0IGFsbCB0aGUgY29udHJpYiBjb21tYW5kcyB3aXRoOgoKICAgIG1ha2UgaGVscC1jb250cmliCgpQdXNoIHRvIHlvdXIgZm9yayBhbmQgW3N1Ym1pdCBhIHB1bGwgcmVxdWVzdF1bcHJdLgoKW3ByXTogaHR0cHM6Ly9kb2NzLmdpdGh1Yi5jb20vZW4vcHVsbC1yZXF1ZXN0cy9jb2xsYWJvcmF0aW5nLXdpdGgtcHVsbC1yZXF1ZXN0cy9wcm9wb3NpbmctY2hhbmdlcy10by15b3VyLXdvcmstd2l0aC1wdWxsLXJlcXVlc3RzL2NyZWF0aW5nLWEtcHVsbC1yZXF1ZXN0Cg=="); file_put_contents($$contributingFile, str_replace(["[repo]"], [basename(__DIR__)], $$contributingContents)); ' || true) + +migrations-php-make-sure-var-exists: #### Make sure `var/` exists ##*I*## + ($(DOCKER_RUN) mkdir var || true) + +migrations-php-make-sure-var-gitkeep-exists: #### Make sure `var/.gitkeep` exists ##*I*## + ($(DOCKER_RUN) touch var/.gitkeep || true) + +migrations-php-make-sure-etc-exists: #### Make sure `etc/` exists ##*I*## + ($(DOCKER_RUN) mkdir etc || true) + +migrations-php-make-sure-etc-ci-exists: #### Make sure `etc/ci/` exists ##*I*## + ($(DOCKER_RUN) mkdir etc/ci || true) + +migrations-php-make-sure-etc-qa-exists: #### Make sure `etc/qa/` exists ##*I*## + ($(DOCKER_RUN) mkdir etc/qa || true) + +migrations-php-move-psalm-xml-config-to-etc: #### Move `psalm.xml` to `etc/qa/psalm.xml` ##*I*## + ($(DOCKER_RUN) mv psalm.xml etc/qa/psalm.xml || true) + +migrations-php-remove-psalm-xml-config: #### Make sure we remove `etc/qa/psalm.xml` ##*I*## + ($(DOCKER_RUN) rm etc/qa/psalm.xml || true) + +migrations-php-remove-old-phpunit-xml-dist-config: #### Make sure we remove `phpunit.xml.dist` ##*I*## + ($(DOCKER_RUN) rm phpunit.xml.dist || true) + +migrations-php-remove-old-phpunit-xml-config: #### Make sure we remove `phpunit.xml` ##*I*## + ($(DOCKER_RUN) rm phpunit.xml || true) + +migrations-php-remove-old-php-cs-fiver-config: #### Make sure we remove `.php_cs` ##*I*## + ($(DOCKER_RUN) rm .php_cs || true) + +migrations-php-remove-old-scrutinizer-yml-config: #### Make sure we remove `.scrutinizer.yml` ##*I*## + ($(DOCKER_RUN) rm .scrutinizer.yml || true) + +migrations-php-remove-old-appveyor-yml-config: #### Make sure we remove `appveyor.yml` ##*I*## + ($(DOCKER_RUN) rm appveyor.yml || true) + +migrations-php-remove-old-travis-yml-config: #### Make sure we remove `.travis.yml` ##*I*## + ($(DOCKER_RUN) rm .travis.yml || true) + +migrations-php-ensure-etc-ci-markdown-link-checker-json-exists: #### Make sure we have `etc/ci/markdown-link-checker.json` ##*I*## + ($(DOCKER_RUN) php -r '$$markdownLinkCheckerFile = "etc/ci/markdown-link-checker.json"; $$json = json_decode("{\"httpHeaders\": [{\"urls\": [\"https://docs.github.com/\"],\"headers\": {\"Accept-Encoding\": \"zstd, br, gzip, deflate\"}}]}"); if (file_exists($$markdownLinkCheckerFile)) {exit;} file_put_contents($$markdownLinkCheckerFile, json_encode($$json, JSON_PRETTY_PRINT | JSON_UNESCAPED_SLASHES) . "\r\n");' || true) + +migrations-php-move-infection-config-to-etc: #### Move `infection.json.dist` to `etc/qa/infection.json5` ##*I*## + ($(DOCKER_RUN) mv infection.json.dist etc/qa/infection.json5 || true) + +migrations-php-infection-create-config-if-not-exists: #### Create Infection config file if it doesn't exists at `etc/qa/infection.json5` ##*I*## + ($(DOCKER_RUN) php -r '$$infectionFile = "etc/qa/infection.json5"; $$infectionConfig = base64_decode("ewogICAgInRpbWVvdXQiOiAxMjAsCiAgICAic291cmNlIjogewogICAgICAgICJkaXJlY3RvcmllcyI6IFsKICAgICAgICAgICAgInNyYyIKICAgICAgICBdCiAgICB9LAogICAgImxvZ3MiOiB7CiAgICAgICAgInRleHQiOiAiLi4vLi4vdmFyL2luZmVjdGlvbi5sb2ciLAogICAgICAgICJzdW1tYXJ5IjogIi4uLy4uL3Zhci9pbmZlY3Rpb24tc3VtbWFyeS5sb2ciLAogICAgICAgICJqc29uIjogIi4uLy4uL3Zhci9pbmZlY3Rpb24uanNvbiIsCiAgICAgICAgInBlck11dGF0b3IiOiAiLi4vLi4vdmFyL2luZmVjdGlvbi1wZXItbXV0YXRvci5tZCIsCiAgICAgICAgImdpdGh1YiI6IHRydWUKICAgIH0sCiAgICAibWluTXNpIjogMTAwLAogICAgIm1pbkNvdmVyZWRNc2kiOiAxMDAsCiAgICAiaWdub3JlTXNpV2l0aE5vTXV0YXRpb25zIjogdHJ1ZSwKICAgICJtdXRhdG9ycyI6IHsKICAgICAgICAiQGRlZmF1bHQiOiB0cnVlCiAgICB9Cn0K"); if (file_exists($$infectionFile)) {exit;} file_put_contents($$infectionFile, $$infectionConfig);' || true) + +migrations-php-remove-phpunit-config-dir-from-infection: #### Drop XXX from `etc/qa/infection.json5` ##*I*## + ($(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) + +migrations-php-fix-logs-relative-paths-for-infection: #### Fix logs paths in `etc/qa/infection.json5` ##*I*## + ($(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) + +migrations-php-infection-ensure-log-text-has-the-correct-path: #### Ensure infection's log.text has config directive has the correct path ##*I*## + ($(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)) { $$json["logs"] = []; } $$json["logs"]["text"] = "../../var/infection.log"; file_put_contents($$infectionFile, json_encode($$json, JSON_PRETTY_PRINT | JSON_UNESCAPED_SLASHES) . "\r\n");' || true) + +migrations-php-infection-ensure-log-summary-has-the-correct-path: #### Ensure infection's log.summary has config directive has the correct path ##*I*## + ($(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)) { $$json["logs"] = []; } $$json["logs"]["summary"] = "../../var/infection-summary.log"; file_put_contents($$infectionFile, json_encode($$json, JSON_PRETTY_PRINT | JSON_UNESCAPED_SLASHES) . "\r\n");' || true) + +migrations-php-infection-ensure-log-json-has-the-correct-path: #### Ensure infection's log.json has config directive has the correct path ##*I*## + ($(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)) { $$json["logs"] = []; } $$json["logs"]["json"] = "../../var/infection.json"; file_put_contents($$infectionFile, json_encode($$json, JSON_PRETTY_PRINT | JSON_UNESCAPED_SLASHES) . "\r\n");' || true) + +migrations-php-infection-ensure-log-per-mutator-has-the-correct-path: #### Ensure infection's log.perMutator has config directive has the correct path ##*I*## + ($(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)) { $$json["logs"] = []; } $$json["logs"]["perMutator"] = "../../var/infection-per-mutator.md"; file_put_contents($$infectionFile, json_encode($$json, JSON_PRETTY_PRINT | JSON_UNESCAPED_SLASHES) . "\r\n");' || true) + +migrations-php-add-github-true-to-for-infection: #### Ensure we configure infection to emit logs to GitHub in `etc/qa/infection.json5` ##*I*## + ($(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;} if (array_key_exists("github", $$json["logs"])) {exit;} $$json["logs"]["github"] = true; file_put_contents($$infectionFile, json_encode($$json, JSON_PRETTY_PRINT | JSON_UNESCAPED_SLASHES) . "\r\n");' || true) + +migrations-php-make-paths-compatible-with-infection-0-32: #### We update path to be relative to `etc/qa/infection.json5` as of 0.32 ##*I*## + ($(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("source", $$json)) {exit;} if (!array_key_exists("directories", $$json["source"])) {exit;} foreach ($$json["source"]["directories"] as $$key => $$value) { if (!str_starts_with($$value, "../../")) {$$json["source"]["directories"][$$key] = "../../" . $$value;} } file_put_contents($$infectionFile, json_encode($$json, JSON_PRETTY_PRINT | JSON_UNESCAPED_SLASHES) . "\r\n");' || true) + +migrations-php-set-phpunit-ensure-config-file-exists: #### Make sure we have a PHPUnit config file at `etc/qa/phpunit.xml` ##*I*## + ($(DOCKER_RUN) php -r '$$phpUnitConfigFIle = "etc/qa/phpunit.xml"; if (file_exists($$phpUnitConfigFIle)) {exit;} file_put_contents($$phpUnitConfigFIle, base64_decode("PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iVVRGLTgiPz4KPHBocHVuaXQKICAgIHhtbG5zOnhzaT0iaHR0cDovL3d3dy53My5vcmcvMjAwMS9YTUxTY2hlbWEtaW5zdGFuY2UiCiAgICBib290c3RyYXA9Ii4uLy4uL3ZlbmRvci9hdXRvbG9hZC5waHAiCiAgICBjb2xvcnM9InRydWUiCiAgICB4c2k6bm9OYW1lc3BhY2VTY2hlbWFMb2NhdGlvbj0iLi4vLi4vdmVuZG9yL3BocHVuaXQvcGhwdW5pdC9waHB1bml0LnhzZCIKICAgIGNhY2hlRGlyZWN0b3J5PSIuLi8uLi92YXIvcGhwdW5pdC9jYWNoZSIKICAgIGRpc3BsYXlEZXRhaWxzT25UZXN0c1RoYXRUcmlnZ2VyRGVwcmVjYXRpb25zPSJ0cnVlIgogICAgZGlzcGxheURldGFpbHNPblRlc3RzVGhhdFRyaWdnZXJFcnJvcnM9InRydWUiCiAgICBkaXNwbGF5RGV0YWlsc09uVGVzdHNUaGF0VHJpZ2dlck5vdGljZXM9InRydWUiCiAgICBkaXNwbGF5RGV0YWlsc09uVGVzdHNUaGF0VHJpZ2dlcldhcm5pbmdzPSJ0cnVlIgogICAgZGlzcGxheURldGFpbHNPblBocHVuaXREZXByZWNhdGlvbnM9InRydWUiCj4KICAgIDx0ZXN0c3VpdGVzPgogICAgICAgIDx0ZXN0c3VpdGUgbmFtZT0iVGVzdCBTdWl0ZSI+CiAgICAgICAgICAgIDxkaXJlY3Rvcnk+Li4vLi4vdGVzdHMvPC9kaXJlY3Rvcnk+CiAgICAgICAgPC90ZXN0c3VpdGU+CiAgICA8L3Rlc3RzdWl0ZXM+CiAgICA8c291cmNlPgogICAgICAgIDxpbmNsdWRlPgogICAgICAgICAgICA8ZGlyZWN0b3J5IHN1ZmZpeD0iLnBocCI+Li4vLi4vc3JjLzwvZGlyZWN0b3J5PgogICAgICAgIDwvaW5jbHVkZT4KICAgIDwvc291cmNlPgogICAgPGV4dGVuc2lvbnM+CiAgICAgICAgPGJvb3RzdHJhcCBjbGFzcz0iRXJnZWJuaXNcUEhQVW5pdFxTbG93VGVzdERldGVjdG9yXEV4dGVuc2lvbiIvPgogICAgPC9leHRlbnNpb25zPgo8L3BocHVuaXQ+Cg=="));' || true) + +migrations-php-set-phpunit-xsd-path-to-local: #### Ensure that the PHPUnit XDS referred in `etc/qa/phpunit.xml` points to `vendor/phpunit/phpunit/phpunit.xsd` so we don't go over the network ##*I*## + ($(DOCKER_RUN) php -r '$$phpUnitConfigFIle = "etc/qa/phpunit.xml"; if (!file_exists($$phpUnitConfigFIle)) {exit;} $$xml = file_get_contents($$phpUnitConfigFIle); if (!is_string($$xml)) {exit;} for ($$major = 0; $$major < 23; $$major++) { for ($$minor = 0; $$minor < 23; $$minor++) { $$xml = str_replace("https://schema.phpunit.de/" . $$major . "." . $$minor . "/phpunit.xsd", "../../vendor/phpunit/phpunit/phpunit.xsd", $$xml); } } file_put_contents($$phpUnitConfigFIle, $$xml);' || true) + +migrations-php-set-phpunit-make-sure-we-see-all-the-warnings-deprecations-etc-etc-that-will-make-phpunit-do-a-non-happy-exit: #### Make sure we see all the warnings, deprecations, etc etc that will make PHPunit do a non-happy exit ##*I*## + ($(DOCKER_RUN) php -r '$$phpUnitConfigFIle = "etc/qa/phpunit.xml"; if (!file_exists($$phpUnitConfigFIle)) {exit;} $$xml = file_get_contents($$phpUnitConfigFIle); if (!is_string($$xml)) {exit;} $$xml = str_replace(base64_decode("PHBocHVuaXQgeG1sbnM6eHNpPSJodHRwOi8vd3d3LnczLm9yZy8yMDAxL1hNTFNjaGVtYS1pbnN0YW5jZSIgYm9vdHN0cmFwPSIuLi8uLi92ZW5kb3IvYXV0b2xvYWQucGhwIiBjb2xvcnM9InRydWUiIHhzaTpub05hbWVzcGFjZVNjaGVtYUxvY2F0aW9uPSIuLi8uLi92ZW5kb3IvcGhwdW5pdC9waHB1bml0L3BocHVuaXQueHNkIiBjYWNoZURpcmVjdG9yeT0iLi4vLi4vdmFyL3BocHVuaXQvY2FjaGUiPgo="), base64_decode("PHBocHVuaXQKICAgIHhtbG5zOnhzaT0iaHR0cDovL3d3dy53My5vcmcvMjAwMS9YTUxTY2hlbWEtaW5zdGFuY2UiCiAgICBib290c3RyYXA9Ii4uLy4uL3ZlbmRvci9hdXRvbG9hZC5waHAiCiAgICBjb2xvcnM9InRydWUiCiAgICB4c2k6bm9OYW1lc3BhY2VTY2hlbWFMb2NhdGlvbj0iLi4vLi4vdmVuZG9yL3BocHVuaXQvcGhwdW5pdC9waHB1bml0LnhzZCIKICAgIGNhY2hlRGlyZWN0b3J5PSIuLi8uLi92YXIvcGhwdW5pdC9jYWNoZSIKICAgIGRpc3BsYXlEZXRhaWxzT25UZXN0c1RoYXRUcmlnZ2VyRGVwcmVjYXRpb25zPSJ0cnVlIgogICAgZGlzcGxheURldGFpbHNPblRlc3RzVGhhdFRyaWdnZXJFcnJvcnM9InRydWUiCiAgICBkaXNwbGF5RGV0YWlsc09uVGVzdHNUaGF0VHJpZ2dlck5vdGljZXM9InRydWUiCiAgICBkaXNwbGF5RGV0YWlsc09uVGVzdHNUaGF0VHJpZ2dlcldhcm5pbmdzPSJ0cnVlIgogICAgZGlzcGxheURldGFpbHNPblBocHVuaXREZXByZWNhdGlvbnM9InRydWUiCj4K"), $$xml); file_put_contents($$phpUnitConfigFIle, $$xml);' || true) + +migrations-php-move-phpstan: #### Move `phpstan.neon` to `etc/qa/phpstan.neon` ##*I*## + ($(DOCKER_RUN) mv phpstan.neon etc/qa/phpstan.neon || true) + +migrations-php-set-phpstan-ensure-config-file-exists: #### Make sure we have a PHPStan config file at `etc/qa/phpstan.neon` ##*I*## + ($(DOCKER_RUN) php -r '$$phpStanConfigFIle = "etc/qa/phpstan.neon"; if (file_exists($$phpStanConfigFIle)) {exit;} file_put_contents($$phpStanConfigFIle, "#parameters:");' || true) + +migrations-php-set-phpstan-uncomment-parameters: #### Ensure PHPStan config as parameters not commented out in `etc/qa/phpstan.neon` ##*I*## + ($(DOCKER_RUN) php -r '$$phpStanConfigFIle = "etc/qa/phpstan.neon"; if (!file_exists($$phpStanConfigFIle)) {exit;} $$neon = file_get_contents($$phpStanConfigFIle); if (!is_string($$neon)) {exit;} if (!str_starts_with($$neon, "#parameters:")) {exit;} $$neon = str_replace("#parameters:", "parameters:", $$neon); file_put_contents($$phpStanConfigFIle, $$neon);' || true) + +migrations-php-set-phpstan-add-parameters-if-it-isnt-present-in-the-config-file: #### Add parameters to PHPStan config file at `etc/qa/phpstan.neon` if it's not present ##*I*## + ($(DOCKER_RUN) php -r '$$phpStanConfigFIle = "etc/qa/phpstan.neon"; if (!file_exists($$phpStanConfigFIle)) {exit;} $$neon = file_get_contents($$phpStanConfigFIle); if (!is_string($$neon)) {exit;} if (strpos($$neon, "parameters:") !== false) {exit;} file_put_contents($$phpStanConfigFIle, "parameters:", FILE_APPEND);' || true) + +migrations-php-set-phpstan-paths-in-config: #### Ensure PHPStan config has the `etc`, `src`, and (optionally) `tests` paths set in `etc/qa/phpstan.neon` ##*I*## + ($(DOCKER_RUN) php -r '$$phpStanConfigFIle = "etc/qa/phpstan.neon"; $$pathsString = "\n\tpaths:\n\t\t- ../../etc\n\t\t- ../../src\n\t\t- ../../tests"; $$pathsStringWithoutTests = "\n\tpaths:\n\t\t- ../../etc\n\t\t- ../../src"; if (!file_exists($$phpStanConfigFIle)) {exit;} $$neon = file_get_contents($$phpStanConfigFIle); if (!is_string($$neon)) {exit;} if (strpos($$neon, $$pathsString) !== false || strpos($$neon, $$pathsStringWithoutTests) !== false) {exit;} $$neon = str_replace("parameters:", "parameters:" . $$pathsString, $$neon); file_put_contents($$phpStanConfigFIle, $$neon);' || true) + +migrations-php-set-phpstan-level-max-in-config: #### Ensure PHPStan config has level set to max in `etc/qa/phpstan.neon` ##*I*## + ($(DOCKER_RUN) php -r '$$phpStanConfigFIle = "etc/qa/phpstan.neon"; $$levelString = "\n\tlevel: max"; if (!file_exists($$phpStanConfigFIle)) {exit;} $$neon = file_get_contents($$phpStanConfigFIle); if (!is_string($$neon)) {exit;} if (strpos($$neon, $$levelString) !== false) {exit;} $$neon = str_replace("parameters:", "parameters:" . $$levelString, $$neon); file_put_contents($$phpStanConfigFIle, $$neon);' || true) + +migrations-php-set-phpstan-resolve-ergebnis-noExtends-classesAllowedToBeExtended: #### Ensure PHPStan config uses ergebnis.noExtends.classesAllowedToBeExtended not ergebnis.classesAllowedToBeExtended ##*I*## + ($(DOCKER_RUN) php -r '$$phpStanConfigFIle = "etc/qa/phpstan.neon"; if (!file_exists($$phpStanConfigFIle)) {exit;} $$neon = file_get_contents($$phpStanConfigFIle); if (!is_string($$neon)) {exit;} $$neon = str_replace("\tergebnis:\n\t\tclassesAllowedToBeExtended:\n", "\tergebnis:\n\t\tnoExtends:\n\t\t\tclassesAllowedToBeExtended:\n", $$neon); file_put_contents($$phpStanConfigFIle, $$neon);' || true) + +migrations-php-set-phpstan-drop-checkGenericClassInNonGenericObjectType: #### Ensure PHPStan config doesn't contain checkGenericClassInNonGenericObjectType as it's no longer a valid config option ##*I*## + ($(DOCKER_RUN) php -r '$$phpStanConfigFIle = "etc/qa/phpstan.neon"; if (!file_exists($$phpStanConfigFIle)) {exit;} $$neon = file_get_contents($$phpStanConfigFIle); if (!is_string($$neon)) {exit;} $$neon = str_replace("\tcheckGenericClassInNonGenericObjectType: false\n", "", $$neon); file_put_contents($$phpStanConfigFIle, $$neon);' || true) + +migrations-php-phpstan-add-prefix-for-anything-that-starts-with-vendor-in-a-list: #### PHPStan add `../../` to anything in a list that starts with `vendor` ##*I*## + ($(DOCKER_RUN) php -r '$$phpStanConfigFIle = "etc/qa/phpstan.neon"; if (!file_exists($$phpStanConfigFIle)) {exit;} $$neon = file_get_contents($$phpStanConfigFIle); if (!is_string($$neon)) {exit;} $$neon = str_replace("- vendor", "- ../../vendor", $$neon); file_put_contents($$phpStanConfigFIle, $$neon);' || true) + +migrations-php-set-phpstan-drop-include-test-utilities-rules: #### Ensure PHPStan config doesn't contain include for `wyrihaximus/async-utilities/rules.neon` as it's now an extension ##*I*## + ($(DOCKER_RUN) php -r '$$phpStanConfigFIle = "etc/qa/phpstan.neon"; if (!file_exists($$phpStanConfigFIle)) {exit;} $$neon = file_get_contents($$phpStanConfigFIle); if (!is_string($$neon)) {exit;} $$neon = str_replace("\nincludes:\n\t- ../../vendor/wyrihaximus/test-utilities/rules.neon\n", "", $$neon); file_put_contents($$phpStanConfigFIle, $$neon);' || true) + +migrations-php-set-phpstan-drop-include-async-test-utilities-rules: #### Ensure PHPStan config doesn't contain include for `wyrihaximus/async-test-utilities/rules.neon` as it's now an extension ##*I*## + ($(DOCKER_RUN) php -r '$$phpStanConfigFIle = "etc/qa/phpstan.neon"; if (!file_exists($$phpStanConfigFIle)) {exit;} $$neon = file_get_contents($$phpStanConfigFIle); if (!is_string($$neon)) {exit;} $$neon = str_replace("\nincludes:\n\t- ../../vendor/wyrihaximus/async-test-utilities/rules.neon", "", $$neon); file_put_contents($$phpStanConfigFIle, $$neon);' || true) + +migrations-php-set-rector-create-config-if-not-exists: #### Create Rector config file if it doesn't exists at `etc/qa/rector.php` ##*I*## + ($(DOCKER_RUN) php -r '$$rectorConfigFile = "etc/qa/rector.php"; $$defaultRectorConfig = "", "", $$xml); file_put_contents($$phpcsConfigFile, $$xml);' || true) + +migrations-php-phpcs-make-cache-is-correct-relatively: #### Make sure PHPCS cache path is has `../../var/.phpcs.cache` and not `.phpcs.cache` ##*I*## + ($(DOCKER_RUN) php -r '$$phpcsConfigFile = "etc/qa/phpcs.xml"; if (!file_exists($$phpcsConfigFile)) {exit;} $$xml = file_get_contents($$phpcsConfigFile); if (!is_string($$xml)) {exit;} $$xml = str_replace("", "", $$xml); file_put_contents($$phpcsConfigFile, $$xml);' || true) + +migrations-php-phpcs-make-sure-config-has-correct-relative-path-for-etc: #### Make sure PHPCS has `../../` prefixing `etc/` to ensure correct relative path ##*I*## + ($(DOCKER_RUN) php -r '$$phpcsConfigFile = "etc/qa/phpcs.xml"; if (!file_exists($$phpcsConfigFile)) {exit;} $$xml = file_get_contents($$phpcsConfigFile); if (!is_string($$xml)) {exit;} $$xml = str_replace("etc", "../../etc/", $$xml); file_put_contents($$phpcsConfigFile, $$xml);' || true) + +migrations-php-phpcs-make-sure-etc-has-no-trailing-slash: #### Make sure PHPCS has no tailing `/` on `etc` ##*I*## + ($(DOCKER_RUN) php -r '$$phpcsConfigFile = "etc/qa/phpcs.xml"; if (!file_exists($$phpcsConfigFile)) {exit;} $$xml = file_get_contents($$phpcsConfigFile); if (!is_string($$xml)) {exit;} $$xml = str_replace("../../etc/", "../../etc", $$xml); file_put_contents($$phpcsConfigFile, $$xml);' || true) + +migrations-php-phpcs-make-sure-config-has-correct-relative-path-for-src: #### Make sure PHPCS has `../../` prefixing `src/` to ensure correct relative path ##*I*## + ($(DOCKER_RUN) php -r '$$phpcsConfigFile = "etc/qa/phpcs.xml"; if (!file_exists($$phpcsConfigFile)) {exit;} $$xml = file_get_contents($$phpcsConfigFile); if (!is_string($$xml)) {exit;} $$xml = str_replace("src", "../../src/", $$xml); file_put_contents($$phpcsConfigFile, $$xml);' || true) + +migrations-php-phpcs-make-sure-src-has-no-trailing-slash: #### Make sure PHPCS has no tailing `/` on src ##*I*## + ($(DOCKER_RUN) php -r '$$phpcsConfigFile = "etc/qa/phpcs.xml"; if (!file_exists($$phpcsConfigFile)) {exit;} $$xml = file_get_contents($$phpcsConfigFile); if (!is_string($$xml)) {exit;} $$xml = str_replace("../../src/", "../../src", $$xml); file_put_contents($$phpcsConfigFile, $$xml);' || true) + +migrations-php-phpcs-make-sure-config-has-correct-relative-path-for-tests: #### Make sure PHPCS has `../../` prefixing `tests/` to ensure correct relative path ##*I*## + ($(DOCKER_RUN) php -r '$$phpcsConfigFile = "etc/qa/phpcs.xml"; if (!file_exists($$phpcsConfigFile)) {exit;} $$xml = file_get_contents($$phpcsConfigFile); if (!is_string($$xml)) {exit;} $$xml = str_replace("tests", "../../tests/", $$xml); file_put_contents($$phpcsConfigFile, $$xml);' || true) + +migrations-php-phpcs-make-sure-tests-has-no-trailing-slash: #### Make sure PHPCS has no tailing `/` on `tests` ##*I*## + ($(DOCKER_RUN) php -r '$$phpcsConfigFile = "etc/qa/phpcs.xml"; if (!file_exists($$phpcsConfigFile)) {exit;} $$xml = file_get_contents($$phpcsConfigFile); if (!is_string($$xml)) {exit;} $$xml = str_replace("../../tests/", "../../tests", $$xml); file_put_contents($$phpcsConfigFile, $$xml);' || true) + +migrations-php-phpcs-make-sure-etc-is-ran-through: #### Make sure PHPCS runs through `etc` ##*I*## + ($(DOCKER_RUN) php -r '$$phpcsConfigFile = "etc/qa/phpcs.xml"; if (!file_exists($$phpcsConfigFile)) {exit;} $$xml = file_get_contents($$phpcsConfigFile); if (!is_string($$xml)) {exit;} if (strpos($$xml, "../../etc") !== false) {exit;} $$xml = str_replace("../../src", "../../etc\n ../../src", $$xml); file_put_contents($$phpcsConfigFile, $$xml);' || true) + +migrations-phpcs-include-examples-directory-when-present: #### Make sure PHPCS runs through `examples` when it exists ##*I*## + ($(DOCKER_RUN) php -r 'if (!file_exists("examples/")) {exit;} $$phpcsConfigFile = "etc/qa/phpcs.xml"; if (!file_exists($$phpcsConfigFile)) {exit;} $$xml = file_get_contents($$phpcsConfigFile); if (!is_string($$xml)) {exit;} if (strpos($$xml, "../../examples") !== false) {exit;} $$xml = str_replace("../../etc", "../../etc\n ../../examples", $$xml); file_put_contents($$phpcsConfigFile, $$xml);' || true) + +migrations-php-move-composer-require-checker: #### Move composer-require-checker.json to `etc/qa/composer-require-checker.json` ##*I*## + ($(DOCKER_RUN) mv composer-require-checker.json etc/qa/composer-require-checker.json || true) + +migrations-php-composer-require-checker-create-config-if-not-exists: #### Create Composer Require Checker config file if it doesn't exists at `etc/qa/composer-require-checker.json` ##*I*## + ($(DOCKER_RUN) php -r '$$composerRequireCheckerConfigFile = "etc/qa/composer-require-checker.json"; $$composerRequireCheckerConfig = base64_decode("ewogICJzeW1ib2wtd2hpdGVsaXN0IiA6IFsKICAgICJudWxsIiwgInRydWUiLCAiZmFsc2UiLAogICAgInN0YXRpYyIsICJzZWxmIiwgInBhcmVudCIsCiAgICAiYXJyYXkiLCAic3RyaW5nIiwgImludCIsICJmbG9hdCIsICJib29sIiwgIml0ZXJhYmxlIiwgImNhbGxhYmxlIiwgInZvaWQiLCAib2JqZWN0IgogIF0sCiAgInBocC1jb3JlLWV4dGVuc2lvbnMiIDogWwogICAgIkNvcmUiLAogICAgImRhdGUiLAogICAgInBjcmUiLAogICAgIlBoYXIiLAogICAgIlJlZmxlY3Rpb24iLAogICAgIlNQTCIsCiAgICAic3RhbmRhcmQiCiAgXSwKICAic2Nhbi1maWxlcyIgOiBbXQp9Cg=="); if (file_exists($$composerRequireCheckerConfigFile)) {exit;} file_put_contents($$composerRequireCheckerConfigFile, $$composerRequireCheckerConfig);' || true) + +migrations-inline-code-phpstan-remove-line-phpstan-ignore-next-line: #### Remove all lines that contains @phpstan-ignore-next-line ##*I*## + ($(DOCKER_RUN) php -r '$$possibleDirectories = ["src", "tests", "etc", "examples"]; foreach ($$possibleDirectories as $$possibleDirectory) { if (!file_exists($$possibleDirectory)) {continue;} $$i = new \RecursiveIteratorIterator(new \RecursiveDirectoryIterator($$possibleDirectory)); $$i->rewind(); while ($$i->valid()) { if (!is_file($$i->key()) || (is_file($$i->key()) && !str_ends_with($$i->key(), ".php"))) { $$i->next(); continue; } $$fileContents = explode("\n", file_get_contents($$i->key())); foreach ($$fileContents as $$lineNumber => $$lineContent) { if (str_contains($$lineContent, "@phpstan-ignore-next-line")) { unset($$fileContents[$$lineNumber]); } } file_put_contents($$i->key(), implode("\n", $$fileContents)); $$i->next(); } }' || true) + +migrations-inline-code-phpstan-remove-rest-of-line-phpstan-ignore-line: #### Remove rest of line for all lines that contain @phpstan-ignore-line ##*I*## + ($(DOCKER_RUN) php -r '$$possibleDirectories = ["src", "tests", "etc", "examples"]; foreach ($$possibleDirectories as $$possibleDirectory) { if (!file_exists($$possibleDirectory)) {continue;} $$i = new \RecursiveIteratorIterator(new \RecursiveDirectoryIterator($$possibleDirectory)); $$i->rewind(); while ($$i->valid()) { if (!is_file($$i->key()) || (is_file($$i->key()) && !str_ends_with($$i->key(), ".php"))) { $$i->next(); continue; } $$fileContents = explode("\n", file_get_contents($$i->key())); foreach ($$fileContents as $$lineNumber => $$lineContent) { if (str_contains($$lineContent, "/** @phpstan-ignore-line")) { [$$fileContents[$$lineNumber]] = explode("/** @phpstan-ignore-line", $$lineContent); } } file_put_contents($$i->key(), implode("\n", $$fileContents)); $$i->next(); } }' || true) + +migrations-inline-code-psalm-remove-line-psalm-suppress: #### Remove all lines that contain @psalm-suppress ##*I*## + ($(DOCKER_RUN) php -r '$$possibleDirectories = ["src", "tests", "etc", "examples"]; foreach ($$possibleDirectories as $$possibleDirectory) { if (!file_exists($$possibleDirectory)) {continue;} $$i = new \RecursiveIteratorIterator(new \RecursiveDirectoryIterator($$possibleDirectory)); $$i->rewind(); while ($$i->valid()) { if (!is_file($$i->key()) || (is_file($$i->key()) && !str_ends_with($$i->key(), ".php"))) { $$i->next(); continue; } $$fileContents = explode("\n", file_get_contents($$i->key())); foreach ($$fileContents as $$lineNumber => $$lineContent) { if (str_contains($$lineContent, "@psalm-suppress")) { unset($$fileContents[$$lineNumber]); } } file_put_contents($$i->key(), implode("\n", $$fileContents)); $$i->next(); } }' || true) + +migrations-inline-code-remove-line-internal: #### Remove all lines that contain @internal ##*I*## + ($(DOCKER_RUN) php -r '$$possibleDirectories = ["src", "tests", "etc", "examples"]; foreach ($$possibleDirectories as $$possibleDirectory) { if (!file_exists($$possibleDirectory)) {continue;} $$i = new \RecursiveIteratorIterator(new \RecursiveDirectoryIterator($$possibleDirectory)); $$i->rewind(); while ($$i->valid()) { if (!is_file($$i->key()) || (is_file($$i->key()) && !str_ends_with($$i->key(), ".php"))) { $$i->next(); continue; } $$fileContents = explode("\n", file_get_contents($$i->key())); foreach ($$fileContents as $$lineNumber => $$lineContent) { if (str_contains($$lineContent, "@internal")) { unset($$fileContents[$$lineNumber]); } } file_put_contents($$i->key(), implode("\n", $$fileContents)); $$i->next(); } }' || true) + +migrations-inline-code-phpunit-replace-expectexceptionmessage-with-expectexceptionmessageisorcontains: #### Replace self::expectExceptionMessage with self::expectExceptionMessageIsOrContains in all PHPUnit tests ##*I*## + ($(DOCKER_RUN) php -r '$$possibleDirectories = ["src", "tests", "etc", "examples"]; foreach ($$possibleDirectories as $$possibleDirectory) { if (!file_exists($$possibleDirectory)) {continue;} $$i = new \RecursiveIteratorIterator(new \RecursiveDirectoryIterator($$possibleDirectory)); $$i->rewind(); while ($$i->valid()) { if (!is_file($$i->key()) || (is_file($$i->key()) && !str_ends_with($$i->key(), ".php"))) { $$i->next(); continue; } $$fileContents = file_get_contents($$i->key()); if (str_contains($$fileContents, "#[Test]") && str_contains($$fileContents, "use PHPUnit\Framework\Attributes\Test;")) { $$fileContents = str_replace("self::expectExceptionMessage(", "self::expectExceptionMessageIsOrContains(", $$fileContents); file_put_contents($$i->key(), $$fileContents); } $$i->next(); } }' || true) + +migrations-supported-features-php-ensure-we-only-cs-check-and-fix-tests-if-unit-tests-is-enabled: #### Ensure we only cs check/fix tests/ if unit-tests is enabled ##*I*## + ($(DOCKER_RUN) php -r 'if (in_array("unit-tests", ["code-style","composer-dependency-checkers","linux","macos","static-analysis","unit-tests","windows"])) {exit;} $$phpCSCongifFIle = "etc/qa/phpcs.xml"; $$fileContents = explode("\n", file_get_contents($$phpCSCongifFIle)); foreach ($$fileContents as $$lineNumber => $$lineContent) { if (str_contains($$lineContent, "../../tests")) { unset($$fileContents[$$lineNumber]); } } file_put_contents($$phpCSCongifFIle, implode("\n", $$fileContents));' || true) + +migrations-supported-features-php-ensure-we-only-staticly-analyse-tests-with-phpstan-if-unit-tests-is-enabled: #### Ensure we only staticly analyse tests/ with PHPStan if unit-tests is enabled ##*I*## + ($(DOCKER_RUN) php -r 'if (in_array("unit-tests", ["code-style","composer-dependency-checkers","linux","macos","static-analysis","unit-tests","windows"])) {exit;} $$phpStanCongifFIle = "etc/qa/phpstan.neon"; $$fileContents = explode("\n", file_get_contents($$phpStanCongifFIle)); foreach ($$fileContents as $$lineNumber => $$lineContent) { if (str_contains($$lineContent, "- ../../tests")) { unset($$fileContents[$$lineNumber]); } } file_put_contents($$phpStanCongifFIle, implode("\n", $$fileContents));' || true) + +migrations-supported-features-php-ensure-no-phpunit-config-file-is-present-when-unit-tests-are-disabled: #### Ensure we remove the PHPUnit config file when unit-tests aren't enabled ##*I*## + ($(DOCKER_RUN) php -r 'if (in_array("unit-tests", ["code-style","composer-dependency-checkers","linux","macos","static-analysis","unit-tests","windows"])) {exit;} @unlink("etc/qa/phpunit.xml");' || true) + +migrations-supported-features-php-ensure-no-infectionphp-config-file-is-present-when-unit-tests-are-disabled: #### Ensure we remove the InfectionPHP config file when unit-tests aren't enabled ##*I*## + ($(DOCKER_RUN) php -r 'if (in_array("unit-tests", ["code-style","composer-dependency-checkers","linux","macos","static-analysis","unit-tests","windows"])) {exit;} @unlink("etc/qa/infection.json5");' || true) + +migrations-supported-features-php-ensure-no-rector-config-file-is-present-when-code-style-is-disabled: #### Ensure we remove the RectorPHP config file when code-style isn't enabled ##*I*## + ($(DOCKER_RUN) php -r 'if (in_array("code-style", ["code-style","composer-dependency-checkers","linux","macos","static-analysis","unit-tests","windows"])) {exit;} @unlink("etc/qa/rector.php");' || true) + +migrations-supported-features-php-ensure-no-phpcs-config-file-is-present-when-code-style-is-disabled: #### Ensure we remove the PHPCSS config file when code-style isn't enabled ##*I*## + ($(DOCKER_RUN) php -r 'if (in_array("code-style", ["code-style","composer-dependency-checkers","linux","macos","static-analysis","unit-tests","windows"])) {exit;} @unlink("etc/qa/phpcs.xml");' || true) + +migrations-supported-features-php-ensure-no-composer-require-checker-config-file-is-present-when-composer-dependency-checkers-are-disabled: #### Ensure we remove the Composer Require Checker config file when composer-dependency-checkers aren't enabled ##*I*## + ($(DOCKER_RUN) php -r 'if (in_array("composer-dependency-checkers", ["code-style","composer-dependency-checkers","linux","macos","static-analysis","unit-tests","windows"])) {exit;} @unlink("etc/qa/composer-require-checker.json");' || true) + +migrations-supported-features-php-ensure-no-composer-unused-config-file-is-present-when-composer-dependency-checkers-are-disabled: #### Ensure we remove the Composer Unused config file when composer-dependency-checkers aren't enabled ##*I*## + ($(DOCKER_RUN) php -r 'if (in_array("composer-dependency-checkers", ["code-style","composer-dependency-checkers","linux","macos","static-analysis","unit-tests","windows"])) {exit;} @unlink("etc/qa/composer-unused.php");' || true) + +migrations-php-make-sure-github-exists: #### Make sure `.github/` exists ##*I*## + ($(DOCKER_RUN) mkdir .github || true) + +migrations-github-codeowners: #### Ensure a `CODEOWNERS` file is present, create only if it doesn't exist yet ##*I*## + ($(DOCKER_RUN) php -r '$$codeOwnersFile = ".github/CODEOWNERS"; if (file_exists($$codeOwnersFile)) {exit;} file_put_contents($$codeOwnersFile, "* @WyriHaximus" . PHP_EOL);' || true) + +migrations-php-make-sure-github-workflows-exists: #### Make sure `.github/workflows` exists ##*I*## + ($(DOCKER_RUN) mkdir .github/workflows || true) + +migrations-github-actions-remove-composer-diff: #### Remove `composer-diff.yaml` it has been folded into centralized workflows through `ci.yaml` ##*I*## + ($(DOCKER_RUN) rm .github/workflows/composer-diff.yaml || true) + +migrations-github-actions-remove-markdown-check-links: #### Remove `markdown-check-links.yaml` it has been folded into centralized workflows through `ci.yaml` ##*I*## + ($(DOCKER_RUN) rm .github/workflows/markdown-check-links.yaml || true) + +migrations-github-actions-remove-markdown-craft-release: #### Remove `craft-release.yaml` it has been folded into centralized workflows through `release-management.yaml` ##*I*## + ($(DOCKER_RUN) rm .github/workflows/craft-release.yaml || true) + +migrations-github-actions-remove-set-milestone-on-pr: #### Remove `set-milestone-on-pr.yaml` it has been folded into centralized workflows through `release-management.yaml` ##*I*## + ($(DOCKER_RUN) rm .github/workflows/set-milestone-on-pr.yaml || true) + +migrations-github-actions-move-ci: #### Move `.github/workflows/ci.yml` to `.github/workflows/ci.yaml` ##*I*## + ($(DOCKER_RUN) mv .github/workflows/ci.yml .github/workflows/ci.yaml || true) + +migrations-github-actions-remove-ci-if-its-old-style-php-ci-workflow: #### Remove CI Workflow if its the old style PHP CI Workflow ##*I*## + ($(DOCKER_RUN) php -r '$$ciWorkflowFile = ".github/workflows/ci.yaml"; if (!file_exists($$ciWorkflowFile)) {exit;} $$yaml = file_get_contents($$ciWorkflowFile); if (!is_string($$yaml)) {exit;} if (strpos($$yaml, "composer: [lowest, locked, highest]") !== false || strpos($$yaml, "composer: [lowest, current, highest]") !== false || strpos($$yaml, "- run: make ${{ matrix.check }}") !== false || strpos($$yaml, trim(base64_decode("aWY6IG1hdHJpeC5jaGVjayA9PSAnYmFja3dhcmQtY29tcGF0aWJpbGl0eS1jaGVjaycK"))) !== false) { unlink($$ciWorkflowFile); }' || true) + +migrations-github-actions-create-ci-if-not-exists: #### Create CI Workflow if it doesn't exists at `.github/workflows/ci.yaml` ##*I*## + ($(DOCKER_RUN) php -r '$$ciWorkflowFile = ".github/workflows/ci.yaml"; $$ciWorkflowContents = base64_decode("bmFtZTogQ29udGludW91cyBJbnRlZ3JhdGlvbgpvbjoKICBwdXNoOgogICAgYnJhbmNoZXM6CiAgICAgIC0gJ21haW4nCiAgICAgIC0gJ21hc3RlcicKICAgICAgLSAncmVmcy9oZWFkcy92WzAtOV0rLlswLTldKy5bMC05XSsnCiAgcHVsbF9yZXF1ZXN0OgojIyBUaGlzIHdvcmtmbG93IG5lZWRzIHRoZSBgcHVsbC1yZXF1ZXN0YCBwZXJtaXNzaW9ucyB0byB3b3JrIGZvciB0aGUgcGFja2FnZSBkaWZmaW5nCiMjIFJlZnM6IGh0dHBzOi8vZG9jcy5naXRodWIuY29tL2VuL2FjdGlvbnMvcmVmZXJlbmNlL3dvcmtmbG93LXN5bnRheC1mb3ItZ2l0aHViLWFjdGlvbnMjcGVybWlzc2lvbnMKcGVybWlzc2lvbnM6CiAgcHVsbC1yZXF1ZXN0czogd3JpdGUKICBjb250ZW50czogcmVhZApqb2JzOgogIGNpOgogICAgbmFtZTogQ29udGludW91cyBJbnRlZ3JhdGlvbgogICAgdXNlczogV3lyaUhheGltdXMvZ2l0aHViLXdvcmtmbG93cy8uZ2l0aHViL3dvcmtmbG93cy9wYWNrYWdlLnlhbWxAbWFpbgo="); if (file_exists($$ciWorkflowFile)) {exit;} file_put_contents($$ciWorkflowFile, $$ciWorkflowContents);' || true) + +migrations-github-actions-move-release-management: #### Move `.github/workflows/release-managment.yaml` to `.github/workflows/release-management.yaml` ##*I*## + ($(DOCKER_RUN) mv .github/workflows/release-managment.yaml .github/workflows/release-management.yaml || true) + +migrations-github-actions-fix-management-in-release-management-referenced-workflow-file: #### Fix management in release-management referenced workflow file ##*I*## + ($(DOCKER_RUN) sed -i -e 's/release-managment.yaml/release-management.yaml/g' .github/workflows/release-management.yaml || true) + +migrations-github-actions-create-release-management-if-not-exists: #### Create Release Management Workflow if it doesn't exists at `.github/workflows/release-management.yaml` ##*I*## + ($(DOCKER_RUN) php -r '$$releaseManagementWorkflowFile = ".github/workflows/release-management.yaml"; $$releaseManagementWorkflowContents = base64_decode("bmFtZTogUmVsZWFzZSBNYW5hZ2VtZW50Cm9uOgogIHB1bGxfcmVxdWVzdDoKICAgIHR5cGVzOgogICAgICAtIG9wZW5lZAogICAgICAtIGxhYmVsZWQKICAgICAgLSB1bmxhYmVsZWQKICAgICAgLSBzeW5jaHJvbml6ZQogICAgICAtIHJlb3BlbmVkCiAgICAgIC0gbWlsZXN0b25lZAogICAgICAtIGRlbWlsZXN0b25lZAogICAgICAtIHJlYWR5X2Zvcl9yZXZpZXcKICBtaWxlc3RvbmU6CiAgICB0eXBlczoKICAgICAgLSBjbG9zZWQKcGVybWlzc2lvbnM6CiAgY29udGVudHM6IHdyaXRlCiAgaXNzdWVzOiB3cml0ZQogIHB1bGwtcmVxdWVzdHM6IHdyaXRlCmpvYnM6CiAgcmVsZWFzZS1tYW5hZ21lbnQ6CiAgICBuYW1lOiBSZWxlYXNlIE1hbmFnZW1lbnQKICAgIHVzZXM6IFd5cmlIYXhpbXVzL2dpdGh1Yi13b3JrZmxvd3MvLmdpdGh1Yi93b3JrZmxvd3MvcGFja2FnZS1yZWxlYXNlLW1hbmFnZW1lbnQueWFtbEBtYWluCiAgICB3aXRoOgogICAgICBtaWxlc3RvbmU6ICR7eyBnaXRodWIuZXZlbnQubWlsZXN0b25lLnRpdGxlIH19CiAgICAgIGRlc2NyaXB0aW9uOiAke3sgZ2l0aHViLmV2ZW50Lm1pbGVzdG9uZS50aXRsZSB9fQo="); if (file_exists($$releaseManagementWorkflowFile)) {exit;} file_put_contents($$releaseManagementWorkflowFile, $$releaseManagementWorkflowContents);' || true) + +migrations-renovate-remove-dependabot-config: #### Make sure we remove `.github/dependabot.yml` ##*I*## + ($(DOCKER_RUN) rm .github/dependabot.yml || true) + ($(DOCKER_RUN) rm .github/dependabot.yaml || true) + +migrations-renovate-move-config: #### Move `renovate.json` to `.github/renovate.json` ##*I*## + ($(DOCKER_RUN) mv renovate.json .github/renovate.json || true) + +migrations-renovate-create-config-if-not-exists: #### Create Renovate Config if it doesn't exists at `.github/renovate.json` ##*I*## + ($(DOCKER_RUN) php -r '$$renovateConfigFile = ".github/renovate.json"; $$renovateConfigContents = base64_decode("ewogICIkc2NoZW1hIjogImh0dHBzOi8vZG9jcy5yZW5vdmF0ZWJvdC5jb20vcmVub3ZhdGUtc2NoZW1hLmpzb24iLAogICJleHRlbmRzIjogWwogICAgImdpdGh1Yj5XeXJpSGF4aW11cy9yZW5vdmF0ZS1jb25maWc6cGhwLXBhY2thZ2UiCiAgXQp9Cg=="); if (file_exists($$renovateConfigFile)) {exit;} file_put_contents($$renovateConfigFile, $$renovateConfigContents);' || true) + +migrations-renovate-point-at-correct-config: #### Ensure `.github/renovate.json` points at github>WyriHaximus/renovate-config:php-package instead of local>WyriHaximus/renovate-config ##*I*## + ($(DOCKER_RUN) php -r '$$renovateFIle = ".github/renovate.json"; if (!file_exists($$renovateFIle)) {exit;} file_put_contents($$renovateFIle, str_replace("local>WyriHaximus/renovate-config", "github>WyriHaximus/renovate-config:php-package", file_get_contents($$renovateFIle)));' || true) + +migrations-renovate-set-php-constraint: #### Always keep renovate's constraints.php in sync with `composer.json`'s `config.platform.php` ##*I*## + ($(DOCKER_RUN) php -r '$$composerFIle = "composer.json"; if (!file_exists($$composerFIle)) {exit;} $$json = json_decode(file_get_contents($$composerFIle), true); if (!array_key_exists("config", $$json)) {exit;} if (!array_key_exists("platform", $$json["config"])) {exit;} if (!array_key_exists("php", $$json["config"]["platform"])) {exit;} $$phpVersionConstraint = str_replace(".13", ".x", $$json["config"]["platform"]["php"]); $$renovateFIle = ".github/renovate.json"; if (!file_exists($$renovateFIle)) {exit;} $$json = json_decode(file_get_contents($$renovateFIle), true); if (!is_array($$json)) {exit;} if (!array_key_exists("constraints", $$json)) {$$json["constraints"] = [];} $$json["constraints"]["php"] = $$phpVersionConstraint; file_put_contents($$renovateFIle, json_encode($$json, JSON_PRETTY_PRINT | JSON_UNESCAPED_SLASHES) . "\r\n");' || true) + +migrations-renovate-set-composer-constraint: #### Always keep renovate's `constraints.composer` at `2.x` ##*I*## + ($(DOCKER_RUN) php -r '$$renovateFIle = ".github/renovate.json"; if (!file_exists($$renovateFIle)) {exit;} $$json = json_decode(file_get_contents($$renovateFIle), true); if (!is_array($$json)) {exit;} if (!array_key_exists("constraints", $$json)) {$$json["constraints"] = [];} $$json["constraints"]["composer"] = "2.x"; file_put_contents($$renovateFIle, json_encode($$json, JSON_PRETTY_PRINT | JSON_UNESCAPED_SLASHES) . "\r\n");' || true) + + +## Our default jobs +OPENAPI_GENERATOR=$(DOCKER_RUN) php ./vendor/bin/openapi-generator generate-example-clients: generate-example-client-one generate-example-client-subsplit generate-example-client-miele generate-example-client-one: - $(DOCKER_RUN) php ./bin/openapi-client-generator ./example/openapi-client-one.yaml + $(OPENAPI_GENERATOR) ./example/openapi-client-one.php generate-example-client-subsplit: - $(DOCKER_RUN) php ./bin/openapi-client-generator ./example/openapi-client-subsplit.yaml + $(OPENAPI_GENERATOR) ./example/openapi-client-subsplit.php generate-example-client-miele: - $(DOCKER_RUN) php ./bin/openapi-client-generator ./example/openapi-client-miele.yaml + $(OPENAPI_GENERATOR) ./example/openapi-client-miele.php generate-test-client: - $(DOCKER_RUN) php ./bin/openapi-client-generator ./tests/openapi-client-petstore.yaml + $(OPENAPI_GENERATOR) ./tests/openapi-client-petstore.php + +generate-packages: + $(OPENAPI_GENERATOR) ./example/client-gitub-one.php + +on-install-or-update: ## Tasks, like migrations, that specifically have be run after composer install or update. These will also run by self hosted Renovate #### +ifeq ("$(ON_INSTALL_OR_UPDATE_HAS_DIRECT_DOCKER_TASKS)","TRUE") + $(DOCKER_RUN_WITH_SOCKET) $(MAKE) migrations-git-enforce-gitattributes-contents migrations-git-make-sure-gitignore-exists migrations-git-make-sure-gitignore-ignores-var migrations-git-make-sure-gitignore-excludes-var-gitkeep migrations-docs-update-readme-copyright-c-year-to-current migrations-docs-update-readme-copyright-year-to-current migrations-docs-update-etc-readme-template-copyright-c-year-to-current migrations-docs-update-etc-readme-template-copyright-year-to-current migrations-docs-create-license-when-it-doesnt-exists migrations-docs-update-license-copyright-c-year-to-current migrations-docs-update-license-copyright-year-to-current migrations-docs-enforce-contributing-md-contents migrations-php-make-sure-var-exists migrations-php-make-sure-var-gitkeep-exists migrations-php-make-sure-etc-exists migrations-php-make-sure-etc-ci-exists migrations-php-make-sure-etc-qa-exists migrations-php-move-psalm-xml-config-to-etc migrations-php-remove-psalm-xml-config migrations-php-remove-old-phpunit-xml-dist-config migrations-php-remove-old-phpunit-xml-config migrations-php-remove-old-php-cs-fiver-config migrations-php-remove-old-scrutinizer-yml-config migrations-php-remove-old-appveyor-yml-config migrations-php-remove-old-travis-yml-config migrations-php-ensure-etc-ci-markdown-link-checker-json-exists migrations-php-move-infection-config-to-etc migrations-php-infection-create-config-if-not-exists migrations-php-remove-phpunit-config-dir-from-infection migrations-php-fix-logs-relative-paths-for-infection migrations-php-infection-ensure-log-text-has-the-correct-path migrations-php-infection-ensure-log-summary-has-the-correct-path migrations-php-infection-ensure-log-json-has-the-correct-path migrations-php-infection-ensure-log-per-mutator-has-the-correct-path migrations-php-add-github-true-to-for-infection migrations-php-make-paths-compatible-with-infection-0-32 migrations-php-set-phpunit-ensure-config-file-exists migrations-php-set-phpunit-xsd-path-to-local migrations-php-set-phpunit-make-sure-we-see-all-the-warnings-deprecations-etc-etc-that-will-make-phpunit-do-a-non-happy-exit migrations-php-move-phpstan migrations-php-set-phpstan-ensure-config-file-exists migrations-php-set-phpstan-uncomment-parameters migrations-php-set-phpstan-add-parameters-if-it-isnt-present-in-the-config-file migrations-php-set-phpstan-paths-in-config migrations-php-set-phpstan-level-max-in-config migrations-php-set-phpstan-resolve-ergebnis-noExtends-classesAllowedToBeExtended migrations-php-set-phpstan-drop-checkGenericClassInNonGenericObjectType migrations-php-phpstan-add-prefix-for-anything-that-starts-with-vendor-in-a-list migrations-php-set-phpstan-drop-include-test-utilities-rules migrations-php-set-phpstan-drop-include-async-test-utilities-rules migrations-php-set-rector-create-config-if-not-exists migrations-php-composer-unused-create-config-if-not-exists migrations-php-composer-unused-drop-commented-out-line-scattered-across-my-repos migrations-php-migrate-composer-unused-from-extra-unused-to-etc-qa-composer-used-php migrations-php-move-phpcs migrations-php-move-phpcs-not-dist migrations-php-set-phpcs-ensure-config-file-exists migrations-php-phpcs-make-basepath-is-correct-relatively migrations-php-phpcs-make-cache-is-correct-relatively migrations-php-phpcs-make-sure-config-has-correct-relative-path-for-etc migrations-php-phpcs-make-sure-etc-has-no-trailing-slash migrations-php-phpcs-make-sure-config-has-correct-relative-path-for-src migrations-php-phpcs-make-sure-src-has-no-trailing-slash migrations-php-phpcs-make-sure-config-has-correct-relative-path-for-tests migrations-php-phpcs-make-sure-tests-has-no-trailing-slash migrations-php-phpcs-make-sure-etc-is-ran-through migrations-phpcs-include-examples-directory-when-present migrations-php-move-composer-require-checker migrations-php-composer-require-checker-create-config-if-not-exists migrations-inline-code-phpstan-remove-line-phpstan-ignore-next-line migrations-inline-code-phpstan-remove-rest-of-line-phpstan-ignore-line migrations-inline-code-psalm-remove-line-psalm-suppress migrations-inline-code-remove-line-internal migrations-inline-code-phpunit-replace-expectexceptionmessage-with-expectexceptionmessageisorcontains migrations-supported-features-php-ensure-we-only-cs-check-and-fix-tests-if-unit-tests-is-enabled migrations-supported-features-php-ensure-we-only-staticly-analyse-tests-with-phpstan-if-unit-tests-is-enabled migrations-supported-features-php-ensure-no-phpunit-config-file-is-present-when-unit-tests-are-disabled migrations-supported-features-php-ensure-no-infectionphp-config-file-is-present-when-unit-tests-are-disabled migrations-supported-features-php-ensure-no-rector-config-file-is-present-when-code-style-is-disabled migrations-supported-features-php-ensure-no-phpcs-config-file-is-present-when-code-style-is-disabled migrations-supported-features-php-ensure-no-composer-require-checker-config-file-is-present-when-composer-dependency-checkers-are-disabled migrations-supported-features-php-ensure-no-composer-unused-config-file-is-present-when-composer-dependency-checkers-are-disabled migrations-php-make-sure-github-exists migrations-github-codeowners migrations-php-make-sure-github-workflows-exists migrations-github-actions-remove-composer-diff migrations-github-actions-remove-markdown-check-links migrations-github-actions-remove-markdown-craft-release migrations-github-actions-remove-set-milestone-on-pr migrations-github-actions-move-ci migrations-github-actions-remove-ci-if-its-old-style-php-ci-workflow migrations-github-actions-create-ci-if-not-exists migrations-github-actions-move-release-management migrations-github-actions-fix-management-in-release-management-referenced-workflow-file migrations-github-actions-create-release-management-if-not-exists migrations-renovate-remove-dependabot-config migrations-renovate-move-config migrations-renovate-create-config-if-not-exists migrations-renovate-point-at-correct-config migrations-renovate-set-php-constraint migrations-renovate-set-composer-constraint composer-validate syntax-php composer-normalize rector-upgrade cs-fix ## Count: 106 +else + $(DOCKER_RUN_WITH_SOCKET) $(MAKE) migrations-git-enforce-gitattributes-contents migrations-git-make-sure-gitignore-exists migrations-git-make-sure-gitignore-ignores-var migrations-git-make-sure-gitignore-excludes-var-gitkeep migrations-docs-update-readme-copyright-c-year-to-current migrations-docs-update-readme-copyright-year-to-current migrations-docs-update-etc-readme-template-copyright-c-year-to-current migrations-docs-update-etc-readme-template-copyright-year-to-current migrations-docs-create-license-when-it-doesnt-exists migrations-docs-update-license-copyright-c-year-to-current migrations-docs-update-license-copyright-year-to-current migrations-docs-enforce-contributing-md-contents migrations-php-make-sure-var-exists migrations-php-make-sure-var-gitkeep-exists migrations-php-make-sure-etc-exists migrations-php-make-sure-etc-ci-exists migrations-php-make-sure-etc-qa-exists migrations-php-move-psalm-xml-config-to-etc migrations-php-remove-psalm-xml-config migrations-php-remove-old-phpunit-xml-dist-config migrations-php-remove-old-phpunit-xml-config migrations-php-remove-old-php-cs-fiver-config migrations-php-remove-old-scrutinizer-yml-config migrations-php-remove-old-appveyor-yml-config migrations-php-remove-old-travis-yml-config migrations-php-ensure-etc-ci-markdown-link-checker-json-exists migrations-php-move-infection-config-to-etc migrations-php-infection-create-config-if-not-exists migrations-php-remove-phpunit-config-dir-from-infection migrations-php-fix-logs-relative-paths-for-infection migrations-php-infection-ensure-log-text-has-the-correct-path migrations-php-infection-ensure-log-summary-has-the-correct-path migrations-php-infection-ensure-log-json-has-the-correct-path migrations-php-infection-ensure-log-per-mutator-has-the-correct-path migrations-php-add-github-true-to-for-infection migrations-php-make-paths-compatible-with-infection-0-32 migrations-php-set-phpunit-ensure-config-file-exists migrations-php-set-phpunit-xsd-path-to-local migrations-php-set-phpunit-make-sure-we-see-all-the-warnings-deprecations-etc-etc-that-will-make-phpunit-do-a-non-happy-exit migrations-php-move-phpstan migrations-php-set-phpstan-ensure-config-file-exists migrations-php-set-phpstan-uncomment-parameters migrations-php-set-phpstan-add-parameters-if-it-isnt-present-in-the-config-file migrations-php-set-phpstan-paths-in-config migrations-php-set-phpstan-level-max-in-config migrations-php-set-phpstan-resolve-ergebnis-noExtends-classesAllowedToBeExtended migrations-php-set-phpstan-drop-checkGenericClassInNonGenericObjectType migrations-php-phpstan-add-prefix-for-anything-that-starts-with-vendor-in-a-list migrations-php-set-phpstan-drop-include-test-utilities-rules migrations-php-set-phpstan-drop-include-async-test-utilities-rules migrations-php-set-rector-create-config-if-not-exists migrations-php-composer-unused-create-config-if-not-exists migrations-php-composer-unused-drop-commented-out-line-scattered-across-my-repos migrations-php-migrate-composer-unused-from-extra-unused-to-etc-qa-composer-used-php migrations-php-move-phpcs migrations-php-move-phpcs-not-dist migrations-php-set-phpcs-ensure-config-file-exists migrations-php-phpcs-make-basepath-is-correct-relatively migrations-php-phpcs-make-cache-is-correct-relatively migrations-php-phpcs-make-sure-config-has-correct-relative-path-for-etc migrations-php-phpcs-make-sure-etc-has-no-trailing-slash migrations-php-phpcs-make-sure-config-has-correct-relative-path-for-src migrations-php-phpcs-make-sure-src-has-no-trailing-slash migrations-php-phpcs-make-sure-config-has-correct-relative-path-for-tests migrations-php-phpcs-make-sure-tests-has-no-trailing-slash migrations-php-phpcs-make-sure-etc-is-ran-through migrations-phpcs-include-examples-directory-when-present migrations-php-move-composer-require-checker migrations-php-composer-require-checker-create-config-if-not-exists migrations-inline-code-phpstan-remove-line-phpstan-ignore-next-line migrations-inline-code-phpstan-remove-rest-of-line-phpstan-ignore-line migrations-inline-code-psalm-remove-line-psalm-suppress migrations-inline-code-remove-line-internal migrations-inline-code-phpunit-replace-expectexceptionmessage-with-expectexceptionmessageisorcontains migrations-supported-features-php-ensure-we-only-cs-check-and-fix-tests-if-unit-tests-is-enabled migrations-supported-features-php-ensure-we-only-staticly-analyse-tests-with-phpstan-if-unit-tests-is-enabled migrations-supported-features-php-ensure-no-phpunit-config-file-is-present-when-unit-tests-are-disabled migrations-supported-features-php-ensure-no-infectionphp-config-file-is-present-when-unit-tests-are-disabled migrations-supported-features-php-ensure-no-rector-config-file-is-present-when-code-style-is-disabled migrations-supported-features-php-ensure-no-phpcs-config-file-is-present-when-code-style-is-disabled migrations-supported-features-php-ensure-no-composer-require-checker-config-file-is-present-when-composer-dependency-checkers-are-disabled migrations-supported-features-php-ensure-no-composer-unused-config-file-is-present-when-composer-dependency-checkers-are-disabled migrations-php-make-sure-github-exists migrations-github-codeowners migrations-php-make-sure-github-workflows-exists migrations-github-actions-remove-composer-diff migrations-github-actions-remove-markdown-check-links migrations-github-actions-remove-markdown-craft-release migrations-github-actions-remove-set-milestone-on-pr migrations-github-actions-move-ci migrations-github-actions-remove-ci-if-its-old-style-php-ci-workflow migrations-github-actions-create-ci-if-not-exists migrations-github-actions-move-release-management migrations-github-actions-fix-management-in-release-management-referenced-workflow-file migrations-github-actions-create-release-management-if-not-exists migrations-renovate-remove-dependabot-config migrations-renovate-move-config migrations-renovate-create-config-if-not-exists migrations-renovate-point-at-correct-config migrations-renovate-set-php-constraint migrations-renovate-set-composer-constraint composer-validate syntax-php composer-normalize rector-upgrade cs-fix ## Count: 106 +endif + +composer-validate: ## Ensure we don't require any package we don't use in this package directly ##*IC*## + $(DOCKER_SHELL) composer validate + +syntax-php: ## Lint PHP syntax ##*ILH*## + $(DOCKER_RUN) vendor/bin/parallel-lint --exclude vendor . + +composer-normalize: ## Normalize composer.json ##*I*## + $(DOCKER_RUN) composer normalize + $(MAKE) update-lock + +rector-upgrade: ## Upgrade any automatically upgradable old code ##*I*##^code-style^## + $(DOCKER_RUN) vendor/bin/rector -c ./etc/qa/rector.php + +cs-fix: ## Fix any automatically fixable code style issues ##*EI*##^code-style^## + $(DOCKER_RUN) vendor/bin/phpcbf --parallel=1 --cache=./var/.phpcs.cache.json --standard=./etc/qa/phpcs.xml || $(MAKE) cs + +cs-fix-debug: ## Fix any automatically fixable code style issues, but with debugging output ####^code-style^## + $(DOCKER_RUN) vendor/bin/phpcbf --parallel=1 --cache=./var/.phpcs.cache.json --standard=./etc/qa/phpcs.xml -vvvv + +cs: ## Check the code for code style issues ##*ELCH*##^code-style^## + $(DOCKER_SHELL) vendor/bin/phpcs --parallel=1 --cache=./var/.phpcs.cache.json --standard=./etc/qa/phpcs.xml + +stan: ## Run static analysis (PHPStan) ##*LCH*##^static-analysis^## + $(DOCKER_SHELL) vendor/bin/phpstan analyse --ansi --configuration=./etc/qa/phpstan.neon + +unit-testing: ## Run tests ##*AE*##^unit-tests^## + $(DOCKER_RUN_WITH_SOCKET) vendor/bin/phpunit --colors=always -c ./etc/qa/phpunit.xml $(shell $(DOCKER_SHELL) php -r 'if (function_exists("xdebug_get_code_coverage")) { echo " --coverage-text --coverage-html ./var/tests-unit-coverage-html --coverage-clover ./var/tests-unit-clover-coverage.xml"; }') + +unit-testing-raw: ## Run tests ##*D*##^unit-tests^## + php vendor/phpunit/phpunit/phpunit --colors=always -c ./etc/qa/phpunit.xml $(shell php -r 'if (function_exists("xdebug_get_code_coverage")) { echo " --coverage-text --coverage-html ./var/tests-unit-coverage-html --coverage-clover ./var/tests-unit-clover-coverage.xml"; }') + +unit-testing-filter: ## Run tests with specified filter ####^unit-tests^## + $(DOCKER_RUN_WITH_SOCKET) vendor/bin/phpunit --colors=always --filter=$(wordlist 2,$(words $(MAKECMDGOALS)),$(MAKECMDGOALS)) -c ./etc/qa/phpunit.xml $(shell $(DOCKER_SHELL) php -r 'if (function_exists("xdebug_get_code_coverage")) { echo " --coverage-text --coverage-html ./var/tests-unit-coverage-html --coverage-clover ./var/tests-unit-clover-coverage.xml"; }') + +mutation-testing: ## Run mutation testing ##*LCH*##^static-analysis|unit-tests^## + $(DOCKER_RUN_WITH_SOCKET) vendor/bin/infection --ansi --log-verbosity=all --ignore-msi-with-no-mutations --configuration=./etc/qa/infection.json5 --static-analysis-tool=phpstan --static-analysis-tool-options="--memory-limit=-1" --threads=$(THREADS) + +mutation-testing-raw: ## Run mutation testing ####^static-analysis|unit-tests^## + vendor/bin/infection --ansi --log-verbosity=all --ignore-msi-with-no-mutations --configuration=./etc/qa/infection.json5 --static-analysis-tool=phpstan --static-analysis-tool-options="--memory-limit=-1" --threads=$(THREADS) + +composer-require-checker: ## Ensure we require every package used in this package directly ##*EC*##^composer-dependency-checkers^## + $(DOCKER_SHELL) vendor/bin/composer-require-checker --ignore-parse-errors --ansi -vvv --config-file=./etc/qa/composer-require-checker.json + +composer-unused: ## Ensure we don't require any package we don't use in this package directly ##*EC*##^composer-dependency-checkers^## + $(DOCKER_SHELL) vendor/bin/composer-unused --ansi --configuration=./etc/qa/composer-unused.php + +backward-compatibility-check: ## Check code for backwards incompatible changes ##*C*## + $(MAKE) backward-compatibility-check-raw || true + +backward-compatibility-check-raw: ## Check code for backwards incompatible changes, doesn't ignore the failure ### + $(DOCKER_SHELL) vendor/bin/roave-backward-compatibility-check + +install: ### Install dependencies #### +ifeq ("$(ON_INSTALL_OR_UPDATE_HAS_DIRECT_DOCKER_TASKS)","TRUE") + $(DOCKER_SHELL) composer install --no-scripts + $(MAKE) on-install-or-update +else + $(DOCKER_SHELL) composer install +endif + +composer-require: ### Require passed dependencies #### + $(DOCKER_INTERACTIVE_SHELL) composer require -W $(wordlist 2,$(words $(MAKECMDGOALS)),$(MAKECMDGOALS)) + +composer-why: ### Show why a specific dependency is loaded #### + $(DOCKER_INTERACTIVE_SHELL) composer why $(wordlist 2,$(words $(MAKECMDGOALS)),$(MAKECMDGOALS)) + +composer-outdated: ### Show outdated packages #### + $(DOCKER_SHELL) composer outdated + +update: ### Update dependencies #### +ifeq ("$(ON_INSTALL_OR_UPDATE_HAS_DIRECT_DOCKER_TASKS)","TRUE") + $(DOCKER_SHELL) composer update -W --no-scripts + $(MAKE) on-install-or-update +else + $(DOCKER_SHELL) composer update -W +endif + +update-lock: ### Update lockfile #### + $(DOCKER_RUN_WITHOUT_NETWORK_FOR_COMPOSER) composer update --lock --no-scripts || $(DOCKER_RUN) composer update --lock --no-scripts + +outdated: ### Show outdated dependencies #### + $(DOCKER_SHELL) composer outdated + +composer-show: ### Show dependencies #### + $(DOCKER_SHELL) composer show + +shell: ## Provides Shell access in the expected environment #### + $(DOCKER_INTERACTIVE_SHELL) bash + +run: ## Provides access in the expected environment to run a single command and then return #### + $(DOCKER_RUN) $(wordlist 2,$(words $(MAKECMDGOALS)),$(MAKECMDGOALS)) + +help: ## Show this help #### + @printf "\033[33mUsage:\033[0m\n make [target]\n\n\033[33mTargets:\033[0m\n" + @printf '%b\n' 'all: ## Runs everything\nbackward-compatibility-check: ## Check code for backwards incompatible changes\nbackward-compatibility-check-raw: ## Check code for backwards incompatible changes, doesn'\''t ignore the failure\ncomposer-normalize: ## Normalize composer.json\ncomposer-outdated: ## Show outdated packages\ncomposer-require: ## Require passed dependencies\ncomposer-require-checker: ## Ensure we require every package used in this package directly\ncomposer-show: ## Show dependencies\ncomposer-unused: ## Ensure we don'\''t require any package we don'\''t use in this package directly\ncomposer-validate: ## Ensure we don'\''t require any package we don'\''t use in this package directly\ncomposer-why: ## Show why a specific dependency is loaded\ncontrib: ## Runs a subset of everything (all)\ncs: ## Check the code for code style issues\ncs-fix: ## Fix any automatically fixable code style issues\ncs-fix-debug: ## Fix any automatically fixable code style issues, but with debugging output\nhelp: ## Show this help\nhelp-contrib: ## Show the migrations help\nhelp-migrations: ## Show the migrations help\ninstall: ## Install dependencies\nmutation-testing: ## Run mutation testing\nmutation-testing-raw: ## Run mutation testing\non-install-or-update: ## Tasks, like migrations, that specifically have be run after composer install or update. These will also run by self hosted Renovate\noutdated: ## Show outdated dependencies\nrector-upgrade: ## Upgrade any automatically upgradable old code\nrun: ## Provides access in the expected environment to run a single command and then return\nshell: ## Provides Shell access in the expected environment\nstan: ## Run static analysis (PHPStan)\nsupported-features: ## CI: List the features this package supports\nsyntax-php: ## Lint PHP syntax\ntask-list-ci-all: ## CI: Generate a JSON array of jobs to run on all variations\ntask-list-ci-dos: ## CI: Generate a JSON array of jobs to run Directly on the OS variations\ntask-list-ci-high: ## CI: Generate a JSON array of jobs to run against the highest dependencies on the primary threading target\ntask-list-ci-locked: ## CI: Generate a JSON array of jobs to run against the locked dependencies on the primary threading target\ntask-list-ci-low: ## CI: Generate a JSON array of jobs to run against the lowest dependencies on the primary threading target\nunit-testing: ## Run tests\nunit-testing-filter: ## Run tests with specified filter\nunit-testing-raw: ## Run tests\nupdate: ## Update dependencies\nupdate-lock: ## Update lockfile' | awk 'BEGIN {FS = ":.*?## "}; {printf " \033[32m%-32s\033[0m %s\n", $$1, $$2}' | tr -d '#' + +help-migrations: ## Show the migrations help #### + @printf "\033[33mUsage:\033[0m\n make [target]\n\n\033[33mTargets:\033[0m\n" + @printf '%b\n' 'migrations-docs-create-license-when-it-doesnt-exists: ## Create license when it doesn'\''t exists\nmigrations-docs-enforce-contributing-md-contents: ## Enforce CONTRIBUTING.md contents\nmigrations-docs-update-etc-readme-template-copyright-c-year-to-current: ## Update readme template in etc/ copyright year to current\nmigrations-docs-update-etc-readme-template-copyright-year-to-current: ## Update readme template in etc/ copyright year to current\nmigrations-docs-update-license-copyright-c-year-to-current: ## Update license copyright year to current\nmigrations-docs-update-license-copyright-year-to-current: ## Update license copyright year to current\nmigrations-docs-update-readme-copyright-c-year-to-current: ## Update readme copyright year to current\nmigrations-docs-update-readme-copyright-year-to-current: ## Update readme copyright year to current\nmigrations-git-enforce-gitattributes-contents: ## Enforce `.gitattributes` contents\nmigrations-git-make-sure-gitignore-excludes-var-gitkeep: ## Make sure `.gitignore` excludes `var/.gitkeep`\nmigrations-git-make-sure-gitignore-exists: ## Make sure `.gitignore` exists\nmigrations-git-make-sure-gitignore-ignores-var: ## Make sure `.gitignore` ignores `var/*`\nmigrations-github-actions-create-ci-if-not-exists: ## Create CI Workflow if it doesn'\''t exists at `.github/workflows/ci.yaml`\nmigrations-github-actions-create-release-management-if-not-exists: ## Create Release Management Workflow if it doesn'\''t exists at `.github/workflows/release-management.yaml`\nmigrations-github-actions-fix-management-in-release-management-referenced-workflow-file: ## Fix management in release-management referenced workflow file\nmigrations-github-actions-move-ci: ## Move `.github/workflows/ci.yml` to `.github/workflows/ci.yaml`\nmigrations-github-actions-move-release-management: ## Move `.github/workflows/release-managment.yaml` to `.github/workflows/release-management.yaml`\nmigrations-github-actions-remove-ci-if-its-old-style-php-ci-workflow: ## Remove CI Workflow if its the old style PHP CI Workflow\nmigrations-github-actions-remove-composer-diff: ## Remove `composer-diff.yaml` it has been folded into centralized workflows through `ci.yaml`\nmigrations-github-actions-remove-markdown-check-links: ## Remove `markdown-check-links.yaml` it has been folded into centralized workflows through `ci.yaml`\nmigrations-github-actions-remove-markdown-craft-release: ## Remove `craft-release.yaml` it has been folded into centralized workflows through `release-management.yaml`\nmigrations-github-actions-remove-set-milestone-on-pr: ## Remove `set-milestone-on-pr.yaml` it has been folded into centralized workflows through `release-management.yaml`\nmigrations-github-codeowners: ## Ensure a `CODEOWNERS` file is present, create only if it doesn'\''t exist yet\nmigrations-inline-code-phpstan-remove-line-phpstan-ignore-next-line: ## Remove all lines that contains @phpstan-ignore-next-line\nmigrations-inline-code-phpstan-remove-rest-of-line-phpstan-ignore-line: ## Remove rest of line for all lines that contain @phpstan-ignore-line\nmigrations-inline-code-phpunit-replace-expectexceptionmessage-with-expectexceptionmessageisorcontains: ## Replace self::expectExceptionMessage with self::expectExceptionMessageIsOrContains in all PHPUnit tests\nmigrations-inline-code-psalm-remove-line-psalm-suppress: ## Remove all lines that contain @psalm-suppress\nmigrations-inline-code-remove-line-internal: ## Remove all lines that contain @internal\nmigrations-php-add-github-true-to-for-infection: ## Ensure we configure infection to emit logs to GitHub in `etc/qa/infection.json5`\nmigrations-php-composer-require-checker-create-config-if-not-exists: ## Create Composer Require Checker config file if it doesn'\''t exists at `etc/qa/composer-require-checker.json`\nmigrations-php-composer-unused-create-config-if-not-exists: ## Create Composer Unused config file if it doesn'\''t exists at `etc/qa/composer-unused.php`\nmigrations-php-composer-unused-drop-commented-out-line-scattered-across-my-repos: ## Update Composer Unused config file dropping a commented out line that is scattered cross my repos\nmigrations-php-ensure-etc-ci-markdown-link-checker-json-exists: ## Make sure we have `etc/ci/markdown-link-checker.json`\nmigrations-php-fix-logs-relative-paths-for-infection: ## Fix logs paths in `etc/qa/infection.json5`\nmigrations-php-infection-create-config-if-not-exists: ## Create Infection config file if it doesn'\''t exists at `etc/qa/infection.json5`\nmigrations-php-infection-ensure-log-json-has-the-correct-path: ## Ensure infection'\''s log.json has config directive has the correct path\nmigrations-php-infection-ensure-log-per-mutator-has-the-correct-path: ## Ensure infection'\''s log.perMutator has config directive has the correct path\nmigrations-php-infection-ensure-log-summary-has-the-correct-path: ## Ensure infection'\''s log.summary has config directive has the correct path\nmigrations-php-infection-ensure-log-text-has-the-correct-path: ## Ensure infection'\''s log.text has config directive has the correct path\nmigrations-php-make-paths-compatible-with-infection-0-32: ## We update path to be relative to `etc/qa/infection.json5` as of 0.32\nmigrations-php-make-sure-etc-ci-exists: ## Make sure `etc/ci/` exists\nmigrations-php-make-sure-etc-exists: ## Make sure `etc/` exists\nmigrations-php-make-sure-etc-qa-exists: ## Make sure `etc/qa/` exists\nmigrations-php-make-sure-github-exists: ## Make sure `.github/` exists\nmigrations-php-make-sure-github-workflows-exists: ## Make sure `.github/workflows` exists\nmigrations-php-make-sure-var-exists: ## Make sure `var/` exists\nmigrations-php-make-sure-var-gitkeep-exists: ## Make sure `var/.gitkeep` exists\nmigrations-php-migrate-composer-unused-from-extra-unused-to-etc-qa-composer-used-php: ## Migrate Compose Unused from `composer.json` extra unused to `etc/qa/composer-unused.php`\nmigrations-php-move-composer-require-checker: ## Move composer-require-checker.json to `etc/qa/composer-require-checker.json`\nmigrations-php-move-infection-config-to-etc: ## Move `infection.json.dist` to `etc/qa/infection.json5`\nmigrations-php-move-phpcs: ## Move `phpcs.xml.dist` to `etc/qa/phpcs.xml`\nmigrations-php-move-phpcs-not-dist: ## Move `phpcs.xml` to `etc/qa/phpcs.xml`\nmigrations-php-move-phpstan: ## Move `phpstan.neon` to `etc/qa/phpstan.neon`\nmigrations-php-move-psalm-xml-config-to-etc: ## Move `psalm.xml` to `etc/qa/psalm.xml`\nmigrations-php-phpcs-make-basepath-is-correct-relatively: ## Make sure PHPCS base path is has `../../` and not `.`\nmigrations-php-phpcs-make-cache-is-correct-relatively: ## Make sure PHPCS cache path is has `../../var/.phpcs.cache` and not `.phpcs.cache`\nmigrations-php-phpcs-make-sure-config-has-correct-relative-path-for-etc: ## Make sure PHPCS has `../../` prefixing `etc/` to ensure correct relative path\nmigrations-php-phpcs-make-sure-config-has-correct-relative-path-for-src: ## Make sure PHPCS has `../../` prefixing `src/` to ensure correct relative path\nmigrations-php-phpcs-make-sure-config-has-correct-relative-path-for-tests: ## Make sure PHPCS has `../../` prefixing `tests/` to ensure correct relative path\nmigrations-php-phpcs-make-sure-etc-has-no-trailing-slash: ## Make sure PHPCS has no tailing `/` on `etc`\nmigrations-php-phpcs-make-sure-etc-is-ran-through: ## Make sure PHPCS runs through `etc`\nmigrations-php-phpcs-make-sure-src-has-no-trailing-slash: ## Make sure PHPCS has no tailing `/` on src\nmigrations-php-phpcs-make-sure-tests-has-no-trailing-slash: ## Make sure PHPCS has no tailing `/` on `tests`\nmigrations-php-phpstan-add-prefix-for-anything-that-starts-with-vendor-in-a-list: ## PHPStan add `../../` to anything in a list that starts with `vendor`\nmigrations-php-remove-old-appveyor-yml-config: ## Make sure we remove `appveyor.yml`\nmigrations-php-remove-old-php-cs-fiver-config: ## Make sure we remove `.php_cs`\nmigrations-php-remove-old-phpunit-xml-config: ## Make sure we remove `phpunit.xml`\nmigrations-php-remove-old-phpunit-xml-dist-config: ## Make sure we remove `phpunit.xml.dist`\nmigrations-php-remove-old-scrutinizer-yml-config: ## Make sure we remove `.scrutinizer.yml`\nmigrations-php-remove-old-travis-yml-config: ## Make sure we remove `.travis.yml`\nmigrations-php-remove-phpunit-config-dir-from-infection: ## Drop XXX from `etc/qa/infection.json5`\nmigrations-php-remove-psalm-xml-config: ## Make sure we remove `etc/qa/psalm.xml`\nmigrations-php-set-phpcs-ensure-config-file-exists: ## Make sure we have a PHPCS config file at `etc/qa/phpcs.xml`\nmigrations-php-set-phpstan-add-parameters-if-it-isnt-present-in-the-config-file: ## Add parameters to PHPStan config file at `etc/qa/phpstan.neon` if it'\''s not present\nmigrations-php-set-phpstan-drop-checkGenericClassInNonGenericObjectType: ## Ensure PHPStan config doesn'\''t contain checkGenericClassInNonGenericObjectType as it'\''s no longer a valid config option\nmigrations-php-set-phpstan-drop-include-async-test-utilities-rules: ## Ensure PHPStan config doesn'\''t contain include for `wyrihaximus/async-test-utilities/rules.neon` as it'\''s now an extension\nmigrations-php-set-phpstan-drop-include-test-utilities-rules: ## Ensure PHPStan config doesn'\''t contain include for `wyrihaximus/async-utilities/rules.neon` as it'\''s now an extension\nmigrations-php-set-phpstan-ensure-config-file-exists: ## Make sure we have a PHPStan config file at `etc/qa/phpstan.neon`\nmigrations-php-set-phpstan-level-max-in-config: ## Ensure PHPStan config has level set to max in `etc/qa/phpstan.neon`\nmigrations-php-set-phpstan-paths-in-config: ## Ensure PHPStan config has the `etc`, `src`, and (optionally) `tests` paths set in `etc/qa/phpstan.neon`\nmigrations-php-set-phpstan-resolve-ergebnis-noExtends-classesAllowedToBeExtended: ## Ensure PHPStan config uses ergebnis.noExtends.classesAllowedToBeExtended not ergebnis.classesAllowedToBeExtended\nmigrations-php-set-phpstan-uncomment-parameters: ## Ensure PHPStan config as parameters not commented out in `etc/qa/phpstan.neon`\nmigrations-php-set-phpunit-ensure-config-file-exists: ## Make sure we have a PHPUnit config file at `etc/qa/phpunit.xml`\nmigrations-php-set-phpunit-make-sure-we-see-all-the-warnings-deprecations-etc-etc-that-will-make-phpunit-do-a-non-happy-exit: ## Make sure we see all the warnings, deprecations, etc etc that will make PHPunit do a non-happy exit\nmigrations-php-set-phpunit-xsd-path-to-local: ## Ensure that the PHPUnit XDS referred in `etc/qa/phpunit.xml` points to `vendor/phpunit/phpunit/phpunit.xsd` so we don'\''t go over the network\nmigrations-php-set-rector-create-config-if-not-exists: ## Create Rector config file if it doesn'\''t exists at `etc/qa/rector.php`\nmigrations-phpcs-include-examples-directory-when-present: ## Make sure PHPCS runs through `examples` when it exists\nmigrations-renovate-create-config-if-not-exists: ## Create Renovate Config if it doesn'\''t exists at `.github/renovate.json`\nmigrations-renovate-move-config: ## Move `renovate.json` to `.github/renovate.json`\nmigrations-renovate-point-at-correct-config: ## Ensure `.github/renovate.json` points at github>WyriHaximus/renovate-config:php-package instead of local>WyriHaximus/renovate-config\nmigrations-renovate-remove-dependabot-config: ## Make sure we remove `.github/dependabot.yml`\nmigrations-renovate-set-composer-constraint: ## Always keep renovate'\''s `constraints.composer` at `2.x`\nmigrations-renovate-set-php-constraint: ## Always keep renovate'\''s constraints.php in sync with `composer.json`'\''s `config.platform.php`\nmigrations-supported-features-php-ensure-no-composer-require-checker-config-file-is-present-when-composer-dependency-checkers-are-disabled: ## Ensure we remove the Composer Require Checker config file when composer-dependency-checkers aren'\''t enabled\nmigrations-supported-features-php-ensure-no-composer-unused-config-file-is-present-when-composer-dependency-checkers-are-disabled: ## Ensure we remove the Composer Unused config file when composer-dependency-checkers aren'\''t enabled\nmigrations-supported-features-php-ensure-no-infectionphp-config-file-is-present-when-unit-tests-are-disabled: ## Ensure we remove the InfectionPHP config file when unit-tests aren'\''t enabled\nmigrations-supported-features-php-ensure-no-phpcs-config-file-is-present-when-code-style-is-disabled: ## Ensure we remove the PHPCSS config file when code-style isn'\''t enabled\nmigrations-supported-features-php-ensure-no-phpunit-config-file-is-present-when-unit-tests-are-disabled: ## Ensure we remove the PHPUnit config file when unit-tests aren'\''t enabled\nmigrations-supported-features-php-ensure-no-rector-config-file-is-present-when-code-style-is-disabled: ## Ensure we remove the RectorPHP config file when code-style isn'\''t enabled\nmigrations-supported-features-php-ensure-we-only-cs-check-and-fix-tests-if-unit-tests-is-enabled: ## Ensure we only cs check/fix tests/ if unit-tests is enabled\nmigrations-supported-features-php-ensure-we-only-staticly-analyse-tests-with-phpstan-if-unit-tests-is-enabled: ## Ensure we only staticly analyse tests/ with PHPStan if unit-tests is enabled' | awk 'BEGIN {FS = ":.*?## "}; {printf " \033[32m%-32s\033[0m %s\n", $$1, $$2}' | tr -d '#' + +help-contrib: ## Show the migrations help #### + @printf "\033[33mUsage:\033[0m\n make [target]\n\n\033[33mTargets:\033[0m\n" + @printf '%b\n' 'composer-require-checker: ## Ensure we require every package used in this package directly\ncomposer-unused: ## Ensure we don'\''t require any package we don'\''t use in this package directly\ncs: ## Check the code for code style issues\ncs-fix: ## Fix any automatically fixable code style issues\nunit-testing: ## Run tests' | awk 'BEGIN {FS = ":.*?## "}; {printf " \033[32m%-32s\033[0m %s\n", $$1, $$2}' | tr -d '#' + +task-list-ci: + @echo "[]" + +task-list-ci-all: ## CI: Generate a JSON array of jobs to run on all variations + @echo "[\"composer-validate\",\"syntax-php\",\"cs\",\"stan\",\"unit-testing\",\"mutation-testing\",\"composer-require-checker\",\"composer-unused\",\"backward-compatibility-check\"]" ## Count: 9 + +task-list-ci-dos: ## CI: Generate a JSON array of jobs to run Directly on the OS variations + @echo "[\"unit-testing-raw\"]" ## Count: 1 + +task-list-ci-low: ## CI: Generate a JSON array of jobs to run against the lowest dependencies on the primary threading target + @echo "[\"syntax-php\",\"cs\",\"stan\",\"mutation-testing\"]" ## Count: 4 + +task-list-ci-locked: ## CI: Generate a JSON array of jobs to run against the locked dependencies on the primary threading target + @echo "[\"composer-validate\",\"cs\",\"stan\",\"mutation-testing\",\"composer-require-checker\",\"composer-unused\",\"backward-compatibility-check\"]" ## Count: 7 + +task-list-ci-high: ## CI: Generate a JSON array of jobs to run against the highest dependencies on the primary threading target + @echo "[\"syntax-php\",\"cs\",\"stan\",\"mutation-testing\"]" ## Count: 4 + +supported-features: ## CI: List the features this package supports + @echo "[\"code-style\",\"composer-dependency-checkers\",\"linux\",\"macos\",\"static-analysis\",\"unit-tests\",\"windows\"]" ## Count: 7 + + +## Catch-all for targets that pass through extra arguments (e.g. `make run ls`) +%: + @: + diff --git a/bin/openapi-client-generator.source b/bin/openapi-client-generator.source deleted file mode 100755 index aa99d5e..0000000 --- a/bin/openapi-client-generator.source +++ /dev/null @@ -1,41 +0,0 @@ -#!/usr/bin/php -hydrateObject(Configuration::class, Yaml::parseFile($configurationFile)); - (new Generator( - $configuration, - dirname($configurationFile) . DIRECTORY_SEPARATOR, - ))->generate( - $configuration->namespace->source . '\\', - $configuration->namespace->test . '\\', - dirname($configurationFile) . DIRECTORY_SEPARATOR, - ); - - return 0; - })($configuration); - } catch (Throwable $throwable) { - Error::display($throwable); - } finally { - exit ($exitCode); - } -})($argv[1]); diff --git a/composer.json b/composer.json index ab7d2e5..9fd9f4a 100644 --- a/composer.json +++ b/composer.json @@ -1,83 +1,93 @@ { - "name": "api-clients/openapi-client-generator", - "description": "Generate a client based on an OpenAPI spec", - "license": "MIT", - "authors": [ - { - "name": "Cees-Jan Kiewiet", - "email": "ceesjank@gmail.com" - } - ], - "require": { - "php": "^8.2", - "api-clients/contracts": "^0.1", - "api-clients/github": "^0.2@dev", - "api-clients/openapi-client-utils": "dev-main", - "ckr/arraymerger": "^3.0", - "codeinc/http-reason-phrase-lookup": "^1.0", - "delight-im/random": "^1.0", - "devizzent/cebe-php-openapi": "^1", - "eventsauce/object-hydrator": "^1.2", - "jawira/case-converter": "^3.5", - "kwn/number-to-words": "^2.6", - "league/openapi-psr7-validator": "^0.21", - "league/uri": "^6.8 || ^7.3", - "nikic/php-parser": "^4.15", - "nunomaduro/termwind": "^1.15", - "ondram/ci-detector": "^4.1", - "phpstan/phpdoc-parser": "^1.22", - "pointybeard/reverse-regex": "1.0.0.3", - "psr/http-message": "^1.1 || ^2 || ^3", - "react/async": "^4.0", - "react/http": "^1.8", - "reactivex/rxphp": "^2.0", - "ringcentral/psr7": "^1.3", - "symfony/yaml": "^6.0", - "twig/twig": "^3.5", - "wyrihaximus/async-test-utilities": "^7.0", - "wyrihaximus/composer-update-bin-autoload-path": "^1", - "wyrihaximus/react-awaitable-observable": "^1.0", - "wyrihaximus/simple-twig": "^2.1", - "wyrihaximus/subsplit-tools": "dev-main" - }, - "autoload": { - "psr-4": { - "ApiClients\\Client\\Github\\": "generated/", - "ApiClients\\Tools\\OpenApiClientGenerator\\": "src/" - } + "name": "api-clients/openapi-client-generator", + "description": "Generate a client based on an OpenAPI spec", + "license": "MIT", + "authors": [ + { + "name": "Cees-Jan Kiewiet", + "email": "ceesjank@gmail.com" + } + ], + "require": { + "php": "^8.4", + "api-clients/contracts": "^0.1.0", + "api-clients/github": "^0.2@dev", + "api-clients/openapi-client-utils": "dev-main", + "ckr/arraymerger": "^3.0.0", + "codeinc/http-reason-phrase-lookup": "^1.0.0", + "delight-im/random": "^1.0.0", + "devizzent/cebe-php-openapi": "^1.1.5", + "eventsauce/object-hydrator": "^1.8.", + "jawira/case-converter": "^3.6.0", + "kwn/number-to-words": "^2.12.0", + "league/openapi-psr7-validator": "^0.21.0", + "league/uri": "^6.8 || ^7.3", + "nikic/php-parser": "^5.8.0", + "nunomaduro/termwind": "^2.4.0", + "ondram/ci-detector": "^4.2.0", + "openapi-tools/configuration": "^0.1.0", + "openapi-tools/contract": "^0.1.0", + "openapi-tools/gatherer": "^0.1.0", + "openapi-tools/generator": "^0.1.0", + "openapi-tools/generator-hydrator": "^0.1.0", + "openapi-tools/generator-psr-15-webhook-middleware": "dev-do-not-use-example-values-for-header-based-resolving", + "openapi-tools/generator-schema": "^0.1.0", + "openapi-tools/generator-templates": "^0.1.0", + "openapi-tools/registry": "^0.1.0", + "openapi-tools/representation": "^0.1.0", + "openapi-tools/utils": "^0.1.0", + "phpstan/phpdoc-parser": "^2.3.3", + "psr/http-message": "^1.1 || ^2 || ^3", + "react/async": "^4.3.00", + "react/http": "^1.11.0", + "reactivex/rxphp": "^2.0", + "ringcentral/psr7": "^1.3", + "symfony/yaml": "^7.4.15", + "twig/twig": "^3.28.0", + "wyrihaximus/react-awaitable-observable": "^1.2.1", + "wyrihaximus/simple-twig": "^2.4.0" + }, + "require-dev": { + "wyrihaximus/async-test-utilities": "^13.5.1", + "wyrihaximus/makefiles": "^0.13.3" + }, + "minimum-stability": "dev", + "prefer-stable": true, + "autoload": { + "psr-4": { + "ApiClients\\Client\\Github\\": "generated/", + "ApiClients\\Tools\\OpenApiClientGenerator\\": "src/" + } + }, + "autoload-dev": { + "psr-4": { + "ApiClients\\Tests\\Tools\\OpenApiClientGenerator\\": "tests/unit/" + } + }, + "config": { + "allow-plugins": { + "composer/package-versions-deprecated": true, + "dealerdirect/phpcodesniffer-composer-installer": true, + "drupol/composer-packages": true, + "ergebnis/composer-normalize": true, + "icanhazstring/composer-unused": true, + "infection/extension-installer": true, + "mindplay/composer-locator": true, + "phpstan/extension-installer": true, + "wyrihaximus/makefiles": true, + "wyrihaximus/test-utilities": true }, - "autoload-dev": { - "psr-4": { - "ApiClients\\Tests\\Tools\\OpenApiClientGenerator\\": "tests/unit/" - } + "platform": { + "php": "8.4.13" }, - "bin": [ - "bin/openapi-client-generator" + "sort-packages": true + }, + "scripts": { + "post-install-cmd": [ + "make on-install-or-update || true" ], - "config": { - "allow-plugins": { - "dealerdirect/phpcodesniffer-composer-installer": true, - "ergebnis/composer-normalize": true, - "infection/extension-installer": true, - "wyrihaximus/composer-update-bin-autoload-path": true - }, - "platform": { - "php": "8.2.13" - } - }, - "extra": { - "wyrihaximus": { - "bin-autoload-path-update": [ - "bin/openapi-client-generator" - ] - } - }, - "scripts": { - "post-install-cmd": [ - "composer normalize" - ], - "post-update-cmd": [ - "composer normalize" - ] - } + "post-update-cmd": [ + "make on-install-or-update || true" + ] + } } diff --git a/composer.lock b/composer.lock index efc2bfc..4719c5a 100644 --- a/composer.lock +++ b/composer.lock @@ -4,174 +4,8 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "This file is @generated automatically" ], - "content-hash": "bd4ead13b5a208ede4245f561957c443", + "content-hash": "715a4230ef3088a691f1ad377c821de5", "packages": [ - { - "name": "amphp/amp", - "version": "v2.6.2", - "source": { - "type": "git", - "url": "https://github.com/amphp/amp.git", - "reference": "9d5100cebffa729aaffecd3ad25dc5aeea4f13bb" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/amphp/amp/zipball/9d5100cebffa729aaffecd3ad25dc5aeea4f13bb", - "reference": "9d5100cebffa729aaffecd3ad25dc5aeea4f13bb", - "shasum": "" - }, - "require": { - "php": ">=7.1" - }, - "require-dev": { - "amphp/php-cs-fixer-config": "dev-master", - "amphp/phpunit-util": "^1", - "ext-json": "*", - "jetbrains/phpstorm-stubs": "^2019.3", - "phpunit/phpunit": "^7 | ^8 | ^9", - "psalm/phar": "^3.11@dev", - "react/promise": "^2" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "2.x-dev" - } - }, - "autoload": { - "files": [ - "lib/functions.php", - "lib/Internal/functions.php" - ], - "psr-4": { - "Amp\\": "lib" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Daniel Lowrey", - "email": "rdlowrey@php.net" - }, - { - "name": "Aaron Piotrowski", - "email": "aaron@trowski.com" - }, - { - "name": "Bob Weinand", - "email": "bobwei9@hotmail.com" - }, - { - "name": "Niklas Keller", - "email": "me@kelunik.com" - } - ], - "description": "A non-blocking concurrency framework for PHP applications.", - "homepage": "https://amphp.org/amp", - "keywords": [ - "async", - "asynchronous", - "awaitable", - "concurrency", - "event", - "event-loop", - "future", - "non-blocking", - "promise" - ], - "support": { - "irc": "irc://irc.freenode.org/amphp", - "issues": "https://github.com/amphp/amp/issues", - "source": "https://github.com/amphp/amp/tree/v2.6.2" - }, - "funding": [ - { - "url": "https://github.com/amphp", - "type": "github" - } - ], - "time": "2022-02-20T17:52:18+00:00" - }, - { - "name": "amphp/byte-stream", - "version": "v1.8.1", - "source": { - "type": "git", - "url": "https://github.com/amphp/byte-stream.git", - "reference": "acbd8002b3536485c997c4e019206b3f10ca15bd" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/amphp/byte-stream/zipball/acbd8002b3536485c997c4e019206b3f10ca15bd", - "reference": "acbd8002b3536485c997c4e019206b3f10ca15bd", - "shasum": "" - }, - "require": { - "amphp/amp": "^2", - "php": ">=7.1" - }, - "require-dev": { - "amphp/php-cs-fixer-config": "dev-master", - "amphp/phpunit-util": "^1.4", - "friendsofphp/php-cs-fixer": "^2.3", - "jetbrains/phpstorm-stubs": "^2019.3", - "phpunit/phpunit": "^6 || ^7 || ^8", - "psalm/phar": "^3.11.4" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.x-dev" - } - }, - "autoload": { - "files": [ - "lib/functions.php" - ], - "psr-4": { - "Amp\\ByteStream\\": "lib" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Aaron Piotrowski", - "email": "aaron@trowski.com" - }, - { - "name": "Niklas Keller", - "email": "me@kelunik.com" - } - ], - "description": "A stream abstraction to make working with non-blocking I/O simple.", - "homepage": "http://amphp.org/byte-stream", - "keywords": [ - "amp", - "amphp", - "async", - "io", - "non-blocking", - "stream" - ], - "support": { - "irc": "irc://irc.freenode.org/amphp", - "issues": "https://github.com/amphp/byte-stream/issues", - "source": "https://github.com/amphp/byte-stream/tree/v1.8.1" - }, - "funding": [ - { - "url": "https://github.com/amphp", - "type": "github" - } - ], - "time": "2021-03-30T17:13:30+00:00" - }, { "name": "api-clients/contracts", "version": "0.1.0", @@ -218,12 +52,12 @@ "source": { "type": "git", "url": "https://github.com/php-api-clients/github.git", - "reference": "13c7dcad79a4d19f8caa9b68fb375f6722a3d76f" + "reference": "f09782df8364bd688d3f1affd617b5829ea8b109" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/php-api-clients/github/zipball/13c7dcad79a4d19f8caa9b68fb375f6722a3d76f", - "reference": "13c7dcad79a4d19f8caa9b68fb375f6722a3d76f", + "url": "https://api.github.com/repos/php-api-clients/github/zipball/f09782df8364bd688d3f1affd617b5829ea8b109", + "reference": "f09782df8364bd688d3f1affd617b5829ea8b109", "shasum": "" }, "require": { @@ -231,7 +65,7 @@ "api-clients/openapi-client-utils": "dev-main", "devizzent/cebe-php-openapi": "^1.0.1", "eventsauce/object-hydrator": "^1.4.0", - "league/openapi-psr7-validator": "^0.21", + "league/openapi-psr7-validator": "^0.22 || ^0.21", "php": "^8.2", "react/async": "^4.1.0", "react/event-loop": "^1.4.0", @@ -262,7 +96,7 @@ "issues": "https://github.com/php-api-clients/github/issues", "source": "https://github.com/php-api-clients/github/tree/v0.2.x" }, - "time": "2023-10-17T01:22:52+00:00" + "time": "2025-03-27T19:52:19+00:00" }, { "name": "api-clients/openapi-client-utils", @@ -270,12 +104,12 @@ "source": { "type": "git", "url": "https://github.com/php-api-clients/openapi-client-utils.git", - "reference": "e1c0db6cd3e2e94958cf9e99e8395a61d2354be5" + "reference": "55c26aa512ce272a350666a5d2aceac9356dcbb2" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/php-api-clients/openapi-client-utils/zipball/e1c0db6cd3e2e94958cf9e99e8395a61d2354be5", - "reference": "e1c0db6cd3e2e94958cf9e99e8395a61d2354be5", + "url": "https://api.github.com/repos/php-api-clients/openapi-client-utils/zipball/55c26aa512ce272a350666a5d2aceac9356dcbb2", + "reference": "55c26aa512ce272a350666a5d2aceac9356dcbb2", "shasum": "" }, "require": { @@ -283,7 +117,7 @@ "php": "^8.2" }, "require-dev": { - "wyrihaximus/async-test-utilities": "^7.1" + "wyrihaximus/async-test-utilities": "^8" }, "default-branch": true, "type": "library", @@ -313,148 +147,7 @@ "type": "github" } ], - "time": "2023-09-27T07:38:48+00:00" - }, - { - "name": "azjezz/psl", - "version": "2.7.0", - "source": { - "type": "git", - "url": "https://github.com/azjezz/psl.git", - "reference": "cd599829541caf1bc87fa0b2a3367e050ff1f837" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/azjezz/psl/zipball/cd599829541caf1bc87fa0b2a3367e050ff1f837", - "reference": "cd599829541caf1bc87fa0b2a3367e050ff1f837", - "shasum": "" - }, - "require": { - "ext-bcmath": "*", - "ext-intl": "*", - "ext-json": "*", - "ext-mbstring": "*", - "ext-sodium": "*", - "php": "~8.1.0 || ~8.2.0", - "revolt/event-loop": "^1.0.1" - }, - "require-dev": { - "friendsofphp/php-cs-fixer": "^3.22.0", - "php-coveralls/php-coveralls": "^2.6.0", - "php-standard-library/psalm-plugin": "^2.2.1", - "phpbench/phpbench": "^1.2.14", - "phpunit/phpunit": "^9.6.10", - "roave/infection-static-analysis-plugin": "^1.32.0", - "squizlabs/php_codesniffer": "^3.7.2", - "vimeo/psalm": "^5.13.1" - }, - "suggest": { - "php-standard-library/psalm-plugin": "Psalm integration" - }, - "type": "library", - "extra": { - "thanks": { - "name": "hhvm/hsl", - "url": "https://github.com/hhvm/hsl" - } - }, - "autoload": { - "files": [ - "src/bootstrap.php" - ], - "psr-4": { - "Psl\\": "src/Psl" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "azjezz", - "email": "azjezz@protonmail.com" - } - ], - "description": "PHP Standard Library", - "support": { - "issues": "https://github.com/azjezz/psl/issues", - "source": "https://github.com/azjezz/psl/tree/2.7.0" - }, - "funding": [ - { - "url": "https://opencollective.com/php-standard-library", - "type": "open_collective" - } - ], - "time": "2023-07-19T20:13:26+00:00" - }, - { - "name": "beberlei/assert", - "version": "v3.3.2", - "source": { - "type": "git", - "url": "https://github.com/beberlei/assert.git", - "reference": "cb70015c04be1baee6f5f5c953703347c0ac1655" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/beberlei/assert/zipball/cb70015c04be1baee6f5f5c953703347c0ac1655", - "reference": "cb70015c04be1baee6f5f5c953703347c0ac1655", - "shasum": "" - }, - "require": { - "ext-ctype": "*", - "ext-json": "*", - "ext-mbstring": "*", - "ext-simplexml": "*", - "php": "^7.0 || ^8.0" - }, - "require-dev": { - "friendsofphp/php-cs-fixer": "*", - "phpstan/phpstan": "*", - "phpunit/phpunit": ">=6.0.0", - "yoast/phpunit-polyfills": "^0.1.0" - }, - "suggest": { - "ext-intl": "Needed to allow Assertion::count(), Assertion::isCountable(), Assertion::minCount(), and Assertion::maxCount() to operate on ResourceBundles" - }, - "type": "library", - "autoload": { - "files": [ - "lib/Assert/functions.php" - ], - "psr-4": { - "Assert\\": "lib/Assert" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-2-Clause" - ], - "authors": [ - { - "name": "Benjamin Eberlei", - "email": "kontakt@beberlei.de", - "role": "Lead Developer" - }, - { - "name": "Richard Quadling", - "email": "rquadling@gmail.com", - "role": "Collaborator" - } - ], - "description": "Thin assertion library for input validation in business models.", - "keywords": [ - "assert", - "assertion", - "validation" - ], - "support": { - "issues": "https://github.com/beberlei/assert/issues", - "source": "https://github.com/beberlei/assert/tree/v3.3.2" - }, - "time": "2021-12-16T21:41:27+00:00" + "time": "2024-04-02T09:54:21+00:00" }, { "name": "ckr/arraymerger", @@ -546,50 +239,157 @@ "time": "2018-06-12T11:08:54+00:00" }, { - "name": "colinodell/json5", - "version": "v2.3.0", + "name": "delight-im/alphabets", + "version": "v1.0.0", "source": { "type": "git", - "url": "https://github.com/colinodell/json5.git", - "reference": "15b063f8cb5e6deb15f0cd39123264ec0d19c710" + "url": "https://github.com/delight-im/PHP-Alphabets.git", + "reference": "54bbe2672875264e583414446b102a1f84bd5b9e" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/colinodell/json5/zipball/15b063f8cb5e6deb15f0cd39123264ec0d19c710", - "reference": "15b063f8cb5e6deb15f0cd39123264ec0d19c710", + "url": "https://api.github.com/repos/delight-im/PHP-Alphabets/zipball/54bbe2672875264e583414446b102a1f84bd5b9e", + "reference": "54bbe2672875264e583414446b102a1f84bd5b9e", "shasum": "" }, "require": { - "ext-json": "*", - "ext-mbstring": "*", - "php": "^7.1.3|^8.0" - }, - "conflict": { - "scrutinizer/ocular": "1.7.*" - }, - "require-dev": { - "mikehaertl/php-shellcommand": "^1.2.5", - "phpstan/phpstan": "^1.4", - "scrutinizer/ocular": "^1.6", - "squizlabs/php_codesniffer": "^2.3 || ^3.0", - "symfony/finder": "^4.4|^5.4|^6.0", - "symfony/phpunit-bridge": "^5.4|^6.0" + "php": ">=5.6.0" }, - "bin": [ - "bin/json5" - ], "type": "library", - "extra": { - "branch-alias": { - "dev-main": "3.0-dev" - } - }, "autoload": { - "files": [ - "src/global.php" - ], "psr-4": { - "ColinODell\\Json5\\": "src" + "Delight\\Alphabets\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "description": "Sets of digits or characters that may be used for base conversions, encoding and decoding tasks, and input validation", + "homepage": "https://github.com/delight-im/PHP-Alphabets", + "keywords": [ + "alpha", + "alphabet", + "alphabets", + "alphanumeric", + "ascii", + "base32", + "base58", + "base64", + "base64url", + "base85", + "binary", + "decimal", + "decode", + "decoding", + "encode", + "encoding", + "hex", + "hexadecimal", + "octal" + ], + "support": { + "issues": "https://github.com/delight-im/PHP-Alphabets/issues", + "source": "https://github.com/delight-im/PHP-Alphabets/tree/v1.0.0" + }, + "time": "2019-11-17T23:48:59+00:00" + }, + { + "name": "delight-im/random", + "version": "v1.0.0", + "source": { + "type": "git", + "url": "https://github.com/delight-im/PHP-Random.git", + "reference": "133aed6cc760065c8dbfc4ae0e8bdacfbb6ce273" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/delight-im/PHP-Random/zipball/133aed6cc760065c8dbfc4ae0e8bdacfbb6ce273", + "reference": "133aed6cc760065c8dbfc4ae0e8bdacfbb6ce273", + "shasum": "" + }, + "require": { + "delight-im/alphabets": "^1.0", + "php": ">=7.0.0" + }, + "type": "library", + "autoload": { + "psr-4": { + "Delight\\Random\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "description": "The most convenient way to securely generate anything random in PHP", + "homepage": "https://github.com/delight-im/PHP-Random", + "keywords": [ + "PRNG", + "cryptography", + "csprng", + "generator", + "integers", + "numbers", + "pseudo-random", + "pseudorandom", + "random", + "random-numbers", + "random-strings", + "strings" + ], + "support": { + "issues": "https://github.com/delight-im/PHP-Random/issues", + "source": "https://github.com/delight-im/PHP-Random/tree/v1.0.0" + }, + "time": "2019-11-19T23:07:00+00:00" + }, + { + "name": "devizzent/cebe-php-openapi", + "version": "1.1.5", + "source": { + "type": "git", + "url": "https://github.com/DEVizzent/cebe-php-openapi.git", + "reference": "6e5fcc8810bfe8ad55d1b40764bff6417f485984" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/DEVizzent/cebe-php-openapi/zipball/6e5fcc8810bfe8ad55d1b40764bff6417f485984", + "reference": "6e5fcc8810bfe8ad55d1b40764bff6417f485984", + "shasum": "" + }, + "require": { + "ext-json": "*", + "justinrainbow/json-schema": "^5.2 || ^6.0", + "php": ">=7.1.0", + "symfony/yaml": "^3.4 || ^4 || ^5 || ^6 || ^7 || ^8" + }, + "conflict": { + "symfony/yaml": "3.4.0 - 3.4.4 || 4.0.0 - 4.4.17 || 5.0.0 - 5.1.9 || 5.2.0" + }, + "replace": { + "cebe/php-openapi": "1.7.0" + }, + "require-dev": { + "apis-guru/openapi-directory": "1.0.0", + "cebe/indent": "*", + "mermade/openapi3-examples": "1.0.0", + "oai/openapi-specification-3.0": "3.0.3", + "phpstan/phpstan": "^0.12.0", + "phpunit/phpunit": "^6.5 || ^7.5 || ^8.5 || ^9.4 || ^11.4" + }, + "bin": [ + "bin/php-openapi" + ], + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.6.x-dev" + } + }, + "autoload": { + "psr-4": { + "cebe\\openapi\\": "src/" } }, "notification-url": "https://packagist.org/downloads/", @@ -598,65 +398,557 @@ ], "authors": [ { - "name": "Colin O'Dell", - "email": "colinodell@gmail.com", - "homepage": "https://www.colinodell.com", - "role": "Developer" + "name": "Carsten Brandt", + "email": "mail@cebe.cc", + "homepage": "https://cebe.cc/", + "role": "Creator" + }, + { + "name": "Vicent Valls", + "email": "vizzent@gmail.com" } ], - "description": "UTF-8 compatible JSON5 parser for PHP", - "homepage": "https://github.com/colinodell/json5", + "description": "Read and write OpenAPI yaml/json files and make the content accessable in PHP objects.", + "homepage": "https://github.com/DEVizzent/cebe-php-openapi#readme", "keywords": [ - "JSON5", - "json", - "json5_decode", - "json_decode" + "openapi" ], "support": { - "issues": "https://github.com/colinodell/json5/issues", - "source": "https://github.com/colinodell/json5/tree/v2.3.0" + "issues": "https://github.com/DEVizzent/cebe-php-openapi/issues", + "source": "https://github.com/DEVizzent/cebe-php-openapi" }, - "funding": [ + "time": "2026-01-23T22:38:14+00:00" + }, + { + "name": "doctrine/collections", + "version": "1.8.0", + "source": { + "type": "git", + "url": "https://github.com/doctrine/collections.git", + "reference": "2b44dd4cbca8b5744327de78bafef5945c7e7b5e" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/doctrine/collections/zipball/2b44dd4cbca8b5744327de78bafef5945c7e7b5e", + "reference": "2b44dd4cbca8b5744327de78bafef5945c7e7b5e", + "shasum": "" + }, + "require": { + "doctrine/deprecations": "^0.5.3 || ^1", + "php": "^7.1.3 || ^8.0" + }, + "require-dev": { + "doctrine/coding-standard": "^9.0 || ^10.0", + "phpstan/phpstan": "^1.4.8", + "phpunit/phpunit": "^7.5 || ^8.5 || ^9.1.5", + "vimeo/psalm": "^4.22" + }, + "type": "library", + "autoload": { + "psr-4": { + "Doctrine\\Common\\Collections\\": "lib/Doctrine/Common/Collections" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ { - "url": "https://www.colinodell.com/sponsor", - "type": "custom" + "name": "Guilherme Blanco", + "email": "guilhermeblanco@gmail.com" }, { - "url": "https://www.paypal.me/colinpodell/10.00", - "type": "custom" + "name": "Roman Borschel", + "email": "roman@code-factory.org" }, { - "url": "https://github.com/colinodell", - "type": "github" + "name": "Benjamin Eberlei", + "email": "kontakt@beberlei.de" }, { - "url": "https://www.patreon.com/colinodell", - "type": "patreon" + "name": "Jonathan Wage", + "email": "jonwage@gmail.com" + }, + { + "name": "Johannes Schmitt", + "email": "schmittjoh@gmail.com" } ], - "time": "2022-12-27T16:44:40+00:00" + "description": "PHP Doctrine Collections library that adds additional functionality on top of PHP arrays.", + "homepage": "https://www.doctrine-project.org/projects/collections.html", + "keywords": [ + "array", + "collections", + "iterators", + "php" + ], + "support": { + "issues": "https://github.com/doctrine/collections/issues", + "source": "https://github.com/doctrine/collections/tree/1.8.0" + }, + "time": "2022-09-01T20:12:10+00:00" }, { - "name": "composer-unused/contracts", - "version": "0.3.0", + "name": "doctrine/deprecations", + "version": "1.1.6", "source": { "type": "git", - "url": "https://github.com/composer-unused/contracts.git", - "reference": "5ec448d3ee80735dccad6a21a3266c377d0845ae" + "url": "https://github.com/doctrine/deprecations.git", + "reference": "d4fe3e6fd9bb9e72557a19674f44d8ac7db4c6ca" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/composer-unused/contracts/zipball/5ec448d3ee80735dccad6a21a3266c377d0845ae", - "reference": "5ec448d3ee80735dccad6a21a3266c377d0845ae", + "url": "https://api.github.com/repos/doctrine/deprecations/zipball/d4fe3e6fd9bb9e72557a19674f44d8ac7db4c6ca", + "reference": "d4fe3e6fd9bb9e72557a19674f44d8ac7db4c6ca", "shasum": "" }, "require": { - "php": "^7.4 || ^8.0" + "php": "^7.1 || ^8.0" + }, + "conflict": { + "phpunit/phpunit": "<=7.5 || >=14" + }, + "require-dev": { + "doctrine/coding-standard": "^9 || ^12 || ^14", + "phpstan/phpstan": "1.4.10 || 2.1.30", + "phpstan/phpstan-phpunit": "^1.0 || ^2", + "phpunit/phpunit": "^7.5 || ^8.5 || ^9.6 || ^10.5 || ^11.5 || ^12.4 || ^13.0", + "psr/log": "^1 || ^2 || ^3" + }, + "suggest": { + "psr/log": "Allows logging deprecations via PSR-3 logger implementation" + }, + "type": "library", + "autoload": { + "psr-4": { + "Doctrine\\Deprecations\\": "src" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "description": "A small layer on top of trigger_error(E_USER_DEPRECATED) or PSR-3 logging with options to disable all deprecations or selectively for packages.", + "homepage": "https://www.doctrine-project.org/", + "support": { + "issues": "https://github.com/doctrine/deprecations/issues", + "source": "https://github.com/doctrine/deprecations/tree/1.1.6" + }, + "time": "2026-02-07T07:09:04+00:00" + }, + { + "name": "doctrine/lexer", + "version": "2.1.1", + "source": { + "type": "git", + "url": "https://github.com/doctrine/lexer.git", + "reference": "861c870e8b75f7c8f69c146c7f89cc1c0f1b49b6" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/doctrine/lexer/zipball/861c870e8b75f7c8f69c146c7f89cc1c0f1b49b6", + "reference": "861c870e8b75f7c8f69c146c7f89cc1c0f1b49b6", + "shasum": "" + }, + "require": { + "doctrine/deprecations": "^1.0", + "php": "^7.1 || ^8.0" + }, + "require-dev": { + "doctrine/coding-standard": "^9 || ^12", + "phpstan/phpstan": "^1.3", + "phpunit/phpunit": "^7.5 || ^8.5 || ^9.6", + "psalm/plugin-phpunit": "^0.18.3", + "vimeo/psalm": "^4.11 || ^5.21" + }, + "type": "library", + "autoload": { + "psr-4": { + "Doctrine\\Common\\Lexer\\": "src" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Guilherme Blanco", + "email": "guilhermeblanco@gmail.com" + }, + { + "name": "Roman Borschel", + "email": "roman@code-factory.org" + }, + { + "name": "Johannes Schmitt", + "email": "schmittjoh@gmail.com" + } + ], + "description": "PHP Doctrine Lexer parser library that can be used in Top-Down, Recursive Descent Parsers.", + "homepage": "https://www.doctrine-project.org/projects/lexer.html", + "keywords": [ + "annotations", + "docblock", + "lexer", + "parser", + "php" + ], + "support": { + "issues": "https://github.com/doctrine/lexer/issues", + "source": "https://github.com/doctrine/lexer/tree/2.1.1" + }, + "funding": [ + { + "url": "https://www.doctrine-project.org/sponsorship.html", + "type": "custom" + }, + { + "url": "https://www.patreon.com/phpdoctrine", + "type": "patreon" + }, + { + "url": "https://tidelift.com/funding/github/packagist/doctrine%2Flexer", + "type": "tidelift" + } + ], + "time": "2024-02-05T11:35:39+00:00" + }, + { + "name": "evenement/evenement", + "version": "v3.0.2", + "source": { + "type": "git", + "url": "https://github.com/igorw/evenement.git", + "reference": "0a16b0d71ab13284339abb99d9d2bd813640efbc" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/igorw/evenement/zipball/0a16b0d71ab13284339abb99d9d2bd813640efbc", + "reference": "0a16b0d71ab13284339abb99d9d2bd813640efbc", + "shasum": "" + }, + "require": { + "php": ">=7.0" + }, + "require-dev": { + "phpunit/phpunit": "^9 || ^6" + }, + "type": "library", + "autoload": { + "psr-4": { + "Evenement\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Igor Wiedler", + "email": "igor@wiedler.ch" + } + ], + "description": "Événement is a very simple event dispatching library for PHP", + "keywords": [ + "event-dispatcher", + "event-emitter" + ], + "support": { + "issues": "https://github.com/igorw/evenement/issues", + "source": "https://github.com/igorw/evenement/tree/v3.0.2" + }, + "time": "2023-08-08T05:53:35+00:00" + }, + { + "name": "eventsauce/object-hydrator", + "version": "1.8.0", + "source": { + "type": "git", + "url": "https://github.com/EventSaucePHP/ObjectHydrator.git", + "reference": "29f66149d2b0c57f356ad4fa6dd5f88821d04d9f" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/EventSaucePHP/ObjectHydrator/zipball/29f66149d2b0c57f356ad4fa6dd5f88821d04d9f", + "reference": "29f66149d2b0c57f356ad4fa6dd5f88821d04d9f", + "shasum": "" + }, + "require": { + "ext-fileinfo": "*", + "php": "^8.0" + }, + "require-dev": { + "friendsofphp/php-cs-fixer": "^3.4", + "league/construct-finder": "^1.6", + "phpbench/phpbench": "^1.2", + "phpstan/phpstan": "^1.7", + "phpunit/phpunit": "^9.5.11", + "ramsey/uuid": "^4.2" + }, + "suggest": { + "league/construct-finder": "Find all classes in a directory for the best dumped hydrators." + }, + "type": "library", + "autoload": { + "psr-4": { + "EventSauce\\ObjectHydrator\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Frank de Jonge", + "email": "info@frankdejonge.nl" + } + ], + "description": "Converts structured data into strict objects.", + "keywords": [ + "construction", + "constructor", + "hydration", + "mapper" + ], + "support": { + "issues": "https://github.com/EventSaucePHP/ObjectHydrator/issues", + "source": "https://github.com/EventSaucePHP/ObjectHydrator/tree/1.8.0" + }, + "funding": [ + { + "url": "https://github.com/frankdejonge", + "type": "github" + } + ], + "time": "2026-02-13T21:06:58+00:00" + }, + { + "name": "fig/http-message-util", + "version": "1.1.5", + "source": { + "type": "git", + "url": "https://github.com/php-fig/http-message-util.git", + "reference": "9d94dc0154230ac39e5bf89398b324a86f63f765" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/php-fig/http-message-util/zipball/9d94dc0154230ac39e5bf89398b324a86f63f765", + "reference": "9d94dc0154230ac39e5bf89398b324a86f63f765", + "shasum": "" + }, + "require": { + "php": "^5.3 || ^7.0 || ^8.0" + }, + "suggest": { + "psr/http-message": "The package containing the PSR-7 interfaces" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.1.x-dev" + } + }, + "autoload": { + "psr-4": { + "Fig\\Http\\Message\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "PHP-FIG", + "homepage": "https://www.php-fig.org/" + } + ], + "description": "Utility classes and constants for use with PSR-7 (psr/http-message)", + "keywords": [ + "http", + "http-message", + "psr", + "psr-7", + "request", + "response" + ], + "support": { + "issues": "https://github.com/php-fig/http-message-util/issues", + "source": "https://github.com/php-fig/http-message-util/tree/1.1.5" + }, + "time": "2020-11-24T22:02:12+00:00" + }, + { + "name": "ilario-pierbattista/reverse-regex", + "version": "0.6.0", + "source": { + "type": "git", + "url": "https://github.com/ilario-pierbattista/ReverseRegex.git", + "reference": "09b92b2873bd4f4bdedce8ec341d4efd156b6478" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/ilario-pierbattista/ReverseRegex/zipball/09b92b2873bd4f4bdedce8ec341d4efd156b6478", + "reference": "09b92b2873bd4f4bdedce8ec341d4efd156b6478", + "shasum": "" + }, + "require": { + "doctrine/collections": "^1.6.5", + "doctrine/lexer": "^1.2.1 || ^2", + "php": "^8.1", + "symfony/polyfill-mbstring": "^1.20.0" + }, + "conflict": { + "icomefromthenet/reverse-regex": "*" + }, + "require-dev": { + "facile-it/facile-coding-standard": "1.3.1", + "friendsofphp/php-cs-fixer": "3.88.2", + "phpstan/phpstan": "^2.0", + "phpunit/phpunit": "^9" + }, + "type": "library", + "autoload": { + "psr-0": { + "PHPStats": "src/", + "ReverseRegex": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Lewis Dyer", + "email": "getintouch@icomefromthenet.com", + "homepage": "http://www.icomefromthenet.com" + } + ], + "description": "Convert Regular Expressions into text, for testing. Fork of icomefromthenet/reverse-regex", + "homepage": "https://github.com/ilario-pierbattista/ReverseRegex", + "keywords": [ + "generator", + "regex", + "test data", + "testing" + ], + "support": { + "issues": "https://github.com/ilario-pierbattista/ReverseRegex/issues", + "source": "https://github.com/ilario-pierbattista/ReverseRegex/tree/0.6.0" + }, + "time": "2026-03-31T04:46:46+00:00" + }, + { + "name": "jawira/case-converter", + "version": "v3.6.0", + "source": { + "type": "git", + "url": "https://github.com/jawira/case-converter.git", + "reference": "de9956122568743a83e0fc7e2eaa92c1b0de3f18" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/jawira/case-converter/zipball/de9956122568743a83e0fc7e2eaa92c1b0de3f18", + "reference": "de9956122568743a83e0fc7e2eaa92c1b0de3f18", + "shasum": "" + }, + "require": { + "ext-mbstring": "*", + "php": ">=7.4" + }, + "require-dev": { + "behat/behat": "^3.0", + "phpstan/phpstan": "^v2", + "phpunit/phpunit": "^9.0" + }, + "suggest": { + "pds/skeleton": "PHP Package Development Standards", + "phing/phing": "PHP Build Tool" + }, + "type": "library", + "autoload": { + "psr-4": { + "Jawira\\CaseConverter\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Jawira Portugal", + "email": "dev@tugal.be" + } + ], + "description": "Convert strings between 13 naming conventions: Snake case, Camel case, Pascal case, Kebab case, Ada case, Train case, Cobol case, Macro case, Upper case, Lower case, Sentence case, Title case and Dot notation.", + "homepage": "https://jawira.github.io/case-converter/", + "keywords": [ + "Ada case", + "Cobol case", + "Macro case", + "Train case", + "camel case", + "dot notation", + "kebab case", + "lower case", + "pascal case", + "sentence case", + "snake case", + "title case", + "upper case" + ], + "support": { + "issues": "https://github.com/jawira/case-converter/issues", + "source": "https://github.com/jawira/case-converter/tree/v3.6.0" + }, + "time": "2025-06-13T21:12:55+00:00" + }, + { + "name": "justinrainbow/json-schema", + "version": "6.11.0", + "source": { + "type": "git", + "url": "https://github.com/jsonrainbow/json-schema.git", + "reference": "7e420a943a6fbc95e60e3cf67acfbee85b3b4da7" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/jsonrainbow/json-schema/zipball/7e420a943a6fbc95e60e3cf67acfbee85b3b4da7", + "reference": "7e420a943a6fbc95e60e3cf67acfbee85b3b4da7", + "shasum": "" + }, + "require": { + "ext-filter": "*", + "ext-json": "*", + "marc-mabe/php-enum": "^4.4", + "php": "^7.2 || ^8.0" + }, + "require-dev": { + "friendsofphp/php-cs-fixer": "3.3.0", + "json-schema/json-schema-test-suite": "dev-main", + "marc-mabe/php-enum-phpstan": "^2.0", + "phpspec/prophecy": "^1.19", + "phpstan/phpstan": "^1.12", + "phpunit/phpunit": "^8.5" }, + "bin": [ + "bin/validate-json" + ], "type": "library", + "extra": { + "branch-alias": { + "dev-master": "6.x-dev" + } + }, "autoload": { "psr-4": { - "ComposerUnused\\Contracts\\": "src/" + "JsonSchema\\": "src/JsonSchema/" } }, "notification-url": "https://packagist.org/downloads/", @@ -665,59 +957,48 @@ ], "authors": [ { - "name": "Andreas Frömer", - "email": "composer-unused@icanhazstring.com" + "name": "Danny van der Sluijs", + "email": "danny.vandersluijs@icloud.com", + "role": "Maintainer" } ], - "description": "Contract repository for composer-unused", + "description": "A library to validate a json schema.", + "homepage": "https://github.com/jsonrainbow/json-schema", + "keywords": [ + "json", + "schema" + ], "support": { - "issues": "https://github.com/composer-unused/contracts/issues", - "source": "https://github.com/composer-unused/contracts/tree/0.3.0" + "issues": "https://github.com/jsonrainbow/json-schema/issues", + "source": "https://github.com/jsonrainbow/json-schema/tree/6.11.0" }, - "funding": [ - { - "url": "https://github.com/icanhazstring", - "type": "github" - } - ], - "time": "2023-03-17T00:41:49+00:00" + "time": "2026-08-21T10:30:42+00:00" }, { - "name": "composer-unused/symbol-parser", - "version": "0.2.1", + "name": "kwn/number-to-words", + "version": "2.12.0", "source": { "type": "git", - "url": "https://github.com/composer-unused/symbol-parser.git", - "reference": "a395a555aa38b63cadf9b2f396880ac86abb44a9" + "url": "https://github.com/kwn/number-to-words.git", + "reference": "c4e0cea84574bc0077121ac6a2331c183d6d1cc0" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/composer-unused/symbol-parser/zipball/a395a555aa38b63cadf9b2f396880ac86abb44a9", - "reference": "a395a555aa38b63cadf9b2f396880ac86abb44a9", + "url": "https://api.github.com/repos/kwn/number-to-words/zipball/c4e0cea84574bc0077121ac6a2331c183d6d1cc0", + "reference": "c4e0cea84574bc0077121ac6a2331c183d6d1cc0", "shasum": "" }, "require": { - "composer-unused/contracts": "^0.3", - "nikic/php-parser": "^4.15", - "php": "^7.4 || ^8.0", - "phpstan/phpdoc-parser": "^1.16", - "psr/container": "^1.0 || ^2.0", - "psr/log": "^1.1 || ^2 || ^3", - "symfony/finder": "^4.4 || ^5.3 || ^6.0" + "php": ">=7.4" }, "require-dev": { - "ergebnis/composer-normalize": "^2.28", - "ext-ds": "*", - "phpstan/phpstan": "^1.10", - "phpunit/phpunit": "^9.6.5", - "roave/security-advisories": "dev-master", - "squizlabs/php_codesniffer": "^3.7.2", - "symfony/serializer": "^5.4" + "phpunit/phpunit": "^9.6", + "squizlabs/php_codesniffer": "^3.7.2" }, "type": "library", "autoload": { "psr-4": { - "ComposerUnused\\SymbolParser\\": "src" + "NumberToWords\\": "src" } }, "notification-url": "https://packagist.org/downloads/", @@ -726,145 +1007,138 @@ ], "authors": [ { - "name": "Andreas Frömer", - "email": "composer-unused@icanhazstring.com" + "name": "Karol Wnuk", + "email": "k.wnuk@ascetic.pl" } ], - "description": "Toolkit to parse symbols from a composer package", - "homepage": "https://github.com/composer-unused/symbol-parser", + "description": "Multi language standalone PHP number to words converter. Fully tested, open for extensions and new languages.", "keywords": [ - "composer", - "parser", - "symbol" + "currency", + "money", + "number", + "numbers", + "string", + "to", + "words" ], "support": { - "issues": "https://github.com/composer-unused/symbol-parser/issues", - "source": "https://github.com/composer-unused/symbol-parser" + "issues": "https://github.com/kwn/number-to-words/issues", + "source": "https://github.com/kwn/number-to-words/tree/2.12.0" }, - "funding": [ - { - "url": "https://github.com/sponsors/icanhazstring", - "type": "github" - }, - { - "url": "https://paypal.me/icanhazstring", - "type": "other" - } - ], - "time": "2023-03-17T00:45:47+00:00" + "time": "2025-07-01T20:49:04+00:00" }, { - "name": "composer/ca-bundle", - "version": "1.3.7", + "name": "league/openapi-psr7-validator", + "version": "0.21", "source": { "type": "git", - "url": "https://github.com/composer/ca-bundle.git", - "reference": "76e46335014860eec1aa5a724799a00a2e47cc85" + "url": "https://github.com/thephpleague/openapi-psr7-validator.git", + "reference": "bccdd3f5037c796fff3ef3f11dcf8c073aaa6192" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/composer/ca-bundle/zipball/76e46335014860eec1aa5a724799a00a2e47cc85", - "reference": "76e46335014860eec1aa5a724799a00a2e47cc85", + "url": "https://api.github.com/repos/thephpleague/openapi-psr7-validator/zipball/bccdd3f5037c796fff3ef3f11dcf8c073aaa6192", + "reference": "bccdd3f5037c796fff3ef3f11dcf8c073aaa6192", "shasum": "" }, "require": { - "ext-openssl": "*", - "ext-pcre": "*", - "php": "^5.3.2 || ^7.0 || ^8.0" + "devizzent/cebe-php-openapi": "^1.0", + "ext-json": "*", + "league/uri": "^6.3", + "php": ">=7.2", + "psr/cache": "^1.0 || ^2.0 || ^3.0", + "psr/http-message": "^1.0", + "psr/http-server-middleware": "^1.0", + "respect/validation": "^1.1.3 || ^2.0", + "riverline/multipart-parser": "^2.0.3", + "symfony/polyfill-php80": "^1.27", + "webmozart/assert": "^1.4" }, "require-dev": { - "phpstan/phpstan": "^0.12.55", - "psr/log": "^1.0", - "symfony/phpunit-bridge": "^4.2 || ^5", - "symfony/process": "^2.5 || ^3.0 || ^4.0 || ^5.0 || ^6.0" + "doctrine/coding-standard": "^8.0", + "guzzlehttp/psr7": "^1.5", + "hansott/psr7-cookies": "^3.0.2", + "phpstan/extension-installer": "^1.0", + "phpstan/phpstan": "^1", + "phpstan/phpstan-phpunit": "^1", + "phpstan/phpstan-webmozart-assert": "^1", + "phpunit/phpunit": "^7 || ^8 || ^9", + "symfony/cache": "^5.1" }, "type": "library", - "extra": { - "branch-alias": { - "dev-main": "1.x-dev" - } - }, "autoload": { "psr-4": { - "Composer\\CaBundle\\": "src" + "League\\OpenAPIValidation\\": "src/" } }, "notification-url": "https://packagist.org/downloads/", "license": [ "MIT" ], - "authors": [ - { - "name": "Jordi Boggiano", - "email": "j.boggiano@seld.be", - "homepage": "http://seld.be" - } - ], - "description": "Lets you find a path to the system CA bundle, and includes a fallback to the Mozilla CA bundle.", + "description": "Validate PSR-7 messages against OpenAPI (3.0.2) specifications expressed in YAML or JSON", + "homepage": "https://github.com/thephpleague/openapi-psr7-validator", "keywords": [ - "cabundle", - "cacert", - "certificate", - "ssl", - "tls" + "http", + "openapi", + "psr7", + "validation" ], "support": { - "irc": "irc://irc.freenode.org/composer", - "issues": "https://github.com/composer/ca-bundle/issues", - "source": "https://github.com/composer/ca-bundle/tree/1.3.7" + "issues": "https://github.com/thephpleague/openapi-psr7-validator/issues", + "source": "https://github.com/thephpleague/openapi-psr7-validator/tree/0.21" }, - "funding": [ - { - "url": "https://packagist.com", - "type": "custom" - }, - { - "url": "https://github.com/composer", - "type": "github" - }, - { - "url": "https://tidelift.com/funding/github/packagist/composer/composer", - "type": "tidelift" - } - ], - "time": "2023-08-30T09:31:38+00:00" + "time": "2023-04-03T21:49:07+00:00" }, { - "name": "composer/class-map-generator", - "version": "1.1.0", + "name": "league/uri", + "version": "6.8.0", "source": { "type": "git", - "url": "https://github.com/composer/class-map-generator.git", - "reference": "953cc4ea32e0c31f2185549c7d216d7921f03da9" + "url": "https://github.com/thephpleague/uri.git", + "reference": "a700b4656e4c54371b799ac61e300ab25a2d1d39" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/composer/class-map-generator/zipball/953cc4ea32e0c31f2185549c7d216d7921f03da9", - "reference": "953cc4ea32e0c31f2185549c7d216d7921f03da9", + "url": "https://api.github.com/repos/thephpleague/uri/zipball/a700b4656e4c54371b799ac61e300ab25a2d1d39", + "reference": "a700b4656e4c54371b799ac61e300ab25a2d1d39", "shasum": "" }, "require": { - "composer/pcre": "^2.1 || ^3.1", - "php": "^7.2 || ^8.0", - "symfony/finder": "^4.4 || ^5.3 || ^6 || ^7" + "ext-json": "*", + "league/uri-interfaces": "^2.3", + "php": "^8.1", + "psr/http-message": "^1.0.1" + }, + "conflict": { + "league/uri-schemes": "^1.0" }, "require-dev": { - "phpstan/phpstan": "^1.6", - "phpstan/phpstan-deprecation-rules": "^1", - "phpstan/phpstan-phpunit": "^1", - "phpstan/phpstan-strict-rules": "^1.1", - "symfony/filesystem": "^5.4 || ^6", - "symfony/phpunit-bridge": "^5" + "friendsofphp/php-cs-fixer": "^v3.9.5", + "nyholm/psr7": "^1.5.1", + "php-http/psr7-integration-tests": "^1.1.1", + "phpbench/phpbench": "^1.2.6", + "phpstan/phpstan": "^1.8.5", + "phpstan/phpstan-deprecation-rules": "^1.0", + "phpstan/phpstan-phpunit": "^1.1.1", + "phpstan/phpstan-strict-rules": "^1.4.3", + "phpunit/phpunit": "^9.5.24", + "psr/http-factory": "^1.0.1" + }, + "suggest": { + "ext-fileinfo": "Needed to create Data URI from a filepath", + "ext-intl": "Needed to improve host validation", + "league/uri-components": "Needed to easily manipulate URI objects", + "psr/http-factory": "Needed to use the URI factory" }, "type": "library", "extra": { "branch-alias": { - "dev-main": "1.x-dev" + "dev-master": "6.x-dev" } }, "autoload": { "psr-4": { - "Composer\\ClassMapGenerator\\": "src" + "League\\Uri\\": "src" } }, "notification-url": "https://packagist.org/downloads/", @@ -873,102 +1147,86 @@ ], "authors": [ { - "name": "Jordi Boggiano", - "email": "j.boggiano@seld.be", - "homepage": "https://seld.be" + "name": "Ignace Nyamagana Butera", + "email": "nyamsprod@gmail.com", + "homepage": "https://nyamsprod.com" } ], - "description": "Utilities to scan PHP code and generate class maps.", + "description": "URI manipulation library", + "homepage": "https://uri.thephpleague.com", "keywords": [ - "classmap" + "data-uri", + "file-uri", + "ftp", + "hostname", + "http", + "https", + "middleware", + "parse_str", + "parse_url", + "psr-7", + "query-string", + "querystring", + "rfc3986", + "rfc3987", + "rfc6570", + "uri", + "uri-template", + "url", + "ws" ], "support": { - "issues": "https://github.com/composer/class-map-generator/issues", - "source": "https://github.com/composer/class-map-generator/tree/1.1.0" + "docs": "https://uri.thephpleague.com", + "forum": "https://thephpleague.slack.com", + "issues": "https://github.com/thephpleague/uri/issues", + "source": "https://github.com/thephpleague/uri/tree/6.8.0" }, "funding": [ { - "url": "https://packagist.com", - "type": "custom" - }, - { - "url": "https://github.com/composer", + "url": "https://github.com/sponsors/nyamsprod", "type": "github" - }, - { - "url": "https://tidelift.com/funding/github/packagist/composer/composer", - "type": "tidelift" } ], - "time": "2023-06-30T13:58:57+00:00" + "time": "2022-09-13T19:58:47+00:00" }, { - "name": "composer/composer", - "version": "2.6.5", + "name": "league/uri-interfaces", + "version": "2.3.0", "source": { "type": "git", - "url": "https://github.com/composer/composer.git", - "reference": "4b0fe89db9e65b1e64df633a992e70a7a215ab33" + "url": "https://github.com/thephpleague/uri-interfaces.git", + "reference": "00e7e2943f76d8cb50c7dfdc2f6dee356e15e383" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/composer/composer/zipball/4b0fe89db9e65b1e64df633a992e70a7a215ab33", - "reference": "4b0fe89db9e65b1e64df633a992e70a7a215ab33", + "url": "https://api.github.com/repos/thephpleague/uri-interfaces/zipball/00e7e2943f76d8cb50c7dfdc2f6dee356e15e383", + "reference": "00e7e2943f76d8cb50c7dfdc2f6dee356e15e383", "shasum": "" }, "require": { - "composer/ca-bundle": "^1.0", - "composer/class-map-generator": "^1.0", - "composer/metadata-minifier": "^1.0", - "composer/pcre": "^2.1 || ^3.1", - "composer/semver": "^3.2.5", - "composer/spdx-licenses": "^1.5.7", - "composer/xdebug-handler": "^2.0.2 || ^3.0.3", - "justinrainbow/json-schema": "^5.2.11", - "php": "^7.2.5 || ^8.0", - "psr/log": "^1.0 || ^2.0 || ^3.0", - "react/promise": "^2.8 || ^3", - "seld/jsonlint": "^1.4", - "seld/phar-utils": "^1.2", - "seld/signal-handler": "^2.0", - "symfony/console": "^5.4.11 || ^6.0.11 || ^7", - "symfony/filesystem": "^5.4 || ^6.0 || ^7", - "symfony/finder": "^5.4 || ^6.0 || ^7", - "symfony/polyfill-php73": "^1.24", - "symfony/polyfill-php80": "^1.24", - "symfony/polyfill-php81": "^1.24", - "symfony/process": "^5.4 || ^6.0 || ^7" + "ext-json": "*", + "php": "^7.2 || ^8.0" }, "require-dev": { - "phpstan/phpstan": "^1.9.3", - "phpstan/phpstan-deprecation-rules": "^1", - "phpstan/phpstan-phpunit": "^1.0", - "phpstan/phpstan-strict-rules": "^1", - "phpstan/phpstan-symfony": "^1.2.10", - "symfony/phpunit-bridge": "^6.0 || ^7" + "friendsofphp/php-cs-fixer": "^2.19", + "phpstan/phpstan": "^0.12.90", + "phpstan/phpstan-phpunit": "^0.12.19", + "phpstan/phpstan-strict-rules": "^0.12.9", + "phpunit/phpunit": "^8.5.15 || ^9.5" }, "suggest": { - "ext-openssl": "Enabling the openssl extension allows you to access https URLs for repositories and packages", - "ext-zip": "Enabling the zip extension allows you to unzip archives", - "ext-zlib": "Allow gzip compression of HTTP requests" + "ext-intl": "to use the IDNA feature", + "symfony/intl": "to use the IDNA feature via Symfony Polyfill" }, - "bin": [ - "bin/composer" - ], "type": "library", "extra": { "branch-alias": { - "dev-main": "2.6-dev" - }, - "phpstan": { - "includes": [ - "phpstan/rules.neon" - ] + "dev-master": "2.x-dev" } }, "autoload": { "psr-4": { - "Composer\\": "src/Composer/" + "League\\Uri\\": "src/" } }, "notification-url": "https://packagist.org/downloads/", @@ -977,215 +1235,207 @@ ], "authors": [ { - "name": "Nils Adermann", - "email": "naderman@naderman.de", - "homepage": "https://www.naderman.de" - }, - { - "name": "Jordi Boggiano", - "email": "j.boggiano@seld.be", - "homepage": "https://seld.be" + "name": "Ignace Nyamagana Butera", + "email": "nyamsprod@gmail.com", + "homepage": "https://nyamsprod.com" } ], - "description": "Composer helps you declare, manage and install dependencies of PHP projects. It ensures you have the right stack everywhere.", - "homepage": "https://getcomposer.org/", + "description": "Common interface for URI representation", + "homepage": "http://github.com/thephpleague/uri-interfaces", "keywords": [ - "autoload", - "dependency", - "package" + "rfc3986", + "rfc3987", + "uri", + "url" ], "support": { - "irc": "ircs://irc.libera.chat:6697/composer", - "issues": "https://github.com/composer/composer/issues", - "security": "https://github.com/composer/composer/security/policy", - "source": "https://github.com/composer/composer/tree/2.6.5" + "issues": "https://github.com/thephpleague/uri-interfaces/issues", + "source": "https://github.com/thephpleague/uri-interfaces/tree/2.3.0" }, "funding": [ { - "url": "https://packagist.com", - "type": "custom" - }, - { - "url": "https://github.com/composer", + "url": "https://github.com/sponsors/nyamsprod", "type": "github" - }, - { - "url": "https://tidelift.com/funding/github/packagist/composer/composer", - "type": "tidelift" } ], - "time": "2023-10-06T08:11:52+00:00" + "time": "2021-06-28T04:27:21+00:00" }, { - "name": "composer/metadata-minifier", - "version": "1.0.0", + "name": "marc-mabe/php-enum", + "version": "v4.7.2", "source": { "type": "git", - "url": "https://github.com/composer/metadata-minifier.git", - "reference": "c549d23829536f0d0e984aaabbf02af91f443207" + "url": "https://github.com/marc-mabe/php-enum.git", + "reference": "bb426fcdd65c60fb3638ef741e8782508fda7eef" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/composer/metadata-minifier/zipball/c549d23829536f0d0e984aaabbf02af91f443207", - "reference": "c549d23829536f0d0e984aaabbf02af91f443207", + "url": "https://api.github.com/repos/marc-mabe/php-enum/zipball/bb426fcdd65c60fb3638ef741e8782508fda7eef", + "reference": "bb426fcdd65c60fb3638ef741e8782508fda7eef", "shasum": "" }, "require": { - "php": "^5.3.2 || ^7.0 || ^8.0" + "ext-reflection": "*", + "php": "^7.1 | ^8.0" }, "require-dev": { - "composer/composer": "^2", - "phpstan/phpstan": "^0.12.55", - "symfony/phpunit-bridge": "^4.2 || ^5" + "phpbench/phpbench": "^0.16.10 || ^1.0.4", + "phpstan/phpstan": "^1.3.1", + "phpunit/phpunit": "^7.5.20 | ^8.5.22 | ^9.5.11", + "vimeo/psalm": "^4.17.0 | ^5.26.1" }, "type": "library", "extra": { "branch-alias": { - "dev-main": "1.x-dev" + "dev-3.x": "3.2-dev", + "dev-master": "4.7-dev" } }, "autoload": { "psr-4": { - "Composer\\MetadataMinifier\\": "src" - } + "MabeEnum\\": "src/" + }, + "classmap": [ + "stubs/Stringable.php" + ] }, "notification-url": "https://packagist.org/downloads/", "license": [ - "MIT" + "BSD-3-Clause" ], "authors": [ { - "name": "Jordi Boggiano", - "email": "j.boggiano@seld.be", - "homepage": "http://seld.be" + "name": "Marc Bennewitz", + "email": "dev@mabe.berlin", + "homepage": "https://mabe.berlin/", + "role": "Lead" } ], - "description": "Small utility library that handles metadata minification and expansion.", + "description": "Simple and fast implementation of enumerations with native PHP", + "homepage": "https://github.com/marc-mabe/php-enum", "keywords": [ - "composer", - "compression" + "enum", + "enum-map", + "enum-set", + "enumeration", + "enumerator", + "enummap", + "enumset", + "map", + "set", + "type", + "type-hint", + "typehint" ], "support": { - "issues": "https://github.com/composer/metadata-minifier/issues", - "source": "https://github.com/composer/metadata-minifier/tree/1.0.0" + "issues": "https://github.com/marc-mabe/php-enum/issues", + "source": "https://github.com/marc-mabe/php-enum/tree/v4.7.2" }, - "funding": [ - { - "url": "https://packagist.com", - "type": "custom" - }, - { - "url": "https://github.com/composer", - "type": "github" - }, - { - "url": "https://tidelift.com/funding/github/packagist/composer/composer", - "type": "tidelift" - } - ], - "time": "2021-04-07T13:37:33+00:00" + "time": "2025-09-14T11:18:39+00:00" }, { - "name": "composer/pcre", - "version": "3.1.1", + "name": "nikic/php-parser", + "version": "v5.8.0", "source": { "type": "git", - "url": "https://github.com/composer/pcre.git", - "reference": "00104306927c7a0919b4ced2aaa6782c1e61a3c9" + "url": "https://github.com/nikic/PHP-Parser.git", + "reference": "044a6a392ff8ad0d61f14370a5fbbd0a0107152f" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/composer/pcre/zipball/00104306927c7a0919b4ced2aaa6782c1e61a3c9", - "reference": "00104306927c7a0919b4ced2aaa6782c1e61a3c9", + "url": "https://api.github.com/repos/nikic/PHP-Parser/zipball/044a6a392ff8ad0d61f14370a5fbbd0a0107152f", + "reference": "044a6a392ff8ad0d61f14370a5fbbd0a0107152f", "shasum": "" }, "require": { - "php": "^7.4 || ^8.0" + "ext-json": "*", + "ext-tokenizer": "*", + "php": ">=7.4" }, "require-dev": { - "phpstan/phpstan": "^1.3", - "phpstan/phpstan-strict-rules": "^1.1", - "symfony/phpunit-bridge": "^5" + "ircmaxell/php-yacc": "^0.0.7", + "phpunit/phpunit": "^9.0" }, + "bin": [ + "bin/php-parse" + ], "type": "library", "extra": { "branch-alias": { - "dev-main": "3.x-dev" + "dev-master": "5.x-dev" } }, "autoload": { "psr-4": { - "Composer\\Pcre\\": "src" + "PhpParser\\": "lib/PhpParser" } }, "notification-url": "https://packagist.org/downloads/", "license": [ - "MIT" + "BSD-3-Clause" ], "authors": [ { - "name": "Jordi Boggiano", - "email": "j.boggiano@seld.be", - "homepage": "http://seld.be" + "name": "Nikita Popov" } ], - "description": "PCRE wrapping library that offers type-safe preg_* replacements.", + "description": "A PHP parser written in PHP", "keywords": [ - "PCRE", - "preg", - "regex", - "regular expression" + "parser", + "php" ], "support": { - "issues": "https://github.com/composer/pcre/issues", - "source": "https://github.com/composer/pcre/tree/3.1.1" + "issues": "https://github.com/nikic/PHP-Parser/issues", + "source": "https://github.com/nikic/PHP-Parser/tree/v5.8.0" }, - "funding": [ - { - "url": "https://packagist.com", - "type": "custom" - }, - { - "url": "https://github.com/composer", - "type": "github" - }, - { - "url": "https://tidelift.com/funding/github/packagist/composer/composer", - "type": "tidelift" - } - ], - "time": "2023-10-11T07:11:09+00:00" + "time": "2026-07-04T14:30:18+00:00" }, { - "name": "composer/semver", - "version": "3.4.0", + "name": "nunomaduro/termwind", + "version": "v2.4.0", "source": { "type": "git", - "url": "https://github.com/composer/semver.git", - "reference": "35e8d0af4486141bc745f23a29cc2091eb624a32" + "url": "https://github.com/nunomaduro/termwind.git", + "reference": "712a31b768f5daea284c2169a7d227031001b9a8" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/composer/semver/zipball/35e8d0af4486141bc745f23a29cc2091eb624a32", - "reference": "35e8d0af4486141bc745f23a29cc2091eb624a32", + "url": "https://api.github.com/repos/nunomaduro/termwind/zipball/712a31b768f5daea284c2169a7d227031001b9a8", + "reference": "712a31b768f5daea284c2169a7d227031001b9a8", "shasum": "" }, "require": { - "php": "^5.3.2 || ^7.0 || ^8.0" + "ext-mbstring": "*", + "php": "^8.2", + "symfony/console": "^7.4.4 || ^8.0.4" }, "require-dev": { - "phpstan/phpstan": "^1.4", - "symfony/phpunit-bridge": "^4.2 || ^5" + "illuminate/console": "^11.47.0", + "laravel/pint": "^1.27.1", + "mockery/mockery": "^1.6.12", + "pestphp/pest": "^2.36.0 || ^3.8.4 || ^4.3.2", + "phpstan/phpstan": "^1.12.32", + "phpstan/phpstan-strict-rules": "^1.6.2", + "symfony/var-dumper": "^7.3.5 || ^8.0.4", + "thecodingmachine/phpstan-strict-rules": "^1.0.0" }, "type": "library", "extra": { + "laravel": { + "providers": [ + "Termwind\\Laravel\\TermwindServiceProvider" + ] + }, "branch-alias": { - "dev-main": "3.x-dev" + "dev-2.x": "2.x-dev" } }, "autoload": { + "files": [ + "src/Functions.php" + ], "psr-4": { - "Composer\\Semver\\": "src" + "Termwind\\": "src/" } }, "notification-url": "https://packagist.org/downloads/", @@ -1194,157 +1444,147 @@ ], "authors": [ { - "name": "Nils Adermann", - "email": "naderman@naderman.de", - "homepage": "http://www.naderman.de" - }, - { - "name": "Jordi Boggiano", - "email": "j.boggiano@seld.be", - "homepage": "http://seld.be" - }, - { - "name": "Rob Bast", - "email": "rob.bast@gmail.com", - "homepage": "http://robbast.nl" + "name": "Nuno Maduro", + "email": "enunomaduro@gmail.com" } ], - "description": "Semver library that offers utilities, version constraint parsing and validation.", + "description": "It's like Tailwind CSS, but for the console.", "keywords": [ - "semantic", - "semver", - "validation", - "versioning" + "cli", + "console", + "css", + "package", + "php", + "style" ], "support": { - "irc": "ircs://irc.libera.chat:6697/composer", - "issues": "https://github.com/composer/semver/issues", - "source": "https://github.com/composer/semver/tree/3.4.0" + "issues": "https://github.com/nunomaduro/termwind/issues", + "source": "https://github.com/nunomaduro/termwind/tree/v2.4.0" }, "funding": [ { - "url": "https://packagist.com", + "url": "https://www.paypal.com/paypalme/enunomaduro", "type": "custom" }, { - "url": "https://github.com/composer", + "url": "https://github.com/nunomaduro", "type": "github" }, { - "url": "https://tidelift.com/funding/github/packagist/composer/composer", - "type": "tidelift" + "url": "https://github.com/xiCO2k", + "type": "github" } ], - "time": "2023-08-31T09:50:34+00:00" + "time": "2026-02-16T23:10:27+00:00" }, { - "name": "composer/spdx-licenses", - "version": "1.5.7", + "name": "ondram/ci-detector", + "version": "4.2.0", "source": { "type": "git", - "url": "https://github.com/composer/spdx-licenses.git", - "reference": "c848241796da2abf65837d51dce1fae55a960149" + "url": "https://github.com/OndraM/ci-detector.git", + "reference": "8b0223b5ed235fd377c75fdd1bfcad05c0f168b8" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/composer/spdx-licenses/zipball/c848241796da2abf65837d51dce1fae55a960149", - "reference": "c848241796da2abf65837d51dce1fae55a960149", + "url": "https://api.github.com/repos/OndraM/ci-detector/zipball/8b0223b5ed235fd377c75fdd1bfcad05c0f168b8", + "reference": "8b0223b5ed235fd377c75fdd1bfcad05c0f168b8", "shasum": "" }, "require": { - "php": "^5.3.2 || ^7.0 || ^8.0" + "php": "^7.4 || ^8.0" }, "require-dev": { - "phpstan/phpstan": "^0.12.55", - "symfony/phpunit-bridge": "^4.2 || ^5" + "ergebnis/composer-normalize": "^2.13.2", + "lmc/coding-standard": "^3.0.0", + "php-parallel-lint/php-parallel-lint": "^1.2", + "phpstan/extension-installer": "^1.1.0", + "phpstan/phpstan": "^1.2.0", + "phpstan/phpstan-phpunit": "^1.0.0", + "phpunit/phpunit": "^9.6.13" }, "type": "library", - "extra": { - "branch-alias": { - "dev-main": "1.x-dev" - } - }, "autoload": { "psr-4": { - "Composer\\Spdx\\": "src" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Nils Adermann", - "email": "naderman@naderman.de", - "homepage": "http://www.naderman.de" - }, - { - "name": "Jordi Boggiano", - "email": "j.boggiano@seld.be", - "homepage": "http://seld.be" - }, - { - "name": "Rob Bast", - "email": "rob.bast@gmail.com", - "homepage": "http://robbast.nl" + "OndraM\\CiDetector\\": "src/" } - ], - "description": "SPDX licenses list and validation library.", - "keywords": [ - "license", - "spdx", - "validator" - ], - "support": { - "irc": "irc://irc.freenode.org/composer", - "issues": "https://github.com/composer/spdx-licenses/issues", - "source": "https://github.com/composer/spdx-licenses/tree/1.5.7" - }, - "funding": [ - { - "url": "https://packagist.com", - "type": "custom" - }, - { - "url": "https://github.com/composer", - "type": "github" - }, + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ { - "url": "https://tidelift.com/funding/github/packagist/composer/composer", - "type": "tidelift" + "name": "Ondřej Machulda", + "email": "ondrej.machulda@gmail.com" } ], - "time": "2022-05-23T07:37:50+00:00" + "description": "Detect continuous integration environment and provide unified access to properties of current build", + "keywords": [ + "CircleCI", + "Codeship", + "Wercker", + "adapter", + "appveyor", + "aws", + "aws codebuild", + "azure", + "azure devops", + "azure pipelines", + "bamboo", + "bitbucket", + "buddy", + "ci-info", + "codebuild", + "continuous integration", + "continuousphp", + "devops", + "drone", + "github", + "gitlab", + "interface", + "jenkins", + "pipelines", + "sourcehut", + "teamcity", + "travis" + ], + "support": { + "issues": "https://github.com/OndraM/ci-detector/issues", + "source": "https://github.com/OndraM/ci-detector/tree/4.2.0" + }, + "time": "2024-03-12T13:22:30+00:00" }, { - "name": "composer/xdebug-handler", - "version": "3.0.3", + "name": "openapi-tools/configuration", + "version": "0.1.0", "source": { "type": "git", - "url": "https://github.com/composer/xdebug-handler.git", - "reference": "ced299686f41dce890debac69273b47ffe98a40c" + "url": "https://github.com/php-openapi-tools/configuration.git", + "reference": "d50517b1a9b72647382a766158f98b0f58654d0d" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/composer/xdebug-handler/zipball/ced299686f41dce890debac69273b47ffe98a40c", - "reference": "ced299686f41dce890debac69273b47ffe98a40c", + "url": "https://api.github.com/repos/php-openapi-tools/configuration/zipball/d50517b1a9b72647382a766158f98b0f58654d0d", + "reference": "d50517b1a9b72647382a766158f98b0f58654d0d", "shasum": "" }, "require": { - "composer/pcre": "^1 || ^2 || ^3", - "php": "^7.2.5 || ^8.0", - "psr/log": "^1 || ^2 || ^3" + "eventsauce/object-hydrator": "^1.8.0", + "jawira/case-converter": "^3.6.0", + "openapi-tools/contract": "^0.1.0", + "openapi-tools/representation": "^0.1.0", + "openapi-tools/utils": "^0.1.0", + "php": "^8.4" }, "require-dev": { - "phpstan/phpstan": "^1.0", - "phpstan/phpstan-strict-rules": "^1.1", - "symfony/phpunit-bridge": "^6.0" + "wyrihaximus/async-test-utilities": "^13.5.1", + "wyrihaximus/makefiles": "^0.13.3" }, "type": "library", "autoload": { "psr-4": { - "Composer\\XdebugHandler\\": "src" + "OpenAPITools\\Configuration\\": "src/" } }, "notification-url": "https://packagist.org/downloads/", @@ -1353,70 +1593,60 @@ ], "authors": [ { - "name": "John Stevenson", - "email": "john-stevenson@blueyonder.co.uk" + "name": "Cees-Jan Kiewiet", + "email": "ceesjank@gmail.com" } ], - "description": "Restarts a process without Xdebug.", - "keywords": [ - "Xdebug", - "performance" - ], + "description": "Configuration for package generators", "support": { - "irc": "irc://irc.freenode.org/composer", - "issues": "https://github.com/composer/xdebug-handler/issues", - "source": "https://github.com/composer/xdebug-handler/tree/3.0.3" + "issues": "https://github.com/php-openapi-tools/configuration/issues", + "source": "https://github.com/php-openapi-tools/configuration/tree/0.1.0" }, "funding": [ { - "url": "https://packagist.com", - "type": "custom" - }, - { - "url": "https://github.com/composer", + "url": "https://github.com/WyriHaximus", "type": "github" - }, - { - "url": "https://tidelift.com/funding/github/packagist/composer/composer", - "type": "tidelift" } ], - "time": "2022-02-25T21:32:43+00:00" + "time": "2026-08-24T16:30:34+00:00" }, { - "name": "dealerdirect/phpcodesniffer-composer-installer", - "version": "v1.0.0", + "name": "openapi-tools/contract", + "version": "0.1.0", "source": { "type": "git", - "url": "https://github.com/PHPCSStandards/composer-installer.git", - "reference": "4be43904336affa5c2f70744a348312336afd0da" + "url": "https://github.com/php-openapi-tools/contract.git", + "reference": "02377cb7dd26d7ec2909cfa42d0478effc6701f4" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/PHPCSStandards/composer-installer/zipball/4be43904336affa5c2f70744a348312336afd0da", - "reference": "4be43904336affa5c2f70744a348312336afd0da", + "url": "https://api.github.com/repos/php-openapi-tools/contract/zipball/02377cb7dd26d7ec2909cfa42d0478effc6701f4", + "reference": "02377cb7dd26d7ec2909cfa42d0478effc6701f4", "shasum": "" }, "require": { - "composer-plugin-api": "^1.0 || ^2.0", - "php": ">=5.4", - "squizlabs/php_codesniffer": "^2.0 || ^3.1.0 || ^4.0" + "nikic/php-parser": "^5.0", + "openapi-tools/representation": "^0.1.0", + "openapi-tools/utils": "^0.1.0", + "php": "^8.4", + "psr/http-message": "^1 || ^2 || ^3" }, "require-dev": { - "composer/composer": "*", - "ext-json": "*", - "ext-zip": "*", - "php-parallel-lint/php-parallel-lint": "^1.3.1", - "phpcompatibility/php-compatibility": "^9.0", - "yoast/phpunit-polyfills": "^1.0" + "wyrihaximus/async-test-utilities": "^13.5.1", + "wyrihaximus/makefiles": "^0.13.3" }, - "type": "composer-plugin", + "type": "library", "extra": { - "class": "PHPCSStandards\\Composer\\Plugin\\Installers\\PHPCodeSniffer\\Plugin" + "wyrihaximus": { + "supported-features": { + "code-style": false, + "unit-tests": false + } + } }, "autoload": { "psr-4": { - "PHPCSStandards\\Composer\\Plugin\\Installers\\PHPCodeSniffer\\": "src/" + "OpenAPITools\\Contract\\": "src/" } }, "notification-url": "https://packagist.org/downloads/", @@ -1425,193 +1655,198 @@ ], "authors": [ { - "name": "Franck Nijhof", - "email": "franck.nijhof@dealerdirect.com", - "homepage": "http://www.frenck.nl", - "role": "Developer / IT Manager" - }, - { - "name": "Contributors", - "homepage": "https://github.com/PHPCSStandards/composer-installer/graphs/contributors" + "name": "Cees-Jan Kiewiet", + "email": "ceesjank@gmail.com" } ], - "description": "PHP_CodeSniffer Standards Composer Installer Plugin", - "homepage": "http://www.dealerdirect.com", - "keywords": [ - "PHPCodeSniffer", - "PHP_CodeSniffer", - "code quality", - "codesniffer", - "composer", - "installer", - "phpcbf", - "phpcs", - "plugin", - "qa", - "quality", - "standard", - "standards", - "style guide", - "stylecheck", - "tests" - ], + "description": "Contracts for OpenAPI Tools", "support": { - "issues": "https://github.com/PHPCSStandards/composer-installer/issues", - "source": "https://github.com/PHPCSStandards/composer-installer" + "issues": "https://github.com/php-openapi-tools/contract/issues", + "source": "https://github.com/php-openapi-tools/contract/tree/0.1.0" }, - "time": "2023-01-05T11:28:13+00:00" + "funding": [ + { + "url": "https://github.com/WyriHaximus", + "type": "github" + } + ], + "time": "2026-08-24T15:40:16+00:00" }, { - "name": "delight-im/alphabets", - "version": "v1.0.0", + "name": "openapi-tools/gatherer", + "version": "0.1.0", "source": { "type": "git", - "url": "https://github.com/delight-im/PHP-Alphabets.git", - "reference": "54bbe2672875264e583414446b102a1f84bd5b9e" + "url": "https://github.com/php-openapi-tools/gatherer.git", + "reference": "d3351b4586e92f74d3b79b0f869e8433d67d0d1c" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/delight-im/PHP-Alphabets/zipball/54bbe2672875264e583414446b102a1f84bd5b9e", - "reference": "54bbe2672875264e583414446b102a1f84bd5b9e", + "url": "https://api.github.com/repos/php-openapi-tools/gatherer/zipball/d3351b4586e92f74d3b79b0f869e8433d67d0d1c", + "reference": "d3351b4586e92f74d3b79b0f869e8433d67d0d1c", "shasum": "" }, "require": { - "php": ">=5.6.0" + "ckr/arraymerger": "^3.0", + "codeinc/http-reason-phrase-lookup": "^1.0", + "devizzent/cebe-php-openapi": "^1.0.3", + "eventsauce/object-hydrator": "^1.4", + "ilario-pierbattista/reverse-regex": "^0.6.0", + "jawira/case-converter": "^3.5.1", + "kwn/number-to-words": "^2.9.1", + "nikic/php-parser": "^5.0", + "openapi-tools/configuration": "^0.1.0", + "openapi-tools/contract": "^0.1.0", + "openapi-tools/registry": "^0.1.0", + "openapi-tools/representation": "^0.1.0", + "openapi-tools/utils": "^0.1.0", + "php": "^8.4", + "psr/http-message": "^1 || ^2 || ^3", + "symfony/yaml": "^7.0" + }, + "require-dev": { + "openapi-tools/test-data": "dev-main", + "wyrihaximus/async-test-utilities": "^13.5.1", + "wyrihaximus/makefiles": "^0.13.3" }, "type": "library", "autoload": { "psr-4": { - "Delight\\Alphabets\\": "src/" + "OpenAPITools\\Gatherer\\": "src/" } }, "notification-url": "https://packagist.org/downloads/", "license": [ "MIT" ], - "description": "Sets of digits or characters that may be used for base conversions, encoding and decoding tasks, and input validation", - "homepage": "https://github.com/delight-im/PHP-Alphabets", - "keywords": [ - "alpha", - "alphabet", - "alphabets", - "alphanumeric", - "ascii", - "base32", - "base58", - "base64", - "base64url", - "base85", - "binary", - "decimal", - "decode", - "decoding", - "encode", - "encoding", - "hex", - "hexadecimal", - "octal" + "authors": [ + { + "name": "Cees-Jan Kiewiet", + "email": "ceesjank@gmail.com" + } ], + "description": "Utils for OpenAPI Tools", "support": { - "issues": "https://github.com/delight-im/PHP-Alphabets/issues", - "source": "https://github.com/delight-im/PHP-Alphabets/tree/v1.0.0" + "issues": "https://github.com/php-openapi-tools/gatherer/issues", + "source": "https://github.com/php-openapi-tools/gatherer/tree/0.1.0" }, - "time": "2019-11-17T23:48:59+00:00" + "funding": [ + { + "url": "https://github.com/WyriHaximus", + "type": "github" + } + ], + "time": "2026-08-25T05:19:25+00:00" }, { - "name": "delight-im/random", - "version": "v1.0.0", + "name": "openapi-tools/generator", + "version": "0.1.0", "source": { "type": "git", - "url": "https://github.com/delight-im/PHP-Random.git", - "reference": "133aed6cc760065c8dbfc4ae0e8bdacfbb6ce273" + "url": "https://github.com/php-openapi-tools/generator.git", + "reference": "0969931555b7f3505549750431987f6d90daa27b" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/delight-im/PHP-Random/zipball/133aed6cc760065c8dbfc4ae0e8bdacfbb6ce273", - "reference": "133aed6cc760065c8dbfc4ae0e8bdacfbb6ce273", + "url": "https://api.github.com/repos/php-openapi-tools/generator/zipball/0969931555b7f3505549750431987f6d90daa27b", + "reference": "0969931555b7f3505549750431987f6d90daa27b", "shasum": "" }, "require": { - "delight-im/alphabets": "^1.0", - "php": ">=7.0.0" + "devizzent/cebe-php-openapi": "^1.1", + "ext-hash": "^8.4", + "nikic/php-parser": "^5.0", + "openapi-tools/configuration": "^0.1.0", + "openapi-tools/contract": "^0.1.0", + "openapi-tools/gatherer": "^0.1.0", + "openapi-tools/generator-utils": "^0.1.0", + "openapi-tools/registry": "^0.1.0", + "openapi-tools/representation": "^0.1.0", + "openapi-tools/utils": "^0.1.0", + "php": "^8.4" }, + "require-dev": { + "openapi-tools/generator-hydrator": "^0.1.0", + "openapi-tools/generator-schema": "^0.1.0", + "openapi-tools/generator-templates": "^0.1.0", + "shipmonk/coverage-guard": "^1.1.0", + "wyrihaximus/async-test-utilities": "^13.5.1", + "wyrihaximus/makefiles": "^0.13.3" + }, + "bin": [ + "bin/openapi-generator" + ], "type": "library", + "extra": { + "wyrihaximus": { + "supported-features": { + "windows": false + } + } + }, "autoload": { "psr-4": { - "Delight\\Random\\": "src/" + "OpenAPITools\\Generator\\": "src/" } }, "notification-url": "https://packagist.org/downloads/", "license": [ "MIT" ], - "description": "The most convenient way to securely generate anything random in PHP", - "homepage": "https://github.com/delight-im/PHP-Random", - "keywords": [ - "PRNG", - "cryptography", - "csprng", - "generator", - "integers", - "numbers", - "pseudo-random", - "pseudorandom", - "random", - "random-numbers", - "random-strings", - "strings" + "authors": [ + { + "name": "Cees-Jan Kiewiet", + "email": "ceesjank@gmail.com" + } ], + "description": "Package generation tool for OpenAPI Spec based packages", "support": { - "issues": "https://github.com/delight-im/PHP-Random/issues", - "source": "https://github.com/delight-im/PHP-Random/tree/v1.0.0" + "issues": "https://github.com/php-openapi-tools/generator/issues", + "source": "https://github.com/php-openapi-tools/generator/tree/0.1.0" }, - "time": "2019-11-19T23:07:00+00:00" + "funding": [ + { + "url": "https://github.com/WyriHaximus", + "type": "github" + } + ], + "time": "2026-08-25T17:28:02+00:00" }, { - "name": "devizzent/cebe-php-openapi", - "version": "1.0.1", + "name": "openapi-tools/generator-hydrator", + "version": "0.1.0", "source": { "type": "git", - "url": "https://github.com/DEVizzent/cebe-php-openapi.git", - "reference": "72b48264eaeb7afb01fae80e26e99243ab6d33f1" + "url": "https://github.com/php-openapi-tools/generator-hydrator.git", + "reference": "dbe285b9837514b0c0b2b1d34bd8d21d3bd8eb6f" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/DEVizzent/cebe-php-openapi/zipball/72b48264eaeb7afb01fae80e26e99243ab6d33f1", - "reference": "72b48264eaeb7afb01fae80e26e99243ab6d33f1", + "url": "https://api.github.com/repos/php-openapi-tools/generator-hydrator/zipball/dbe285b9837514b0c0b2b1d34bd8d21d3bd8eb6f", + "reference": "dbe285b9837514b0c0b2b1d34bd8d21d3bd8eb6f", "shasum": "" }, "require": { - "ext-json": "*", - "justinrainbow/json-schema": "^5.2", - "php": ">=7.1.0", - "symfony/yaml": "^3.4 || ^4 || ^5 || ^6" - }, - "conflict": { - "symfony/yaml": "3.4.0 - 3.4.4 || 4.0.0 - 4.4.17 || 5.0.0 - 5.1.9 || 5.2.0" + "eventsauce/object-hydrator": "^1.5", + "nikic/php-parser": "^5.0", + "openapi-tools/contract": "^0.1.0", + "openapi-tools/generator-utils": "^0.1.0", + "openapi-tools/representation": "^0.1.0", + "openapi-tools/utils": "^0.1.0", + "php": "^8.4" }, "require-dev": { - "apis-guru/openapi-directory": "1.0.0", - "cebe/indent": "*", - "mermade/openapi3-examples": "1.0.0", - "nexmo/api-specification": "1.0.0", - "oai/openapi-specification-3.0": "3.0.3", - "oai/openapi-specification-3.1": "3.1.0", - "phpstan/phpstan": "^0.12.0", - "phpunit/phpunit": "^6.5 || ^7.5 || ^8.5 || ^9.4" + "openapi-tools/configuration": "^0.1.0", + "openapi-tools/gatherer": "^0.1.0", + "openapi-tools/generator-schema": "^0.1.0", + "openapi-tools/test-data": "^0.1.0", + "wyrihaximus/async-test-utilities": "^13.5.1", + "wyrihaximus/makefiles": "^0.13.3" }, - "bin": [ - "bin/php-openapi" - ], "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.6.x-dev" - } - }, "autoload": { "psr-4": { - "cebe\\openapi\\": "src/" + "OpenAPITools\\Generator\\Hydrator\\": "src/" } }, "notification-url": "https://packagist.org/downloads/", @@ -1620,148 +1855,180 @@ ], "authors": [ { - "name": "Carsten Brandt", - "email": "mail@cebe.cc", - "homepage": "https://cebe.cc/", - "role": "Creator" - }, - { - "name": "Vicent Valls", - "email": "vizzent@gmail.com" + "name": "Cees-Jan Kiewiet", + "email": "ceesjank@gmail.com" } ], - "description": "Read and write OpenAPI yaml/json files and make the content accessable in PHP objects.", - "homepage": "https://github.com/DEVizzent/cebe-php-openapi#readme", - "keywords": [ - "openapi" + "description": "Object hydrator generator for OpenAPI Tools schema classes", + "support": { + "issues": "https://github.com/php-openapi-tools/generator-hydrator/issues", + "source": "https://github.com/php-openapi-tools/generator-hydrator/tree/0.1.0" + }, + "funding": [ + { + "url": "https://github.com/WyriHaximus", + "type": "github" + } ], - "support": { - "issues": "https://github.com/DEVizzent/cebe-php-openapi/issues", - "source": "https://github.com/DEVizzent/cebe-php-openapi" - }, - "time": "2023-07-12T09:00:33+00:00" + "time": "2026-08-25T16:51:28+00:00" }, { - "name": "dnoegel/php-xdg-base-dir", - "version": "v0.1.1", + "name": "openapi-tools/generator-psr-15-webhook-middleware", + "version": "dev-do-not-use-example-values-for-header-based-resolving", "source": { "type": "git", - "url": "https://github.com/dnoegel/php-xdg-base-dir.git", - "reference": "8f8a6e48c5ecb0f991c2fdcf5f154a47d85f9ffd" + "url": "https://github.com/php-openapi-tools/generator-psr-15-webhook-middleware.git", + "reference": "34604783d3249e11115cf51e5c005bbb84dede26" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/dnoegel/php-xdg-base-dir/zipball/8f8a6e48c5ecb0f991c2fdcf5f154a47d85f9ffd", - "reference": "8f8a6e48c5ecb0f991c2fdcf5f154a47d85f9ffd", + "url": "https://api.github.com/repos/php-openapi-tools/generator-psr-15-webhook-middleware/zipball/34604783d3249e11115cf51e5c005bbb84dede26", + "reference": "34604783d3249e11115cf51e5c005bbb84dede26", "shasum": "" }, "require": { - "php": ">=5.3.2" + "devizzent/cebe-php-openapi": "^1.1.5", + "ext-json": "^8.4", + "league/openapi-psr7-validator": "^0.21.0", + "nikic/php-parser": "^5.0", + "openapi-tools/contract": "^0.1.0", + "openapi-tools/generator-utils": "^0.1.0", + "openapi-tools/representation": "^0.1.0", + "openapi-tools/utils": "^0.1.0", + "php": "^8.4", + "psr/http-message": "^1 || ^2 || ^3", + "psr/http-server-handler": "^1 || ^2", + "psr/http-server-middleware": "^1.0" }, "require-dev": { - "phpunit/phpunit": "~7.0|~6.0|~5.0|~4.8.35" + "dantleech/docbot": "^0.3.0", + "openapi-tools/configuration": "^0.1.0", + "openapi-tools/gatherer": "^0.1.0", + "openapi-tools/test-data": "^0.1.0", + "wyrihaximus/async-test-utilities": "^14.1.0", + "wyrihaximus/makefiles": "^0.14.6" }, "type": "library", "autoload": { "psr-4": { - "XdgBaseDir\\": "src/" + "OpenAPITools\\Generator\\PSR15\\WebHook\\": "src/" } }, "notification-url": "https://packagist.org/downloads/", "license": [ "MIT" ], - "description": "implementation of xdg base directory specification for php", + "authors": [ + { + "name": "Cees-Jan Kiewiet", + "email": "ceesjank@gmail.com" + } + ], + "description": "PSR-15 WebHook Middleware generator", "support": { - "issues": "https://github.com/dnoegel/php-xdg-base-dir/issues", - "source": "https://github.com/dnoegel/php-xdg-base-dir/tree/v0.1.1" + "issues": "https://github.com/php-openapi-tools/generator-psr-15-webhook-middleware/issues", + "source": "https://github.com/php-openapi-tools/generator-psr-15-webhook-middleware/tree/do-not-use-example-values-for-header-based-resolving" }, - "time": "2019-12-04T15:06:13+00:00" + "funding": [ + { + "url": "https://github.com/WyriHaximus", + "type": "github" + } + ], + "time": "2026-08-27T17:58:40+00:00" }, { - "name": "doctrine/coding-standard", - "version": "12.0.0", + "name": "openapi-tools/generator-schema", + "version": "0.1.0", "source": { "type": "git", - "url": "https://github.com/doctrine/coding-standard.git", - "reference": "1b2b7dc58c68833af481fb9325c25abd40681c79" + "url": "https://github.com/php-openapi-tools/generator-schema.git", + "reference": "1d9e28449bbdda858972dc70e3739f697793c20c" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/doctrine/coding-standard/zipball/1b2b7dc58c68833af481fb9325c25abd40681c79", - "reference": "1b2b7dc58c68833af481fb9325c25abd40681c79", + "url": "https://api.github.com/repos/php-openapi-tools/generator-schema/zipball/1d9e28449bbdda858972dc70e3739f697793c20c", + "reference": "1d9e28449bbdda858972dc70e3739f697793c20c", "shasum": "" }, "require": { - "dealerdirect/phpcodesniffer-composer-installer": "^0.6.2 || ^0.7 || ^1.0.0", - "php": "^7.2 || ^8.0", - "slevomat/coding-standard": "^8.11", - "squizlabs/php_codesniffer": "^3.7" + "eventsauce/object-hydrator": "^1.5", + "ext-json": "^8.4", + "nikic/php-parser": "^5.0", + "openapi-tools/contract": "^0.1.0", + "openapi-tools/generator-utils": "^0.1.0", + "openapi-tools/representation": "^0.1.0", + "openapi-tools/utils": "^0.1.0", + "php": "^8.4" + }, + "require-dev": { + "openapi-tools/configuration": "^0.1.0", + "openapi-tools/gatherer": "^0.1.0", + "openapi-tools/test-data": "dev-main", + "wyrihaximus/async-test-utilities": "^13.5.1", + "wyrihaximus/makefiles": "^0.13.3" + }, + "type": "library", + "autoload": { + "psr-4": { + "OpenAPITools\\Generator\\Schema\\": "src/" + } }, - "type": "phpcodesniffer-standard", "notification-url": "https://packagist.org/downloads/", "license": [ "MIT" ], "authors": [ { - "name": "Benjamin Eberlei", - "email": "kontakt@beberlei.de" - }, - { - "name": "Steve Müller", - "email": "st.mueller@dzh-online.de" + "name": "Cees-Jan Kiewiet", + "email": "ceesjank@gmail.com" } ], - "description": "The Doctrine Coding Standard is a set of PHPCS rules applied to all Doctrine projects.", - "homepage": "https://www.doctrine-project.org/projects/coding-standard.html", - "keywords": [ - "checks", - "code", - "coding", - "cs", - "dev", - "doctrine", - "rules", - "sniffer", - "sniffs", - "standard", - "style" - ], + "description": "Schema (+ contract + error) generator", "support": { - "issues": "https://github.com/doctrine/coding-standard/issues", - "source": "https://github.com/doctrine/coding-standard/tree/12.0.0" + "issues": "https://github.com/php-openapi-tools/generator-schema/issues", + "source": "https://github.com/php-openapi-tools/generator-schema/tree/0.1.0" }, - "time": "2023-04-24T17:43:28+00:00" + "funding": [ + { + "url": "https://github.com/WyriHaximus", + "type": "github" + } + ], + "time": "2026-08-25T15:15:40+00:00" }, { - "name": "doctrine/collections", - "version": "1.8.0", + "name": "openapi-tools/generator-templates", + "version": "0.1.0", "source": { "type": "git", - "url": "https://github.com/doctrine/collections.git", - "reference": "2b44dd4cbca8b5744327de78bafef5945c7e7b5e" + "url": "https://github.com/php-openapi-tools/generator-templates.git", + "reference": "5c6d3370ff0eed8e00ff22f2976ec931d29bf78f" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/doctrine/collections/zipball/2b44dd4cbca8b5744327de78bafef5945c7e7b5e", - "reference": "2b44dd4cbca8b5744327de78bafef5945c7e7b5e", + "url": "https://api.github.com/repos/php-openapi-tools/generator-templates/zipball/5c6d3370ff0eed8e00ff22f2976ec931d29bf78f", + "reference": "5c6d3370ff0eed8e00ff22f2976ec931d29bf78f", "shasum": "" }, "require": { - "doctrine/deprecations": "^0.5.3 || ^1", - "php": "^7.1.3 || ^8.0" + "openapi-tools/contract": "^0.1.0", + "openapi-tools/representation": "^0.1.0", + "openapi-tools/utils": "^0.1.0", + "php": "^8.4", + "wyrihaximus/simple-twig": "^2.1" }, "require-dev": { - "doctrine/coding-standard": "^9.0 || ^10.0", - "phpstan/phpstan": "^1.4.8", - "phpunit/phpunit": "^7.5 || ^8.5 || ^9.1.5", - "vimeo/psalm": "^4.22" + "openapi-tools/configuration": "^0.1.0", + "openapi-tools/gatherer": "^0.1.0", + "openapi-tools/test-data": "dev-main", + "wyrihaximus/async-test-utilities": "^13.5.1", + "wyrihaximus/makefiles": "^0.13.3" }, "type": "library", "autoload": { "psr-4": { - "Doctrine\\Common\\Collections\\": "lib/Doctrine/Common/Collections" + "OpenAPITools\\Generator\\Templates\\": "src/" } }, "notification-url": "https://packagist.org/downloads/", @@ -1770,118 +2037,98 @@ ], "authors": [ { - "name": "Guilherme Blanco", - "email": "guilhermeblanco@gmail.com" - }, - { - "name": "Roman Borschel", - "email": "roman@code-factory.org" - }, - { - "name": "Benjamin Eberlei", - "email": "kontakt@beberlei.de" - }, - { - "name": "Jonathan Wage", - "email": "jonwage@gmail.com" - }, - { - "name": "Johannes Schmitt", - "email": "schmittjoh@gmail.com" + "name": "Cees-Jan Kiewiet", + "email": "ceesjank@gmail.com" } ], - "description": "PHP Doctrine Collections library that adds additional functionality on top of PHP arrays.", - "homepage": "https://www.doctrine-project.org/projects/collections.html", - "keywords": [ - "array", - "collections", - "iterators", - "php" - ], + "description": "Templates generator", "support": { - "issues": "https://github.com/doctrine/collections/issues", - "source": "https://github.com/doctrine/collections/tree/1.8.0" + "issues": "https://github.com/php-openapi-tools/generator-templates/issues", + "source": "https://github.com/php-openapi-tools/generator-templates/tree/0.1.0" }, - "time": "2022-09-01T20:12:10+00:00" + "funding": [ + { + "url": "https://github.com/WyriHaximus", + "type": "github" + } + ], + "time": "2026-08-25T16:18:22+00:00" }, { - "name": "doctrine/deprecations", - "version": "1.1.2", + "name": "openapi-tools/generator-utils", + "version": "0.1.0", "source": { "type": "git", - "url": "https://github.com/doctrine/deprecations.git", - "reference": "4f2d4f2836e7ec4e7a8625e75c6aa916004db931" + "url": "https://github.com/php-openapi-tools/generator-utils.git", + "reference": "176a3e5758f68bc9c87c09730d5d8171b2fdb24a" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/doctrine/deprecations/zipball/4f2d4f2836e7ec4e7a8625e75c6aa916004db931", - "reference": "4f2d4f2836e7ec4e7a8625e75c6aa916004db931", + "url": "https://api.github.com/repos/php-openapi-tools/generator-utils/zipball/176a3e5758f68bc9c87c09730d5d8171b2fdb24a", + "reference": "176a3e5758f68bc9c87c09730d5d8171b2fdb24a", "shasum": "" }, "require": { - "php": "^7.1 || ^8.0" + "nikic/php-parser": "^5.0", + "openapi-tools/representation": "^0.1.0", + "openapi-tools/utils": "^0.1.0", + "php": "^8.4" }, "require-dev": { - "doctrine/coding-standard": "^9", - "phpstan/phpstan": "1.4.10 || 1.10.15", - "phpstan/phpstan-phpunit": "^1.0", - "phpunit/phpunit": "^7.5 || ^8.5 || ^9.5", - "psalm/plugin-phpunit": "0.18.4", - "psr/log": "^1 || ^2 || ^3", - "vimeo/psalm": "4.30.0 || 5.12.0" - }, - "suggest": { - "psr/log": "Allows logging deprecations via PSR-3 logger implementation" + "wyrihaximus/async-test-utilities": "^13.5.1", + "wyrihaximus/makefiles": "^0.13.3" }, "type": "library", "autoload": { "psr-4": { - "Doctrine\\Deprecations\\": "lib/Doctrine/Deprecations" + "OpenAPITools\\Generator\\Utils\\": "src/" } }, "notification-url": "https://packagist.org/downloads/", "license": [ "MIT" ], - "description": "A small layer on top of trigger_error(E_USER_DEPRECATED) or PSR-3 logging with options to disable all deprecations or selectively for packages.", - "homepage": "https://www.doctrine-project.org/", + "authors": [ + { + "name": "Cees-Jan Kiewiet", + "email": "ceesjank@gmail.com" + } + ], + "description": "Shared PHP Parser utilities for OpenAPI Tools code generators", "support": { - "issues": "https://github.com/doctrine/deprecations/issues", - "source": "https://github.com/doctrine/deprecations/tree/1.1.2" + "issues": "https://github.com/php-openapi-tools/generator-utils/issues", + "source": "https://github.com/php-openapi-tools/generator-utils/tree/0.1.0" }, - "time": "2023-09-27T20:04:15+00:00" + "time": "2026-08-24T16:51:21+00:00" }, { - "name": "doctrine/instantiator", - "version": "2.0.0", + "name": "openapi-tools/registry", + "version": "0.1.0", "source": { "type": "git", - "url": "https://github.com/doctrine/instantiator.git", - "reference": "c6222283fa3f4ac679f8b9ced9a4e23f163e80d0" + "url": "https://github.com/php-openapi-tools/registry.git", + "reference": "c667a911273d7951e9dbb497f13ac219ee78c653" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/doctrine/instantiator/zipball/c6222283fa3f4ac679f8b9ced9a4e23f163e80d0", - "reference": "c6222283fa3f4ac679f8b9ced9a4e23f163e80d0", + "url": "https://api.github.com/repos/php-openapi-tools/registry/zipball/c667a911273d7951e9dbb497f13ac219ee78c653", + "reference": "c667a911273d7951e9dbb497f13ac219ee78c653", "shasum": "" }, "require": { - "php": "^8.1" + "devizzent/cebe-php-openapi": "^1", + "ext-json": "^8.4", + "openapi-tools/utils": "^0.1.0", + "php": "^8.4" }, "require-dev": { - "doctrine/coding-standard": "^11", - "ext-pdo": "*", - "ext-phar": "*", - "phpbench/phpbench": "^1.2", - "phpstan/phpstan": "^1.9.4", - "phpstan/phpstan-phpunit": "^1.3", - "phpunit/phpunit": "^9.5.27", - "vimeo/psalm": "^5.4" + "wyrihaximus/makefiles": "^0.13.3", + "wyrihaximus/test-utilities": "^13.5.1" }, "type": "library", "autoload": { "psr-4": { - "Doctrine\\Instantiator\\": "src/Doctrine/Instantiator/" + "OpenAPITools\\Registry\\": "src/" } }, "notification-url": "https://packagist.org/downloads/", @@ -1890,64 +2137,51 @@ ], "authors": [ { - "name": "Marco Pivetta", - "email": "ocramius@gmail.com", - "homepage": "https://ocramius.github.io/" + "name": "Cees-Jan Kiewiet", + "email": "ceesjank@gmail.com" } ], - "description": "A small, lightweight utility to instantiate objects in PHP without invoking their constructors", - "homepage": "https://www.doctrine-project.org/projects/instantiator.html", - "keywords": [ - "constructor", - "instantiate" - ], + "description": "Class Registries for OpenAPI Tools", "support": { - "issues": "https://github.com/doctrine/instantiator/issues", - "source": "https://github.com/doctrine/instantiator/tree/2.0.0" + "issues": "https://github.com/php-openapi-tools/registry/issues", + "source": "https://github.com/php-openapi-tools/registry/tree/0.1.0" }, "funding": [ { - "url": "https://www.doctrine-project.org/sponsorship.html", - "type": "custom" - }, - { - "url": "https://www.patreon.com/phpdoctrine", - "type": "patreon" - }, - { - "url": "https://tidelift.com/funding/github/packagist/doctrine%2Finstantiator", - "type": "tidelift" + "url": "https://github.com/WyriHaximus", + "type": "github" } ], - "time": "2022-12-30T00:23:10+00:00" + "time": "2026-08-24T20:34:38+00:00" }, { - "name": "doctrine/lexer", - "version": "1.2.3", + "name": "openapi-tools/representation", + "version": "0.1.0", "source": { "type": "git", - "url": "https://github.com/doctrine/lexer.git", - "reference": "c268e882d4dbdd85e36e4ad69e02dc284f89d229" + "url": "https://github.com/php-openapi-tools/representation.git", + "reference": "ff1eff7fbd01d7fb802e5685fd9ada5484a8f1f9" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/doctrine/lexer/zipball/c268e882d4dbdd85e36e4ad69e02dc284f89d229", - "reference": "c268e882d4dbdd85e36e4ad69e02dc284f89d229", + "url": "https://api.github.com/repos/php-openapi-tools/representation/zipball/ff1eff7fbd01d7fb802e5685fd9ada5484a8f1f9", + "reference": "ff1eff7fbd01d7fb802e5685fd9ada5484a8f1f9", "shasum": "" }, "require": { - "php": "^7.1 || ^8.0" + "devizzent/cebe-php-openapi": "^1", + "nikic/php-parser": "^5.8", + "openapi-tools/utils": "^0.1.0", + "php": "^8.4" }, "require-dev": { - "doctrine/coding-standard": "^9.0", - "phpstan/phpstan": "^1.3", - "phpunit/phpunit": "^7.5 || ^8.5 || ^9.5", - "vimeo/psalm": "^4.11" + "wyrihaximus/async-test-utilities": "^13.5.0", + "wyrihaximus/makefiles": "^0.13.3" }, "type": "library", "autoload": { "psr-4": { - "Doctrine\\Common\\Lexer\\": "lib/Doctrine/Common/Lexer" + "OpenAPITools\\Representation\\": "src/" } }, "notification-url": "https://packagist.org/downloads/", @@ -1956,96 +2190,51 @@ ], "authors": [ { - "name": "Guilherme Blanco", - "email": "guilhermeblanco@gmail.com" - }, - { - "name": "Roman Borschel", - "email": "roman@code-factory.org" - }, - { - "name": "Johannes Schmitt", - "email": "schmittjoh@gmail.com" + "name": "Cees-Jan Kiewiet", + "email": "ceesjank@gmail.com" } ], - "description": "PHP Doctrine Lexer parser library that can be used in Top-Down, Recursive Descent Parsers.", - "homepage": "https://www.doctrine-project.org/projects/lexer.html", - "keywords": [ - "annotations", - "docblock", - "lexer", - "parser", - "php" - ], + "description": "User friendly OpenAPI Spec representation", "support": { - "issues": "https://github.com/doctrine/lexer/issues", - "source": "https://github.com/doctrine/lexer/tree/1.2.3" + "issues": "https://github.com/php-openapi-tools/representation/issues", + "source": "https://github.com/php-openapi-tools/representation/tree/0.1.0" }, "funding": [ { - "url": "https://www.doctrine-project.org/sponsorship.html", - "type": "custom" - }, - { - "url": "https://www.patreon.com/phpdoctrine", - "type": "patreon" - }, - { - "url": "https://tidelift.com/funding/github/packagist/doctrine%2Flexer", - "type": "tidelift" + "url": "https://github.com/WyriHaximus", + "type": "github" } ], - "time": "2022-02-28T11:07:21+00:00" + "time": "2026-08-24T15:20:45+00:00" }, { - "name": "ergebnis/composer-normalize", - "version": "2.39.0", + "name": "openapi-tools/utils", + "version": "0.1.0", "source": { "type": "git", - "url": "https://github.com/ergebnis/composer-normalize.git", - "reference": "a878360bc8cb5cb440b9381f72b0aaa125f937c7" + "url": "https://github.com/php-openapi-tools/utils.git", + "reference": "4319f0ab40b73e2a19c382e1e7b0c428b834f9f1" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/ergebnis/composer-normalize/zipball/a878360bc8cb5cb440b9381f72b0aaa125f937c7", - "reference": "a878360bc8cb5cb440b9381f72b0aaa125f937c7", + "url": "https://api.github.com/repos/php-openapi-tools/utils/zipball/4319f0ab40b73e2a19c382e1e7b0c428b834f9f1", + "reference": "4319f0ab40b73e2a19c382e1e7b0c428b834f9f1", "shasum": "" }, "require": { - "composer-plugin-api": "^2.0.0", - "ergebnis/json": "^1.1.0", - "ergebnis/json-normalizer": "^4.3.0", - "ergebnis/json-printer": "^3.4.0", - "ext-json": "*", - "justinrainbow/json-schema": "^5.2.12", - "localheinz/diff": "^1.1.1", - "php": "~8.1.0 || ~8.2.0 || ~8.3.0" - }, - "require-dev": { - "composer/composer": "^2.6.5", - "ergebnis/license": "^2.2.0", - "ergebnis/php-cs-fixer-config": "~6.7.0", - "ergebnis/phpunit-slow-test-detector": "^2.3.0", - "fakerphp/faker": "^1.23.0", - "infection/infection": "~0.27.4", - "phpunit/phpunit": "^10.4.1", - "psalm/plugin-phpunit": "~0.18.4", - "rector/rector": "~0.18.5", - "symfony/filesystem": "^6.0.13", - "vimeo/psalm": "^5.15.0" + "eventsauce/object-hydrator": "^1.8.0", + "ext-json": "^8.4", + "jawira/case-converter": "^3.6.0", + "php": "^8.4" }, - "type": "composer-plugin", - "extra": { - "class": "Ergebnis\\Composer\\Normalize\\NormalizePlugin", - "composer-normalize": { - "indent-size": 2, - "indent-style": "space" - }, - "plugin-optional": true + "require-dev": { + "wyrihaximus/async-test-utilities": "^13.5.0", + "wyrihaximus/makefiles": "^0.13.3" }, + "type": "library", "autoload": { "psr-4": { - "Ergebnis\\Composer\\Normalize\\": "src/" + "OpenAPITools\\Utils\\": "src/" } }, "notification-url": "https://packagist.org/downloads/", @@ -2054,66 +2243,96 @@ ], "authors": [ { - "name": "Andreas Möller", - "email": "am@localheinz.com", - "homepage": "https://localheinz.com" + "name": "Cees-Jan Kiewiet", + "email": "ceesjank@gmail.com" } ], - "description": "Provides a composer plugin for normalizing composer.json.", - "homepage": "https://github.com/ergebnis/composer-normalize", - "keywords": [ - "composer", - "normalize", - "normalizer", - "plugin" + "description": "Utils for OpenAPI Tools", + "support": { + "issues": "https://github.com/php-openapi-tools/utils/issues", + "source": "https://github.com/php-openapi-tools/utils/tree/0.1.0" + }, + "funding": [ + { + "url": "https://github.com/WyriHaximus", + "type": "github" + } + ], + "time": "2026-08-24T05:41:26+00:00" + }, + { + "name": "phpstan/phpdoc-parser", + "version": "2.3.3", + "source": { + "type": "git", + "url": "https://github.com/phpstan/phpdoc-parser.git", + "reference": "fb19eedd2bb67ff8cf7a5502ad329e701d6398a3" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/phpstan/phpdoc-parser/zipball/fb19eedd2bb67ff8cf7a5502ad329e701d6398a3", + "reference": "fb19eedd2bb67ff8cf7a5502ad329e701d6398a3", + "shasum": "" + }, + "require": { + "php": "^7.4 || ^8.0" + }, + "require-dev": { + "doctrine/annotations": "^2.0", + "nikic/php-parser": "^5.3.0", + "php-parallel-lint/php-parallel-lint": "^1.2", + "phpstan/extension-installer": "^1.0", + "phpstan/phpstan": "^2.0", + "phpstan/phpstan-phpunit": "^2.0", + "phpstan/phpstan-strict-rules": "^2.0", + "phpunit/phpunit": "^9.6", + "symfony/process": "^5.2" + }, + "type": "library", + "autoload": { + "psr-4": { + "PHPStan\\PhpDocParser\\": [ + "src/" + ] + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" ], + "description": "PHPDoc parser with support for nullable, intersection and generic types", "support": { - "issues": "https://github.com/ergebnis/composer-normalize/issues", - "security": "https://github.com/ergebnis/composer-normalize/blob/main/.github/SECURITY.md", - "source": "https://github.com/ergebnis/composer-normalize" + "issues": "https://github.com/phpstan/phpdoc-parser/issues", + "source": "https://github.com/phpstan/phpdoc-parser/tree/2.3.3" }, - "time": "2023-10-10T15:43:27+00:00" + "time": "2026-07-08T07:01:06+00:00" }, { - "name": "ergebnis/json", - "version": "1.1.0", + "name": "psr/cache", + "version": "3.0.0", "source": { "type": "git", - "url": "https://github.com/ergebnis/json.git", - "reference": "9f2b9086c43b189d7044a5b6215a931fb6e9125d" + "url": "https://github.com/php-fig/cache.git", + "reference": "aa5030cfa5405eccfdcb1083ce040c2cb8d253bf" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/ergebnis/json/zipball/9f2b9086c43b189d7044a5b6215a931fb6e9125d", - "reference": "9f2b9086c43b189d7044a5b6215a931fb6e9125d", + "url": "https://api.github.com/repos/php-fig/cache/zipball/aa5030cfa5405eccfdcb1083ce040c2cb8d253bf", + "reference": "aa5030cfa5405eccfdcb1083ce040c2cb8d253bf", "shasum": "" }, "require": { - "php": "~8.1.0 || ~8.2.0 || ~8.3.0" - }, - "require-dev": { - "ergebnis/composer-normalize": "^2.29.0", - "ergebnis/data-provider": "^3.0.0", - "ergebnis/license": "^2.2.0", - "ergebnis/php-cs-fixer-config": "^6.6.0", - "ergebnis/phpunit-slow-test-detector": "^2.3.0", - "fakerphp/faker": "^1.23.0", - "infection/infection": "~0.27.4", - "phpunit/phpunit": "^10.4.1", - "psalm/plugin-phpunit": "~0.18.4", - "rector/rector": "~0.18.5", - "vimeo/psalm": "^5.15.0" + "php": ">=8.0.0" }, "type": "library", "extra": { - "composer-normalize": { - "indent-size": 2, - "indent-style": "space" + "branch-alias": { + "dev-master": "1.0.x-dev" } }, "autoload": { "psr-4": { - "Ergebnis\\Json\\": "src/" + "Psr\\Cache\\": "src/" } }, "notification-url": "https://packagist.org/downloads/", @@ -2122,68 +2341,47 @@ ], "authors": [ { - "name": "Andreas Möller", - "email": "am@localheinz.com", - "homepage": "https://localheinz.com" + "name": "PHP-FIG", + "homepage": "https://www.php-fig.org/" } ], - "description": "Provides a Json value object for representing a valid JSON string.", - "homepage": "https://github.com/ergebnis/json", + "description": "Common interface for caching libraries", "keywords": [ - "json" + "cache", + "psr", + "psr-6" ], "support": { - "issues": "https://github.com/ergebnis/json/issues", - "security": "https://github.com/ergebnis/json/blob/main/.github/SECURITY.md", - "source": "https://github.com/ergebnis/json" + "source": "https://github.com/php-fig/cache/tree/3.0.0" }, - "time": "2023-10-10T07:57:48+00:00" + "time": "2021-02-03T23:26:27+00:00" }, { - "name": "ergebnis/json-normalizer", - "version": "4.3.0", + "name": "psr/container", + "version": "2.0.2", "source": { "type": "git", - "url": "https://github.com/ergebnis/json-normalizer.git", - "reference": "716fa0a5dcc75fbcb2c1c2e0542b2f56732460bd" + "url": "https://github.com/php-fig/container.git", + "reference": "c71ecc56dfe541dbd90c5360474fbc405f8d5963" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/ergebnis/json-normalizer/zipball/716fa0a5dcc75fbcb2c1c2e0542b2f56732460bd", - "reference": "716fa0a5dcc75fbcb2c1c2e0542b2f56732460bd", + "url": "https://api.github.com/repos/php-fig/container/zipball/c71ecc56dfe541dbd90c5360474fbc405f8d5963", + "reference": "c71ecc56dfe541dbd90c5360474fbc405f8d5963", "shasum": "" }, "require": { - "ergebnis/json": "^1.1.0", - "ergebnis/json-pointer": "^3.2.0", - "ergebnis/json-printer": "^3.4.0", - "ergebnis/json-schema-validator": "^4.1.0", - "ext-json": "*", - "justinrainbow/json-schema": "^5.2.12", - "php": "~8.1.0 || ~8.2.0 || ~8.3.0" - }, - "require-dev": { - "composer/semver": "^3.4.0", - "ergebnis/data-provider": "^3.0.0", - "ergebnis/license": "^2.2.0", - "ergebnis/php-cs-fixer-config": "~6.7.0", - "ergebnis/phpunit-slow-test-detector": "^2.3.0", - "fakerphp/faker": "^1.23.0", - "infection/infection": "~0.27.4", - "phpunit/phpunit": "^10.4.1", - "psalm/plugin-phpunit": "~0.18.4", - "rector/rector": "~0.18.5", - "symfony/filesystem": "^6.3.1", - "symfony/finder": "^6.3.5", - "vimeo/psalm": "^5.15.0" - }, - "suggest": { - "composer/semver": "If you want to use ComposerJsonNormalizer or VersionConstraintNormalizer" + "php": ">=7.4.0" }, "type": "library", + "extra": { + "branch-alias": { + "dev-master": "2.0.x-dev" + } + }, "autoload": { "psr-4": { - "Ergebnis\\Json\\Normalizer\\": "src/" + "Psr\\Container\\": "src/" } }, "notification-url": "https://packagist.org/downloads/", @@ -2192,64 +2390,51 @@ ], "authors": [ { - "name": "Andreas Möller", - "email": "am@localheinz.com", - "homepage": "https://localheinz.com" + "name": "PHP-FIG", + "homepage": "https://www.php-fig.org/" } ], - "description": "Provides generic and vendor-specific normalizers for normalizing JSON documents.", - "homepage": "https://github.com/ergebnis/json-normalizer", + "description": "Common Container Interface (PHP FIG PSR-11)", + "homepage": "https://github.com/php-fig/container", "keywords": [ - "json", - "normalizer" + "PSR-11", + "container", + "container-interface", + "container-interop", + "psr" ], "support": { - "issues": "https://github.com/ergebnis/json-normalizer/issues", - "security": "https://github.com/ergebnis/json-normalizer/blob/main/.github/SECURITY.md", - "source": "https://github.com/ergebnis/json-normalizer" + "issues": "https://github.com/php-fig/container/issues", + "source": "https://github.com/php-fig/container/tree/2.0.2" }, - "time": "2023-10-10T15:15:03+00:00" + "time": "2021-11-05T16:47:00+00:00" }, { - "name": "ergebnis/json-pointer", - "version": "3.3.0", + "name": "psr/http-message", + "version": "1.1", "source": { "type": "git", - "url": "https://github.com/ergebnis/json-pointer.git", - "reference": "8e517faefc06b7c761eaa041febef51a9375819a" + "url": "https://github.com/php-fig/http-message.git", + "reference": "cb6ce4845ce34a8ad9e68117c10ee90a29919eba" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/ergebnis/json-pointer/zipball/8e517faefc06b7c761eaa041febef51a9375819a", - "reference": "8e517faefc06b7c761eaa041febef51a9375819a", + "url": "https://api.github.com/repos/php-fig/http-message/zipball/cb6ce4845ce34a8ad9e68117c10ee90a29919eba", + "reference": "cb6ce4845ce34a8ad9e68117c10ee90a29919eba", "shasum": "" }, "require": { - "php": "~8.1.0 || ~8.2.0 || ~8.3.0" - }, - "require-dev": { - "ergebnis/composer-normalize": "^2.29.0", - "ergebnis/data-provider": "^3.0.0", - "ergebnis/license": "^2.2.0", - "ergebnis/php-cs-fixer-config": "~6.7.0", - "ergebnis/phpunit-slow-test-detector": "^2.3.0", - "fakerphp/faker": "^1.23.0", - "infection/infection": "~0.27.4", - "phpunit/phpunit": "^10.4.1", - "psalm/plugin-phpunit": "~0.18.4", - "rector/rector": "~0.18.5", - "vimeo/psalm": "^5.15.0" + "php": "^7.2 || ^8.0" }, "type": "library", "extra": { - "composer-normalize": { - "indent-size": 2, - "indent-style": "space" + "branch-alias": { + "dev-master": "1.1.x-dev" } }, "autoload": { "psr-4": { - "Ergebnis\\Json\\Pointer\\": "src/" + "Psr\\Http\\Message\\": "src/" } }, "notification-url": "https://packagist.org/downloads/", @@ -2258,59 +2443,52 @@ ], "authors": [ { - "name": "Andreas Möller", - "email": "am@localheinz.com", - "homepage": "https://localheinz.com" + "name": "PHP-FIG", + "homepage": "http://www.php-fig.org/" } ], - "description": "Provides JSON pointer as a value object.", - "homepage": "https://github.com/ergebnis/json-pointer", + "description": "Common interface for HTTP messages", + "homepage": "https://github.com/php-fig/http-message", "keywords": [ - "RFC6901", - "json", - "pointer" + "http", + "http-message", + "psr", + "psr-7", + "request", + "response" ], "support": { - "issues": "https://github.com/ergebnis/json-pointer/issues", - "security": "https://github.com/ergebnis/json-pointer/blob/main/.github/SECURITY.md", - "source": "https://github.com/ergebnis/json-pointer" + "source": "https://github.com/php-fig/http-message/tree/1.1" }, - "time": "2023-10-10T14:41:06+00:00" + "time": "2023-04-04T09:50:52+00:00" }, { - "name": "ergebnis/json-printer", - "version": "3.4.0", + "name": "psr/http-server-handler", + "version": "1.0.2", "source": { "type": "git", - "url": "https://github.com/ergebnis/json-printer.git", - "reference": "05841593d72499de4f7ce4034a237c77e470558f" + "url": "https://github.com/php-fig/http-server-handler.git", + "reference": "84c4fb66179be4caaf8e97bd239203245302e7d4" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/ergebnis/json-printer/zipball/05841593d72499de4f7ce4034a237c77e470558f", - "reference": "05841593d72499de4f7ce4034a237c77e470558f", + "url": "https://api.github.com/repos/php-fig/http-server-handler/zipball/84c4fb66179be4caaf8e97bd239203245302e7d4", + "reference": "84c4fb66179be4caaf8e97bd239203245302e7d4", "shasum": "" }, "require": { - "ext-json": "*", - "ext-mbstring": "*", - "php": "~8.1.0 || ~8.2.0 || ~8.3.0" - }, - "require-dev": { - "ergebnis/license": "^2.2.0", - "ergebnis/php-cs-fixer-config": "^6.6.0", - "ergebnis/phpunit-slow-test-detector": "^2.3.0", - "fakerphp/faker": "^1.23.0", - "infection/infection": "~0.27.3", - "phpunit/phpunit": "^10.4.1", - "psalm/plugin-phpunit": "~0.18.4", - "rector/rector": "~0.18.5", - "vimeo/psalm": "^5.15.0" + "php": ">=7.0", + "psr/http-message": "^1.0 || ^2.0" }, "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.0.x-dev" + } + }, "autoload": { "psr-4": { - "Ergebnis\\Json\\Printer\\": "src/" + "Psr\\Http\\Server\\": "src/" } }, "notification-url": "https://packagist.org/downloads/", @@ -2319,69 +2497,55 @@ ], "authors": [ { - "name": "Andreas Möller", - "email": "am@localheinz.com", - "homepage": "https://localheinz.com" + "name": "PHP-FIG", + "homepage": "https://www.php-fig.org/" } ], - "description": "Provides a JSON printer, allowing for flexible indentation.", - "homepage": "https://github.com/ergebnis/json-printer", + "description": "Common interface for HTTP server-side request handler", "keywords": [ - "formatter", - "json", - "printer" + "handler", + "http", + "http-interop", + "psr", + "psr-15", + "psr-7", + "request", + "response", + "server" ], "support": { - "issues": "https://github.com/ergebnis/json-printer/issues", - "security": "https://github.com/ergebnis/json-printer/blob/main/.github/SECURITY.md", - "source": "https://github.com/ergebnis/json-printer" + "source": "https://github.com/php-fig/http-server-handler/tree/1.0.2" }, - "time": "2023-10-10T07:42:48+00:00" + "time": "2023-04-10T20:06:20+00:00" }, { - "name": "ergebnis/json-schema-validator", - "version": "4.1.0", + "name": "psr/http-server-middleware", + "version": "1.0.2", "source": { "type": "git", - "url": "https://github.com/ergebnis/json-schema-validator.git", - "reference": "d568ed85d1cdc2e49d650c2fc234dc2516f3f25b" + "url": "https://github.com/php-fig/http-server-middleware.git", + "reference": "c1481f747daaa6a0782775cd6a8c26a1bf4a3829" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/ergebnis/json-schema-validator/zipball/d568ed85d1cdc2e49d650c2fc234dc2516f3f25b", - "reference": "d568ed85d1cdc2e49d650c2fc234dc2516f3f25b", + "url": "https://api.github.com/repos/php-fig/http-server-middleware/zipball/c1481f747daaa6a0782775cd6a8c26a1bf4a3829", + "reference": "c1481f747daaa6a0782775cd6a8c26a1bf4a3829", "shasum": "" }, "require": { - "ergebnis/json": "^1.0.1", - "ergebnis/json-pointer": "^3.2.0", - "ext-json": "*", - "justinrainbow/json-schema": "^5.2.12", - "php": "~8.1.0 || ~8.2.0 || ~8.3.0" - }, - "require-dev": { - "ergebnis/composer-normalize": "^2.21.0", - "ergebnis/data-provider": "^3.0.0", - "ergebnis/license": "^2.2.0", - "ergebnis/php-cs-fixer-config": "~6.6.0", - "ergebnis/phpunit-slow-test-detector": "^2.3.0", - "fakerphp/faker": "^1.23.0", - "infection/infection": "~0.27.4", - "phpunit/phpunit": "^10.4.1", - "psalm/plugin-phpunit": "~0.18.4", - "rector/rector": "~0.18.5", - "vimeo/psalm": "^5.15.0" + "php": ">=7.0", + "psr/http-message": "^1.0 || ^2.0", + "psr/http-server-handler": "^1.0" }, "type": "library", "extra": { - "composer-normalize": { - "indent-size": 2, - "indent-style": "space" + "branch-alias": { + "dev-master": "1.0.x-dev" } }, "autoload": { "psr-4": { - "Ergebnis\\Json\\SchemaValidator\\": "src/" + "Psr\\Http\\Server\\": "src/" } }, "notification-url": "https://packagist.org/downloads/", @@ -2390,72 +2554,57 @@ ], "authors": [ { - "name": "Andreas Möller", - "email": "am@localheinz.com", - "homepage": "https://localheinz.com" + "name": "PHP-FIG", + "homepage": "https://www.php-fig.org/" } ], - "description": "Provides a JSON schema validator, building on top of justinrainbow/json-schema.", - "homepage": "https://github.com/ergebnis/json-schema-validator", + "description": "Common interface for HTTP server-side middleware", "keywords": [ - "json", - "schema", - "validator" + "http", + "http-interop", + "middleware", + "psr", + "psr-15", + "psr-7", + "request", + "response" ], "support": { - "issues": "https://github.com/ergebnis/json-schema-validator/issues", - "security": "https://github.com/ergebnis/json-schema-validator/blob/main/.github/SECURITY.md", - "source": "https://github.com/ergebnis/json-schema-validator" + "issues": "https://github.com/php-fig/http-server-middleware/issues", + "source": "https://github.com/php-fig/http-server-middleware/tree/1.0.2" }, - "time": "2023-10-10T14:16:57+00:00" + "time": "2023-04-11T06:14:47+00:00" }, { - "name": "ergebnis/phpstan-rules", - "version": "2.1.0", + "name": "react/async", + "version": "v4.3.0", "source": { "type": "git", - "url": "https://github.com/ergebnis/phpstan-rules.git", - "reference": "119e229c48688946450ccca9f1c57c9ca4fb6f02" + "url": "https://github.com/reactphp/async.git", + "reference": "635d50e30844a484495713e8cb8d9e079c0008a5" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/ergebnis/phpstan-rules/zipball/119e229c48688946450ccca9f1c57c9ca4fb6f02", - "reference": "119e229c48688946450ccca9f1c57c9ca4fb6f02", + "url": "https://api.github.com/repos/reactphp/async/zipball/635d50e30844a484495713e8cb8d9e079c0008a5", + "reference": "635d50e30844a484495713e8cb8d9e079c0008a5", "shasum": "" }, "require": { - "ext-mbstring": "*", - "nikic/php-parser": "^4.2.3", - "php": "~8.1.0 || ~8.2.0 || ~8.3.0", - "phpstan/phpstan": "^1.10.21" - }, - "require-dev": { - "doctrine/orm": "^2.16.1", - "ergebnis/composer-normalize": "^2.35.0", - "ergebnis/license": "^2.1.0", - "ergebnis/php-cs-fixer-config": "^5.13.0", - "ergebnis/phpunit-slow-test-detector": "^2.3.0", - "infection/infection": "~0.27.0", - "nette/di": "^3.1.3", - "phpstan/phpstan-deprecation-rules": "^1.1.4", - "phpstan/phpstan-strict-rules": "^1.1.0", - "phpunit/phpunit": "^10.3.2", - "psalm/plugin-phpunit": "~0.18.4", - "psr/container": "^1.1.2", - "rector/rector": "~0.17.13", - "vimeo/psalm": "^5.14.1" + "php": ">=8.1", + "react/event-loop": "^1.2", + "react/promise": "^3.2 || ^2.8 || ^1.2.1" }, - "type": "phpstan-extension", - "extra": { - "phpstan": { - "includes": [ - "rules.neon" - ] - } + "require-dev": { + "phpstan/phpstan": "1.10.39", + "phpunit/phpunit": "^9.6" }, + "type": "library", "autoload": { + "files": [ + "src/functions_include.php" + ], "psr-4": { - "Ergebnis\\PHPStan\\Rules\\": "src/" + "React\\Async\\": "src/" } }, "notification-url": "https://packagist.org/downloads/", @@ -2464,47 +2613,68 @@ ], "authors": [ { - "name": "Andreas Möller", - "email": "am@localheinz.com" + "name": "Christian Lück", + "email": "christian@clue.engineering", + "homepage": "https://clue.engineering/" + }, + { + "name": "Cees-Jan Kiewiet", + "email": "reactphp@ceesjankiewiet.nl", + "homepage": "https://wyrihaximus.net/" + }, + { + "name": "Jan Sorgalla", + "email": "jsorgalla@gmail.com", + "homepage": "https://sorgalla.com/" + }, + { + "name": "Chris Boden", + "email": "cboden@gmail.com", + "homepage": "https://cboden.dev/" } ], - "description": "Provides additional rules for phpstan/phpstan.", - "homepage": "https://github.com/ergebnis/phpstan-rules", + "description": "Async utilities and fibers for ReactPHP", "keywords": [ - "PHPStan", - "phpstan-extreme-rules", - "phpstan-rules" + "async", + "reactphp" ], "support": { - "issues": "https://github.com/ergebnis/phpstan-rules/issues", - "source": "https://github.com/ergebnis/phpstan-rules" + "issues": "https://github.com/reactphp/async/issues", + "source": "https://github.com/reactphp/async/tree/v4.3.0" }, - "time": "2023-08-17T10:28:37+00:00" + "funding": [ + { + "url": "https://opencollective.com/reactphp", + "type": "open_collective" + } + ], + "time": "2024-06-04T14:40:02+00:00" }, { - "name": "evenement/evenement", - "version": "v3.0.2", + "name": "react/cache", + "version": "v1.2.0", "source": { "type": "git", - "url": "https://github.com/igorw/evenement.git", - "reference": "0a16b0d71ab13284339abb99d9d2bd813640efbc" + "url": "https://github.com/reactphp/cache.git", + "reference": "d47c472b64aa5608225f47965a484b75c7817d5b" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/igorw/evenement/zipball/0a16b0d71ab13284339abb99d9d2bd813640efbc", - "reference": "0a16b0d71ab13284339abb99d9d2bd813640efbc", + "url": "https://api.github.com/repos/reactphp/cache/zipball/d47c472b64aa5608225f47965a484b75c7817d5b", + "reference": "d47c472b64aa5608225f47965a484b75c7817d5b", "shasum": "" }, "require": { - "php": ">=7.0" + "php": ">=5.3.0", + "react/promise": "^3.0 || ^2.0 || ^1.1" }, "require-dev": { - "phpunit/phpunit": "^9 || ^6" + "phpunit/phpunit": "^9.5 || ^5.7 || ^4.8.35" }, "type": "library", "autoload": { "psr-4": { - "Evenement\\": "src/" + "React\\Cache\\": "src/" } }, "notification-url": "https://packagist.org/downloads/", @@ -2513,54 +2683,74 @@ ], "authors": [ { - "name": "Igor Wiedler", - "email": "igor@wiedler.ch" + "name": "Christian Lück", + "email": "christian@clue.engineering", + "homepage": "https://clue.engineering/" + }, + { + "name": "Cees-Jan Kiewiet", + "email": "reactphp@ceesjankiewiet.nl", + "homepage": "https://wyrihaximus.net/" + }, + { + "name": "Jan Sorgalla", + "email": "jsorgalla@gmail.com", + "homepage": "https://sorgalla.com/" + }, + { + "name": "Chris Boden", + "email": "cboden@gmail.com", + "homepage": "https://cboden.dev/" } ], - "description": "Événement is a very simple event dispatching library for PHP", + "description": "Async, Promise-based cache interface for ReactPHP", "keywords": [ - "event-dispatcher", - "event-emitter" + "cache", + "caching", + "promise", + "reactphp" ], "support": { - "issues": "https://github.com/igorw/evenement/issues", - "source": "https://github.com/igorw/evenement/tree/v3.0.2" + "issues": "https://github.com/reactphp/cache/issues", + "source": "https://github.com/reactphp/cache/tree/v1.2.0" }, - "time": "2023-08-08T05:53:35+00:00" + "funding": [ + { + "url": "https://opencollective.com/reactphp", + "type": "open_collective" + } + ], + "time": "2022-11-30T15:59:55+00:00" }, { - "name": "eventsauce/object-hydrator", - "version": "1.4.0", + "name": "react/dns", + "version": "v1.14.0", "source": { "type": "git", - "url": "https://github.com/EventSaucePHP/ObjectHydrator.git", - "reference": "743ee4524d1a3d7b381ef9f61afcb18e0cc81cb0" + "url": "https://github.com/reactphp/dns.git", + "reference": "7562c05391f42701c1fccf189c8225fece1cd7c3" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/EventSaucePHP/ObjectHydrator/zipball/743ee4524d1a3d7b381ef9f61afcb18e0cc81cb0", - "reference": "743ee4524d1a3d7b381ef9f61afcb18e0cc81cb0", + "url": "https://api.github.com/repos/reactphp/dns/zipball/7562c05391f42701c1fccf189c8225fece1cd7c3", + "reference": "7562c05391f42701c1fccf189c8225fece1cd7c3", "shasum": "" }, "require": { - "ext-fileinfo": "*", - "php": "^8.0" + "php": ">=5.3.0", + "react/cache": "^1.0 || ^0.6 || ^0.5", + "react/event-loop": "^1.2", + "react/promise": "^3.2 || ^2.7 || ^1.2.1" }, "require-dev": { - "friendsofphp/php-cs-fixer": "^3.4", - "league/construct-finder": "^1.1", - "phpbench/phpbench": "^1.2", - "phpstan/phpstan": "^1.7", - "phpunit/phpunit": "^9.5.11", - "ramsey/uuid": "^4.2" - }, - "suggest": { - "league/construct-finder": "Find all classes in a directory for the best dumped hydrators." + "phpunit/phpunit": "^9.6 || ^5.7 || ^4.8.36", + "react/async": "^4.3 || ^3 || ^2", + "react/promise-timer": "^1.11" }, "type": "library", "autoload": { "psr-4": { - "EventSauce\\ObjectHydrator\\": "src/" + "React\\Dns\\": "src/" } }, "notification-url": "https://packagist.org/downloads/", @@ -2569,162 +2759,236 @@ ], "authors": [ { - "name": "Frank de Jonge", - "email": "info@frankdejonge.nl" + "name": "Christian Lück", + "email": "christian@clue.engineering", + "homepage": "https://clue.engineering/" + }, + { + "name": "Cees-Jan Kiewiet", + "email": "reactphp@ceesjankiewiet.nl", + "homepage": "https://wyrihaximus.net/" + }, + { + "name": "Jan Sorgalla", + "email": "jsorgalla@gmail.com", + "homepage": "https://sorgalla.com/" + }, + { + "name": "Chris Boden", + "email": "cboden@gmail.com", + "homepage": "https://cboden.dev/" } ], - "description": "Converts structured data into strict objects.", + "description": "Async DNS resolver for ReactPHP", "keywords": [ - "construction", - "constructor", - "hydration", - "mapper" + "async", + "dns", + "dns-resolver", + "reactphp" ], "support": { - "issues": "https://github.com/EventSaucePHP/ObjectHydrator/issues", - "source": "https://github.com/EventSaucePHP/ObjectHydrator/tree/1.4.0" + "issues": "https://github.com/reactphp/dns/issues", + "source": "https://github.com/reactphp/dns/tree/v1.14.0" }, "funding": [ { - "url": "https://github.com/frankdejonge", - "type": "github" + "url": "https://opencollective.com/reactphp", + "type": "open_collective" } ], - "time": "2023-08-03T07:27:58+00:00" + "time": "2025-11-18T19:34:28+00:00" }, { - "name": "felixfbecker/advanced-json-rpc", - "version": "v3.2.1", + "name": "react/event-loop", + "version": "v1.6.0", "source": { "type": "git", - "url": "https://github.com/felixfbecker/php-advanced-json-rpc.git", - "reference": "b5f37dbff9a8ad360ca341f3240dc1c168b45447" + "url": "https://github.com/reactphp/event-loop.git", + "reference": "ba276bda6083df7e0050fd9b33f66ad7a4ac747a" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/felixfbecker/php-advanced-json-rpc/zipball/b5f37dbff9a8ad360ca341f3240dc1c168b45447", - "reference": "b5f37dbff9a8ad360ca341f3240dc1c168b45447", + "url": "https://api.github.com/repos/reactphp/event-loop/zipball/ba276bda6083df7e0050fd9b33f66ad7a4ac747a", + "reference": "ba276bda6083df7e0050fd9b33f66ad7a4ac747a", "shasum": "" }, "require": { - "netresearch/jsonmapper": "^1.0 || ^2.0 || ^3.0 || ^4.0", - "php": "^7.1 || ^8.0", - "phpdocumentor/reflection-docblock": "^4.3.4 || ^5.0.0" + "php": ">=5.3.0" }, "require-dev": { - "phpunit/phpunit": "^7.0 || ^8.0" + "phpunit/phpunit": "^9.6 || ^5.7 || ^4.8.36" + }, + "suggest": { + "ext-pcntl": "For signal handling support when using the StreamSelectLoop" }, "type": "library", "autoload": { "psr-4": { - "AdvancedJsonRpc\\": "lib/" + "React\\EventLoop\\": "src/" } }, "notification-url": "https://packagist.org/downloads/", "license": [ - "ISC" + "MIT" ], "authors": [ { - "name": "Felix Becker", - "email": "felix.b@outlook.com" + "name": "Christian Lück", + "email": "christian@clue.engineering", + "homepage": "https://clue.engineering/" + }, + { + "name": "Cees-Jan Kiewiet", + "email": "reactphp@ceesjankiewiet.nl", + "homepage": "https://wyrihaximus.net/" + }, + { + "name": "Jan Sorgalla", + "email": "jsorgalla@gmail.com", + "homepage": "https://sorgalla.com/" + }, + { + "name": "Chris Boden", + "email": "cboden@gmail.com", + "homepage": "https://cboden.dev/" } ], - "description": "A more advanced JSONRPC implementation", + "description": "ReactPHP's core reactor event loop that libraries can use for evented I/O.", + "keywords": [ + "asynchronous", + "event-loop" + ], "support": { - "issues": "https://github.com/felixfbecker/php-advanced-json-rpc/issues", - "source": "https://github.com/felixfbecker/php-advanced-json-rpc/tree/v3.2.1" + "issues": "https://github.com/reactphp/event-loop/issues", + "source": "https://github.com/reactphp/event-loop/tree/v1.6.0" }, - "time": "2021-06-11T22:34:44+00:00" + "funding": [ + { + "url": "https://opencollective.com/reactphp", + "type": "open_collective" + } + ], + "time": "2025-11-17T20:46:25+00:00" }, { - "name": "felixfbecker/language-server-protocol", - "version": "v1.5.2", + "name": "react/http", + "version": "v1.11.0", "source": { "type": "git", - "url": "https://github.com/felixfbecker/php-language-server-protocol.git", - "reference": "6e82196ffd7c62f7794d778ca52b69feec9f2842" + "url": "https://github.com/reactphp/http.git", + "reference": "8db02de41dcca82037367f67a2d4be365b1c4db9" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/felixfbecker/php-language-server-protocol/zipball/6e82196ffd7c62f7794d778ca52b69feec9f2842", - "reference": "6e82196ffd7c62f7794d778ca52b69feec9f2842", + "url": "https://api.github.com/repos/reactphp/http/zipball/8db02de41dcca82037367f67a2d4be365b1c4db9", + "reference": "8db02de41dcca82037367f67a2d4be365b1c4db9", "shasum": "" }, "require": { - "php": ">=7.1" + "evenement/evenement": "^3.0 || ^2.0 || ^1.0", + "fig/http-message-util": "^1.1", + "php": ">=5.3.0", + "psr/http-message": "^1.0", + "react/event-loop": "^1.2", + "react/promise": "^3.2 || ^2.3 || ^1.2.1", + "react/socket": "^1.16", + "react/stream": "^1.4" }, "require-dev": { - "phpstan/phpstan": "*", - "squizlabs/php_codesniffer": "^3.1", - "vimeo/psalm": "^4.0" + "clue/http-proxy-react": "^1.8", + "clue/reactphp-ssh-proxy": "^1.4", + "clue/socks-react": "^1.4", + "phpunit/phpunit": "^9.6 || ^5.7 || ^4.8.36", + "react/async": "^4.2 || ^3 || ^2", + "react/promise-stream": "^1.4", + "react/promise-timer": "^1.11" }, "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.x-dev" - } - }, "autoload": { "psr-4": { - "LanguageServerProtocol\\": "src/" + "React\\Http\\": "src/" } }, "notification-url": "https://packagist.org/downloads/", "license": [ - "ISC" + "MIT" ], "authors": [ { - "name": "Felix Becker", - "email": "felix.b@outlook.com" + "name": "Christian Lück", + "email": "christian@clue.engineering", + "homepage": "https://clue.engineering/" + }, + { + "name": "Cees-Jan Kiewiet", + "email": "reactphp@ceesjankiewiet.nl", + "homepage": "https://wyrihaximus.net/" + }, + { + "name": "Jan Sorgalla", + "email": "jsorgalla@gmail.com", + "homepage": "https://sorgalla.com/" + }, + { + "name": "Chris Boden", + "email": "cboden@gmail.com", + "homepage": "https://cboden.dev/" } ], - "description": "PHP classes for the Language Server Protocol", + "description": "Event-driven, streaming HTTP client and server implementation for ReactPHP", "keywords": [ - "language", - "microsoft", - "php", - "server" + "async", + "client", + "event-driven", + "http", + "http client", + "http server", + "https", + "psr-7", + "reactphp", + "server", + "streaming" ], "support": { - "issues": "https://github.com/felixfbecker/php-language-server-protocol/issues", - "source": "https://github.com/felixfbecker/php-language-server-protocol/tree/v1.5.2" + "issues": "https://github.com/reactphp/http/issues", + "source": "https://github.com/reactphp/http/tree/v1.11.0" }, - "time": "2022-03-02T22:36:06+00:00" + "funding": [ + { + "url": "https://opencollective.com/reactphp", + "type": "open_collective" + } + ], + "time": "2024-11-20T15:24:08+00:00" }, { - "name": "fidry/cpu-core-counter", - "version": "0.5.1", + "name": "react/promise", + "version": "v3.3.0", "source": { "type": "git", - "url": "https://github.com/theofidry/cpu-core-counter.git", - "reference": "b58e5a3933e541dc286cc91fc4f3898bbc6f1623" + "url": "https://github.com/reactphp/promise.git", + "reference": "23444f53a813a3296c1368bb104793ce8d88f04a" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/theofidry/cpu-core-counter/zipball/b58e5a3933e541dc286cc91fc4f3898bbc6f1623", - "reference": "b58e5a3933e541dc286cc91fc4f3898bbc6f1623", + "url": "https://api.github.com/repos/reactphp/promise/zipball/23444f53a813a3296c1368bb104793ce8d88f04a", + "reference": "23444f53a813a3296c1368bb104793ce8d88f04a", "shasum": "" }, "require": { - "php": "^7.2 || ^8.0" + "php": ">=7.1.0" }, "require-dev": { - "fidry/makefile": "^0.2.0", - "phpstan/extension-installer": "^1.2.0", - "phpstan/phpstan": "^1.9.2", - "phpstan/phpstan-deprecation-rules": "^1.0.0", - "phpstan/phpstan-phpunit": "^1.2.2", - "phpstan/phpstan-strict-rules": "^1.4.4", - "phpunit/phpunit": "^9.5.26 || ^8.5.31", - "theofidry/php-cs-fixer-config": "^1.0", - "webmozarts/strict-phpunit": "^7.5" + "phpstan/phpstan": "1.12.28 || 1.4.10", + "phpunit/phpunit": "^9.6 || ^7.5" }, "type": "library", "autoload": { + "files": [ + "src/functions_include.php" + ], "psr-4": { - "Fidry\\CpuCoreCounter\\": "src/" + "React\\Promise\\": "src/" } }, "notification-url": "https://packagist.org/downloads/", @@ -2733,56 +2997,75 @@ ], "authors": [ { - "name": "Théo FIDRY", - "email": "theo.fidry@gmail.com" + "name": "Jan Sorgalla", + "email": "jsorgalla@gmail.com", + "homepage": "https://sorgalla.com/" + }, + { + "name": "Christian Lück", + "email": "christian@clue.engineering", + "homepage": "https://clue.engineering/" + }, + { + "name": "Cees-Jan Kiewiet", + "email": "reactphp@ceesjankiewiet.nl", + "homepage": "https://wyrihaximus.net/" + }, + { + "name": "Chris Boden", + "email": "cboden@gmail.com", + "homepage": "https://cboden.dev/" } ], - "description": "Tiny utility to get the number of CPU cores.", + "description": "A lightweight implementation of CommonJS Promises/A for PHP", "keywords": [ - "CPU", - "core" + "promise", + "promises" ], "support": { - "issues": "https://github.com/theofidry/cpu-core-counter/issues", - "source": "https://github.com/theofidry/cpu-core-counter/tree/0.5.1" + "issues": "https://github.com/reactphp/promise/issues", + "source": "https://github.com/reactphp/promise/tree/v3.3.0" }, "funding": [ { - "url": "https://github.com/theofidry", - "type": "github" + "url": "https://opencollective.com/reactphp", + "type": "open_collective" } ], - "time": "2022-12-24T12:35:10+00:00" + "time": "2025-08-19T18:57:03+00:00" }, { - "name": "fig/http-message-util", - "version": "1.1.5", + "name": "react/socket", + "version": "v1.17.0", "source": { "type": "git", - "url": "https://github.com/php-fig/http-message-util.git", - "reference": "9d94dc0154230ac39e5bf89398b324a86f63f765" + "url": "https://github.com/reactphp/socket.git", + "reference": "ef5b17b81f6f60504c539313f94f2d826c5faa08" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/php-fig/http-message-util/zipball/9d94dc0154230ac39e5bf89398b324a86f63f765", - "reference": "9d94dc0154230ac39e5bf89398b324a86f63f765", + "url": "https://api.github.com/repos/reactphp/socket/zipball/ef5b17b81f6f60504c539313f94f2d826c5faa08", + "reference": "ef5b17b81f6f60504c539313f94f2d826c5faa08", "shasum": "" }, "require": { - "php": "^5.3 || ^7.0 || ^8.0" + "evenement/evenement": "^3.0 || ^2.0 || ^1.0", + "php": ">=5.3.0", + "react/dns": "^1.13", + "react/event-loop": "^1.2", + "react/promise": "^3.2 || ^2.6 || ^1.2.1", + "react/stream": "^1.4" }, - "suggest": { - "psr/http-message": "The package containing the PSR-7 interfaces" + "require-dev": { + "phpunit/phpunit": "^9.6 || ^5.7 || ^4.8.36", + "react/async": "^4.3 || ^3.3 || ^2", + "react/promise-stream": "^1.4", + "react/promise-timer": "^1.11" }, "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.1.x-dev" - } - }, "autoload": { "psr-4": { - "Fig\\Http\\Message\\": "src/" + "React\\Socket\\": "src/" } }, "notification-url": "https://packagist.org/downloads/", @@ -2791,61 +3074,73 @@ ], "authors": [ { - "name": "PHP-FIG", - "homepage": "https://www.php-fig.org/" + "name": "Christian Lück", + "email": "christian@clue.engineering", + "homepage": "https://clue.engineering/" + }, + { + "name": "Cees-Jan Kiewiet", + "email": "reactphp@ceesjankiewiet.nl", + "homepage": "https://wyrihaximus.net/" + }, + { + "name": "Jan Sorgalla", + "email": "jsorgalla@gmail.com", + "homepage": "https://sorgalla.com/" + }, + { + "name": "Chris Boden", + "email": "cboden@gmail.com", + "homepage": "https://cboden.dev/" } ], - "description": "Utility classes and constants for use with PSR-7 (psr/http-message)", + "description": "Async, streaming plaintext TCP/IP and secure TLS socket server and client connections for ReactPHP", "keywords": [ - "http", - "http-message", - "psr", - "psr-7", - "request", - "response" + "Connection", + "Socket", + "async", + "reactphp", + "stream" ], "support": { - "issues": "https://github.com/php-fig/http-message-util/issues", - "source": "https://github.com/php-fig/http-message-util/tree/1.1.5" + "issues": "https://github.com/reactphp/socket/issues", + "source": "https://github.com/reactphp/socket/tree/v1.17.0" }, - "time": "2020-11-24T22:02:12+00:00" + "funding": [ + { + "url": "https://opencollective.com/reactphp", + "type": "open_collective" + } + ], + "time": "2025-11-19T20:47:34+00:00" }, { - "name": "filp/whoops", - "version": "2.15.3", + "name": "react/stream", + "version": "v1.4.0", "source": { "type": "git", - "url": "https://github.com/filp/whoops.git", - "reference": "c83e88a30524f9360b11f585f71e6b17313b7187" + "url": "https://github.com/reactphp/stream.git", + "reference": "1e5b0acb8fe55143b5b426817155190eb6f5b18d" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/filp/whoops/zipball/c83e88a30524f9360b11f585f71e6b17313b7187", - "reference": "c83e88a30524f9360b11f585f71e6b17313b7187", + "url": "https://api.github.com/repos/reactphp/stream/zipball/1e5b0acb8fe55143b5b426817155190eb6f5b18d", + "reference": "1e5b0acb8fe55143b5b426817155190eb6f5b18d", "shasum": "" }, "require": { - "php": "^5.5.9 || ^7.0 || ^8.0", - "psr/log": "^1.0.1 || ^2.0 || ^3.0" + "evenement/evenement": "^3.0 || ^2.0 || ^1.0", + "php": ">=5.3.8", + "react/event-loop": "^1.2" }, "require-dev": { - "mockery/mockery": "^0.9 || ^1.0", - "phpunit/phpunit": "^4.8.36 || ^5.7.27 || ^6.5.14 || ^7.5.20 || ^8.5.8 || ^9.3.3", - "symfony/var-dumper": "^2.6 || ^3.0 || ^4.0 || ^5.0" - }, - "suggest": { - "symfony/var-dumper": "Pretty print complex values better with var-dumper available", - "whoops/soap": "Formats errors as SOAP responses" + "clue/stream-filter": "~1.2", + "phpunit/phpunit": "^9.6 || ^5.7 || ^4.8.36" }, "type": "library", - "extra": { - "branch-alias": { - "dev-master": "2.7-dev" - } - }, "autoload": { "psr-4": { - "Whoops\\": "src/Whoops/" + "React\\Stream\\": "src/" } }, "notification-url": "https://packagist.org/downloads/", @@ -2854,84 +3149,85 @@ ], "authors": [ { - "name": "Filipe Dobreira", - "homepage": "https://github.com/filp", - "role": "Developer" + "name": "Christian Lück", + "email": "christian@clue.engineering", + "homepage": "https://clue.engineering/" + }, + { + "name": "Cees-Jan Kiewiet", + "email": "reactphp@ceesjankiewiet.nl", + "homepage": "https://wyrihaximus.net/" + }, + { + "name": "Jan Sorgalla", + "email": "jsorgalla@gmail.com", + "homepage": "https://sorgalla.com/" + }, + { + "name": "Chris Boden", + "email": "cboden@gmail.com", + "homepage": "https://cboden.dev/" } ], - "description": "php error handling for cool kids", - "homepage": "https://filp.github.io/whoops/", + "description": "Event-driven readable and writable streams for non-blocking I/O in ReactPHP", "keywords": [ - "error", - "exception", - "handling", - "library", - "throwable", - "whoops" + "event-driven", + "io", + "non-blocking", + "pipe", + "reactphp", + "readable", + "stream", + "writable" ], "support": { - "issues": "https://github.com/filp/whoops/issues", - "source": "https://github.com/filp/whoops/tree/2.15.3" + "issues": "https://github.com/reactphp/stream/issues", + "source": "https://github.com/reactphp/stream/tree/v1.4.0" }, "funding": [ { - "url": "https://github.com/denis-sokolov", - "type": "github" + "url": "https://opencollective.com/reactphp", + "type": "open_collective" } ], - "time": "2023-07-13T12:00:00+00:00" + "time": "2024-06-11T12:45:25+00:00" }, { - "name": "guzzlehttp/guzzle", - "version": "7.8.0", + "name": "reactivex/rxphp", + "version": "2.1.0", "source": { "type": "git", - "url": "https://github.com/guzzle/guzzle.git", - "reference": "1110f66a6530a40fe7aea0378fe608ee2b2248f9" + "url": "https://github.com/ReactiveX/RxPHP.git", + "reference": "f0a64efd0d3a70d3d8cc55396a84bc43116b7ba1" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/guzzle/guzzle/zipball/1110f66a6530a40fe7aea0378fe608ee2b2248f9", - "reference": "1110f66a6530a40fe7aea0378fe608ee2b2248f9", + "url": "https://api.github.com/repos/ReactiveX/RxPHP/zipball/f0a64efd0d3a70d3d8cc55396a84bc43116b7ba1", + "reference": "f0a64efd0d3a70d3d8cc55396a84bc43116b7ba1", "shasum": "" }, "require": { - "ext-json": "*", - "guzzlehttp/promises": "^1.5.3 || ^2.0.1", - "guzzlehttp/psr7": "^1.9.1 || ^2.5.1", - "php": "^7.2.5 || ^8.0", - "psr/http-client": "^1.0", - "symfony/deprecation-contracts": "^2.2 || ^3.0" - }, - "provide": { - "psr/http-client-implementation": "1.0" + "php": ">=7.1.0", + "react/promise": "^3 || ~2.2" }, "require-dev": { - "bamarni/composer-bin-plugin": "^1.8.1", - "ext-curl": "*", - "php-http/client-integration-tests": "dev-master#2c025848417c1135031fdf9c728ee53d0a7ceaee as 3.0.999", - "php-http/message-factory": "^1.1", - "phpunit/phpunit": "^8.5.29 || ^9.5.23", - "psr/log": "^1.1 || ^2.0 || ^3.0" + "phpunit/phpunit": "^8.5 || ^9", + "react/event-loop": "^1.0 || ^0.5 || ^0.4.2", + "rector/rector": "^2.0", + "satooshi/php-coveralls": "~1.0" }, "suggest": { - "ext-curl": "Required for CURL handler support", - "ext-intl": "Required for Internationalized Domain Name (IDN) support", - "psr/log": "Required for using the Log middleware" + "react/event-loop": "Used for scheduling async operations" }, "type": "library", "extra": { - "bamarni-bin": { - "bin-links": true, - "forward-command": false + "branch-alias": { + "dev-master": "2.0-dev" } }, "autoload": { - "files": [ - "src/functions_include.php" - ], "psr-4": { - "GuzzleHttp\\": "src/" + "Rx\\": "src" } }, "notification-url": "https://packagist.org/downloads/", @@ -2940,104 +3236,67 @@ ], "authors": [ { - "name": "Graham Campbell", - "email": "hello@gjcampbell.co.uk", - "homepage": "https://github.com/GrahamCampbell" - }, - { - "name": "Michael Dowling", - "email": "mtdowling@gmail.com", - "homepage": "https://github.com/mtdowling" - }, - { - "name": "Jeremy Lindblom", - "email": "jeremeamia@gmail.com", - "homepage": "https://github.com/jeremeamia" - }, - { - "name": "George Mponos", - "email": "gmponos@gmail.com", - "homepage": "https://github.com/gmponos" - }, - { - "name": "Tobias Nyholm", - "email": "tobias.nyholm@gmail.com", - "homepage": "https://github.com/Nyholm" + "name": "Alexander", + "email": "iam.asm89@gmail.com" }, { - "name": "Márk Sági-Kazár", - "email": "mark.sagikazar@gmail.com", - "homepage": "https://github.com/sagikazarmark" + "name": "David Dan", + "email": "davidwdan@gmail.com" }, { - "name": "Tobias Schultze", - "email": "webmaster@tubo-world.de", - "homepage": "https://github.com/Tobion" + "name": "Matt Bonneau", + "email": "matt@bonneau.net" } ], - "description": "Guzzle is a PHP HTTP client library", + "description": "Reactive extensions for php.", + "homepage": "https://github.com/ReactiveX/RxPHP", "keywords": [ - "client", - "curl", - "framework", - "http", - "http client", - "psr-18", - "psr-7", - "rest", - "web service" + "extensions", + "reactive", + "rx" ], "support": { - "issues": "https://github.com/guzzle/guzzle/issues", - "source": "https://github.com/guzzle/guzzle/tree/7.8.0" + "issues": "https://github.com/ReactiveX/RxPHP/issues", + "source": "https://github.com/ReactiveX/RxPHP/tree/2.1.0" }, - "funding": [ - { - "url": "https://github.com/GrahamCampbell", - "type": "github" - }, - { - "url": "https://github.com/Nyholm", - "type": "github" - }, - { - "url": "https://tidelift.com/funding/github/packagist/guzzlehttp/guzzle", - "type": "tidelift" - } - ], - "time": "2023-08-27T10:20:53+00:00" + "time": "2025-10-27T20:55:39+00:00" }, { - "name": "guzzlehttp/promises", - "version": "2.0.1", + "name": "respect/stringifier", + "version": "1.0.0", "source": { "type": "git", - "url": "https://github.com/guzzle/promises.git", - "reference": "111166291a0f8130081195ac4556a5587d7f1b5d" + "url": "https://github.com/Respect/Stringifier.git", + "reference": "e88515f675b373596d5dcdd9dc6103b8504c7ca5" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/guzzle/promises/zipball/111166291a0f8130081195ac4556a5587d7f1b5d", - "reference": "111166291a0f8130081195ac4556a5587d7f1b5d", + "url": "https://api.github.com/repos/Respect/Stringifier/zipball/e88515f675b373596d5dcdd9dc6103b8504c7ca5", + "reference": "e88515f675b373596d5dcdd9dc6103b8504c7ca5", "shasum": "" }, "require": { - "php": "^7.2.5 || ^8.0" + "php": "^8.1" }, "require-dev": { - "bamarni/composer-bin-plugin": "^1.8.1", - "phpunit/phpunit": "^8.5.29 || ^9.5.23" + "malukenho/docheader": "^0.1.7", + "phpstan/phpstan": "^1.10", + "phpstan/phpstan-deprecation-rules": "^1.1", + "phpstan/phpstan-phpunit": "^1.3", + "phpstan/phpstan-strict-rules": "^1.5", + "phpunit/phpunit": "^10.0", + "respect/coding-standard": "^4.0", + "squizlabs/php_codesniffer": "^3.7" }, "type": "library", - "extra": { - "bamarni-bin": { - "bin-links": true, - "forward-command": false - } - }, "autoload": { + "files": [ + "src/stringify.php" + ], "psr-4": { - "GuzzleHttp\\Promise\\": "src/" + "Respect\\Stringifier\\": "src/", + "Respect\\Stringifier\\Test\\": "tests/src/", + "Respect\\Stringifier\\Test\\Unit\\": "tests/unit" } }, "notification-url": "https://packagist.org/downloads/", @@ -3046,92 +3305,65 @@ ], "authors": [ { - "name": "Graham Campbell", - "email": "hello@gjcampbell.co.uk", - "homepage": "https://github.com/GrahamCampbell" - }, - { - "name": "Michael Dowling", - "email": "mtdowling@gmail.com", - "homepage": "https://github.com/mtdowling" - }, - { - "name": "Tobias Nyholm", - "email": "tobias.nyholm@gmail.com", - "homepage": "https://github.com/Nyholm" - }, - { - "name": "Tobias Schultze", - "email": "webmaster@tubo-world.de", - "homepage": "https://github.com/Tobion" + "name": "Respect/Stringifier Contributors", + "homepage": "https://github.com/Respect/Stringifier/graphs/contributors" } ], - "description": "Guzzle promises library", + "description": "Converts any value to a string", "keywords": [ - "promise" + "respect", + "stringifier", + "stringify" ], "support": { - "issues": "https://github.com/guzzle/promises/issues", - "source": "https://github.com/guzzle/promises/tree/2.0.1" + "issues": "https://github.com/Respect/Stringifier/issues", + "source": "https://github.com/Respect/Stringifier/tree/1.0.0" }, - "funding": [ - { - "url": "https://github.com/GrahamCampbell", - "type": "github" - }, - { - "url": "https://github.com/Nyholm", - "type": "github" - }, - { - "url": "https://tidelift.com/funding/github/packagist/guzzlehttp/promises", - "type": "tidelift" - } - ], - "time": "2023-08-03T15:11:55+00:00" + "time": "2023-04-12T20:15:44+00:00" }, { - "name": "guzzlehttp/psr7", - "version": "2.6.1", + "name": "respect/validation", + "version": "2.5.0", "source": { "type": "git", - "url": "https://github.com/guzzle/psr7.git", - "reference": "be45764272e8873c72dbe3d2edcfdfcc3bc9f727" + "url": "https://github.com/Respect/Validation.git", + "reference": "48254ed1079fc0879eb03fb2b600f92bb4ecb787" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/guzzle/psr7/zipball/be45764272e8873c72dbe3d2edcfdfcc3bc9f727", - "reference": "be45764272e8873c72dbe3d2edcfdfcc3bc9f727", + "url": "https://api.github.com/repos/Respect/Validation/zipball/48254ed1079fc0879eb03fb2b600f92bb4ecb787", + "reference": "48254ed1079fc0879eb03fb2b600f92bb4ecb787", "shasum": "" }, "require": { - "php": "^7.2.5 || ^8.0", - "psr/http-factory": "^1.0", - "psr/http-message": "^1.1 || ^2.0", - "ralouphie/getallheaders": "^3.0" - }, - "provide": { - "psr/http-factory-implementation": "1.0", - "psr/http-message-implementation": "1.0" + "php": ">=8.1", + "respect/stringifier": "^0.2.0 || ^1.0", + "symfony/polyfill-mbstring": "^1.2" }, "require-dev": { - "bamarni/composer-bin-plugin": "^1.8.1", - "http-interop/http-factory-tests": "^0.9", - "phpunit/phpunit": "^8.5.29 || ^9.5.23" + "egulias/email-validator": "^3.0 || ^4.0", + "giggsey/libphonenumber-for-php-lite": "^8.13 || ^9.0", + "malukenho/docheader": "^1.0", + "mikey179/vfsstream": "^1.6", + "phpstan/phpstan": "^1.9", + "phpstan/phpstan-deprecation-rules": "^1.1", + "phpstan/phpstan-phpunit": "^1.3", + "phpunit/phpunit": "^9.6", + "psr/http-message": "^1.0", + "respect/coding-standard": "^4.0", + "squizlabs/php_codesniffer": "^3.7" }, "suggest": { - "laminas/laminas-httphandlerrunner": "Emit PSR-7 responses" + "egulias/email-validator": "Improves the Email rule if available", + "ext-bcmath": "Arbitrary Precision Mathematics", + "ext-fileinfo": "File Information", + "ext-mbstring": "Multibyte String Functions", + "giggsey/libphonenumber-for-php-lite": "Enables the phone rule if available" }, "type": "library", - "extra": { - "bamarni-bin": { - "bin-links": true, - "forward-command": false - } - }, "autoload": { "psr-4": { - "GuzzleHttp\\Psr7\\": "src/" + "Respect\\Validation\\": "library/" } }, "notification-url": "https://packagist.org/downloads/", @@ -3140,133 +3372,59 @@ ], "authors": [ { - "name": "Graham Campbell", - "email": "hello@gjcampbell.co.uk", - "homepage": "https://github.com/GrahamCampbell" - }, - { - "name": "Michael Dowling", - "email": "mtdowling@gmail.com", - "homepage": "https://github.com/mtdowling" - }, - { - "name": "George Mponos", - "email": "gmponos@gmail.com", - "homepage": "https://github.com/gmponos" - }, - { - "name": "Tobias Nyholm", - "email": "tobias.nyholm@gmail.com", - "homepage": "https://github.com/Nyholm" - }, - { - "name": "Márk Sági-Kazár", - "email": "mark.sagikazar@gmail.com", - "homepage": "https://github.com/sagikazarmark" - }, - { - "name": "Tobias Schultze", - "email": "webmaster@tubo-world.de", - "homepage": "https://github.com/Tobion" - }, - { - "name": "Márk Sági-Kazár", - "email": "mark.sagikazar@gmail.com", - "homepage": "https://sagikazarmark.hu" + "name": "Respect/Validation Contributors", + "homepage": "https://github.com/Respect/Validation/graphs/contributors" } ], - "description": "PSR-7 message implementation that also provides common utility methods", + "description": "The most awesome validation engine ever created for PHP", + "homepage": "http://respect.github.io/Validation/", "keywords": [ - "http", - "message", - "psr-7", - "request", - "response", - "stream", - "uri", - "url" + "respect", + "validation", + "validator" ], "support": { - "issues": "https://github.com/guzzle/psr7/issues", - "source": "https://github.com/guzzle/psr7/tree/2.6.1" + "issues": "https://github.com/Respect/Validation/issues", + "source": "https://github.com/Respect/Validation/tree/2.5.0" }, - "funding": [ - { - "url": "https://github.com/GrahamCampbell", - "type": "github" - }, - { - "url": "https://github.com/Nyholm", - "type": "github" - }, - { - "url": "https://tidelift.com/funding/github/packagist/guzzlehttp/psr7", - "type": "tidelift" - } - ], - "time": "2023-08-27T10:13:57+00:00" + "time": "2026-07-22T15:21:03+00:00" }, { - "name": "icanhazstring/composer-unused", - "version": "0.8.10", + "name": "ringcentral/psr7", + "version": "1.3.0", "source": { "type": "git", - "url": "https://github.com/composer-unused/composer-unused.git", - "reference": "fd2624f49de2d8925355cfb8739e2b2a57017d10" + "url": "https://github.com/ringcentral/psr7.git", + "reference": "360faaec4b563958b673fb52bbe94e37f14bc686" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/composer-unused/composer-unused/zipball/fd2624f49de2d8925355cfb8739e2b2a57017d10", - "reference": "fd2624f49de2d8925355cfb8739e2b2a57017d10", + "url": "https://api.github.com/repos/ringcentral/psr7/zipball/360faaec4b563958b673fb52bbe94e37f14bc686", + "reference": "360faaec4b563958b673fb52bbe94e37f14bc686", "shasum": "" }, "require": { - "composer-unused/contracts": "^0.3", - "composer-unused/symbol-parser": "^0.2.1", - "ext-json": "*", - "nikic/php-parser": "^4.15", - "ondram/ci-detector": "^4.1", - "php": "^7.4 || ^8.0", - "phpstan/phpdoc-parser": "^1.12", - "psr/container": "^1.0 || ^2.0", - "psr/log": "^1.1 || ^2 || ^3", - "symfony/config": "^4.4 || ^5.4 || ^6.0", - "symfony/console": "^4.4 || ^5.4 || ^6.0", - "symfony/dependency-injection": "^4.4.8 || ^5.4 || ^6.0", - "symfony/property-access": "^4.4 || ^5.4 || ^6.0", - "symfony/serializer": "^4.4 || ^5.4 || ^6.0", - "webmozart/assert": "^1.10", - "webmozart/glob": "^4.4" + "php": ">=5.3", + "psr/http-message": "~1.0" + }, + "provide": { + "psr/http-message-implementation": "1.0" }, "require-dev": { - "bamarni/composer-bin-plugin": "^1.8", - "dg/bypass-finals": "^1.4", - "ergebnis/composer-normalize": "^2.28", - "ext-ds": "*", - "ext-zend-opcache": "*", - "jangregor/phpstan-prophecy": "^1.0", - "php-ds/php-ds": "^1.4", - "phpspec/prophecy-phpunit": "^2.0.2", - "phpstan/extension-installer": "^1.3", - "phpstan/phpstan": "^1.10", - "phpstan/phpstan-phpunit": "^1.3", - "phpunit/phpunit": "^9.6.8", - "roave/security-advisories": "dev-master", - "squizlabs/php_codesniffer": "^3.7" + "phpunit/phpunit": "~4.0" }, - "bin": [ - "bin/composer-unused" - ], "type": "library", "extra": { - "bamarni-bin": { - "bin-links": true, - "forward-command": true + "branch-alias": { + "dev-master": "1.0-dev" } }, "autoload": { + "files": [ + "src/functions_include.php" + ], "psr-4": { - "ComposerUnused\\ComposerUnused\\": "src" + "RingCentral\\Psr7\\": "src/" } }, "notification-url": "https://packagist.org/downloads/", @@ -3275,364 +3433,364 @@ ], "authors": [ { - "name": "Andreas Frömer", - "email": "composer-unused@icanhazstring.com" + "name": "Michael Dowling", + "email": "mtdowling@gmail.com", + "homepage": "https://github.com/mtdowling" } ], - "description": "Show unused packages by scanning your code", - "homepage": "https://github.com/composer-unused/composer-unused", + "description": "PSR-7 message implementation", "keywords": [ - "composer", - "php-parser", - "static analysis", - "unused" + "http", + "message", + "stream", + "uri" ], "support": { - "issues": "https://github.com/composer-unused/composer-unused/issues", - "source": "https://github.com/composer-unused/composer-unused" + "source": "https://github.com/ringcentral/psr7/tree/master" }, - "funding": [ - { - "url": "https://github.com/sponsors/icanhazstring", - "type": "github" - }, - { - "url": "https://paypal.me/icanhazstring", - "type": "other" - } - ], - "time": "2023-07-06T05:41:37+00:00" + "time": "2018-05-29T20:21:04+00:00" }, { - "name": "infection/abstract-testframework-adapter", - "version": "0.5.0", + "name": "riverline/multipart-parser", + "version": "2.2.2", "source": { "type": "git", - "url": "https://github.com/infection/abstract-testframework-adapter.git", - "reference": "18925e20d15d1a5995bb85c9dc09e8751e1e069b" + "url": "https://github.com/Riverline/multipart-parser.git", + "reference": "fadbb1c1f8e66f96eaa36ab8ed13cbc451c6ded7" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/infection/abstract-testframework-adapter/zipball/18925e20d15d1a5995bb85c9dc09e8751e1e069b", - "reference": "18925e20d15d1a5995bb85c9dc09e8751e1e069b", + "url": "https://api.github.com/repos/Riverline/multipart-parser/zipball/fadbb1c1f8e66f96eaa36ab8ed13cbc451c6ded7", + "reference": "fadbb1c1f8e66f96eaa36ab8ed13cbc451c6ded7", "shasum": "" }, "require": { - "php": "^7.4 || ^8.0" + "ext-mbstring": "*", + "php": ">=7.0" }, "require-dev": { - "ergebnis/composer-normalize": "^2.8", - "friendsofphp/php-cs-fixer": "^2.17", - "phpunit/phpunit": "^9.5" + "laminas/laminas-diactoros": "*", + "phpunit/phpunit": "*", + "psr/http-message": "*", + "symfony/psr-http-message-bridge": "*" }, "type": "library", "autoload": { "psr-4": { - "Infection\\AbstractTestFramework\\": "src/" + "Riverline\\MultiPartParser\\": "src/" } }, "notification-url": "https://packagist.org/downloads/", "license": [ - "BSD-3-Clause" + "MIT" ], "authors": [ { - "name": "Maks Rafalko", - "email": "maks.rafalko@gmail.com" - } - ], - "description": "Abstract Test Framework Adapter for Infection", - "support": { - "issues": "https://github.com/infection/abstract-testframework-adapter/issues", - "source": "https://github.com/infection/abstract-testframework-adapter/tree/0.5.0" - }, - "funding": [ - { - "url": "https://github.com/infection", - "type": "github" + "name": "Romain Cambien", + "email": "romain@cambien.net" }, { - "url": "https://opencollective.com/infection", - "type": "open_collective" + "name": "Riverline", + "homepage": "http://www.riverline.fr" } ], - "time": "2021-08-17T18:49:12+00:00" + "description": "One class library to parse multipart content with encoding and charset support.", + "keywords": [ + "http", + "multipart", + "parser" + ], + "support": { + "issues": "https://github.com/Riverline/multipart-parser/issues", + "source": "https://github.com/Riverline/multipart-parser/tree/2.2.2" + }, + "time": "2026-01-15T11:08:16+00:00" }, { - "name": "infection/extension-installer", - "version": "0.1.2", + "name": "symfony/console", + "version": "v7.4.17", "source": { "type": "git", - "url": "https://github.com/infection/extension-installer.git", - "reference": "9b351d2910b9a23ab4815542e93d541e0ca0cdcf" + "url": "https://github.com/symfony/console.git", + "reference": "962e18f09ebe68a49039b4c82fc0ea4871824fca" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/infection/extension-installer/zipball/9b351d2910b9a23ab4815542e93d541e0ca0cdcf", - "reference": "9b351d2910b9a23ab4815542e93d541e0ca0cdcf", + "url": "https://api.github.com/repos/symfony/console/zipball/962e18f09ebe68a49039b4c82fc0ea4871824fca", + "reference": "962e18f09ebe68a49039b4c82fc0ea4871824fca", "shasum": "" }, "require": { - "composer-plugin-api": "^1.1 || ^2.0" + "php": ">=8.2", + "symfony/deprecation-contracts": "^2.5|^3", + "symfony/polyfill-mbstring": "~1.0", + "symfony/service-contracts": "^2.5|^3", + "symfony/string": "^7.2|^8.0" }, - "require-dev": { - "composer/composer": "^1.9 || ^2.0", - "friendsofphp/php-cs-fixer": "^2.18, <2.19", - "infection/infection": "^0.15.2", - "php-coveralls/php-coveralls": "^2.4", - "phpstan/extension-installer": "^1.0", - "phpstan/phpstan": "^0.12.10", - "phpstan/phpstan-phpunit": "^0.12.6", - "phpstan/phpstan-strict-rules": "^0.12.2", - "phpstan/phpstan-webmozart-assert": "^0.12.2", - "phpunit/phpunit": "^9.5", - "vimeo/psalm": "^4.8" + "conflict": { + "symfony/dependency-injection": "<6.4", + "symfony/dotenv": "<6.4", + "symfony/event-dispatcher": "<6.4", + "symfony/lock": "<6.4", + "symfony/process": "<6.4" }, - "type": "composer-plugin", - "extra": { - "class": "Infection\\ExtensionInstaller\\Plugin" + "provide": { + "psr/log-implementation": "1.0|2.0|3.0" + }, + "require-dev": { + "psr/log": "^1|^2|^3", + "symfony/config": "^6.4|^7.0|^8.0", + "symfony/dependency-injection": "^6.4|^7.0|^8.0", + "symfony/event-dispatcher": "^6.4|^7.0|^8.0", + "symfony/http-foundation": "^6.4|^7.0|^8.0", + "symfony/http-kernel": "^6.4|^7.0|^8.0", + "symfony/lock": "^6.4|^7.0|^8.0", + "symfony/messenger": "^6.4|^7.0|^8.0", + "symfony/process": "^6.4|^7.0|^8.0", + "symfony/stopwatch": "^6.4|^7.0|^8.0", + "symfony/var-dumper": "^6.4|^7.0|^8.0" }, + "type": "library", "autoload": { "psr-4": { - "Infection\\ExtensionInstaller\\": "src/" - } + "Symfony\\Component\\Console\\": "" + }, + "exclude-from-classmap": [ + "/Tests/" + ] }, "notification-url": "https://packagist.org/downloads/", "license": [ - "BSD-3-Clause" + "MIT" ], "authors": [ { - "name": "Maks Rafalko", - "email": "maks.rafalko@gmail.com" + "name": "Fabien Potencier", + "email": "fabien@symfony.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" } ], - "description": "Infection Extension Installer", + "description": "Eases the creation of beautiful and testable command line interfaces", + "homepage": "https://symfony.com", + "keywords": [ + "cli", + "command-line", + "console", + "terminal" + ], "support": { - "issues": "https://github.com/infection/extension-installer/issues", - "source": "https://github.com/infection/extension-installer/tree/0.1.2" + "source": "https://github.com/symfony/console/tree/v7.4.17" }, "funding": [ { - "url": "https://github.com/infection", + "url": "https://symfony.com/sponsor", + "type": "custom" + }, + { + "url": "https://github.com/fabpot", "type": "github" }, { - "url": "https://opencollective.com/infection", - "type": "open_collective" + "url": "https://github.com/nicolas-grekas", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "type": "tidelift" } ], - "time": "2021-10-20T22:08:34+00:00" + "time": "2026-08-21T12:09:28+00:00" }, { - "name": "infection/include-interceptor", - "version": "0.2.5", + "name": "symfony/deprecation-contracts", + "version": "v3.7.1", "source": { "type": "git", - "url": "https://github.com/infection/include-interceptor.git", - "reference": "0cc76d95a79d9832d74e74492b0a30139904bdf7" + "url": "https://github.com/symfony/deprecation-contracts.git", + "reference": "f3202fa1b5097b0af062dc978b32ecf63404e31d" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/infection/include-interceptor/zipball/0cc76d95a79d9832d74e74492b0a30139904bdf7", - "reference": "0cc76d95a79d9832d74e74492b0a30139904bdf7", + "url": "https://api.github.com/repos/symfony/deprecation-contracts/zipball/f3202fa1b5097b0af062dc978b32ecf63404e31d", + "reference": "f3202fa1b5097b0af062dc978b32ecf63404e31d", "shasum": "" }, - "require-dev": { - "friendsofphp/php-cs-fixer": "^2.16", - "infection/infection": "^0.15.0", - "phan/phan": "^2.4 || ^3", - "php-coveralls/php-coveralls": "^2.2", - "phpstan/phpstan": "^0.12.8", - "phpunit/phpunit": "^8.5", - "vimeo/psalm": "^3.8" + "require": { + "php": ">=8.1" }, "type": "library", - "autoload": { - "psr-4": { - "Infection\\StreamWrapper\\": "src/" + "extra": { + "thanks": { + "url": "https://github.com/symfony/contracts", + "name": "symfony/contracts" + }, + "branch-alias": { + "dev-main": "3.7-dev" } }, + "autoload": { + "files": [ + "function.php" + ] + }, "notification-url": "https://packagist.org/downloads/", "license": [ - "BSD-3-Clause" + "MIT" ], "authors": [ { - "name": "Maks Rafalko", - "email": "maks.rafalko@gmail.com" + "name": "Nicolas Grekas", + "email": "p@tchwork.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" } ], - "description": "Stream Wrapper: Include Interceptor. Allows to replace included (autoloaded) file with another one.", + "description": "A generic function and convention to trigger deprecation notices", + "homepage": "https://symfony.com", "support": { - "issues": "https://github.com/infection/include-interceptor/issues", - "source": "https://github.com/infection/include-interceptor/tree/0.2.5" + "source": "https://github.com/symfony/deprecation-contracts/tree/v3.7.1" }, "funding": [ { - "url": "https://github.com/infection", + "url": "https://symfony.com/sponsor", + "type": "custom" + }, + { + "url": "https://github.com/fabpot", "type": "github" }, { - "url": "https://opencollective.com/infection", - "type": "open_collective" + "url": "https://github.com/nicolas-grekas", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "type": "tidelift" } ], - "time": "2021-08-09T10:03:57+00:00" + "time": "2026-06-05T06:23:12+00:00" }, { - "name": "infection/infection", - "version": "0.27.0", + "name": "symfony/polyfill-ctype", + "version": "v1.37.0", "source": { "type": "git", - "url": "https://github.com/infection/infection.git", - "reference": "a9ff8171577d98b887d7f16428edd81ff69ce887" + "url": "https://github.com/symfony/polyfill-ctype.git", + "reference": "141046a8f9477948ff284fa65be2095baafb94f2" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/infection/infection/zipball/a9ff8171577d98b887d7f16428edd81ff69ce887", - "reference": "a9ff8171577d98b887d7f16428edd81ff69ce887", + "url": "https://api.github.com/repos/symfony/polyfill-ctype/zipball/141046a8f9477948ff284fa65be2095baafb94f2", + "reference": "141046a8f9477948ff284fa65be2095baafb94f2", "shasum": "" }, "require": { - "colinodell/json5": "^2.2", - "composer-runtime-api": "^2.0", - "composer/xdebug-handler": "^2.0 || ^3.0", - "ext-dom": "*", - "ext-json": "*", - "ext-libxml": "*", - "ext-mbstring": "*", - "fidry/cpu-core-counter": "^0.4.0 || ^0.5.0", - "infection/abstract-testframework-adapter": "^0.5.0", - "infection/extension-installer": "^0.1.0", - "infection/include-interceptor": "^0.2.5", - "justinrainbow/json-schema": "^5.2.10", - "nikic/php-parser": "^4.15.1", - "ondram/ci-detector": "^4.1.0", - "php": "^8.1", - "sanmai/later": "^0.1.1", - "sanmai/pipeline": "^5.1 || ^6", - "sebastian/diff": "^3.0.2 || ^4.0 || ^5.0", - "symfony/console": "^5.4 || ^6.0", - "symfony/filesystem": "^5.4 || ^6.0", - "symfony/finder": "^5.4 || ^6.0", - "symfony/process": "^5.4 || ^6.0", - "thecodingmachine/safe": "^2.1.2", - "webmozart/assert": "^1.11" + "php": ">=7.2" }, - "conflict": { - "antecedent/patchwork": "<2.1.25", - "dg/bypass-finals": "<1.4.1", - "phpunit/php-code-coverage": ">9,<9.1.4 || >9.2.17,<9.2.21" + "provide": { + "ext-ctype": "*" }, - "require-dev": { - "brianium/paratest": "^6.3", - "ext-simplexml": "*", - "fidry/makefile": "^0.2.0", - "helmich/phpunit-json-assert": "^3.0", - "phpspec/prophecy": "^1.15", - "phpspec/prophecy-phpunit": "^2.0", - "phpstan/extension-installer": "^1.1.0", - "phpstan/phpstan": "^1.10.15", - "phpstan/phpstan-phpunit": "^1.0.0", - "phpstan/phpstan-strict-rules": "^1.1.0", - "phpstan/phpstan-webmozart-assert": "^1.0.2", - "phpunit/phpunit": "^9.5.5", - "rector/rector": "^0.16.0", - "sidz/phpstan-rules": "^0.2.1", - "symfony/phpunit-bridge": "^5.4 || ^6.0", - "symfony/yaml": "^5.4 || ^6.0", - "thecodingmachine/phpstan-safe-rule": "^1.2.0" + "suggest": { + "ext-ctype": "For best performance" }, - "bin": [ - "bin/infection" - ], "type": "library", + "extra": { + "thanks": { + "url": "https://github.com/symfony/polyfill", + "name": "symfony/polyfill" + } + }, "autoload": { + "files": [ + "bootstrap.php" + ], "psr-4": { - "Infection\\": "src/" + "Symfony\\Polyfill\\Ctype\\": "" } }, "notification-url": "https://packagist.org/downloads/", "license": [ - "BSD-3-Clause" + "MIT" ], "authors": [ - { - "name": "Maks Rafalko", - "email": "maks.rafalko@gmail.com", - "homepage": "https://twitter.com/maks_rafalko" - }, - { - "name": "Oleg Zhulnev", - "homepage": "https://github.com/sidz" - }, { "name": "Gert de Pagter", - "homepage": "https://github.com/BackEndTea" - }, - { - "name": "Théo FIDRY", - "email": "theo.fidry@gmail.com", - "homepage": "https://twitter.com/tfidry" - }, - { - "name": "Alexey Kopytko", - "email": "alexey@kopytko.com", - "homepage": "https://www.alexeykopytko.com" + "email": "BackEndTea@gmail.com" }, { - "name": "Andreas Möller", - "email": "am@localheinz.com", - "homepage": "https://localheinz.com" + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" } ], - "description": "Infection is a Mutation Testing framework for PHP. The mutation adequacy score can be used to measure the effectiveness of a test set in terms of its ability to detect faults.", + "description": "Symfony polyfill for ctype functions", + "homepage": "https://symfony.com", "keywords": [ - "coverage", - "mutant", - "mutation framework", - "mutation testing", - "testing", - "unit testing" + "compatibility", + "ctype", + "polyfill", + "portable" ], "support": { - "issues": "https://github.com/infection/infection/issues", - "source": "https://github.com/infection/infection/tree/0.27.0" + "source": "https://github.com/symfony/polyfill-ctype/tree/v1.37.0" }, "funding": [ { - "url": "https://github.com/infection", + "url": "https://symfony.com/sponsor", + "type": "custom" + }, + { + "url": "https://github.com/fabpot", "type": "github" }, { - "url": "https://opencollective.com/infection", - "type": "open_collective" + "url": "https://github.com/nicolas-grekas", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "type": "tidelift" } ], - "time": "2023-05-16T05:28:04+00:00" + "time": "2026-04-10T16:19:22+00:00" }, { - "name": "jakobbuis/simple-slow-test-reporter", - "version": "v1.0.0", + "name": "symfony/polyfill-intl-grapheme", + "version": "v1.41.0", "source": { "type": "git", - "url": "https://github.com/jakobbuis/simple-slow-test-reporter.git", - "reference": "7111cb24f4670ca455f5578710022311f78ef1c4" + "url": "https://github.com/symfony/polyfill-intl-grapheme.git", + "reference": "bb899c1db0aa8127dc3afe8cda4a67eb24915f8d" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/jakobbuis/simple-slow-test-reporter/zipball/7111cb24f4670ca455f5578710022311f78ef1c4", - "reference": "7111cb24f4670ca455f5578710022311f78ef1c4", + "url": "https://api.github.com/repos/symfony/polyfill-intl-grapheme/zipball/bb899c1db0aa8127dc3afe8cda4a67eb24915f8d", + "reference": "bb899c1db0aa8127dc3afe8cda4a67eb24915f8d", "shasum": "" }, "require": { - "phpunit/phpunit": "^9.0" + "php": ">=7.2" + }, + "suggest": { + "ext-intl": "For best performance" }, "type": "library", + "extra": { + "thanks": { + "url": "https://github.com/symfony/polyfill", + "name": "symfony/polyfill" + } + }, "autoload": { + "files": [ + "bootstrap.php" + ], "psr-4": { - "SSTR\\": "src/" + "Symfony\\Polyfill\\Intl\\Grapheme\\": "" } }, "notification-url": "https://packagist.org/downloads/", @@ -3641,58 +3799,84 @@ ], "authors": [ { - "name": "Jakob Buis", - "email": "jakob@jakobbuis.nl" + "name": "Nicolas Grekas", + "email": "p@tchwork.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" } ], - "description": "Reports slow tests in your PHPUnit testsuite", + "description": "Symfony polyfill for intl's grapheme_* functions", + "homepage": "https://symfony.com", + "keywords": [ + "compatibility", + "grapheme", + "intl", + "polyfill", + "portable", + "shim" + ], "support": { - "issues": "https://github.com/jakobbuis/simple-slow-test-reporter/issues", - "source": "https://github.com/jakobbuis/simple-slow-test-reporter/tree/v1.0.0" + "source": "https://github.com/symfony/polyfill-intl-grapheme/tree/v1.41.0" }, - "time": "2020-12-26T16:20:53+00:00" + "funding": [ + { + "url": "https://symfony.com/sponsor", + "type": "custom" + }, + { + "url": "https://github.com/fabpot", + "type": "github" + }, + { + "url": "https://github.com/nicolas-grekas", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "type": "tidelift" + } + ], + "time": "2026-07-28T08:25:59+00:00" }, { - "name": "jangregor/phpstan-prophecy", - "version": "1.0.0", + "name": "symfony/polyfill-intl-normalizer", + "version": "v1.42.0", "source": { "type": "git", - "url": "https://github.com/Jan0707/phpstan-prophecy.git", - "reference": "2bc7ca9460395690c6bf7332bdfb2f25d5cae8e0" + "url": "https://github.com/symfony/polyfill-intl-normalizer.git", + "reference": "aa20edea75bd9c48cfecc8360922e5a6e5c44502" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/Jan0707/phpstan-prophecy/zipball/2bc7ca9460395690c6bf7332bdfb2f25d5cae8e0", - "reference": "2bc7ca9460395690c6bf7332bdfb2f25d5cae8e0", + "url": "https://api.github.com/repos/symfony/polyfill-intl-normalizer/zipball/aa20edea75bd9c48cfecc8360922e5a6e5c44502", + "reference": "aa20edea75bd9c48cfecc8360922e5a6e5c44502", "shasum": "" }, "require": { - "php": "^7.1 || ^8.0", - "phpstan/phpstan": "^1.0.0" - }, - "conflict": { - "phpspec/prophecy": "<1.7.0,>=2.0.0", - "phpunit/phpunit": "<6.0.0,>=10.0.0" + "php": ">=7.2" }, - "require-dev": { - "ergebnis/composer-normalize": "^2.1.1", - "ergebnis/license": "^1.0.0", - "ergebnis/php-cs-fixer-config": "~2.2.0", - "phpspec/prophecy": "^1.7.0", - "phpunit/phpunit": "^6.0.0 || ^7.0.0 || ^8.0.0 || ^9.0.0" + "suggest": { + "ext-intl": "For best performance" }, - "type": "phpstan-extension", + "type": "library", "extra": { - "phpstan": { - "includes": [ - "extension.neon" - ] + "thanks": { + "url": "https://github.com/symfony/polyfill", + "name": "symfony/polyfill" } }, "autoload": { + "files": [ + "bootstrap.php" + ], "psr-4": { - "JanGregor\\Prophecy\\": "src/" - } + "Symfony\\Polyfill\\Intl\\Normalizer\\": "" + }, + "classmap": [ + "Resources/stubs" + ] }, "notification-url": "https://packagist.org/downloads/", "license": [ @@ -3700,55 +3884,84 @@ ], "authors": [ { - "name": "Jan Gregor Emge-Triebel", - "email": "jan@jangregor.me" + "name": "Nicolas Grekas", + "email": "p@tchwork.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" } ], - "description": "Provides a phpstan/phpstan extension for phpspec/prophecy", + "description": "Symfony polyfill for intl's Normalizer class and related functions", + "homepage": "https://symfony.com", + "keywords": [ + "compatibility", + "intl", + "normalizer", + "polyfill", + "portable", + "shim" + ], "support": { - "issues": "https://github.com/Jan0707/phpstan-prophecy/issues", - "source": "https://github.com/Jan0707/phpstan-prophecy/tree/1.0.0" + "source": "https://github.com/symfony/polyfill-intl-normalizer/tree/v1.42.0" }, "funding": [ { - "url": "https://github.com/localheinz", + "url": "https://symfony.com/sponsor", + "type": "custom" + }, + { + "url": "https://github.com/fabpot", + "type": "github" + }, + { + "url": "https://github.com/nicolas-grekas", "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "type": "tidelift" } ], - "time": "2021-11-08T16:37:47+00:00" + "time": "2026-08-07T06:33:24+00:00" }, { - "name": "jawira/case-converter", - "version": "v3.5.1", + "name": "symfony/polyfill-mbstring", + "version": "v1.38.2", "source": { "type": "git", - "url": "https://github.com/jawira/case-converter.git", - "reference": "2be05b98dcb743bef60ab6f849145bd3434ed003" + "url": "https://github.com/symfony/polyfill-mbstring.git", + "reference": "d3d318bad5e7a1bfbd026009c8bfb8d8f99ae6b6" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/jawira/case-converter/zipball/2be05b98dcb743bef60ab6f849145bd3434ed003", - "reference": "2be05b98dcb743bef60ab6f849145bd3434ed003", + "url": "https://api.github.com/repos/symfony/polyfill-mbstring/zipball/d3d318bad5e7a1bfbd026009c8bfb8d8f99ae6b6", + "reference": "d3d318bad5e7a1bfbd026009c8bfb8d8f99ae6b6", "shasum": "" }, "require": { - "ext-mbstring": "*", - "php": ">=7.4" + "ext-iconv": "*", + "php": ">=7.2" }, - "require-dev": { - "behat/behat": "^3.0", - "phpstan/phpstan": "^1.0", - "phpunit/phpunit": "^9.0", - "vimeo/psalm": "^4.0" + "provide": { + "ext-mbstring": "*" }, "suggest": { - "pds/skeleton": "PHP Package Development Standards", - "phing/phing": "PHP Build Tool" + "ext-mbstring": "For best performance" }, "type": "library", + "extra": { + "thanks": { + "url": "https://github.com/symfony/polyfill", + "name": "symfony/polyfill" + } + }, "autoload": { + "files": [ + "bootstrap.php" + ], "psr-4": { - "Jawira\\CaseConverter\\": "src/" + "Symfony\\Polyfill\\Mbstring\\": "" } }, "notification-url": "https://packagist.org/downloads/", @@ -3757,116 +3970,169 @@ ], "authors": [ { - "name": "Jawira Portugal", - "email": "dev@tugal.be" + "name": "Nicolas Grekas", + "email": "p@tchwork.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" } ], - "description": "Convert strings between 13 naming conventions: Snake case, Camel case, Pascal case, Kebab case, Ada case, Train case, Cobol case, Macro case, Upper case, Lower case, Sentence case, Title case and Dot notation.", - "homepage": "https://jawira.github.io/case-converter/", + "description": "Symfony polyfill for the Mbstring extension", + "homepage": "https://symfony.com", "keywords": [ - "Ada case", - "Cobol case", - "Macro case", - "Train case", - "camel case", - "dot notation", - "kebab case", - "lower case", - "pascal case", - "sentence case", - "snake case", - "title case", - "upper case" + "compatibility", + "mbstring", + "polyfill", + "portable", + "shim" ], "support": { - "issues": "https://github.com/jawira/case-converter/issues", - "source": "https://github.com/jawira/case-converter/tree/v3.5.1" + "source": "https://github.com/symfony/polyfill-mbstring/tree/v1.38.2" }, - "time": "2022-08-14T11:40:18+00:00" + "funding": [ + { + "url": "https://symfony.com/sponsor", + "type": "custom" + }, + { + "url": "https://github.com/fabpot", + "type": "github" + }, + { + "url": "https://github.com/nicolas-grekas", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "type": "tidelift" + } + ], + "time": "2026-05-27T06:59:30+00:00" }, { - "name": "jetbrains/phpstorm-stubs", - "version": "v2023.2", + "name": "symfony/polyfill-php80", + "version": "v1.37.0", "source": { "type": "git", - "url": "https://github.com/JetBrains/phpstorm-stubs.git", - "reference": "3bb9c8a1050ad324c2dca7964487fa9f081f1005" + "url": "https://github.com/symfony/polyfill-php80.git", + "reference": "dfb55726c3a76ea3b6459fcfda1ec2d80a682411" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/JetBrains/phpstorm-stubs/zipball/3bb9c8a1050ad324c2dca7964487fa9f081f1005", - "reference": "3bb9c8a1050ad324c2dca7964487fa9f081f1005", + "url": "https://api.github.com/repos/symfony/polyfill-php80/zipball/dfb55726c3a76ea3b6459fcfda1ec2d80a682411", + "reference": "dfb55726c3a76ea3b6459fcfda1ec2d80a682411", "shasum": "" }, - "require-dev": { - "friendsofphp/php-cs-fixer": "@stable", - "nikic/php-parser": "@stable", - "php": "^8.0", - "phpdocumentor/reflection-docblock": "@stable", - "phpunit/phpunit": "^9.6" + "require": { + "php": ">=7.2" }, "type": "library", + "extra": { + "thanks": { + "url": "https://github.com/symfony/polyfill", + "name": "symfony/polyfill" + } + }, "autoload": { "files": [ - "PhpStormStubsMap.php" + "bootstrap.php" + ], + "psr-4": { + "Symfony\\Polyfill\\Php80\\": "" + }, + "classmap": [ + "Resources/stubs" ] }, "notification-url": "https://packagist.org/downloads/", "license": [ - "Apache-2.0" + "MIT" ], - "description": "PHP runtime & extensions header files for PhpStorm", - "homepage": "https://www.jetbrains.com/phpstorm", + "authors": [ + { + "name": "Ion Bazan", + "email": "ion.bazan@gmail.com" + }, + { + "name": "Nicolas Grekas", + "email": "p@tchwork.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Symfony polyfill backporting some PHP 8.0+ features to lower PHP versions", + "homepage": "https://symfony.com", "keywords": [ - "autocomplete", - "code", - "inference", - "inspection", - "jetbrains", - "phpstorm", - "stubs", - "type" + "compatibility", + "polyfill", + "portable", + "shim" ], "support": { - "source": "https://github.com/JetBrains/phpstorm-stubs/tree/v2023.2" + "source": "https://github.com/symfony/polyfill-php80/tree/v1.37.0" }, - "time": "2023-07-14T12:50:15+00:00" + "funding": [ + { + "url": "https://symfony.com/sponsor", + "type": "custom" + }, + { + "url": "https://github.com/fabpot", + "type": "github" + }, + { + "url": "https://github.com/nicolas-grekas", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "type": "tidelift" + } + ], + "time": "2026-04-10T16:19:22+00:00" }, { - "name": "justinrainbow/json-schema", - "version": "v5.2.13", + "name": "symfony/service-contracts", + "version": "v3.7.1", "source": { "type": "git", - "url": "https://github.com/justinrainbow/json-schema.git", - "reference": "fbbe7e5d79f618997bc3332a6f49246036c45793" + "url": "https://github.com/symfony/service-contracts.git", + "reference": "c0a284bab1ed8aa0417e3d69250ab437739563a0" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/justinrainbow/json-schema/zipball/fbbe7e5d79f618997bc3332a6f49246036c45793", - "reference": "fbbe7e5d79f618997bc3332a6f49246036c45793", + "url": "https://api.github.com/repos/symfony/service-contracts/zipball/c0a284bab1ed8aa0417e3d69250ab437739563a0", + "reference": "c0a284bab1ed8aa0417e3d69250ab437739563a0", "shasum": "" }, "require": { - "php": ">=5.3.3" + "php": ">=8.1", + "psr/container": "^1.1|^2.0", + "symfony/deprecation-contracts": "^2.5|^3" }, - "require-dev": { - "friendsofphp/php-cs-fixer": "~2.2.20||~2.15.1", - "json-schema/json-schema-test-suite": "1.2.0", - "phpunit/phpunit": "^4.8.35" + "conflict": { + "ext-psr": "<1.1|>=2" }, - "bin": [ - "bin/validate-json" - ], "type": "library", "extra": { + "thanks": { + "url": "https://github.com/symfony/contracts", + "name": "symfony/contracts" + }, "branch-alias": { - "dev-master": "5.0.x-dev" + "dev-main": "3.7-dev" } }, "autoload": { "psr-4": { - "JsonSchema\\": "src/JsonSchema/" - } + "Symfony\\Contracts\\Service\\": "" + }, + "exclude-from-classmap": [ + "/Test/" + ] }, "notification-url": "https://packagist.org/downloads/", "license": [ @@ -3874,60 +4140,89 @@ ], "authors": [ { - "name": "Bruno Prieto Reis", - "email": "bruno.p.reis@gmail.com" - }, - { - "name": "Justin Rainbow", - "email": "justin.rainbow@gmail.com" - }, - { - "name": "Igor Wiedler", - "email": "igor@wiedler.ch" + "name": "Nicolas Grekas", + "email": "p@tchwork.com" }, { - "name": "Robert Schönthal", - "email": "seroscho@googlemail.com" + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" } ], - "description": "A library to validate a json schema.", - "homepage": "https://github.com/justinrainbow/json-schema", + "description": "Generic abstractions related to writing services", + "homepage": "https://symfony.com", "keywords": [ - "json", - "schema" + "abstractions", + "contracts", + "decoupling", + "interfaces", + "interoperability", + "standards" ], "support": { - "issues": "https://github.com/justinrainbow/json-schema/issues", - "source": "https://github.com/justinrainbow/json-schema/tree/v5.2.13" + "source": "https://github.com/symfony/service-contracts/tree/v3.7.1" }, - "time": "2023-09-26T02:20:38+00:00" + "funding": [ + { + "url": "https://symfony.com/sponsor", + "type": "custom" + }, + { + "url": "https://github.com/fabpot", + "type": "github" + }, + { + "url": "https://github.com/nicolas-grekas", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "type": "tidelift" + } + ], + "time": "2026-06-16T09:55:08+00:00" }, { - "name": "kwn/number-to-words", - "version": "2.7.2", + "name": "symfony/string", + "version": "v8.1.2", "source": { "type": "git", - "url": "https://github.com/kwn/number-to-words.git", - "reference": "6821e1f6c2195ceff1595cfba9ecb13c9b121579" + "url": "https://github.com/symfony/string.git", + "reference": "286a76b7255e5cc4bf0101a0bc5388ecf1c38ccc" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/kwn/number-to-words/zipball/6821e1f6c2195ceff1595cfba9ecb13c9b121579", - "reference": "6821e1f6c2195ceff1595cfba9ecb13c9b121579", + "url": "https://api.github.com/repos/symfony/string/zipball/286a76b7255e5cc4bf0101a0bc5388ecf1c38ccc", + "reference": "286a76b7255e5cc4bf0101a0bc5388ecf1c38ccc", "shasum": "" }, "require": { - "php": ">=7.4" + "php": ">=8.4.1", + "symfony/polyfill-ctype": "^1.8", + "symfony/polyfill-intl-grapheme": "^1.33", + "symfony/polyfill-intl-normalizer": "^1.0", + "symfony/polyfill-mbstring": "^1.0" + }, + "conflict": { + "symfony/translation-contracts": "<2.5" }, "require-dev": { - "phpunit/phpunit": "^9.6.7", - "squizlabs/php_codesniffer": "^3.7.2" + "symfony/emoji": "^7.4|^8.0", + "symfony/http-client": "^7.4|^8.0", + "symfony/intl": "^7.4|^8.0", + "symfony/translation-contracts": "^2.5|^3.0", + "symfony/var-exporter": "^7.4|^8.0" }, "type": "library", "autoload": { + "files": [ + "Resources/functions.php" + ], "psr-4": { - "NumberToWords\\": "src" - } + "Symfony\\Component\\String\\": "" + }, + "exclude-from-classmap": [ + "/Tests/" + ] }, "notification-url": "https://packagist.org/downloads/", "license": [ @@ -3935,226 +4230,237 @@ ], "authors": [ { - "name": "Karol Wnuk", - "email": "k.wnuk@ascetic.pl" + "name": "Nicolas Grekas", + "email": "p@tchwork.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" } ], - "description": "Multi language standalone PHP number to words converter. Fully tested, open for extensions and new languages.", + "description": "Provides an object-oriented API to strings and deals with bytes, UTF-8 code points and grapheme clusters in a unified way", + "homepage": "https://symfony.com", "keywords": [ - "currency", - "money", - "number", - "numbers", + "grapheme", + "i18n", "string", - "to", - "words" + "unicode", + "utf-8", + "utf8" ], "support": { - "issues": "https://github.com/kwn/number-to-words/issues", - "source": "https://github.com/kwn/number-to-words/tree/2.7.2" + "source": "https://github.com/symfony/string/tree/v8.1.2" }, - "time": "2023-09-16T15:30:18+00:00" + "funding": [ + { + "url": "https://symfony.com/sponsor", + "type": "custom" + }, + { + "url": "https://github.com/fabpot", + "type": "github" + }, + { + "url": "https://github.com/nicolas-grekas", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "type": "tidelift" + } + ], + "time": "2026-07-28T07:35:25+00:00" }, { - "name": "league/openapi-psr7-validator", - "version": "0.21", + "name": "symfony/yaml", + "version": "v7.4.17", "source": { "type": "git", - "url": "https://github.com/thephpleague/openapi-psr7-validator.git", - "reference": "bccdd3f5037c796fff3ef3f11dcf8c073aaa6192" + "url": "https://github.com/symfony/yaml.git", + "reference": "0b040d7b66ceb10b7bb24c8e6656257932693a12" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/thephpleague/openapi-psr7-validator/zipball/bccdd3f5037c796fff3ef3f11dcf8c073aaa6192", - "reference": "bccdd3f5037c796fff3ef3f11dcf8c073aaa6192", + "url": "https://api.github.com/repos/symfony/yaml/zipball/0b040d7b66ceb10b7bb24c8e6656257932693a12", + "reference": "0b040d7b66ceb10b7bb24c8e6656257932693a12", "shasum": "" }, "require": { - "devizzent/cebe-php-openapi": "^1.0", - "ext-json": "*", - "league/uri": "^6.3", - "php": ">=7.2", - "psr/cache": "^1.0 || ^2.0 || ^3.0", - "psr/http-message": "^1.0", - "psr/http-server-middleware": "^1.0", - "respect/validation": "^1.1.3 || ^2.0", - "riverline/multipart-parser": "^2.0.3", - "symfony/polyfill-php80": "^1.27", - "webmozart/assert": "^1.4" + "php": ">=8.2", + "symfony/deprecation-contracts": "^2.5|^3", + "symfony/polyfill-ctype": "^1.8" + }, + "conflict": { + "symfony/console": "<6.4" }, "require-dev": { - "doctrine/coding-standard": "^8.0", - "guzzlehttp/psr7": "^1.5", - "hansott/psr7-cookies": "^3.0.2", - "phpstan/extension-installer": "^1.0", - "phpstan/phpstan": "^1", - "phpstan/phpstan-phpunit": "^1", - "phpstan/phpstan-webmozart-assert": "^1", - "phpunit/phpunit": "^7 || ^8 || ^9", - "symfony/cache": "^5.1" + "symfony/console": "^6.4|^7.0|^8.0" }, + "bin": [ + "Resources/bin/yaml-lint" + ], "type": "library", "autoload": { "psr-4": { - "League\\OpenAPIValidation\\": "src/" - } + "Symfony\\Component\\Yaml\\": "" + }, + "exclude-from-classmap": [ + "/Tests/" + ] }, "notification-url": "https://packagist.org/downloads/", "license": [ "MIT" ], - "description": "Validate PSR-7 messages against OpenAPI (3.0.2) specifications expressed in YAML or JSON", - "homepage": "https://github.com/thephpleague/openapi-psr7-validator", - "keywords": [ - "http", - "openapi", - "psr7", - "validation" + "authors": [ + { + "name": "Fabien Potencier", + "email": "fabien@symfony.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } ], + "description": "Loads and dumps YAML files", + "homepage": "https://symfony.com", "support": { - "issues": "https://github.com/thephpleague/openapi-psr7-validator/issues", - "source": "https://github.com/thephpleague/openapi-psr7-validator/tree/0.21" + "source": "https://github.com/symfony/yaml/tree/v7.4.17" }, - "time": "2023-04-03T21:49:07+00:00" + "funding": [ + { + "url": "https://symfony.com/sponsor", + "type": "custom" + }, + { + "url": "https://github.com/fabpot", + "type": "github" + }, + { + "url": "https://github.com/nicolas-grekas", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "type": "tidelift" + } + ], + "time": "2026-08-21T12:09:28+00:00" }, { - "name": "league/uri", - "version": "6.8.0", + "name": "twig/twig", + "version": "v3.28.0", "source": { "type": "git", - "url": "https://github.com/thephpleague/uri.git", - "reference": "a700b4656e4c54371b799ac61e300ab25a2d1d39" + "url": "https://github.com/twigphp/Twig.git", + "reference": "597c12ed286fb9d1701a36684ce6e0cbe28ebc8b" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/thephpleague/uri/zipball/a700b4656e4c54371b799ac61e300ab25a2d1d39", - "reference": "a700b4656e4c54371b799ac61e300ab25a2d1d39", + "url": "https://api.github.com/repos/twigphp/Twig/zipball/597c12ed286fb9d1701a36684ce6e0cbe28ebc8b", + "reference": "597c12ed286fb9d1701a36684ce6e0cbe28ebc8b", "shasum": "" }, "require": { - "ext-json": "*", - "league/uri-interfaces": "^2.3", - "php": "^8.1", - "psr/http-message": "^1.0.1" - }, - "conflict": { - "league/uri-schemes": "^1.0" + "php": ">=8.1.0", + "symfony/deprecation-contracts": "^2.5|^3", + "symfony/polyfill-ctype": "^1.8", + "symfony/polyfill-mbstring": "^1.3" }, "require-dev": { - "friendsofphp/php-cs-fixer": "^v3.9.5", - "nyholm/psr7": "^1.5.1", - "php-http/psr7-integration-tests": "^1.1.1", - "phpbench/phpbench": "^1.2.6", - "phpstan/phpstan": "^1.8.5", - "phpstan/phpstan-deprecation-rules": "^1.0", - "phpstan/phpstan-phpunit": "^1.1.1", - "phpstan/phpstan-strict-rules": "^1.4.3", - "phpunit/phpunit": "^9.5.24", - "psr/http-factory": "^1.0.1" - }, - "suggest": { - "ext-fileinfo": "Needed to create Data URI from a filepath", - "ext-intl": "Needed to improve host validation", - "league/uri-components": "Needed to easily manipulate URI objects", - "psr/http-factory": "Needed to use the URI factory" + "php-cs-fixer/shim": "^3.0@stable", + "phpstan/phpstan": "^2.0@stable", + "psr/container": "^1.0|^2.0", + "symfony/phpunit-bridge": "^5.4.9|^6.4|^7.0" }, "type": "library", - "extra": { - "branch-alias": { - "dev-master": "6.x-dev" - } - }, "autoload": { + "files": [ + "src/Resources/core.php", + "src/Resources/debug.php", + "src/Resources/escaper.php", + "src/Resources/string_loader.php" + ], "psr-4": { - "League\\Uri\\": "src" + "Twig\\": "src/" } }, "notification-url": "https://packagist.org/downloads/", "license": [ - "MIT" + "BSD-3-Clause" ], "authors": [ { - "name": "Ignace Nyamagana Butera", - "email": "nyamsprod@gmail.com", - "homepage": "https://nyamsprod.com" + "name": "Fabien Potencier", + "email": "fabien@symfony.com", + "homepage": "http://fabien.potencier.org", + "role": "Lead Developer" + }, + { + "name": "Twig Team", + "role": "Contributors" + }, + { + "name": "Armin Ronacher", + "email": "armin.ronacher@active-4.com", + "role": "Project Founder" } ], - "description": "URI manipulation library", - "homepage": "https://uri.thephpleague.com", + "description": "Twig, the flexible, fast, and secure template language for PHP", + "homepage": "https://twig.symfony.com", "keywords": [ - "data-uri", - "file-uri", - "ftp", - "hostname", - "http", - "https", - "middleware", - "parse_str", - "parse_url", - "psr-7", - "query-string", - "querystring", - "rfc3986", - "rfc3987", - "rfc6570", - "uri", - "uri-template", - "url", - "ws" + "templating" ], "support": { - "docs": "https://uri.thephpleague.com", - "forum": "https://thephpleague.slack.com", - "issues": "https://github.com/thephpleague/uri/issues", - "source": "https://github.com/thephpleague/uri/tree/6.8.0" + "issues": "https://github.com/twigphp/Twig/issues", + "source": "https://github.com/twigphp/Twig/tree/v3.28.0" }, "funding": [ { - "url": "https://github.com/sponsors/nyamsprod", + "url": "https://github.com/fabpot", "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/twig/twig", + "type": "tidelift" } ], - "time": "2022-09-13T19:58:47+00:00" + "time": "2026-07-03T20:44:34+00:00" }, { - "name": "league/uri-interfaces", - "version": "2.3.0", + "name": "webmozart/assert", + "version": "1.12.1", "source": { "type": "git", - "url": "https://github.com/thephpleague/uri-interfaces.git", - "reference": "00e7e2943f76d8cb50c7dfdc2f6dee356e15e383" + "url": "https://github.com/webmozarts/assert.git", + "reference": "9be6926d8b485f55b9229203f962b51ed377ba68" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/thephpleague/uri-interfaces/zipball/00e7e2943f76d8cb50c7dfdc2f6dee356e15e383", - "reference": "00e7e2943f76d8cb50c7dfdc2f6dee356e15e383", + "url": "https://api.github.com/repos/webmozarts/assert/zipball/9be6926d8b485f55b9229203f962b51ed377ba68", + "reference": "9be6926d8b485f55b9229203f962b51ed377ba68", "shasum": "" }, "require": { - "ext-json": "*", + "ext-ctype": "*", + "ext-date": "*", + "ext-filter": "*", "php": "^7.2 || ^8.0" }, - "require-dev": { - "friendsofphp/php-cs-fixer": "^2.19", - "phpstan/phpstan": "^0.12.90", - "phpstan/phpstan-phpunit": "^0.12.19", - "phpstan/phpstan-strict-rules": "^0.12.9", - "phpunit/phpunit": "^8.5.15 || ^9.5" - }, "suggest": { - "ext-intl": "to use the IDNA feature", - "symfony/intl": "to use the IDNA feature via Symfony Polyfill" + "ext-intl": "", + "ext-simplexml": "", + "ext-spl": "" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "2.x-dev" + "dev-master": "1.10-dev" } }, "autoload": { "psr-4": { - "League\\Uri\\": "src/" + "Webmozart\\Assert\\": "src/" } }, "notification-url": "https://packagist.org/downloads/", @@ -4163,136 +4469,162 @@ ], "authors": [ { - "name": "Ignace Nyamagana Butera", - "email": "nyamsprod@gmail.com", - "homepage": "https://nyamsprod.com" + "name": "Bernhard Schussek", + "email": "bschussek@gmail.com" } ], - "description": "Common interface for URI representation", - "homepage": "http://github.com/thephpleague/uri-interfaces", + "description": "Assertions to validate method input/output with nice error messages.", "keywords": [ - "rfc3986", - "rfc3987", - "uri", - "url" + "assert", + "check", + "validate" ], "support": { - "issues": "https://github.com/thephpleague/uri-interfaces/issues", - "source": "https://github.com/thephpleague/uri-interfaces/tree/2.3.0" + "issues": "https://github.com/webmozarts/assert/issues", + "source": "https://github.com/webmozarts/assert/tree/1.12.1" }, - "funding": [ - { - "url": "https://github.com/sponsors/nyamsprod", - "type": "github" - } - ], - "time": "2021-06-28T04:27:21+00:00" + "time": "2025-10-29T15:56:20+00:00" }, { - "name": "localheinz/diff", - "version": "1.1.1", + "name": "wyrihaximus/react-awaitable-observable", + "version": "1.2.1", "source": { "type": "git", - "url": "https://github.com/localheinz/diff.git", - "reference": "851bb20ea8358c86f677f5f111c4ab031b1c764c" + "url": "https://github.com/WyriHaximus/reactphp-awaitable-observable.git", + "reference": "6af262ce44b657a0df9c57af4ca3798f57276cdb" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/localheinz/diff/zipball/851bb20ea8358c86f677f5f111c4ab031b1c764c", - "reference": "851bb20ea8358c86f677f5f111c4ab031b1c764c", + "url": "https://api.github.com/repos/WyriHaximus/reactphp-awaitable-observable/zipball/6af262ce44b657a0df9c57af4ca3798f57276cdb", + "reference": "6af262ce44b657a0df9c57af4ca3798f57276cdb", "shasum": "" }, "require": { - "php": "^7.1 || ^8.0" + "php": "^8.4", + "react/async": "^4.3.0", + "react/promise": "^3.3.0", + "reactivex/rxphp": "^2.1.0", + "wyrihaximus/react-event-loop-rx-scheduler-hook-up": "^0.1.1" }, "require-dev": { - "phpunit/phpunit": "^7.5 || ^8.0", - "symfony/process": "^4.2 || ^5" + "wyrihaximus/async-test-utilities": "^12.0.0", + "wyrihaximus/makefiles": "^0.10.2" }, "type": "library", "autoload": { - "classmap": [ - "src/" - ] + "files": [ + "src/functions_include.php" + ], + "psr-4": { + "WyriHaximus\\React\\": "src/" + } }, "notification-url": "https://packagist.org/downloads/", "license": [ - "BSD-3-Clause" + "MIT" ], "authors": [ { - "name": "Sebastian Bergmann", - "email": "sebastian@phpunit.de" - }, + "name": "Cees-Jan Kiewiet", + "email": "ceesjank@gmail.com" + } + ], + "description": "🛠️ Make observables foreachable using async & await", + "support": { + "issues": "https://github.com/WyriHaximus/reactphp-awaitable-observable/issues", + "source": "https://github.com/WyriHaximus/reactphp-awaitable-observable/tree/1.2.1" + }, + "funding": [ { - "name": "Kore Nordmann", - "email": "mail@kore-nordmann.de" + "url": "https://github.com/WyriHaximus", + "type": "github" } ], - "description": "Fork of sebastian/diff for use with ergebnis/composer-normalize", - "homepage": "https://github.com/localheinz/diff", - "keywords": [ - "diff", - "udiff", - "unidiff", - "unified diff" + "time": "2026-02-28T22:26:32+00:00" + }, + { + "name": "wyrihaximus/react-event-loop-rx-scheduler-hook-up", + "version": "0.1.1", + "source": { + "type": "git", + "url": "https://github.com/WyriHaximus/reactphp-event-loop-rx-scheduler-hook-up.git", + "reference": "462e794cba3c810b77d1e8cb33be43a902673272" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/WyriHaximus/reactphp-event-loop-rx-scheduler-hook-up/zipball/462e794cba3c810b77d1e8cb33be43a902673272", + "reference": "462e794cba3c810b77d1e8cb33be43a902673272", + "shasum": "" + }, + "require": { + "php": "^8.1", + "react/event-loop": "^1.3", + "reactivex/rxphp": "^2.0" + }, + "conflict": { + "azjezz/psl": "<2" + }, + "require-dev": { + "wyrihaximus/async-test-utilities": "^5.0.25" + }, + "type": "library", + "extra": { + "unused": [ + "wyrihaximus/react-mutex", + "wyrihaximus/react-mutex-contracts" + ] + }, + "autoload": { + "files": [ + "src/bootstrap.php" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" ], + "description": "🪝 Hook up ReactPHP Event Loop to the RxPHP Scheduler", "support": { - "source": "https://github.com/localheinz/diff/tree/main" + "issues": "https://github.com/WyriHaximus/reactphp-event-loop-rx-scheduler-hook-up/issues", + "source": "https://github.com/WyriHaximus/reactphp-event-loop-rx-scheduler-hook-up/tree/0.1.1" }, "funding": [ { - "url": "https://github.com/sebastianbergmann", + "url": "https://github.com/WyriHaximus", "type": "github" } ], - "time": "2020-07-06T04:49:32+00:00" + "time": "2023-02-26T15:05:42+00:00" }, { - "name": "maglnet/composer-require-checker", - "version": "4.7.1", + "name": "wyrihaximus/simple-twig", + "version": "2.4.0", "source": { "type": "git", - "url": "https://github.com/maglnet/ComposerRequireChecker.git", - "reference": "e49c58b18fef21e37941a642c1a70d3962e86f28" + "url": "https://github.com/WyriHaximus/php-simple-twig.git", + "reference": "187fa8fcbb4c53414d85c2b5be8fb084fbeeb779" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/maglnet/ComposerRequireChecker/zipball/e49c58b18fef21e37941a642c1a70d3962e86f28", - "reference": "e49c58b18fef21e37941a642c1a70d3962e86f28", + "url": "https://api.github.com/repos/WyriHaximus/php-simple-twig/zipball/187fa8fcbb4c53414d85c2b5be8fb084fbeeb779", + "reference": "187fa8fcbb4c53414d85c2b5be8fb084fbeeb779", "shasum": "" }, "require": { - "composer-runtime-api": "^2.0.0", - "ext-phar": "*", - "nikic/php-parser": "^4.17.1", - "php": "~8.1.0 || ~8.2.0 || ~8.3.0", - "symfony/console": "^6.3.4", - "webmozart/assert": "^1.11.0", - "webmozart/glob": "^4.6.0" + "php": "^8.4", + "twig/twig": "^3.27.0" }, "require-dev": { - "doctrine/coding-standard": "^12.0.0", - "ext-zend-opcache": "*", - "mikey179/vfsstream": "^1.6.11", - "phing/phing": "^2.17.4", - "phpstan/phpstan": "^1.10.34", - "phpunit/phpunit": "^10.3.4", - "roave/infection-static-analysis-plugin": "^1.33", - "vimeo/psalm": "^5.15" + "wyrihaximus/makefiles": "^0.10.6", + "wyrihaximus/test-utilities": "^12.2.0" }, - "bin": [ - "bin/composer-require-checker" - ], "type": "library", - "extra": { - "branch-alias": { - "dev-master": "2.1-dev" - } - }, "autoload": { + "files": [ + "src/functions_include.php" + ], "psr-4": { - "ComposerRequireChecker\\": "src/ComposerRequireChecker" + "WyriHaximus\\Twig\\": "src/" } }, "notification-url": "https://packagist.org/downloads/", @@ -4301,233 +4633,278 @@ ], "authors": [ { - "name": "Marco Pivetta", - "email": "ocramius@gmail.com", - "homepage": "http://ocramius.github.io/" - }, - { - "name": "Matthias Glaub", - "email": "magl@magl.net", - "homepage": "http://magl.net" + "name": "Cees-Jan Kiewiet", + "email": "ceesjank@gmail.com" } ], - "description": "CLI tool to analyze composer dependencies and verify that no unknown symbols are used in the sources of a package", - "homepage": "https://github.com/maglnet/ComposerRequireChecker", - "keywords": [ - "analysis", - "cli", - "composer", - "dependency", - "imports", - "require", - "requirements" - ], + "description": "🌱 Wrapper around Twig making rendering a string template trivial", "support": { - "issues": "https://github.com/maglnet/ComposerRequireChecker/issues", - "source": "https://github.com/maglnet/ComposerRequireChecker/tree/4.7.1" + "issues": "https://github.com/WyriHaximus/php-simple-twig/issues", + "source": "https://github.com/WyriHaximus/php-simple-twig/tree/2.4.0" }, - "time": "2023-09-27T14:57:19+00:00" - }, + "funding": [ + { + "url": "https://github.com/WyriHaximus", + "type": "github" + } + ], + "time": "2026-05-29T11:21:53+00:00" + } + ], + "packages-dev": [ { - "name": "myclabs/deep-copy", - "version": "1.11.1", + "name": "azjezz/psl", + "version": "4.3.0", "source": { "type": "git", - "url": "https://github.com/myclabs/DeepCopy.git", - "reference": "7284c22080590fb39f2ffa3e9057f10a4ddd0e0c" + "url": "https://github.com/php-standard-library/php-standard-library.git", + "reference": "74c95be0214eb7ea39146ed00ac4eb71b45d787b" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/myclabs/DeepCopy/zipball/7284c22080590fb39f2ffa3e9057f10a4ddd0e0c", - "reference": "7284c22080590fb39f2ffa3e9057f10a4ddd0e0c", + "url": "https://api.github.com/repos/php-standard-library/php-standard-library/zipball/74c95be0214eb7ea39146ed00ac4eb71b45d787b", + "reference": "74c95be0214eb7ea39146ed00ac4eb71b45d787b", "shasum": "" }, "require": { - "php": "^7.1 || ^8.0" - }, - "conflict": { - "doctrine/collections": "<1.6.8", - "doctrine/common": "<2.13.3 || >=3,<3.2.2" + "ext-bcmath": "*", + "ext-intl": "*", + "ext-json": "*", + "ext-mbstring": "*", + "ext-sodium": "*", + "php": "~8.3.0 || ~8.4.0 || ~8.5.0", + "revolt/event-loop": "^1.0.7" }, "require-dev": { - "doctrine/collections": "^1.6.8", - "doctrine/common": "^2.13.3 || ^3.2.2", - "phpunit/phpunit": "^7.5.20 || ^8.5.23 || ^9.5.13" + "carthage-software/mago": "^1.6.0", + "infection/infection": "^0.31.2", + "php-coveralls/php-coveralls": "^2.7.0", + "phpbench/phpbench": "^1.4.0", + "phpunit/phpunit": "^9.6.22" + }, + "suggest": { + "php-standard-library/phpstan-extension": "PHPStan integration", + "php-standard-library/psalm-plugin": "Psalm integration" }, "type": "library", + "extra": { + "thanks": { + "url": "https://github.com/hhvm/hsl", + "name": "hhvm/hsl" + } + }, "autoload": { "files": [ - "src/DeepCopy/deep_copy.php" + "src/bootstrap.php" ], "psr-4": { - "DeepCopy\\": "src/DeepCopy/" + "Psl\\": "src/Psl" } }, "notification-url": "https://packagist.org/downloads/", "license": [ "MIT" ], - "description": "Create deep copies (clones) of your objects", - "keywords": [ - "clone", - "copy", - "duplicate", - "object", - "object graph" + "authors": [ + { + "name": "azjezz", + "email": "azjezz@protonmail.com" + } ], + "description": "PHP Standard Library", "support": { - "issues": "https://github.com/myclabs/DeepCopy/issues", - "source": "https://github.com/myclabs/DeepCopy/tree/1.11.1" + "issues": "https://github.com/php-standard-library/php-standard-library/issues", + "source": "https://github.com/php-standard-library/php-standard-library/tree/4.3.0" }, "funding": [ { - "url": "https://tidelift.com/funding/github/packagist/myclabs/deep-copy", - "type": "tidelift" + "url": "https://github.com/azjezz", + "type": "github" + }, + { + "url": "https://github.com/veewee", + "type": "github" } ], - "time": "2023-03-08T13:26:56+00:00" + "abandoned": "php-standard-library/php-standard-library", + "time": "2026-02-24T01:58:53+00:00" }, { - "name": "netresearch/jsonmapper", - "version": "v4.2.0", + "name": "beberlei/assert", + "version": "v3.3.4", "source": { "type": "git", - "url": "https://github.com/cweiske/jsonmapper.git", - "reference": "f60565f8c0566a31acf06884cdaa591867ecc956" + "url": "https://github.com/beberlei/assert.git", + "reference": "f193f4613c7d7fbcee2c05e4daff4061d49c040e" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/cweiske/jsonmapper/zipball/f60565f8c0566a31acf06884cdaa591867ecc956", - "reference": "f60565f8c0566a31acf06884cdaa591867ecc956", + "url": "https://api.github.com/repos/beberlei/assert/zipball/f193f4613c7d7fbcee2c05e4daff4061d49c040e", + "reference": "f193f4613c7d7fbcee2c05e4daff4061d49c040e", "shasum": "" }, "require": { + "ext-ctype": "*", "ext-json": "*", - "ext-pcre": "*", - "ext-reflection": "*", - "ext-spl": "*", - "php": ">=7.1" + "ext-mbstring": "*", + "ext-simplexml": "*", + "php": "^7.1 || ^8.0" }, "require-dev": { - "phpunit/phpunit": "~7.5 || ~8.0 || ~9.0", - "squizlabs/php_codesniffer": "~3.5" + "friendsofphp/php-cs-fixer": "*", + "phpstan/phpstan": "*", + "phpunit/phpunit": ">=6.0.0", + "yoast/phpunit-polyfills": "^0.1.0" + }, + "suggest": { + "ext-intl": "Needed to allow Assertion::count(), Assertion::isCountable(), Assertion::minCount(), and Assertion::maxCount() to operate on ResourceBundles" }, "type": "library", "autoload": { - "psr-0": { - "JsonMapper": "src/" + "files": [ + "lib/Assert/functions.php" + ], + "psr-4": { + "Assert\\": "lib/Assert" } }, "notification-url": "https://packagist.org/downloads/", "license": [ - "OSL-3.0" + "BSD-2-Clause" ], "authors": [ { - "name": "Christian Weiske", - "email": "cweiske@cweiske.de", - "homepage": "http://github.com/cweiske/jsonmapper/", - "role": "Developer" + "name": "Benjamin Eberlei", + "email": "kontakt@beberlei.de", + "role": "Lead Developer" + }, + { + "name": "Richard Quadling", + "email": "rquadling@gmail.com", + "role": "Collaborator" } ], - "description": "Map nested JSON structures onto PHP classes", + "description": "Thin assertion library for input validation in business models.", + "keywords": [ + "assert", + "assertion", + "validation" + ], "support": { - "email": "cweiske@cweiske.de", - "issues": "https://github.com/cweiske/jsonmapper/issues", - "source": "https://github.com/cweiske/jsonmapper/tree/v4.2.0" + "issues": "https://github.com/beberlei/assert/issues", + "source": "https://github.com/beberlei/assert/tree/v3.3.4" }, - "time": "2023-04-09T17:37:40+00:00" + "time": "2026-06-10T19:47:05+00:00" }, { - "name": "nikic/php-parser", - "version": "v4.17.1", + "name": "colinodell/json5", + "version": "v3.0.0", "source": { "type": "git", - "url": "https://github.com/nikic/PHP-Parser.git", - "reference": "a6303e50c90c355c7eeee2c4a8b27fe8dc8fef1d" + "url": "https://github.com/colinodell/json5.git", + "reference": "5724d21bc5c910c2560af1b8915f0cc0163579c8" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/nikic/PHP-Parser/zipball/a6303e50c90c355c7eeee2c4a8b27fe8dc8fef1d", - "reference": "a6303e50c90c355c7eeee2c4a8b27fe8dc8fef1d", + "url": "https://api.github.com/repos/colinodell/json5/zipball/5724d21bc5c910c2560af1b8915f0cc0163579c8", + "reference": "5724d21bc5c910c2560af1b8915f0cc0163579c8", "shasum": "" }, "require": { - "ext-tokenizer": "*", - "php": ">=7.0" + "ext-json": "*", + "ext-mbstring": "*", + "php": "^8.0" }, "require-dev": { - "ircmaxell/php-yacc": "^0.0.7", - "phpunit/phpunit": "^6.5 || ^7.0 || ^8.0 || ^9.0" + "mikehaertl/php-shellcommand": "^1.7.0", + "phpstan/phpstan": "^1.10.57", + "scrutinizer/ocular": "^1.9", + "squizlabs/php_codesniffer": "^3.8.1", + "symfony/finder": "^6.0|^7.0", + "symfony/phpunit-bridge": "^7.0.3" }, "bin": [ - "bin/php-parse" + "bin/json5" ], "type": "library", "extra": { "branch-alias": { - "dev-master": "4.9-dev" + "dev-main": "4.0-dev" } }, "autoload": { + "files": [ + "src/global.php" + ], "psr-4": { - "PhpParser\\": "lib/PhpParser" + "ColinODell\\Json5\\": "src" } }, "notification-url": "https://packagist.org/downloads/", "license": [ - "BSD-3-Clause" + "MIT" ], "authors": [ { - "name": "Nikita Popov" + "name": "Colin O'Dell", + "email": "colinodell@gmail.com", + "homepage": "https://www.colinodell.com", + "role": "Developer" } ], - "description": "A PHP parser written in PHP", + "description": "UTF-8 compatible JSON5 parser for PHP", + "homepage": "https://github.com/colinodell/json5", "keywords": [ - "parser", - "php" + "JSON5", + "json", + "json5_decode", + "json_decode" ], "support": { - "issues": "https://github.com/nikic/PHP-Parser/issues", - "source": "https://github.com/nikic/PHP-Parser/tree/v4.17.1" + "issues": "https://github.com/colinodell/json5/issues", + "source": "https://github.com/colinodell/json5/tree/v3.0.0" }, - "time": "2023-08-13T19:53:39+00:00" + "funding": [ + { + "url": "https://www.colinodell.com/sponsor", + "type": "custom" + }, + { + "url": "https://www.paypal.me/colinpodell/10.00", + "type": "custom" + }, + { + "url": "https://github.com/colinodell", + "type": "github" + }, + { + "url": "https://www.patreon.com/colinodell", + "type": "patreon" + } + ], + "time": "2024-02-09T13:06:12+00:00" }, { - "name": "nikolaposa/version", - "version": "4.1.1", + "name": "composer-unused/contracts", + "version": "0.3.0", "source": { "type": "git", - "url": "https://github.com/nikolaposa/version.git", - "reference": "f6bdd64be914940529b843a67335d6386d980cec" + "url": "https://github.com/composer-unused/contracts.git", + "reference": "5ec448d3ee80735dccad6a21a3266c377d0845ae" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/nikolaposa/version/zipball/f6bdd64be914940529b843a67335d6386d980cec", - "reference": "f6bdd64be914940529b843a67335d6386d980cec", + "url": "https://api.github.com/repos/composer-unused/contracts/zipball/5ec448d3ee80735dccad6a21a3266c377d0845ae", + "reference": "5ec448d3ee80735dccad6a21a3266c377d0845ae", "shasum": "" }, "require": { - "beberlei/assert": "^3.2", - "php": "^7.2 || ^8.0" - }, - "require-dev": { - "friendsofphp/php-cs-fixer": "^2.17", - "phpstan/phpstan": "^0.12.10", - "phpstan/phpstan-beberlei-assert": "^0.12.2", - "phpstan/phpstan-phpunit": "^0.12.6", - "phpunit/phpunit": "^8.0" + "php": "^7.4 || ^8.0" }, "type": "library", - "extra": { - "branch-alias": { - "dev-master": "4.1.x-dev" - } - }, "autoload": { "psr-4": { - "Version\\": "src/" + "ComposerUnused\\Contracts\\": "src/" } }, "notification-url": "https://packagist.org/downloads/", @@ -4536,76 +4913,60 @@ ], "authors": [ { - "name": "Nikola Poša", - "email": "posa.nikola@gmail.com", - "homepage": "https://www.nikolaposa.in.rs" + "name": "Andreas Frömer", + "email": "composer-unused@icanhazstring.com" } ], - "description": "Value Object that represents a SemVer-compliant version number.", - "homepage": "https://github.com/nikolaposa/version", - "keywords": [ - "semantic", - "semver", - "version", - "versioning" - ], + "description": "Contract repository for composer-unused", "support": { - "issues": "https://github.com/nikolaposa/version/issues", - "source": "https://github.com/nikolaposa/version/tree/4.1.1" + "issues": "https://github.com/composer-unused/contracts/issues", + "source": "https://github.com/composer-unused/contracts/tree/0.3.0" }, - "time": "2023-08-04T17:13:40+00:00" + "funding": [ + { + "url": "https://github.com/icanhazstring", + "type": "github" + } + ], + "time": "2023-03-17T00:41:49+00:00" }, { - "name": "nunomaduro/collision", - "version": "v7.10.0", + "name": "composer-unused/symbol-parser", + "version": "0.3.3", "source": { "type": "git", - "url": "https://github.com/nunomaduro/collision.git", - "reference": "49ec67fa7b002712da8526678abd651c09f375b2" + "url": "https://github.com/composer-unused/symbol-parser.git", + "reference": "afa62007cca768bd1ecbc0e8ed347c675c239410" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/nunomaduro/collision/zipball/49ec67fa7b002712da8526678abd651c09f375b2", - "reference": "49ec67fa7b002712da8526678abd651c09f375b2", + "url": "https://api.github.com/repos/composer-unused/symbol-parser/zipball/afa62007cca768bd1ecbc0e8ed347c675c239410", + "reference": "afa62007cca768bd1ecbc0e8ed347c675c239410", "shasum": "" }, "require": { - "filp/whoops": "^2.15.3", - "nunomaduro/termwind": "^1.15.1", - "php": "^8.1.0", - "symfony/console": "^6.3.4" - }, - "conflict": { - "laravel/framework": ">=11.0.0" + "composer-unused/contracts": "^0.3", + "nikic/php-parser": "^5.0", + "php": "^7.4 || ^8.0", + "phpstan/phpdoc-parser": "^1.25 || ^2", + "psr/container": "^1.0 || ^2.0", + "psr/log": "^1.1 || ^2 || ^3", + "symfony/finder": "^5.3 || ^6.0 || ^7.0 || ^8.0" }, "require-dev": { - "brianium/paratest": "^7.3.0", - "laravel/framework": "^10.28.0", - "laravel/pint": "^1.13.3", - "laravel/sail": "^1.25.0", - "laravel/sanctum": "^3.3.1", - "laravel/tinker": "^2.8.2", - "nunomaduro/larastan": "^2.6.4", - "orchestra/testbench-core": "^8.13.0", - "pestphp/pest": "^2.23.2", - "phpunit/phpunit": "^10.4.1", - "sebastian/environment": "^6.0.1", - "spatie/laravel-ignition": "^2.3.1" + "ergebnis/composer-normalize": "^2.49", + "ext-ds": "*", + "phpstan/phpstan": "^2.1", + "phpunit/phpunit": "^10.5", + "roave/security-advisories": "dev-master", + "squizlabs/php_codesniffer": "^4.0.1", + "symfony/property-access": "^5.4 || ^6.0 || ^7.0 || ^8.0", + "symfony/serializer": "^5.4 || ^6.0 || ^7.0 || ^8.0" }, "type": "library", - "extra": { - "laravel": { - "providers": [ - "NunoMaduro\\Collision\\Adapters\\Laravel\\CollisionServiceProvider" - ] - } - }, "autoload": { - "files": [ - "./src/Adapters/Phpunit/Autoload.php" - ], "psr-4": { - "NunoMaduro\\Collision\\": "src/" + "ComposerUnused\\SymbolParser\\": "src" } }, "notification-url": "https://packagist.org/downloads/", @@ -4614,88 +4975,67 @@ ], "authors": [ { - "name": "Nuno Maduro", - "email": "enunomaduro@gmail.com" + "name": "Andreas Frömer", + "email": "composer-unused@icanhazstring.com" } ], - "description": "Cli error handling for console/command-line PHP applications.", + "description": "Toolkit to parse symbols from a composer package", + "homepage": "https://github.com/composer-unused/symbol-parser", "keywords": [ - "artisan", - "cli", - "command-line", - "console", - "error", - "handling", - "laravel", - "laravel-zero", - "php", - "symfony" + "composer", + "parser", + "symbol" ], "support": { - "issues": "https://github.com/nunomaduro/collision/issues", - "source": "https://github.com/nunomaduro/collision" + "issues": "https://github.com/composer-unused/symbol-parser/issues", + "source": "https://github.com/composer-unused/symbol-parser" }, "funding": [ { - "url": "https://www.paypal.com/paypalme/enunomaduro", - "type": "custom" - }, - { - "url": "https://github.com/nunomaduro", + "url": "https://github.com/sponsors/icanhazstring", "type": "github" }, { - "url": "https://www.patreon.com/nunomaduro", - "type": "patreon" + "url": "https://paypal.me/icanhazstring", + "type": "other" } ], - "time": "2023-10-11T15:45:01+00:00" + "time": "2026-01-29T13:38:57+00:00" }, { - "name": "nunomaduro/termwind", - "version": "v1.15.1", + "name": "composer/ca-bundle", + "version": "1.5.14", "source": { "type": "git", - "url": "https://github.com/nunomaduro/termwind.git", - "reference": "8ab0b32c8caa4a2e09700ea32925441385e4a5dc" + "url": "https://github.com/composer/ca-bundle.git", + "reference": "0c8abba0634f637bd78c4e451981da368d403463" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/nunomaduro/termwind/zipball/8ab0b32c8caa4a2e09700ea32925441385e4a5dc", - "reference": "8ab0b32c8caa4a2e09700ea32925441385e4a5dc", + "url": "https://api.github.com/repos/composer/ca-bundle/zipball/0c8abba0634f637bd78c4e451981da368d403463", + "reference": "0c8abba0634f637bd78c4e451981da368d403463", "shasum": "" }, "require": { - "ext-mbstring": "*", - "php": "^8.0", - "symfony/console": "^5.3.0|^6.0.0" - }, - "require-dev": { - "ergebnis/phpstan-rules": "^1.0.", - "illuminate/console": "^8.0|^9.0", - "illuminate/support": "^8.0|^9.0", - "laravel/pint": "^1.0.0", - "pestphp/pest": "^1.21.0", - "pestphp/pest-plugin-mock": "^1.0", - "phpstan/phpstan": "^1.4.6", - "phpstan/phpstan-strict-rules": "^1.1.0", - "symfony/var-dumper": "^5.2.7|^6.0.0", - "thecodingmachine/phpstan-strict-rules": "^1.0.0" + "ext-openssl": "*", + "ext-pcre": "*", + "php": "^7.2 || ^8.0" + }, + "require-dev": { + "phpstan/phpstan": "^1.10", + "phpunit/phpunit": "^8 || ^9", + "psr/log": "^1.0 || ^2.0 || ^3.0", + "symfony/process": "^4.0 || ^5.0 || ^6.0 || ^7.0" }, "type": "library", "extra": { - "laravel": { - "providers": [ - "Termwind\\Laravel\\TermwindServiceProvider" - ] + "branch-alias": { + "dev-main": "1.x-dev" } }, "autoload": { - "files": [ - "src/Functions.php" - ], "psr-4": { - "Termwind\\": "src/" + "Composer\\CaBundle\\": "src" } }, "notification-url": "https://packagist.org/downloads/", @@ -4704,72 +5044,72 @@ ], "authors": [ { - "name": "Nuno Maduro", - "email": "enunomaduro@gmail.com" + "name": "Jordi Boggiano", + "email": "j.boggiano@seld.be", + "homepage": "http://seld.be" } ], - "description": "Its like Tailwind CSS, but for the console.", + "description": "Lets you find a path to the system CA bundle, and includes a fallback to the Mozilla CA bundle.", "keywords": [ - "cli", - "console", - "css", - "package", - "php", - "style" + "cabundle", + "cacert", + "certificate", + "ssl", + "tls" ], "support": { - "issues": "https://github.com/nunomaduro/termwind/issues", - "source": "https://github.com/nunomaduro/termwind/tree/v1.15.1" + "irc": "irc://irc.freenode.org/composer", + "issues": "https://github.com/composer/ca-bundle/issues", + "source": "https://github.com/composer/ca-bundle/tree/1.5.14" }, "funding": [ { - "url": "https://www.paypal.com/paypalme/enunomaduro", + "url": "https://packagist.com", "type": "custom" }, { - "url": "https://github.com/nunomaduro", - "type": "github" - }, - { - "url": "https://github.com/xiCO2k", + "url": "https://github.com/composer", "type": "github" } ], - "time": "2023-02-08T01:06:31+00:00" + "time": "2026-08-21T14:57:29+00:00" }, { - "name": "ocramius/package-versions", - "version": "2.8.0", + "name": "composer/class-map-generator", + "version": "1.7.3", "source": { "type": "git", - "url": "https://github.com/Ocramius/PackageVersions.git", - "reference": "7b5821f854cf1e6753c4ed7ceb3b11ae83bbad4e" + "url": "https://github.com/composer/class-map-generator.git", + "reference": "86d8208fc3c649a3a999daf1a63c25201be2990f" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/Ocramius/PackageVersions/zipball/7b5821f854cf1e6753c4ed7ceb3b11ae83bbad4e", - "reference": "7b5821f854cf1e6753c4ed7ceb3b11ae83bbad4e", + "url": "https://api.github.com/repos/composer/class-map-generator/zipball/86d8208fc3c649a3a999daf1a63c25201be2990f", + "reference": "86d8208fc3c649a3a999daf1a63c25201be2990f", "shasum": "" }, "require": { - "composer-runtime-api": "^2.2.0", - "php": "~8.1.0 || ~8.2.0 || ~8.3.0" - }, - "replace": { - "composer/package-versions-deprecated": "*" + "composer/pcre": "^2.1 || ^3.1", + "php": "^7.2 || ^8.0", + "symfony/finder": "^4.4 || ^5.3 || ^6 || ^7 || ^8" }, "require-dev": { - "composer/composer": "^2.6.3", - "doctrine/coding-standard": "^12.0.0", - "ext-zip": "^1.15.0", - "phpunit/phpunit": "^9.6.12", - "roave/infection-static-analysis-plugin": "^1.33", - "vimeo/psalm": "^5.15.0" + "phpstan/phpstan": "^1.12 || ^2", + "phpstan/phpstan-deprecation-rules": "^1 || ^2", + "phpstan/phpstan-phpunit": "^1 || ^2", + "phpstan/phpstan-strict-rules": "^1.1 || ^2", + "phpunit/phpunit": "^8", + "symfony/filesystem": "^5.4 || ^6 || ^7 || ^8" }, "type": "library", + "extra": { + "branch-alias": { + "dev-main": "1.x-dev" + } + }, "autoload": { "psr-4": { - "PackageVersions\\": "src/PackageVersions" + "Composer\\ClassMapGenerator\\": "src" } }, "notification-url": "https://packagist.org/downloads/", @@ -4778,57 +5118,103 @@ ], "authors": [ { - "name": "Marco Pivetta", - "email": "ocramius@gmail.com" + "name": "Jordi Boggiano", + "email": "j.boggiano@seld.be", + "homepage": "https://seld.be" } ], - "description": "Provides efficient querying for installed package versions (no runtime IO)", + "description": "Utilities to scan PHP code and generate class maps.", + "keywords": [ + "classmap" + ], "support": { - "issues": "https://github.com/Ocramius/PackageVersions/issues", - "source": "https://github.com/Ocramius/PackageVersions/tree/2.8.0" + "issues": "https://github.com/composer/class-map-generator/issues", + "source": "https://github.com/composer/class-map-generator/tree/1.7.3" }, "funding": [ { - "url": "https://github.com/Ocramius", - "type": "github" + "url": "https://packagist.com", + "type": "custom" }, { - "url": "https://tidelift.com/funding/github/packagist/ocramius/package-versions", - "type": "tidelift" + "url": "https://github.com/composer", + "type": "github" } ], - "time": "2023-09-15T11:02:59+00:00" + "time": "2026-05-05T09:17:07+00:00" }, { - "name": "ondram/ci-detector", - "version": "4.1.0", + "name": "composer/composer", + "version": "2.10.3", "source": { "type": "git", - "url": "https://github.com/OndraM/ci-detector.git", - "reference": "8a4b664e916df82ff26a44709942dfd593fa6f30" + "url": "https://github.com/composer/composer.git", + "reference": "f0de0bf90226853b841672f086d8b58b02332504" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/OndraM/ci-detector/zipball/8a4b664e916df82ff26a44709942dfd593fa6f30", - "reference": "8a4b664e916df82ff26a44709942dfd593fa6f30", + "url": "https://api.github.com/repos/composer/composer/zipball/f0de0bf90226853b841672f086d8b58b02332504", + "reference": "f0de0bf90226853b841672f086d8b58b02332504", "shasum": "" }, "require": { - "php": "^7.1 || ^8.0" + "composer/ca-bundle": "^1.5", + "composer/class-map-generator": "^1.4.0", + "composer/metadata-minifier": "^1.0", + "composer/pcre": "^2.3 || ^3.3", + "composer/semver": "^3.3", + "composer/spdx-licenses": "^1.5.7", + "composer/xdebug-handler": "^2.0.2 || ^3.0.3", + "ext-filter": "*", + "ext-hash": "*", + "ext-json": "*", + "justinrainbow/json-schema": "^6.5.1", + "php": "^7.2.5 || ^8.0", + "psr/log": "^1.0 || ^2.0 || ^3.0", + "react/promise": "^3.3", + "seld/jsonlint": "^1.4", + "seld/phar-utils": "^1.2", + "seld/signal-handler": "^2.0", + "symfony/console": "^5.4.47 || ^6.4.25 || ^7.1.10 || ^8.0", + "symfony/filesystem": "^5.4.45 || ^6.4.24 || ^7.1.10 || ^8.0", + "symfony/finder": "^5.4.45 || ^6.4.24 || ^7.1.10 || ^8.0", + "symfony/polyfill-php73": "^1.24", + "symfony/polyfill-php80": "^1.24", + "symfony/polyfill-php81": "^1.24", + "symfony/polyfill-php84": "^1.30", + "symfony/process": "^5.4.47 || ^6.4.25 || ^7.1.10 || ^8.0" }, "require-dev": { - "ergebnis/composer-normalize": "^2.2", - "lmc/coding-standard": "^1.3 || ^2.1", - "php-parallel-lint/php-parallel-lint": "^1.2", - "phpstan/extension-installer": "^1.0.5", - "phpstan/phpstan": "^0.12.58", - "phpstan/phpstan-phpunit": "^0.12.16", - "phpunit/phpunit": "^7.1 || ^8.0 || ^9.0" + "phpstan/phpstan": "^1.11.8", + "phpstan/phpstan-deprecation-rules": "^1.2.0", + "phpstan/phpstan-phpunit": "^1.4.0", + "phpstan/phpstan-strict-rules": "^1.6.0", + "phpstan/phpstan-symfony": "^1.4.0", + "symfony/phpunit-bridge": "^6.4.25 || ^7.3.3 || ^8.0" + }, + "suggest": { + "ext-curl": "Provides HTTP support (will fallback to PHP streams if missing)", + "ext-openssl": "Enables access to repositories and packages over HTTPS", + "ext-zip": "Allows direct extraction of ZIP archives (unzip/7z binaries will be used instead if available)", + "ext-zlib": "Enables gzip for HTTP requests" }, + "bin": [ + "bin/composer" + ], "type": "library", + "extra": { + "phpstan": { + "includes": [ + "phpstan/rules.neon" + ] + }, + "branch-alias": { + "dev-main": "2.10-dev" + } + }, "autoload": { "psr-4": { - "OndraM\\CiDetector\\": "src/" + "Composer\\": "src/Composer/" } }, "notification-url": "https://packagist.org/downloads/", @@ -4837,82 +5223,72 @@ ], "authors": [ { - "name": "Ondřej Machulda", - "email": "ondrej.machulda@gmail.com" + "name": "Nils Adermann", + "email": "naderman@naderman.de", + "homepage": "https://www.naderman.de" + }, + { + "name": "Jordi Boggiano", + "email": "j.boggiano@seld.be", + "homepage": "https://seld.be" } ], - "description": "Detect continuous integration environment and provide unified access to properties of current build", + "description": "Composer helps you declare, manage and install dependencies of PHP projects. It ensures you have the right stack everywhere.", + "homepage": "https://getcomposer.org/", "keywords": [ - "CircleCI", - "Codeship", - "Wercker", - "adapter", - "appveyor", - "aws", - "aws codebuild", - "azure", - "azure devops", - "azure pipelines", - "bamboo", - "bitbucket", - "buddy", - "ci-info", - "codebuild", - "continuous integration", - "continuousphp", - "devops", - "drone", - "github", - "gitlab", - "interface", - "jenkins", - "pipelines", - "sourcehut", - "teamcity", - "travis" + "autoload", + "dependency", + "package" ], "support": { - "issues": "https://github.com/OndraM/ci-detector/issues", - "source": "https://github.com/OndraM/ci-detector/tree/4.1.0" + "irc": "ircs://irc.libera.chat:6697/composer", + "issues": "https://github.com/composer/composer/issues", + "security": "https://github.com/composer/composer/security/policy", + "source": "https://github.com/composer/composer/tree/2.10.3" }, - "time": "2021-04-14T09:16:52+00:00" + "funding": [ + { + "url": "https://packagist.com", + "type": "custom" + }, + { + "url": "https://github.com/composer", + "type": "github" + } + ], + "time": "2026-08-27T11:34:23+00:00" }, { - "name": "orklah/psalm-insane-comparison", - "version": "v2.2.0", + "name": "composer/metadata-minifier", + "version": "1.0.1", "source": { "type": "git", - "url": "https://github.com/orklah/psalm-insane-comparison.git", - "reference": "f0e44bf31678d189c8ee4556598d0ad6e3f853c9" + "url": "https://github.com/composer/metadata-minifier.git", + "reference": "8e86142e3ade750b837d55e55f0cdc786d8da006" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/orklah/psalm-insane-comparison/zipball/f0e44bf31678d189c8ee4556598d0ad6e3f853c9", - "reference": "f0e44bf31678d189c8ee4556598d0ad6e3f853c9", + "url": "https://api.github.com/repos/composer/metadata-minifier/zipball/8e86142e3ade750b837d55e55f0cdc786d8da006", + "reference": "8e86142e3ade750b837d55e55f0cdc786d8da006", "shasum": "" }, "require": { - "ext-simplexml": "*", - "php": "^7.3|^8.0" + "php": "^5.3.2 || ^7.0 || ^8.0" }, "require-dev": { - "nikic/php-parser": "^4.0", - "vimeo/psalm": "^4.0|^5" + "composer/composer": "^2", + "phpstan/phpstan": "^1", + "symfony/phpunit-bridge": "^4.2 || ^5 || ^6 || ^7" }, - "type": "psalm-plugin", + "type": "library", "extra": { - "psalm": { - "pluginClass": "Orklah\\PsalmInsaneComparison\\Plugin" + "branch-alias": { + "dev-main": "1.x-dev" } }, "autoload": { "psr-4": { - "Orklah\\PsalmInsaneComparison\\": [ - "." - ], - "Orklah\\PsalmInsaneComparison\\Hooks\\": [ - "hooks" - ] + "Composer\\MetadataMinifier\\": "src" } }, "notification-url": "https://packagist.org/downloads/", @@ -4921,223 +5297,289 @@ ], "authors": [ { - "name": "orklah" + "name": "Jordi Boggiano", + "email": "j.boggiano@seld.be", + "homepage": "http://seld.be" + } + ], + "description": "Small utility library that handles metadata minification and expansion.", + "keywords": [ + "composer", + "compression" + ], + "support": { + "issues": "https://github.com/composer/metadata-minifier/issues", + "source": "https://github.com/composer/metadata-minifier/tree/1.0.1" + }, + "funding": [ + { + "url": "https://packagist.com", + "type": "custom" + }, + { + "url": "https://github.com/composer", + "type": "github" } ], - "description": "Detects possible insane comparison (\"string\" == 0) to help migrate to PHP8", - "support": { - "issues": "https://github.com/orklah/psalm-insane-comparison/issues", - "source": "https://github.com/orklah/psalm-insane-comparison/tree/v2.2.0" - }, - "time": "2023-01-06T09:06:11+00:00" + "time": "2026-06-30T11:34:59+00:00" }, { - "name": "pepakriz/phpstan-exception-rules", - "version": "v0.12.0", + "name": "composer/pcre", + "version": "3.4.0", "source": { "type": "git", - "url": "https://github.com/pepakriz/phpstan-exception-rules.git", - "reference": "c5f3fe501e5a6c57c33fb678ad9278131bc1b9bd" + "url": "https://github.com/composer/pcre.git", + "reference": "d5a341b3fb61f3001970940afb1d332968a183ed" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/pepakriz/phpstan-exception-rules/zipball/c5f3fe501e5a6c57c33fb678ad9278131bc1b9bd", - "reference": "c5f3fe501e5a6c57c33fb678ad9278131bc1b9bd", + "url": "https://api.github.com/repos/composer/pcre/zipball/d5a341b3fb61f3001970940afb1d332968a183ed", + "reference": "d5a341b3fb61f3001970940afb1d332968a183ed", "shasum": "" }, "require": { - "nikic/php-parser": "^4.13", - "php": ">=7.1", - "phpstan/phpstan": "^1.0" + "php": "^7.4 || ^8.0" + }, + "conflict": { + "phpstan/phpstan": "<2.2.2" }, "require-dev": { - "nette/utils": "^3.0", - "php-parallel-lint/php-console-highlighter": "^0.4.0", - "php-parallel-lint/php-parallel-lint": "^1.2.0", - "phpstan/phpstan-nette": "^1.0", - "phpstan/phpstan-phpunit": "^1.0", - "phpstan/phpstan-strict-rules": "^1.0", - "phpunit/phpunit": "^7.5.6 || ^9.4.2", - "slevomat/coding-standard": "^6.4.1", - "squizlabs/php_codesniffer": "~3.5.2" + "phpstan/phpstan": "^2", + "phpstan/phpstan-deprecation-rules": "^2", + "phpstan/phpstan-strict-rules": "^2", + "phpunit/phpunit": "^9" }, - "type": "phpstan-extension", + "type": "library", "extra": { - "branch-alias": { - "dev-master": "0.12-dev" - }, "phpstan": { "includes": [ "extension.neon" ] + }, + "branch-alias": { + "dev-main": "3.x-dev" } }, "autoload": { "psr-4": { - "Pepakriz\\PHPStanExceptionRules\\": "src" + "Composer\\Pcre\\": "src" } }, "notification-url": "https://packagist.org/downloads/", "license": [ "MIT" ], - "description": "Exception rules for PHPStan", + "authors": [ + { + "name": "Jordi Boggiano", + "email": "j.boggiano@seld.be", + "homepage": "http://seld.be" + } + ], + "description": "PCRE wrapping library that offers type-safe preg_* replacements.", + "keywords": [ + "PCRE", + "preg", + "regex", + "regular expression" + ], "support": { - "issues": "https://github.com/pepakriz/phpstan-exception-rules/issues", - "source": "https://github.com/pepakriz/phpstan-exception-rules/tree/v0.12.0" + "issues": "https://github.com/composer/pcre/issues", + "source": "https://github.com/composer/pcre/tree/3.4.0" }, - "time": "2021-11-07T19:03:56+00:00" + "funding": [ + { + "url": "https://packagist.com", + "type": "custom" + }, + { + "url": "https://github.com/composer", + "type": "github" + } + ], + "time": "2026-06-07T11:47:49+00:00" }, { - "name": "phar-io/manifest", - "version": "2.0.3", + "name": "composer/semver", + "version": "3.4.4", "source": { "type": "git", - "url": "https://github.com/phar-io/manifest.git", - "reference": "97803eca37d319dfa7826cc2437fc020857acb53" + "url": "https://github.com/composer/semver.git", + "reference": "198166618906cb2de69b95d7d47e5fa8aa1b2b95" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/phar-io/manifest/zipball/97803eca37d319dfa7826cc2437fc020857acb53", - "reference": "97803eca37d319dfa7826cc2437fc020857acb53", + "url": "https://api.github.com/repos/composer/semver/zipball/198166618906cb2de69b95d7d47e5fa8aa1b2b95", + "reference": "198166618906cb2de69b95d7d47e5fa8aa1b2b95", "shasum": "" }, "require": { - "ext-dom": "*", - "ext-phar": "*", - "ext-xmlwriter": "*", - "phar-io/version": "^3.0.1", - "php": "^7.2 || ^8.0" + "php": "^5.3.2 || ^7.0 || ^8.0" + }, + "require-dev": { + "phpstan/phpstan": "^1.11", + "symfony/phpunit-bridge": "^3 || ^7" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "2.0.x-dev" + "dev-main": "3.x-dev" } }, "autoload": { - "classmap": [ - "src/" - ] + "psr-4": { + "Composer\\Semver\\": "src" + } }, "notification-url": "https://packagist.org/downloads/", "license": [ - "BSD-3-Clause" + "MIT" ], "authors": [ { - "name": "Arne Blankerts", - "email": "arne@blankerts.de", - "role": "Developer" + "name": "Nils Adermann", + "email": "naderman@naderman.de", + "homepage": "http://www.naderman.de" }, { - "name": "Sebastian Heuer", - "email": "sebastian@phpeople.de", - "role": "Developer" + "name": "Jordi Boggiano", + "email": "j.boggiano@seld.be", + "homepage": "http://seld.be" }, { - "name": "Sebastian Bergmann", - "email": "sebastian@phpunit.de", - "role": "Developer" + "name": "Rob Bast", + "email": "rob.bast@gmail.com", + "homepage": "http://robbast.nl" } ], - "description": "Component for reading phar.io manifest information from a PHP Archive (PHAR)", + "description": "Semver library that offers utilities, version constraint parsing and validation.", + "keywords": [ + "semantic", + "semver", + "validation", + "versioning" + ], "support": { - "issues": "https://github.com/phar-io/manifest/issues", - "source": "https://github.com/phar-io/manifest/tree/2.0.3" + "irc": "ircs://irc.libera.chat:6697/composer", + "issues": "https://github.com/composer/semver/issues", + "source": "https://github.com/composer/semver/tree/3.4.4" }, - "time": "2021-07-20T11:28:43+00:00" + "funding": [ + { + "url": "https://packagist.com", + "type": "custom" + }, + { + "url": "https://github.com/composer", + "type": "github" + } + ], + "time": "2025-08-20T19:15:30+00:00" }, { - "name": "phar-io/version", - "version": "3.2.1", + "name": "composer/spdx-licenses", + "version": "1.6.0", "source": { "type": "git", - "url": "https://github.com/phar-io/version.git", - "reference": "4f7fd7836c6f332bb2933569e566a0d6c4cbed74" + "url": "https://github.com/composer/spdx-licenses.git", + "reference": "5ecd0cb4177696f9fd48f1605dda81db3dee7889" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/phar-io/version/zipball/4f7fd7836c6f332bb2933569e566a0d6c4cbed74", - "reference": "4f7fd7836c6f332bb2933569e566a0d6c4cbed74", + "url": "https://api.github.com/repos/composer/spdx-licenses/zipball/5ecd0cb4177696f9fd48f1605dda81db3dee7889", + "reference": "5ecd0cb4177696f9fd48f1605dda81db3dee7889", "shasum": "" }, "require": { "php": "^7.2 || ^8.0" }, + "require-dev": { + "phpstan/phpstan": "^1.11", + "symfony/phpunit-bridge": "^6.4.25 || ^7.3.3 || ^8.0" + }, "type": "library", + "extra": { + "branch-alias": { + "dev-main": "1.x-dev" + } + }, "autoload": { - "classmap": [ - "src/" - ] + "psr-4": { + "Composer\\Spdx\\": "src" + } }, "notification-url": "https://packagist.org/downloads/", "license": [ - "BSD-3-Clause" + "MIT" ], "authors": [ { - "name": "Arne Blankerts", - "email": "arne@blankerts.de", - "role": "Developer" + "name": "Nils Adermann", + "email": "naderman@naderman.de", + "homepage": "http://www.naderman.de" }, { - "name": "Sebastian Heuer", - "email": "sebastian@phpeople.de", - "role": "Developer" + "name": "Jordi Boggiano", + "email": "j.boggiano@seld.be", + "homepage": "http://seld.be" }, { - "name": "Sebastian Bergmann", - "email": "sebastian@phpunit.de", - "role": "Developer" + "name": "Rob Bast", + "email": "rob.bast@gmail.com", + "homepage": "http://robbast.nl" } ], - "description": "Library for handling version information and constraints", + "description": "SPDX licenses list and validation library.", + "keywords": [ + "license", + "spdx", + "validator" + ], "support": { - "issues": "https://github.com/phar-io/version/issues", - "source": "https://github.com/phar-io/version/tree/3.2.1" + "irc": "ircs://irc.libera.chat:6697/composer", + "issues": "https://github.com/composer/spdx-licenses/issues", + "source": "https://github.com/composer/spdx-licenses/tree/1.6.0" }, - "time": "2022-02-21T01:04:05+00:00" + "funding": [ + { + "url": "https://packagist.com", + "type": "custom" + }, + { + "url": "https://github.com/composer", + "type": "github" + } + ], + "time": "2026-04-08T20:18:39+00:00" }, { - "name": "php-coveralls/php-coveralls", - "version": "v2.6.0", + "name": "composer/xdebug-handler", + "version": "3.0.5", "source": { "type": "git", - "url": "https://github.com/php-coveralls/php-coveralls.git", - "reference": "9e88d7d38e9eab7c675da674481784321ea7a9bc" + "url": "https://github.com/composer/xdebug-handler.git", + "reference": "6c1925561632e83d60a44492e0b344cf48ab85ef" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/php-coveralls/php-coveralls/zipball/9e88d7d38e9eab7c675da674481784321ea7a9bc", - "reference": "9e88d7d38e9eab7c675da674481784321ea7a9bc", + "url": "https://api.github.com/repos/composer/xdebug-handler/zipball/6c1925561632e83d60a44492e0b344cf48ab85ef", + "reference": "6c1925561632e83d60a44492e0b344cf48ab85ef", "shasum": "" }, "require": { - "ext-json": "*", - "ext-simplexml": "*", - "guzzlehttp/guzzle": "^6.0 || ^7.0", - "php": "^5.5 || ^7.0 || ^8.0", - "psr/log": "^1.0 || ^2.0", - "symfony/config": "^2.1 || ^3.0 || ^4.0 || ^5.0 || ^6.0", - "symfony/console": "^2.1 || ^3.0 || ^4.0 || ^5.0 || ^6.0", - "symfony/stopwatch": "^2.0 || ^3.0 || ^4.0 || ^5.0 || ^6.0", - "symfony/yaml": "^2.0.5 || ^3.0 || ^4.0 || ^5.0 || ^6.0" + "composer/pcre": "^1 || ^2 || ^3", + "php": "^7.2.5 || ^8.0", + "psr/log": "^1 || ^2 || ^3" }, "require-dev": { - "phpunit/phpunit": "^4.8.35 || ^5.4.3 || ^6.0 || ^7.0 || >=8.0 <8.5.29 || >=9.0 <9.5.23", - "sanmai/phpunit-legacy-adapter": "^6.1 || ^8.0" - }, - "suggest": { - "symfony/http-kernel": "Allows Symfony integration" + "phpstan/phpstan": "^1.0", + "phpstan/phpstan-strict-rules": "^1.1", + "phpunit/phpunit": "^8.5 || ^9.6 || ^10.5" }, - "bin": [ - "bin/php-coveralls" - ], "type": "library", "autoload": { "psr-4": { - "PhpCoveralls\\": "src/" + "Composer\\XdebugHandler\\": "src" } }, "notification-url": "https://packagist.org/downloads/", @@ -5146,235 +5588,320 @@ ], "authors": [ { - "name": "Kitamura Satoshi", - "email": "with.no.parachute@gmail.com", - "homepage": "https://www.facebook.com/satooshi.jp", - "role": "Original creator" - }, - { - "name": "Takashi Matsuo", - "email": "tmatsuo@google.com" - }, + "name": "John Stevenson", + "email": "john-stevenson@blueyonder.co.uk" + } + ], + "description": "Restarts a process without Xdebug.", + "keywords": [ + "Xdebug", + "performance" + ], + "support": { + "irc": "ircs://irc.libera.chat:6697/composer", + "issues": "https://github.com/composer/xdebug-handler/issues", + "source": "https://github.com/composer/xdebug-handler/tree/3.0.5" + }, + "funding": [ { - "name": "Google Inc" + "url": "https://packagist.com", + "type": "custom" }, { - "name": "Dariusz Ruminski", - "email": "dariusz.ruminski@gmail.com", - "homepage": "https://github.com/keradus" + "url": "https://github.com/composer", + "type": "github" }, { - "name": "Contributors", - "homepage": "https://github.com/php-coveralls/php-coveralls/graphs/contributors" + "url": "https://tidelift.com/funding/github/packagist/composer/composer", + "type": "tidelift" } ], - "description": "PHP client library for Coveralls API", - "homepage": "https://github.com/php-coveralls/php-coveralls", - "keywords": [ - "ci", - "coverage", - "github", - "test" - ], - "support": { - "issues": "https://github.com/php-coveralls/php-coveralls/issues", - "source": "https://github.com/php-coveralls/php-coveralls/tree/v2.6.0" - }, - "time": "2023-07-16T08:39:10+00:00" + "time": "2024-05-06T16:37:16+00:00" }, { - "name": "php-parallel-lint/php-console-color", - "version": "v1.0.1", + "name": "dealerdirect/phpcodesniffer-composer-installer", + "version": "v1.2.1", "source": { "type": "git", - "url": "https://github.com/php-parallel-lint/PHP-Console-Color.git", - "reference": "7adfefd530aa2d7570ba87100a99e2483a543b88" + "url": "https://github.com/PHPCSStandards/composer-installer.git", + "reference": "963f0c67bffde0eac41b56be71ac0e8ba132f0bd" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/php-parallel-lint/PHP-Console-Color/zipball/7adfefd530aa2d7570ba87100a99e2483a543b88", - "reference": "7adfefd530aa2d7570ba87100a99e2483a543b88", + "url": "https://api.github.com/repos/PHPCSStandards/composer-installer/zipball/963f0c67bffde0eac41b56be71ac0e8ba132f0bd", + "reference": "963f0c67bffde0eac41b56be71ac0e8ba132f0bd", "shasum": "" }, "require": { - "php": ">=5.3.2" - }, - "replace": { - "jakub-onderka/php-console-color": "*" + "composer-plugin-api": "^2.2", + "php": ">=5.4", + "squizlabs/php_codesniffer": "^3.1.0 || ^4.0" }, "require-dev": { - "php-parallel-lint/php-code-style": "^2.0", - "php-parallel-lint/php-parallel-lint": "^1.0", - "php-parallel-lint/php-var-dump-check": "0.*", - "phpunit/phpunit": "^4.8.36 || ^5.7.21 || ^6.0 || ^7.0 || ^8.0 || ^9.0" + "composer/composer": "^2.2", + "ext-json": "*", + "ext-zip": "*", + "php-parallel-lint/php-parallel-lint": "^1.4.0", + "phpcompatibility/php-compatibility": "^9.0 || ^10.0.0@dev", + "yoast/phpunit-polyfills": "^1.0" + }, + "type": "composer-plugin", + "extra": { + "class": "PHPCSStandards\\Composer\\Plugin\\Installers\\PHPCodeSniffer\\Plugin" }, - "type": "library", "autoload": { "psr-4": { - "PHP_Parallel_Lint\\PhpConsoleColor\\": "src/" + "PHPCSStandards\\Composer\\Plugin\\Installers\\PHPCodeSniffer\\": "src/" } }, "notification-url": "https://packagist.org/downloads/", "license": [ - "BSD-2-Clause" + "MIT" + ], + "authors": [ + { + "name": "Franck Nijhof", + "email": "opensource@frenck.dev", + "homepage": "https://frenck.dev", + "role": "Open source developer" + }, + { + "name": "Contributors", + "homepage": "https://github.com/PHPCSStandards/composer-installer/graphs/contributors" + } + ], + "description": "PHP_CodeSniffer Standards Composer Installer Plugin", + "keywords": [ + "PHPCodeSniffer", + "PHP_CodeSniffer", + "code quality", + "codesniffer", + "composer", + "installer", + "phpcbf", + "phpcs", + "plugin", + "qa", + "quality", + "standard", + "standards", + "style guide", + "stylecheck", + "tests" ], - "authors": [ + "support": { + "issues": "https://github.com/PHPCSStandards/composer-installer/issues", + "security": "https://github.com/PHPCSStandards/composer-installer/security/policy", + "source": "https://github.com/PHPCSStandards/composer-installer" + }, + "funding": [ { - "name": "Jakub Onderka", - "email": "jakub.onderka@gmail.com" + "url": "https://github.com/PHPCSStandards", + "type": "github" + }, + { + "url": "https://github.com/jrfnl", + "type": "github" + }, + { + "url": "https://opencollective.com/php_codesniffer", + "type": "open_collective" + }, + { + "url": "https://thanks.dev/u/gh/phpcsstandards", + "type": "thanks_dev" } ], - "description": "Simple library for creating colored console ouput.", - "support": { - "issues": "https://github.com/php-parallel-lint/PHP-Console-Color/issues", - "source": "https://github.com/php-parallel-lint/PHP-Console-Color/tree/v1.0.1" - }, - "time": "2021-12-25T06:49:29+00:00" + "time": "2026-05-06T08:26:05+00:00" }, { - "name": "php-parallel-lint/php-console-highlighter", - "version": "v1.0.0", + "name": "doctrine/coding-standard", + "version": "14.0.0", "source": { "type": "git", - "url": "https://github.com/php-parallel-lint/PHP-Console-Highlighter.git", - "reference": "5b4803384d3303cf8e84141039ef56c8a123138d" + "url": "https://github.com/doctrine/coding-standard.git", + "reference": "897a7dc209e49ee6cf04e689c41112df17967130" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/php-parallel-lint/PHP-Console-Highlighter/zipball/5b4803384d3303cf8e84141039ef56c8a123138d", - "reference": "5b4803384d3303cf8e84141039ef56c8a123138d", + "url": "https://api.github.com/repos/doctrine/coding-standard/zipball/897a7dc209e49ee6cf04e689c41112df17967130", + "reference": "897a7dc209e49ee6cf04e689c41112df17967130", "shasum": "" }, "require": { - "ext-tokenizer": "*", - "php": ">=5.3.2", - "php-parallel-lint/php-console-color": "^1.0.1" - }, - "replace": { - "jakub-onderka/php-console-highlighter": "*" - }, - "require-dev": { - "php-parallel-lint/php-code-style": "^2.0", - "php-parallel-lint/php-parallel-lint": "^1.0", - "php-parallel-lint/php-var-dump-check": "0.*", - "phpunit/phpunit": "^4.8.36 || ^5.7.21 || ^6.0 || ^7.0 || ^8.0 || ^9.0" - }, - "type": "library", - "autoload": { - "psr-4": { - "PHP_Parallel_Lint\\PhpConsoleHighlighter\\": "src/" - } + "dealerdirect/phpcodesniffer-composer-installer": "^0.6.2 || ^0.7 || ^1.0.0", + "php": "^7.4 || ^8.0", + "slevomat/coding-standard": "^8.23", + "squizlabs/php_codesniffer": "^4" }, + "type": "phpcodesniffer-standard", "notification-url": "https://packagist.org/downloads/", "license": [ "MIT" ], "authors": [ { - "name": "Jakub Onderka", - "email": "acci@acci.cz", - "homepage": "http://www.acci.cz/" + "name": "Benjamin Eberlei", + "email": "kontakt@beberlei.de" + }, + { + "name": "Steve Müller", + "email": "st.mueller@dzh-online.de" } ], - "description": "Highlight PHP code in terminal", + "description": "The Doctrine Coding Standard is a set of PHPCS rules applied to all Doctrine projects.", + "homepage": "https://www.doctrine-project.org/projects/coding-standard.html", + "keywords": [ + "checks", + "code", + "coding", + "cs", + "dev", + "doctrine", + "rules", + "sniffer", + "sniffs", + "standard", + "style" + ], "support": { - "issues": "https://github.com/php-parallel-lint/PHP-Console-Highlighter/issues", - "source": "https://github.com/php-parallel-lint/PHP-Console-Highlighter/tree/v1.0.0" + "issues": "https://github.com/doctrine/coding-standard/issues", + "source": "https://github.com/doctrine/coding-standard/tree/14.0.0" }, - "time": "2022-02-18T08:23:19+00:00" + "time": "2025-09-21T18:21:47+00:00" }, { - "name": "php-parallel-lint/php-parallel-lint", - "version": "v1.3.2", + "name": "ergebnis/composer-normalize", + "version": "2.52.0", "source": { "type": "git", - "url": "https://github.com/php-parallel-lint/PHP-Parallel-Lint.git", - "reference": "6483c9832e71973ed29cf71bd6b3f4fde438a9de" + "url": "https://github.com/ergebnis/composer-normalize.git", + "reference": "988f83f5e51a42cdd2337e5fcd935432f8dfa33c" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/php-parallel-lint/PHP-Parallel-Lint/zipball/6483c9832e71973ed29cf71bd6b3f4fde438a9de", - "reference": "6483c9832e71973ed29cf71bd6b3f4fde438a9de", + "url": "https://api.github.com/repos/ergebnis/composer-normalize/zipball/988f83f5e51a42cdd2337e5fcd935432f8dfa33c", + "reference": "988f83f5e51a42cdd2337e5fcd935432f8dfa33c", "shasum": "" }, "require": { + "composer-plugin-api": "^2.0.0", + "ergebnis/json": "^1.4.0", + "ergebnis/json-normalizer": "^4.9.0", + "ergebnis/json-printer": "^3.7.0", "ext-json": "*", - "php": ">=5.3.0" - }, - "replace": { - "grogy/php-parallel-lint": "*", - "jakub-onderka/php-parallel-lint": "*" + "justinrainbow/json-schema": "^5.2.12 || ^6.0.0", + "localheinz/diff": "^1.3.0", + "php": "~7.4.0 || ~8.0.0 || ~8.1.0 || ~8.2.0 || ~8.3.0 || ~8.4.0 || ~8.5.0" + }, + "require-dev": { + "composer/composer": "^2.9.8", + "ergebnis/license": "^2.7.0", + "ergebnis/php-cs-fixer-config": "^6.62.1", + "ergebnis/phpstan-rules": "^2.13.1", + "ergebnis/phpunit-slow-test-detector": "^2.24.0", + "ergebnis/rector-rules": "^1.18.1", + "fakerphp/faker": "^1.24.1", + "phpstan/extension-installer": "^1.4.3", + "phpstan/phpstan": "^2.1.54", + "phpstan/phpstan-deprecation-rules": "^2.0.4", + "phpstan/phpstan-phpunit": "^2.0.16", + "phpstan/phpstan-strict-rules": "^2.0.11", + "phpunit/phpunit": "^9.6.33", + "rector/rector": "^2.4.3", + "symfony/filesystem": "^5.4.41" }, - "require-dev": { - "nette/tester": "^1.3 || ^2.0", - "php-parallel-lint/php-console-highlighter": "0.* || ^1.0", - "squizlabs/php_codesniffer": "^3.6" - }, - "suggest": { - "php-parallel-lint/php-console-highlighter": "Highlight syntax in code snippet" + "type": "composer-plugin", + "extra": { + "class": "Ergebnis\\Composer\\Normalize\\NormalizePlugin", + "branch-alias": { + "dev-main": "2.52-dev" + }, + "plugin-optional": true, + "composer-normalize": { + "indent-size": 2, + "indent-style": "space" + } }, - "bin": [ - "parallel-lint" - ], - "type": "library", "autoload": { - "classmap": [ - "./src/" - ] + "psr-4": { + "Ergebnis\\Composer\\Normalize\\": "src/" + } }, "notification-url": "https://packagist.org/downloads/", "license": [ - "BSD-2-Clause" + "MIT" ], "authors": [ { - "name": "Jakub Onderka", - "email": "ahoj@jakubonderka.cz" + "name": "Andreas Möller", + "email": "am@localheinz.com", + "homepage": "https://localheinz.com" } ], - "description": "This tool check syntax of PHP files about 20x faster than serial check.", - "homepage": "https://github.com/php-parallel-lint/PHP-Parallel-Lint", + "description": "Provides a composer plugin for normalizing composer.json.", + "homepage": "https://github.com/ergebnis/composer-normalize", + "keywords": [ + "composer", + "normalize", + "normalizer", + "plugin" + ], "support": { - "issues": "https://github.com/php-parallel-lint/PHP-Parallel-Lint/issues", - "source": "https://github.com/php-parallel-lint/PHP-Parallel-Lint/tree/v1.3.2" + "issues": "https://github.com/ergebnis/composer-normalize/issues", + "security": "https://github.com/ergebnis/composer-normalize/blob/main/.github/SECURITY.md", + "source": "https://github.com/ergebnis/composer-normalize" }, - "time": "2022-02-21T12:50:22+00:00" + "time": "2026-05-15T15:39:24+00:00" }, { - "name": "php-standard-library/psalm-plugin", - "version": "2.2.1", + "name": "ergebnis/json", + "version": "1.6.0", "source": { "type": "git", - "url": "https://github.com/php-standard-library/psalm-plugin.git", - "reference": "068bc7a8fcbe53658c94d54eec65205eb7e6caae" + "url": "https://github.com/ergebnis/json.git", + "reference": "7b56d2b5d9e897e75b43e2e753075a0904c921b1" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/php-standard-library/psalm-plugin/zipball/068bc7a8fcbe53658c94d54eec65205eb7e6caae", - "reference": "068bc7a8fcbe53658c94d54eec65205eb7e6caae", + "url": "https://api.github.com/repos/ergebnis/json/zipball/7b56d2b5d9e897e75b43e2e753075a0904c921b1", + "reference": "7b56d2b5d9e897e75b43e2e753075a0904c921b1", "shasum": "" }, "require": { - "php": "^8.1", - "vimeo/psalm": "^5.0" - }, - "conflict": { - "azjezz/psl": "<2.0" - }, - "require-dev": { - "friendsofphp/php-cs-fixer": "^2.18", - "roave/security-advisories": "dev-master", - "squizlabs/php_codesniffer": "^3.5" + "ext-json": "*", + "php": "~7.4.0 || ~8.0.0 || ~8.1.0 || ~8.2.0 || ~8.3.0 || ~8.4.0 || ~8.5.0" + }, + "require-dev": { + "ergebnis/composer-normalize": "^2.44.0", + "ergebnis/data-provider": "^3.3.0", + "ergebnis/license": "^2.5.0", + "ergebnis/php-cs-fixer-config": "^6.37.0", + "ergebnis/phpstan-rules": "^2.11.0", + "ergebnis/phpunit-slow-test-detector": "^2.16.1", + "fakerphp/faker": "^1.24.0", + "infection/infection": "~0.26.6", + "phpstan/extension-installer": "^1.4.3", + "phpstan/phpstan": "^2.1.22", + "phpstan/phpstan-deprecation-rules": "^2.0.3", + "phpstan/phpstan-phpunit": "^2.0.7", + "phpstan/phpstan-strict-rules": "^2.0.6", + "phpunit/phpunit": "^9.6.24", + "rector/rector": "^2.1.4" }, - "type": "psalm-plugin", + "type": "library", "extra": { - "psalm": { - "pluginClass": "Psl\\Psalm\\Plugin" + "branch-alias": { + "dev-main": "1.7-dev" + }, + "composer-normalize": { + "indent-size": 2, + "indent-style": "space" } }, "autoload": { "psr-4": { - "Psl\\Psalm\\": "src/" + "Ergebnis\\Json\\": "src/" } }, "notification-url": "https://packagist.org/downloads/", @@ -5383,43 +5910,79 @@ ], "authors": [ { - "name": "azjezz", - "email": "azjezz@protonmail.com" + "name": "Andreas Möller", + "email": "am@localheinz.com", + "homepage": "https://localheinz.com" } ], - "description": "Psalm plugin for the PHP Standard Library", + "description": "Provides a Json value object for representing a valid JSON string.", + "homepage": "https://github.com/ergebnis/json", + "keywords": [ + "json" + ], "support": { - "issues": "https://github.com/php-standard-library/psalm-plugin/issues", - "source": "https://github.com/php-standard-library/psalm-plugin/tree/2.2.1" + "issues": "https://github.com/ergebnis/json/issues", + "security": "https://github.com/ergebnis/json/blob/main/.github/SECURITY.md", + "source": "https://github.com/ergebnis/json" }, - "time": "2022-12-06T10:44:56+00:00" + "time": "2025-09-06T09:08:45+00:00" }, { - "name": "phpdocumentor/reflection-common", - "version": "2.2.0", + "name": "ergebnis/json-normalizer", + "version": "4.10.1", "source": { "type": "git", - "url": "https://github.com/phpDocumentor/ReflectionCommon.git", - "reference": "1d01c49d4ed62f25aa84a747ad35d5a16924662b" + "url": "https://github.com/ergebnis/json-normalizer.git", + "reference": "77961faf2c651c3f05977b53c6c68e8434febf62" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/phpDocumentor/ReflectionCommon/zipball/1d01c49d4ed62f25aa84a747ad35d5a16924662b", - "reference": "1d01c49d4ed62f25aa84a747ad35d5a16924662b", + "url": "https://api.github.com/repos/ergebnis/json-normalizer/zipball/77961faf2c651c3f05977b53c6c68e8434febf62", + "reference": "77961faf2c651c3f05977b53c6c68e8434febf62", "shasum": "" }, "require": { - "php": "^7.2 || ^8.0" + "ergebnis/json": "^1.2.0", + "ergebnis/json-pointer": "^3.4.0", + "ergebnis/json-printer": "^3.5.0", + "ergebnis/json-schema-validator": "^4.2.0", + "ext-json": "*", + "justinrainbow/json-schema": "^5.2.12 || ^6.0.0", + "php": "~7.4.0 || ~8.0.0 || ~8.1.0 || ~8.2.0 || ~8.3.0 || ~8.4.0 || ~8.5.0" + }, + "require-dev": { + "composer/semver": "^3.4.3", + "ergebnis/composer-normalize": "^2.44.0", + "ergebnis/data-provider": "^3.3.0", + "ergebnis/license": "^2.5.0", + "ergebnis/php-cs-fixer-config": "^6.37.0", + "ergebnis/phpunit-slow-test-detector": "^2.16.1", + "fakerphp/faker": "^1.24.0", + "infection/infection": "~0.26.6", + "phpstan/extension-installer": "^1.4.3", + "phpstan/phpstan": "^1.12.10", + "phpstan/phpstan-deprecation-rules": "^1.2.1", + "phpstan/phpstan-phpunit": "^1.4.0", + "phpstan/phpstan-strict-rules": "^1.6.1", + "phpunit/phpunit": "^9.6.19", + "rector/rector": "^1.2.10" + }, + "suggest": { + "composer/semver": "If you want to use ComposerJsonNormalizer or VersionConstraintNormalizer" }, "type": "library", "extra": { "branch-alias": { - "dev-2.x": "2.x-dev" + "dev-main": "4.11-dev" + }, + "composer-normalize": { + "indent-size": 2, + "indent-style": "space" } }, "autoload": { "psr-4": { - "phpDocumentor\\Reflection\\": "src/" + "Ergebnis\\Json\\Normalizer\\": "src/" } }, "notification-url": "https://packagist.org/downloads/", @@ -5428,59 +5991,72 @@ ], "authors": [ { - "name": "Jaap van Otterdijk", - "email": "opensource@ijaap.nl" + "name": "Andreas Möller", + "email": "am@localheinz.com", + "homepage": "https://localheinz.com" } ], - "description": "Common reflection classes used by phpdocumentor to reflect the code structure", - "homepage": "http://www.phpdoc.org", + "description": "Provides generic and vendor-specific normalizers for normalizing JSON documents.", + "homepage": "https://github.com/ergebnis/json-normalizer", "keywords": [ - "FQSEN", - "phpDocumentor", - "phpdoc", - "reflection", - "static analysis" + "json", + "normalizer" ], "support": { - "issues": "https://github.com/phpDocumentor/ReflectionCommon/issues", - "source": "https://github.com/phpDocumentor/ReflectionCommon/tree/2.x" + "issues": "https://github.com/ergebnis/json-normalizer/issues", + "security": "https://github.com/ergebnis/json-normalizer/blob/main/.github/SECURITY.md", + "source": "https://github.com/ergebnis/json-normalizer" }, - "time": "2020-06-27T09:03:43+00:00" + "time": "2025-09-06T09:18:13+00:00" }, { - "name": "phpdocumentor/reflection-docblock", - "version": "5.3.0", + "name": "ergebnis/json-pointer", + "version": "3.8.0", "source": { "type": "git", - "url": "https://github.com/phpDocumentor/ReflectionDocBlock.git", - "reference": "622548b623e81ca6d78b721c5e029f4ce664f170" + "url": "https://github.com/ergebnis/json-pointer.git", + "reference": "b58c3c468a7ff109fdf9a255f17de29ecbe5276c" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/phpDocumentor/ReflectionDocBlock/zipball/622548b623e81ca6d78b721c5e029f4ce664f170", - "reference": "622548b623e81ca6d78b721c5e029f4ce664f170", + "url": "https://api.github.com/repos/ergebnis/json-pointer/zipball/b58c3c468a7ff109fdf9a255f17de29ecbe5276c", + "reference": "b58c3c468a7ff109fdf9a255f17de29ecbe5276c", "shasum": "" }, "require": { - "ext-filter": "*", - "php": "^7.2 || ^8.0", - "phpdocumentor/reflection-common": "^2.2", - "phpdocumentor/type-resolver": "^1.3", - "webmozart/assert": "^1.9.1" + "php": "~7.4.0 || ~8.0.0 || ~8.1.0 || ~8.2.0 || ~8.3.0 || ~8.4.0 || ~8.5.0" }, "require-dev": { - "mockery/mockery": "~1.3.2", - "psalm/phar": "^4.8" + "ergebnis/composer-normalize": "^2.50.0", + "ergebnis/data-provider": "^3.6.0", + "ergebnis/license": "^2.7.0", + "ergebnis/php-cs-fixer-config": "^6.60.2", + "ergebnis/phpstan-rules": "^2.13.1", + "ergebnis/phpunit-slow-test-detector": "^2.24.0", + "ergebnis/rector-rules": "^1.16.0", + "fakerphp/faker": "^1.24.1", + "infection/infection": "~0.26.6", + "phpstan/extension-installer": "^1.4.3", + "phpstan/phpstan": "^2.1.46", + "phpstan/phpstan-deprecation-rules": "^2.0.4", + "phpstan/phpstan-phpunit": "^2.0.16", + "phpstan/phpstan-strict-rules": "^2.0.10", + "phpunit/phpunit": "^9.6.34", + "rector/rector": "^2.4.0" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "5.x-dev" + "dev-main": "3.8-dev" + }, + "composer-normalize": { + "indent-size": 2, + "indent-style": "space" } }, "autoload": { "psr-4": { - "phpDocumentor\\Reflection\\": "src" + "Ergebnis\\Json\\Pointer\\": "src/" } }, "notification-url": "https://packagist.org/downloads/", @@ -5489,60 +6065,73 @@ ], "authors": [ { - "name": "Mike van Riel", - "email": "me@mikevanriel.com" - }, - { - "name": "Jaap van Otterdijk", - "email": "account@ijaap.nl" + "name": "Andreas Möller", + "email": "am@localheinz.com", + "homepage": "https://localheinz.com" } ], - "description": "With this component, a library can provide support for annotations via DocBlocks or otherwise retrieve information that is embedded in a DocBlock.", + "description": "Provides an abstraction of a JSON pointer.", + "homepage": "https://github.com/ergebnis/json-pointer", + "keywords": [ + "RFC6901", + "json", + "pointer" + ], "support": { - "issues": "https://github.com/phpDocumentor/ReflectionDocBlock/issues", - "source": "https://github.com/phpDocumentor/ReflectionDocBlock/tree/5.3.0" + "issues": "https://github.com/ergebnis/json-pointer/issues", + "security": "https://github.com/ergebnis/json-pointer/blob/main/.github/SECURITY.md", + "source": "https://github.com/ergebnis/json-pointer" }, - "time": "2021-10-19T17:43:47+00:00" + "time": "2026-04-07T14:52:13+00:00" }, { - "name": "phpdocumentor/type-resolver", - "version": "1.7.3", + "name": "ergebnis/json-printer", + "version": "3.8.1", "source": { "type": "git", - "url": "https://github.com/phpDocumentor/TypeResolver.git", - "reference": "3219c6ee25c9ea71e3d9bbaf39c67c9ebd499419" + "url": "https://github.com/ergebnis/json-printer.git", + "reference": "211d73fc7ec6daf98568ee6ed6e6d133dee8503e" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/phpDocumentor/TypeResolver/zipball/3219c6ee25c9ea71e3d9bbaf39c67c9ebd499419", - "reference": "3219c6ee25c9ea71e3d9bbaf39c67c9ebd499419", + "url": "https://api.github.com/repos/ergebnis/json-printer/zipball/211d73fc7ec6daf98568ee6ed6e6d133dee8503e", + "reference": "211d73fc7ec6daf98568ee6ed6e6d133dee8503e", "shasum": "" }, "require": { - "doctrine/deprecations": "^1.0", - "php": "^7.4 || ^8.0", - "phpdocumentor/reflection-common": "^2.0", - "phpstan/phpdoc-parser": "^1.13" + "ext-json": "*", + "ext-mbstring": "*", + "php": "~7.4.0 || ~8.0.0 || ~8.1.0 || ~8.2.0 || ~8.3.0 || ~8.4.0 || ~8.5.0" }, "require-dev": { - "ext-tokenizer": "*", - "phpbench/phpbench": "^1.2", - "phpstan/extension-installer": "^1.1", - "phpstan/phpstan": "^1.8", - "phpstan/phpstan-phpunit": "^1.1", - "phpunit/phpunit": "^9.5", - "rector/rector": "^0.13.9", - "vimeo/psalm": "^4.25" + "ergebnis/composer-normalize": "^2.44.0", + "ergebnis/data-provider": "^3.3.0", + "ergebnis/license": "^2.5.0", + "ergebnis/php-cs-fixer-config": "^6.37.0", + "ergebnis/phpunit-slow-test-detector": "^2.16.1", + "fakerphp/faker": "^1.24.0", + "infection/infection": "~0.26.6", + "phpstan/extension-installer": "^1.4.3", + "phpstan/phpstan": "^1.12.10", + "phpstan/phpstan-deprecation-rules": "^1.2.1", + "phpstan/phpstan-phpunit": "^1.4.1", + "phpstan/phpstan-strict-rules": "^1.6.1", + "phpunit/phpunit": "^9.6.21", + "rector/rector": "^1.2.10" }, "type": "library", "extra": { "branch-alias": { - "dev-1.x": "1.x-dev" + "dev-main": "3.9-dev" + }, + "composer-normalize": { + "indent-size": 2, + "indent-style": "space" } }, "autoload": { "psr-4": { - "phpDocumentor\\Reflection\\": "src" + "Ergebnis\\Json\\Printer\\": "src/" } }, "notification-url": "https://packagist.org/downloads/", @@ -5551,52 +6140,75 @@ ], "authors": [ { - "name": "Mike van Riel", - "email": "me@mikevanriel.com" + "name": "Andreas Möller", + "email": "am@localheinz.com", + "homepage": "https://localheinz.com" } ], - "description": "A PSR-5 based resolver of Class names, Types and Structural Element Names", + "description": "Provides a JSON printer, allowing for flexible indentation.", + "homepage": "https://github.com/ergebnis/json-printer", + "keywords": [ + "formatter", + "json", + "printer" + ], "support": { - "issues": "https://github.com/phpDocumentor/TypeResolver/issues", - "source": "https://github.com/phpDocumentor/TypeResolver/tree/1.7.3" + "issues": "https://github.com/ergebnis/json-printer/issues", + "security": "https://github.com/ergebnis/json-printer/blob/main/.github/SECURITY.md", + "source": "https://github.com/ergebnis/json-printer" }, - "time": "2023-08-12T11:01:26+00:00" + "time": "2025-09-06T09:59:26+00:00" }, { - "name": "phpspec/prophecy", - "version": "v1.17.0", + "name": "ergebnis/json-schema-validator", + "version": "4.5.1", "source": { "type": "git", - "url": "https://github.com/phpspec/prophecy.git", - "reference": "15873c65b207b07765dbc3c95d20fdf4a320cbe2" + "url": "https://github.com/ergebnis/json-schema-validator.git", + "reference": "b739527a480a9e3651360ad351ea77e7e9019df2" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/phpspec/prophecy/zipball/15873c65b207b07765dbc3c95d20fdf4a320cbe2", - "reference": "15873c65b207b07765dbc3c95d20fdf4a320cbe2", + "url": "https://api.github.com/repos/ergebnis/json-schema-validator/zipball/b739527a480a9e3651360ad351ea77e7e9019df2", + "reference": "b739527a480a9e3651360ad351ea77e7e9019df2", "shasum": "" }, "require": { - "doctrine/instantiator": "^1.2 || ^2.0", - "php": "^7.2 || 8.0.* || 8.1.* || 8.2.*", - "phpdocumentor/reflection-docblock": "^5.2", - "sebastian/comparator": "^3.0 || ^4.0", - "sebastian/recursion-context": "^3.0 || ^4.0" - }, - "require-dev": { - "phpspec/phpspec": "^6.0 || ^7.0", - "phpstan/phpstan": "^1.9", - "phpunit/phpunit": "^8.0 || ^9.0" + "ergebnis/json": "^1.2.0", + "ergebnis/json-pointer": "^3.4.0", + "ext-json": "*", + "justinrainbow/json-schema": "^5.2.12 || ^6.0.0", + "php": "~7.4.0 || ~8.0.0 || ~8.1.0 || ~8.2.0 || ~8.3.0 || ~8.4.0 || ~8.5.0" + }, + "require-dev": { + "ergebnis/composer-normalize": "^2.44.0", + "ergebnis/data-provider": "^3.3.0", + "ergebnis/license": "^2.5.0", + "ergebnis/php-cs-fixer-config": "^6.37.0", + "ergebnis/phpunit-slow-test-detector": "^2.16.1", + "fakerphp/faker": "^1.24.0", + "infection/infection": "~0.26.6", + "phpstan/extension-installer": "^1.4.3", + "phpstan/phpstan": "^1.12.10", + "phpstan/phpstan-deprecation-rules": "^1.2.1", + "phpstan/phpstan-phpunit": "^1.4.0", + "phpstan/phpstan-strict-rules": "^1.6.1", + "phpunit/phpunit": "^9.6.20", + "rector/rector": "^1.2.10" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "1.x-dev" + "dev-main": "4.6-dev" + }, + "composer-normalize": { + "indent-size": 2, + "indent-style": "space" } }, "autoload": { "psr-4": { - "Prophecy\\": "src/Prophecy" + "Ergebnis\\Json\\SchemaValidator\\": "src/" } }, "notification-url": "https://packagist.org/downloads/", @@ -5605,59 +6217,72 @@ ], "authors": [ { - "name": "Konstantin Kudryashov", - "email": "ever.zet@gmail.com", - "homepage": "http://everzet.com" - }, - { - "name": "Marcello Duarte", - "email": "marcello.duarte@gmail.com" + "name": "Andreas Möller", + "email": "am@localheinz.com", + "homepage": "https://localheinz.com" } ], - "description": "Highly opinionated mocking framework for PHP 5.3+", - "homepage": "https://github.com/phpspec/prophecy", + "description": "Provides a JSON schema validator, building on top of justinrainbow/json-schema.", + "homepage": "https://github.com/ergebnis/json-schema-validator", "keywords": [ - "Double", - "Dummy", - "fake", - "mock", - "spy", - "stub" + "json", + "schema", + "validator" ], "support": { - "issues": "https://github.com/phpspec/prophecy/issues", - "source": "https://github.com/phpspec/prophecy/tree/v1.17.0" + "issues": "https://github.com/ergebnis/json-schema-validator/issues", + "security": "https://github.com/ergebnis/json-schema-validator/blob/main/.github/SECURITY.md", + "source": "https://github.com/ergebnis/json-schema-validator" }, - "time": "2023-02-02T15:41:36+00:00" + "time": "2025-09-06T11:37:35+00:00" }, { - "name": "phpspec/prophecy-phpunit", - "version": "v2.0.2", + "name": "ergebnis/phpstan-rules", + "version": "2.13.1", "source": { "type": "git", - "url": "https://github.com/phpspec/prophecy-phpunit.git", - "reference": "9f26c224a2fa335f33e6666cc078fbf388255e87" + "url": "https://github.com/ergebnis/phpstan-rules.git", + "reference": "f69db86b98595c34fc1f61c89fe3b380141aa519" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/phpspec/prophecy-phpunit/zipball/9f26c224a2fa335f33e6666cc078fbf388255e87", - "reference": "9f26c224a2fa335f33e6666cc078fbf388255e87", + "url": "https://api.github.com/repos/ergebnis/phpstan-rules/zipball/f69db86b98595c34fc1f61c89fe3b380141aa519", + "reference": "f69db86b98595c34fc1f61c89fe3b380141aa519", "shasum": "" }, "require": { - "php": "^7.3 || ^8", - "phpspec/prophecy": "^1.3", - "phpunit/phpunit": "^9.1" + "ext-mbstring": "*", + "php": "~7.4.0 || ~8.0.0 || ~8.1.0 || ~8.2.0 || ~8.3.0 || ~8.4.0 || ~8.5.0", + "phpstan/phpstan": "^2.1.35" + }, + "require-dev": { + "codeception/codeception": "^4.0.0 || ^5.0.0", + "doctrine/orm": "^2.20.0 || ^3.3.0", + "ergebnis/composer-normalize": "^2.49.0", + "ergebnis/license": "^2.7.0", + "ergebnis/php-cs-fixer-config": "^6.59.0", + "ergebnis/phpunit-slow-test-detector": "^2.20.0", + "fakerphp/faker": "^1.24.1", + "phpstan/extension-installer": "^1.4.3", + "phpstan/phpstan-deprecation-rules": "^2.0.3", + "phpstan/phpstan-phpunit": "^2.0.12", + "phpstan/phpstan-strict-rules": "^2.0.8", + "phpunit/phpunit": "^9.6.21", + "psr/container": "^2.0.2", + "symfony/finder": "^5.4.45", + "symfony/process": "^5.4.47" }, - "type": "library", + "type": "phpstan-extension", "extra": { - "branch-alias": { - "dev-master": "2.0-dev" + "phpstan": { + "includes": [ + "rules.neon" + ] } }, "autoload": { "psr-4": { - "Prophecy\\PhpUnit\\": "src" + "Ergebnis\\PHPStan\\Rules\\": "src/" } }, "notification-url": "https://packagist.org/downloads/", @@ -5666,428 +6291,465 @@ ], "authors": [ { - "name": "Christophe Coevoet", - "email": "stof@notk.org" + "name": "Andreas Möller", + "email": "am@localheinz.com", + "homepage": "https://localheinz.com" } ], - "description": "Integrating the Prophecy mocking library in PHPUnit test cases", - "homepage": "http://phpspec.net", + "description": "Provides rules for phpstan/phpstan.", + "homepage": "https://github.com/ergebnis/phpstan-rules", "keywords": [ - "phpunit", - "prophecy" + "PHPStan", + "phpstan-rules" ], "support": { - "issues": "https://github.com/phpspec/prophecy-phpunit/issues", - "source": "https://github.com/phpspec/prophecy-phpunit/tree/v2.0.2" + "issues": "https://github.com/ergebnis/phpstan-rules/issues", + "security": "https://github.com/ergebnis/phpstan-rules/blob/main/.github/SECURITY.md", + "source": "https://github.com/ergebnis/phpstan-rules" }, - "time": "2023-04-18T11:58:05+00:00" + "time": "2026-01-27T17:13:06+00:00" }, { - "name": "phpstan/phpdoc-parser", - "version": "1.24.2", + "name": "ergebnis/phpunit-slow-test-detector", + "version": "2.24.0", "source": { "type": "git", - "url": "https://github.com/phpstan/phpdoc-parser.git", - "reference": "bcad8d995980440892759db0c32acae7c8e79442" + "url": "https://github.com/ergebnis/phpunit-slow-test-detector.git", + "reference": "e713c1397b09e07892657cdf909731d29481ff4c" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/phpstan/phpdoc-parser/zipball/bcad8d995980440892759db0c32acae7c8e79442", - "reference": "bcad8d995980440892759db0c32acae7c8e79442", + "url": "https://api.github.com/repos/ergebnis/phpunit-slow-test-detector/zipball/e713c1397b09e07892657cdf909731d29481ff4c", + "reference": "e713c1397b09e07892657cdf909731d29481ff4c", "shasum": "" }, "require": { - "php": "^7.2 || ^8.0" + "php": "~7.0.0 || ~7.1.0 || ~7.2.0 || ~7.3.0 || ~7.4.0 || ~8.0.0 || ~8.1.0 || ~8.2.0 || ~8.3.0 || ~8.4.0 || ~8.5.0", + "phpunit/phpunit": "^6.5.0 || ^7.5.0 || ^8.5.19 || ^9.0.0 || ^10.0.0 || ^11.0.0 || ^12.0.0 || ^13.0.0" }, "require-dev": { - "doctrine/annotations": "^2.0", - "nikic/php-parser": "^4.15", - "php-parallel-lint/php-parallel-lint": "^1.2", - "phpstan/extension-installer": "^1.0", - "phpstan/phpstan": "^1.5", - "phpstan/phpstan-phpunit": "^1.1", - "phpstan/phpstan-strict-rules": "^1.0", - "phpunit/phpunit": "^9.5", - "symfony/process": "^5.2" + "ergebnis/composer-normalize": "^2.50.0", + "ergebnis/license": "^2.7.0", + "ergebnis/php-cs-fixer-config": "^6.60.1", + "fakerphp/faker": "~1.20.0", + "phpstan/extension-installer": "^1.4.3", + "phpstan/phpstan": "^1.12.11", + "phpstan/phpstan-deprecation-rules": "^1.2.1", + "phpstan/phpstan-phpunit": "^1.4.1", + "phpstan/phpstan-strict-rules": "^1.6.1", + "psr/container": "~1.0.0", + "rector/rector": "^1.2.10" }, "type": "library", + "extra": { + "branch-alias": { + "dev-main": "2.16-dev" + }, + "composer-normalize": { + "indent-size": 2, + "indent-style": "space" + } + }, "autoload": { "psr-4": { - "PHPStan\\PhpDocParser\\": [ - "src/" - ] + "Ergebnis\\PHPUnit\\SlowTestDetector\\": "src/" } }, "notification-url": "https://packagist.org/downloads/", "license": [ "MIT" ], - "description": "PHPDoc parser with support for nullable, intersection and generic types", + "authors": [ + { + "name": "Andreas Möller", + "email": "am@localheinz.com", + "homepage": "https://localheinz.com" + } + ], + "description": "Provides facilities for detecting slow tests in phpunit/phpunit.", + "homepage": "https://github.com/ergebnis/phpunit-slow-test-detector", + "keywords": [ + "detector", + "extension", + "phpunit", + "slow", + "test" + ], "support": { - "issues": "https://github.com/phpstan/phpdoc-parser/issues", - "source": "https://github.com/phpstan/phpdoc-parser/tree/1.24.2" + "issues": "https://github.com/ergebnis/phpunit-slow-test-detector/issues", + "security": "https://github.com/ergebnis/phpunit-slow-test-detector/blob/main/.github/SECURITY.md", + "source": "https://github.com/ergebnis/phpunit-slow-test-detector" }, - "time": "2023-09-26T12:28:12+00:00" + "time": "2026-03-13T10:52:55+00:00" }, { - "name": "phpstan/phpstan", - "version": "1.10.39", + "name": "fidry/cpu-core-counter", + "version": "1.3.0", "source": { "type": "git", - "url": "https://github.com/phpstan/phpstan.git", - "reference": "d9dedb0413f678b4d03cbc2279a48f91592c97c4" + "url": "https://github.com/theofidry/cpu-core-counter.git", + "reference": "db9508f7b1474469d9d3c53b86f817e344732678" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/phpstan/phpstan/zipball/d9dedb0413f678b4d03cbc2279a48f91592c97c4", - "reference": "d9dedb0413f678b4d03cbc2279a48f91592c97c4", + "url": "https://api.github.com/repos/theofidry/cpu-core-counter/zipball/db9508f7b1474469d9d3c53b86f817e344732678", + "reference": "db9508f7b1474469d9d3c53b86f817e344732678", "shasum": "" }, "require": { - "php": "^7.2|^8.0" + "php": "^7.2 || ^8.0" }, - "conflict": { - "phpstan/phpstan-shim": "*" + "require-dev": { + "fidry/makefile": "^0.2.0", + "fidry/php-cs-fixer-config": "^1.1.2", + "phpstan/extension-installer": "^1.2.0", + "phpstan/phpstan": "^2.0", + "phpstan/phpstan-deprecation-rules": "^2.0.0", + "phpstan/phpstan-phpunit": "^2.0", + "phpstan/phpstan-strict-rules": "^2.0", + "phpunit/phpunit": "^8.5.31 || ^9.5.26", + "webmozarts/strict-phpunit": "^7.5" }, - "bin": [ - "phpstan", - "phpstan.phar" - ], "type": "library", "autoload": { - "files": [ - "bootstrap.php" - ] + "psr-4": { + "Fidry\\CpuCoreCounter\\": "src/" + } }, "notification-url": "https://packagist.org/downloads/", "license": [ "MIT" ], - "description": "PHPStan - PHP Static Analysis Tool", + "authors": [ + { + "name": "Théo FIDRY", + "email": "theo.fidry@gmail.com" + } + ], + "description": "Tiny utility to get the number of CPU cores.", "keywords": [ - "dev", - "static analysis" + "CPU", + "core" ], "support": { - "docs": "https://phpstan.org/user-guide/getting-started", - "forum": "https://github.com/phpstan/phpstan/discussions", - "issues": "https://github.com/phpstan/phpstan/issues", - "security": "https://github.com/phpstan/phpstan/security/policy", - "source": "https://github.com/phpstan/phpstan-src" + "issues": "https://github.com/theofidry/cpu-core-counter/issues", + "source": "https://github.com/theofidry/cpu-core-counter/tree/1.3.0" }, "funding": [ { - "url": "https://github.com/ondrejmirtes", - "type": "github" - }, - { - "url": "https://github.com/phpstan", + "url": "https://github.com/theofidry", "type": "github" - }, - { - "url": "https://tidelift.com/funding/github/packagist/phpstan/phpstan", - "type": "tidelift" } ], - "time": "2023-10-17T15:46:26+00:00" + "time": "2025-08-14T07:29:31+00:00" }, { - "name": "phpstan/phpstan-deprecation-rules", - "version": "1.1.4", + "name": "hamcrest/hamcrest-php", + "version": "v3.0.0", "source": { "type": "git", - "url": "https://github.com/phpstan/phpstan-deprecation-rules.git", - "reference": "089d8a8258ed0aeefdc7b68b6c3d25572ebfdbaa" + "url": "https://github.com/hamcrest/hamcrest-php.git", + "reference": "b61cd040da1a4925bc90a51c074f5297e7c0fa52" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/phpstan/phpstan-deprecation-rules/zipball/089d8a8258ed0aeefdc7b68b6c3d25572ebfdbaa", - "reference": "089d8a8258ed0aeefdc7b68b6c3d25572ebfdbaa", + "url": "https://api.github.com/repos/hamcrest/hamcrest-php/zipball/b61cd040da1a4925bc90a51c074f5297e7c0fa52", + "reference": "b61cd040da1a4925bc90a51c074f5297e7c0fa52", "shasum": "" }, "require": { - "php": "^7.2 || ^8.0", - "phpstan/phpstan": "^1.10.3" + "ext-ctype": "*", + "ext-dom": "*", + "php": "^7.4|^8.0" + }, + "replace": { + "cordoval/hamcrest-php": "*", + "davedevelopment/hamcrest-php": "*", + "kodova/hamcrest-php": "*" }, "require-dev": { - "php-parallel-lint/php-parallel-lint": "^1.2", - "phpstan/phpstan-php-parser": "^1.1", - "phpstan/phpstan-phpunit": "^1.0", - "phpunit/phpunit": "^9.5" + "phpstan/phpstan": "^2.1", + "phpstan/phpstan-phpunit": "^2.0", + "phpunit/php-file-iterator": "^1.4 || ^2.0 || ^3.0", + "phpunit/phpunit": "^4.8.36 || ^5.7 || ^6.5 || ^7.0 || ^8.0 || ^9.0" }, - "type": "phpstan-extension", + "type": "library", "extra": { - "phpstan": { - "includes": [ - "rules.neon" - ] + "branch-alias": { + "dev-master": "3.0-dev" } }, "autoload": { - "psr-4": { - "PHPStan\\": "src/" - } + "classmap": [ + "hamcrest" + ] }, "notification-url": "https://packagist.org/downloads/", "license": [ - "MIT" + "BSD-3-Clause" + ], + "description": "This is the PHP port of Hamcrest Matchers", + "keywords": [ + "test" ], - "description": "PHPStan rules for detecting usage of deprecated classes, methods, properties, constants and traits.", "support": { - "issues": "https://github.com/phpstan/phpstan-deprecation-rules/issues", - "source": "https://github.com/phpstan/phpstan-deprecation-rules/tree/1.1.4" + "issues": "https://github.com/hamcrest/hamcrest-php/issues", + "source": "https://github.com/hamcrest/hamcrest-php/tree/v3.0.0" }, - "time": "2023-08-05T09:02:04+00:00" + "time": "2026-03-17T11:56:53+00:00" }, { - "name": "phpstan/phpstan-mockery", - "version": "1.1.1", + "name": "icanhazstring/composer-unused", + "version": "0.9.6", "source": { "type": "git", - "url": "https://github.com/phpstan/phpstan-mockery.git", - "reference": "6aa86bd8e9c9a1be97baf0558d4a2ed1374736a6" + "url": "https://github.com/composer-unused/composer-unused.git", + "reference": "c60030af7954a528746dd2180c10b5e0871e84c7" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/phpstan/phpstan-mockery/zipball/6aa86bd8e9c9a1be97baf0558d4a2ed1374736a6", - "reference": "6aa86bd8e9c9a1be97baf0558d4a2ed1374736a6", + "url": "https://api.github.com/repos/composer-unused/composer-unused/zipball/c60030af7954a528746dd2180c10b5e0871e84c7", + "reference": "c60030af7954a528746dd2180c10b5e0871e84c7", "shasum": "" }, "require": { - "php": "^7.2 || ^8.0", - "phpstan/phpstan": "^1.10" + "composer-runtime-api": "^2.0", + "composer-unused/contracts": "^0.3", + "composer-unused/symbol-parser": "^0.3.1", + "composer/xdebug-handler": "^3.0", + "ext-json": "*", + "nikic/php-parser": "^5.0", + "ondram/ci-detector": "^4.1", + "php": "^8.1", + "phpstan/phpdoc-parser": "^1.25 || ^2", + "psr/container": "^1.0 || ^2.0", + "psr/log": "^1.1 || ^2 || ^3", + "symfony/config": "^6.0 || ^7.0 || ^8.0", + "symfony/console": "^6.0 || ^7.0 || ^8.0", + "symfony/dependency-injection": "^6.0 || ^7.0 || ^8.0", + "symfony/property-access": "^6.0 || ^7.0 || ^8.0", + "symfony/serializer": "^6.0 || ^7.0 || ^8.0", + "webmozart/assert": "^1.10 || ^2.0", + "webmozart/glob": "^4.4" }, "require-dev": { - "mockery/mockery": "^1.2.4", - "nikic/php-parser": "^4.13.0", - "php-parallel-lint/php-parallel-lint": "^1.2", - "phpstan/phpstan-phpunit": "^1.0", - "phpstan/phpstan-strict-rules": "^1.0", - "phpunit/phpunit": "^9.5" + "bamarni/composer-bin-plugin": "^1.8", + "codeception/verify": "^3.1", + "dg/bypass-finals": "^1.6", + "ergebnis/composer-normalize": "^2.49", + "ext-ds": "*", + "ext-zend-opcache": "*", + "jangregor/phpstan-prophecy": "^2.1.1", + "mikey179/vfsstream": "^1.6.10", + "php-ds/php-ds": "^1.5", + "phpspec/prophecy-phpunit": "^2.2.0", + "phpstan/extension-installer": "^1.3", + "phpstan/phpstan": "^2.1.37", + "phpstan/phpstan-phpunit": "^2.0.12", + "phpunit/phpunit": "^9.6.34", + "roave/security-advisories": "dev-master", + "squizlabs/php_codesniffer": "^3.13" }, - "type": "phpstan-extension", + "bin": [ + "bin/composer-unused" + ], + "type": "library", "extra": { - "phpstan": { - "includes": [ - "extension.neon" - ] + "bamarni-bin": { + "bin-links": true, + "forward-command": true } }, "autoload": { "psr-4": { - "PHPStan\\": "src/" + "ComposerUnused\\ComposerUnused\\": "src" } }, "notification-url": "https://packagist.org/downloads/", "license": [ "MIT" ], - "description": "PHPStan Mockery extension", + "authors": [ + { + "name": "Andreas Frömer", + "email": "composer-unused@icanhazstring.com" + } + ], + "description": "Show unused packages by scanning your code", + "homepage": "https://github.com/composer-unused/composer-unused", + "keywords": [ + "composer", + "php-parser", + "static analysis", + "unused" + ], "support": { - "issues": "https://github.com/phpstan/phpstan-mockery/issues", - "source": "https://github.com/phpstan/phpstan-mockery/tree/1.1.1" - }, - "time": "2023-02-18T13:54:03+00:00" - }, - { - "name": "phpstan/phpstan-php-parser", - "version": "1.1.0", - "source": { - "type": "git", - "url": "https://github.com/phpstan/phpstan-php-parser.git", - "reference": "1c7670dd92da864b5d019f22d9f512a6ae18b78e" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/phpstan/phpstan-php-parser/zipball/1c7670dd92da864b5d019f22d9f512a6ae18b78e", - "reference": "1c7670dd92da864b5d019f22d9f512a6ae18b78e", - "shasum": "" - }, - "require": { - "php": "^7.1 || ^8.0", - "phpstan/phpstan": "^1.3" - }, - "require-dev": { - "php-parallel-lint/php-parallel-lint": "^1.2", - "phpstan/phpstan-phpunit": "^1.0", - "phpstan/phpstan-strict-rules": "^1.0", - "phpunit/phpunit": "^9.5" + "issues": "https://github.com/composer-unused/composer-unused/issues", + "source": "https://github.com/composer-unused/composer-unused" }, - "type": "phpstan-extension", - "extra": { - "branch-alias": { - "dev-master": "1.1-dev" + "funding": [ + { + "url": "https://github.com/sponsors/icanhazstring", + "type": "github" }, - "phpstan": { - "includes": [ - "extension.neon" - ] - } - }, - "autoload": { - "psr-4": { - "PHPStan\\": "src/" + { + "url": "https://paypal.me/icanhazstring", + "type": "other" } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" ], - "description": "PHP-Parser extensions for PHPStan", - "support": { - "issues": "https://github.com/phpstan/phpstan-php-parser/issues", - "source": "https://github.com/phpstan/phpstan-php-parser/tree/1.1.0" - }, - "abandoned": true, - "time": "2021-12-16T19:43:32+00:00" + "time": "2026-01-30T05:52:24+00:00" }, { - "name": "phpstan/phpstan-phpunit", - "version": "1.3.15", + "name": "infection/abstract-testframework-adapter", + "version": "0.5.1", "source": { "type": "git", - "url": "https://github.com/phpstan/phpstan-phpunit.git", - "reference": "70ecacc64fe8090d8d2a33db5a51fe8e88acd93a" + "url": "https://github.com/infection/abstract-testframework-adapter.git", + "reference": "b24bf3e850f70cd20a10621f08c3cef66f147ac8" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/phpstan/phpstan-phpunit/zipball/70ecacc64fe8090d8d2a33db5a51fe8e88acd93a", - "reference": "70ecacc64fe8090d8d2a33db5a51fe8e88acd93a", + "url": "https://api.github.com/repos/infection/abstract-testframework-adapter/zipball/b24bf3e850f70cd20a10621f08c3cef66f147ac8", + "reference": "b24bf3e850f70cd20a10621f08c3cef66f147ac8", "shasum": "" }, "require": { - "php": "^7.2 || ^8.0", - "phpstan/phpstan": "^1.10" - }, - "conflict": { - "phpunit/phpunit": "<7.0" + "php": "^8.3" }, "require-dev": { - "nikic/php-parser": "^4.13.0", - "php-parallel-lint/php-parallel-lint": "^1.2", - "phpstan/phpstan-strict-rules": "^1.5.1", - "phpunit/phpunit": "^9.5" - }, - "type": "phpstan-extension", - "extra": { - "phpstan": { - "includes": [ - "extension.neon", - "rules.neon" - ] - } + "ergebnis/composer-normalize": "^2.18", + "fidry/makefile": "^1.0", + "friendsofphp/php-cs-fixer": "^3.95.2", + "phpunit/phpunit": "^12.0 || ^13.0", + "rector/rector": "^2.4.5" }, + "type": "library", "autoload": { "psr-4": { - "PHPStan\\": "src/" + "Infection\\AbstractTestFramework\\": "src/" } }, "notification-url": "https://packagist.org/downloads/", "license": [ - "MIT" + "BSD-3-Clause" ], - "description": "PHPUnit extensions and rules for PHPStan", + "authors": [ + { + "name": "Maks Rafalko", + "email": "maks.rafalko@gmail.com" + } + ], + "description": "Abstract Test Framework Adapter for Infection", "support": { - "issues": "https://github.com/phpstan/phpstan-phpunit/issues", - "source": "https://github.com/phpstan/phpstan-phpunit/tree/1.3.15" + "issues": "https://github.com/infection/abstract-testframework-adapter/issues", + "source": "https://github.com/infection/abstract-testframework-adapter/tree/0.5.1" }, - "time": "2023-10-09T18:58:39+00:00" + "funding": [ + { + "url": "https://github.com/infection", + "type": "github" + }, + { + "url": "https://opencollective.com/infection", + "type": "open_collective" + } + ], + "time": "2026-05-28T19:10:29+00:00" }, { - "name": "phpstan/phpstan-strict-rules", - "version": "1.5.1", + "name": "infection/extension-installer", + "version": "0.1.2", "source": { "type": "git", - "url": "https://github.com/phpstan/phpstan-strict-rules.git", - "reference": "b21c03d4f6f3a446e4311155f4be9d65048218e6" + "url": "https://github.com/infection/extension-installer.git", + "reference": "9b351d2910b9a23ab4815542e93d541e0ca0cdcf" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/phpstan/phpstan-strict-rules/zipball/b21c03d4f6f3a446e4311155f4be9d65048218e6", - "reference": "b21c03d4f6f3a446e4311155f4be9d65048218e6", + "url": "https://api.github.com/repos/infection/extension-installer/zipball/9b351d2910b9a23ab4815542e93d541e0ca0cdcf", + "reference": "9b351d2910b9a23ab4815542e93d541e0ca0cdcf", "shasum": "" }, "require": { - "php": "^7.2 || ^8.0", - "phpstan/phpstan": "^1.10" + "composer-plugin-api": "^1.1 || ^2.0" }, "require-dev": { - "nikic/php-parser": "^4.13.0", - "php-parallel-lint/php-parallel-lint": "^1.2", - "phpstan/phpstan-deprecation-rules": "^1.1", - "phpstan/phpstan-phpunit": "^1.0", - "phpunit/phpunit": "^9.5" + "composer/composer": "^1.9 || ^2.0", + "friendsofphp/php-cs-fixer": "^2.18, <2.19", + "infection/infection": "^0.15.2", + "php-coveralls/php-coveralls": "^2.4", + "phpstan/extension-installer": "^1.0", + "phpstan/phpstan": "^0.12.10", + "phpstan/phpstan-phpunit": "^0.12.6", + "phpstan/phpstan-strict-rules": "^0.12.2", + "phpstan/phpstan-webmozart-assert": "^0.12.2", + "phpunit/phpunit": "^9.5", + "vimeo/psalm": "^4.8" }, - "type": "phpstan-extension", + "type": "composer-plugin", "extra": { - "phpstan": { - "includes": [ - "rules.neon" - ] - } + "class": "Infection\\ExtensionInstaller\\Plugin" }, "autoload": { "psr-4": { - "PHPStan\\": "src/" + "Infection\\ExtensionInstaller\\": "src/" } }, "notification-url": "https://packagist.org/downloads/", "license": [ - "MIT" + "BSD-3-Clause" ], - "description": "Extra strict and opinionated rules for PHPStan", + "authors": [ + { + "name": "Maks Rafalko", + "email": "maks.rafalko@gmail.com" + } + ], + "description": "Infection Extension Installer", "support": { - "issues": "https://github.com/phpstan/phpstan-strict-rules/issues", - "source": "https://github.com/phpstan/phpstan-strict-rules/tree/1.5.1" + "issues": "https://github.com/infection/extension-installer/issues", + "source": "https://github.com/infection/extension-installer/tree/0.1.2" }, - "time": "2023-03-29T14:47:40+00:00" + "funding": [ + { + "url": "https://github.com/infection", + "type": "github" + }, + { + "url": "https://opencollective.com/infection", + "type": "open_collective" + } + ], + "time": "2021-10-20T22:08:34+00:00" }, { - "name": "phpunit/php-code-coverage", - "version": "9.2.29", + "name": "infection/include-interceptor", + "version": "1.0.0", "source": { "type": "git", - "url": "https://github.com/sebastianbergmann/php-code-coverage.git", - "reference": "6a3a87ac2bbe33b25042753df8195ba4aa534c76" + "url": "https://github.com/infection/include-interceptor.git", + "reference": "c083331bc0cd1cd319ac1b7a08e3ad4a34aa7992" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/php-code-coverage/zipball/6a3a87ac2bbe33b25042753df8195ba4aa534c76", - "reference": "6a3a87ac2bbe33b25042753df8195ba4aa534c76", + "url": "https://api.github.com/repos/infection/include-interceptor/zipball/c083331bc0cd1cd319ac1b7a08e3ad4a34aa7992", + "reference": "c083331bc0cd1cd319ac1b7a08e3ad4a34aa7992", "shasum": "" }, - "require": { - "ext-dom": "*", - "ext-libxml": "*", - "ext-xmlwriter": "*", - "nikic/php-parser": "^4.15", - "php": ">=7.3", - "phpunit/php-file-iterator": "^3.0.3", - "phpunit/php-text-template": "^2.0.2", - "sebastian/code-unit-reverse-lookup": "^2.0.2", - "sebastian/complexity": "^2.0", - "sebastian/environment": "^5.1.2", - "sebastian/lines-of-code": "^1.0.3", - "sebastian/version": "^3.0.1", - "theseer/tokenizer": "^1.2.0" - }, "require-dev": { - "phpunit/phpunit": "^9.3" - }, - "suggest": { - "ext-pcov": "PHP extension that provides line coverage", - "ext-xdebug": "PHP extension that provides line coverage as well as branch and path coverage" + "friendsofphp/php-cs-fixer": "^2.16", + "infection/infection": "^0.19.0", + "phan/phan": "^2.4 || ^3", + "php-coveralls/php-coveralls": "^2.2", + "phpstan/phpstan": "^0.12.8", + "phpunit/phpunit": "^8.5", + "vimeo/psalm": "^3.8" }, "type": "library", - "extra": { - "branch-alias": { - "dev-master": "9.2-dev" - } - }, "autoload": { - "classmap": [ - "src/" - ] + "psr-4": { + "Infection\\StreamWrapper\\": "src/" + } }, "notification-url": "https://packagist.org/downloads/", "license": [ @@ -6095,61 +6757,106 @@ ], "authors": [ { - "name": "Sebastian Bergmann", - "email": "sebastian@phpunit.de", - "role": "lead" + "name": "Maks Rafalko", + "email": "maks.rafalko@gmail.com" } ], - "description": "Library that provides collection, processing, and rendering functionality for PHP code coverage information.", - "homepage": "https://github.com/sebastianbergmann/php-code-coverage", - "keywords": [ - "coverage", - "testing", - "xunit" - ], + "description": "Stream Wrapper: Include Interceptor. Allows to replace included (autoloaded) file with another one.", "support": { - "issues": "https://github.com/sebastianbergmann/php-code-coverage/issues", - "security": "https://github.com/sebastianbergmann/php-code-coverage/security/policy", - "source": "https://github.com/sebastianbergmann/php-code-coverage/tree/9.2.29" + "issues": "https://github.com/infection/include-interceptor/issues", + "source": "https://github.com/infection/include-interceptor/tree/1.0.0" }, "funding": [ { - "url": "https://github.com/sebastianbergmann", + "url": "https://github.com/infection", "type": "github" + }, + { + "url": "https://opencollective.com/infection", + "type": "open_collective" } ], - "time": "2023-09-19T04:57:46+00:00" + "time": "2024-05-03T21:48:06+00:00" }, { - "name": "phpunit/php-file-iterator", - "version": "3.0.6", + "name": "infection/infection", + "version": "0.34.2", "source": { "type": "git", - "url": "https://github.com/sebastianbergmann/php-file-iterator.git", - "reference": "cf1c2e7c203ac650e352f4cc675a7021e7d1b3cf" + "url": "https://github.com/infection/infection.git", + "reference": "18d9bef39fae250f202920d1453ab96e793e6637" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/php-file-iterator/zipball/cf1c2e7c203ac650e352f4cc675a7021e7d1b3cf", - "reference": "cf1c2e7c203ac650e352f4cc675a7021e7d1b3cf", + "url": "https://api.github.com/repos/infection/infection/zipball/18d9bef39fae250f202920d1453ab96e793e6637", + "reference": "18d9bef39fae250f202920d1453ab96e793e6637", "shasum": "" }, "require": { - "php": ">=7.3" + "colinodell/json5": "^3.0", + "composer-runtime-api": "^2.0", + "composer/xdebug-handler": "^3.0", + "ext-dom": "*", + "ext-json": "*", + "ext-libxml": "*", + "ext-mbstring": "*", + "fidry/cpu-core-counter": "^1.0", + "infection/abstract-testframework-adapter": "^0.5.0", + "infection/extension-installer": "^0.1.0", + "infection/include-interceptor": "^0.2.5 || ^1.0.0", + "infection/mutator": "^0.4", + "justinrainbow/json-schema": "^6.0", + "nikic/php-parser": "^5.6.2", + "ondram/ci-detector": "^4.1.0", + "php": "^8.3", + "psr/log": "^2.0 || ^3.0", + "sanmai/di-container": "^0.1.16", + "sanmai/duoclock": "^0.1.0", + "sanmai/later": "^0.1.7", + "sanmai/pipeline": "^7.2", + "sebastian/diff": "^4.0 || ^5.0 || ^6.0 || ^7.0 || ^8.0 || ^9.0", + "symfony/console": "^6.4 || ^7.4 || ^8.0", + "symfony/filesystem": "^6.4 || ^7.4 || ^8.0", + "symfony/finder": "^6.4 || ^7.4 || ^8.0", + "symfony/polyfill-php85": "^1.33", + "symfony/process": "^6.4 || ^7.4 || ^8.0", + "thecodingmachine/safe": "^v3.0", + "webmozart/assert": "^1.11 || ^2.0" + }, + "conflict": { + "antecedent/patchwork": "<2.1.25", + "dg/bypass-finals": "<1.4.1" }, "require-dev": { - "phpunit/phpunit": "^9.3" + "carthage-software/mago": "^1.20", + "ext-simplexml": "*", + "fidry/makefile": "^1.0", + "fig/log-test": "^1.2", + "phpat/phpat": "^0.12.4", + "phpbench/phpbench": "^1.4", + "phpstan/extension-installer": "^1.4", + "phpstan/phpstan": "^2.1", + "phpstan/phpstan-deprecation-rules": "^2.0", + "phpstan/phpstan-phpunit": "^2.0", + "phpstan/phpstan-strict-rules": "^2.0", + "phpstan/phpstan-webmozart-assert": "^2.0", + "phpunit/phpunit": "^12.5.29", + "rector/rector": "^2.2.4", + "shipmonk/dead-code-detector": "^1.3", + "shipmonk/name-collision-detector": "^2.1", + "sidz/phpstan-rules": "^0.5.1", + "symfony/yaml": "^6.4 || ^7.4 || ^8.0", + "thecodingmachine/phpstan-safe-rule": "^1.4", + "webmozarts/strict-phpunit": "^7.15" }, + "bin": [ + "bin/infection" + ], "type": "library", - "extra": { - "branch-alias": { - "dev-master": "3.0-dev" - } - }, "autoload": { - "classmap": [ - "src/" - ] + "psr-4": { + "Infection\\": "src/" + } }, "notification-url": "https://packagist.org/downloads/", "license": [ @@ -6157,63 +6864,84 @@ ], "authors": [ { - "name": "Sebastian Bergmann", - "email": "sebastian@phpunit.de", - "role": "lead" + "name": "Maks Rafalko", + "email": "maks.rafalko@gmail.com", + "homepage": "https://twitter.com/maks_rafalko" + }, + { + "name": "Oleg Zhulnev", + "homepage": "https://github.com/sidz" + }, + { + "name": "Gert de Pagter", + "homepage": "https://github.com/BackEndTea" + }, + { + "name": "Théo FIDRY", + "email": "theo.fidry@gmail.com", + "homepage": "https://twitter.com/tfidry" + }, + { + "name": "Alexey Kopytko", + "email": "alexey@kopytko.com", + "homepage": "https://www.alexeykopytko.com" + }, + { + "name": "Andreas Möller", + "email": "am@localheinz.com", + "homepage": "https://localheinz.com" } ], - "description": "FilterIterator implementation that filters files based on a list of suffixes.", - "homepage": "https://github.com/sebastianbergmann/php-file-iterator/", + "description": "Infection is a Mutation Testing framework for PHP. The mutation adequacy score can be used to measure the effectiveness of a test set in terms of its ability to detect faults.", "keywords": [ - "filesystem", - "iterator" + "coverage", + "mutant", + "mutation framework", + "mutation testing", + "testing", + "unit testing" ], "support": { - "issues": "https://github.com/sebastianbergmann/php-file-iterator/issues", - "source": "https://github.com/sebastianbergmann/php-file-iterator/tree/3.0.6" + "issues": "https://github.com/infection/infection/issues", + "source": "https://github.com/infection/infection/tree/0.34.2" }, "funding": [ { - "url": "https://github.com/sebastianbergmann", + "url": "https://github.com/infection", "type": "github" + }, + { + "url": "https://opencollective.com/infection", + "type": "open_collective" } ], - "time": "2021-12-02T12:48:52+00:00" + "time": "2026-08-07T12:59:47+00:00" }, { - "name": "phpunit/php-invoker", - "version": "3.1.1", + "name": "infection/mutator", + "version": "0.4.1", "source": { "type": "git", - "url": "https://github.com/sebastianbergmann/php-invoker.git", - "reference": "5a10147d0aaf65b58940a0b72f71c9ac0423cc67" + "url": "https://github.com/infection/mutator.git", + "reference": "3c976d721b02b32f851ee4e15d553ef1e9186d1d" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/php-invoker/zipball/5a10147d0aaf65b58940a0b72f71c9ac0423cc67", - "reference": "5a10147d0aaf65b58940a0b72f71c9ac0423cc67", + "url": "https://api.github.com/repos/infection/mutator/zipball/3c976d721b02b32f851ee4e15d553ef1e9186d1d", + "reference": "3c976d721b02b32f851ee4e15d553ef1e9186d1d", "shasum": "" }, "require": { - "php": ">=7.3" + "nikic/php-parser": "^5.0" }, "require-dev": { - "ext-pcntl": "*", - "phpunit/phpunit": "^9.3" - }, - "suggest": { - "ext-pcntl": "*" + "phpunit/phpunit": "^9.6 || ^10" }, "type": "library", - "extra": { - "branch-alias": { - "dev-master": "3.1-dev" - } - }, "autoload": { - "classmap": [ - "src/" - ] + "psr-4": { + "Infection\\Mutator\\": "src/" + } }, "notification-url": "https://packagist.org/downloads/", "license": [ @@ -6221,113 +6949,93 @@ ], "authors": [ { - "name": "Sebastian Bergmann", - "email": "sebastian@phpunit.de", - "role": "lead" + "name": "Maks Rafalko", + "email": "maks.rafalko@gmail.com" } ], - "description": "Invoke callables with a timeout", - "homepage": "https://github.com/sebastianbergmann/php-invoker/", - "keywords": [ - "process" - ], + "description": "Mutator interface to implement custom mutators (mutation operators) for Infection", "support": { - "issues": "https://github.com/sebastianbergmann/php-invoker/issues", - "source": "https://github.com/sebastianbergmann/php-invoker/tree/3.1.1" + "issues": "https://github.com/infection/mutator/issues", + "source": "https://github.com/infection/mutator/tree/0.4.1" }, "funding": [ { - "url": "https://github.com/sebastianbergmann", + "url": "https://github.com/infection", "type": "github" + }, + { + "url": "https://opencollective.com/infection", + "type": "open_collective" } ], - "time": "2020-09-28T05:58:55+00:00" + "time": "2025-04-29T08:19:52+00:00" }, { - "name": "phpunit/php-text-template", - "version": "2.0.4", + "name": "jetbrains/phpstorm-stubs", + "version": "v2026.2", "source": { "type": "git", - "url": "https://github.com/sebastianbergmann/php-text-template.git", - "reference": "5da5f67fc95621df9ff4c4e5a84d6a8a2acf7c28" + "url": "https://github.com/JetBrains/phpstorm-stubs", + "reference": "709e512210784a7c0a677b3a89d35def844a59b9" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/php-text-template/zipball/5da5f67fc95621df9ff4c4e5a84d6a8a2acf7c28", - "reference": "5da5f67fc95621df9ff4c4e5a84d6a8a2acf7c28", + "url": "https://api.github.com/repos/JetBrains/phpstorm-stubs/zipball/709e512210784a7c0a677b3a89d35def844a59b9", + "reference": "709e512210784a7c0a677b3a89d35def844a59b9", "shasum": "" }, - "require": { - "php": ">=7.3" - }, "require-dev": { - "phpunit/phpunit": "^9.3" + "friendsofphp/php-cs-fixer": "^v3.86", + "nikic/php-parser": "^v5.6", + "phpdocumentor/reflection-docblock": "^5.6", + "phpunit/phpunit": "^12.3" }, "type": "library", - "extra": { - "branch-alias": { - "dev-master": "2.0-dev" - } - }, "autoload": { - "classmap": [ - "src/" + "files": [ + "PhpStormStubsMap.php" ] }, "notification-url": "https://packagist.org/downloads/", "license": [ - "BSD-3-Clause" - ], - "authors": [ - { - "name": "Sebastian Bergmann", - "email": "sebastian@phpunit.de", - "role": "lead" - } + "Apache-2.0" ], - "description": "Simple template engine.", - "homepage": "https://github.com/sebastianbergmann/php-text-template/", + "description": "PHP runtime & extensions header files for PhpStorm", + "homepage": "https://www.jetbrains.com/phpstorm", "keywords": [ - "template" - ], - "support": { - "issues": "https://github.com/sebastianbergmann/php-text-template/issues", - "source": "https://github.com/sebastianbergmann/php-text-template/tree/2.0.4" - }, - "funding": [ - { - "url": "https://github.com/sebastianbergmann", - "type": "github" - } + "autocomplete", + "code", + "inference", + "inspection", + "jetbrains", + "phpstorm", + "stubs", + "type" ], - "time": "2020-10-26T05:33:50+00:00" + "time": "2026-06-12T13:19:10+00:00" }, { - "name": "phpunit/php-timer", - "version": "5.0.3", + "name": "localheinz/diff", + "version": "1.3.0", "source": { "type": "git", - "url": "https://github.com/sebastianbergmann/php-timer.git", - "reference": "5a63ce20ed1b5bf577850e2c4e87f4aa902afbd2" + "url": "https://github.com/localheinz/diff.git", + "reference": "33bd840935970cda6691c23fc7d94ae764c0734c" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/php-timer/zipball/5a63ce20ed1b5bf577850e2c4e87f4aa902afbd2", - "reference": "5a63ce20ed1b5bf577850e2c4e87f4aa902afbd2", + "url": "https://api.github.com/repos/localheinz/diff/zipball/33bd840935970cda6691c23fc7d94ae764c0734c", + "reference": "33bd840935970cda6691c23fc7d94ae764c0734c", "shasum": "" }, "require": { - "php": ">=7.3" + "php": "~7.1.0 || ~7.2.0 || ~7.3.0 || ~7.4.0 || ~8.0.0 || ~8.1.0 || ~8.2.0 || ~8.3.0 || ~8.4.0 || ~8.5.0" }, "require-dev": { - "phpunit/phpunit": "^9.3" + "phpunit/phpunit": "^7.5.0 || ^8.5.23", + "symfony/process": "^4.2 || ^5" }, "type": "library", - "extra": { - "branch-alias": { - "dev-master": "5.0-dev" - } - }, "autoload": { "classmap": [ "src/" @@ -6340,281 +7048,289 @@ "authors": [ { "name": "Sebastian Bergmann", - "email": "sebastian@phpunit.de", - "role": "lead" + "email": "sebastian@phpunit.de" + }, + { + "name": "Kore Nordmann", + "email": "mail@kore-nordmann.de" } ], - "description": "Utility class for timing", - "homepage": "https://github.com/sebastianbergmann/php-timer/", + "description": "Fork of sebastian/diff for use with ergebnis/composer-normalize", + "homepage": "https://github.com/localheinz/diff", "keywords": [ - "timer" + "diff", + "udiff", + "unidiff", + "unified diff" ], "support": { - "issues": "https://github.com/sebastianbergmann/php-timer/issues", - "source": "https://github.com/sebastianbergmann/php-timer/tree/5.0.3" + "issues": "https://github.com/localheinz/diff/issues", + "source": "https://github.com/localheinz/diff/tree/1.3.0" }, - "funding": [ - { - "url": "https://github.com/sebastianbergmann", - "type": "github" - } - ], - "time": "2020-10-26T13:16:10+00:00" + "time": "2025-08-30T09:44:18+00:00" }, { - "name": "phpunit/phpunit", - "version": "9.6.13", + "name": "maglnet/composer-require-checker", + "version": "4.20.0", "source": { "type": "git", - "url": "https://github.com/sebastianbergmann/phpunit.git", - "reference": "f3d767f7f9e191eab4189abe41ab37797e30b1be" + "url": "https://github.com/maglnet/ComposerRequireChecker.git", + "reference": "c62d517ef5ac2d347dd9b3d02c1cc16c0f1091e2" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/f3d767f7f9e191eab4189abe41ab37797e30b1be", - "reference": "f3d767f7f9e191eab4189abe41ab37797e30b1be", + "url": "https://api.github.com/repos/maglnet/ComposerRequireChecker/zipball/c62d517ef5ac2d347dd9b3d02c1cc16c0f1091e2", + "reference": "c62d517ef5ac2d347dd9b3d02c1cc16c0f1091e2", "shasum": "" }, "require": { - "doctrine/instantiator": "^1.3.1 || ^2", - "ext-dom": "*", - "ext-json": "*", - "ext-libxml": "*", - "ext-mbstring": "*", - "ext-xml": "*", - "ext-xmlwriter": "*", - "myclabs/deep-copy": "^1.10.1", - "phar-io/manifest": "^2.0.3", - "phar-io/version": "^3.0.2", - "php": ">=7.3", - "phpunit/php-code-coverage": "^9.2.28", - "phpunit/php-file-iterator": "^3.0.5", - "phpunit/php-invoker": "^3.1.1", - "phpunit/php-text-template": "^2.0.3", - "phpunit/php-timer": "^5.0.2", - "sebastian/cli-parser": "^1.0.1", - "sebastian/code-unit": "^1.0.6", - "sebastian/comparator": "^4.0.8", - "sebastian/diff": "^4.0.3", - "sebastian/environment": "^5.1.3", - "sebastian/exporter": "^4.0.5", - "sebastian/global-state": "^5.0.1", - "sebastian/object-enumerator": "^4.0.3", - "sebastian/resource-operations": "^3.0.3", - "sebastian/type": "^3.2", - "sebastian/version": "^3.0.2" + "azjezz/psl": "^4.2.0", + "composer-runtime-api": "^2.0.0", + "ext-phar": "*", + "nikic/php-parser": "^5.7.0", + "php": "~8.3.0 || ~8.4.0 || ~8.5.0", + "symfony/console": "^7.4.1", + "webmozart/glob": "^4.7.0" }, - "suggest": { - "ext-soap": "To be able to generate mocks based on WSDL files", - "ext-xdebug": "PHP extension that provides line coverage as well as branch and path coverage" + "conflict": { + "revolt/event-loop": "< 1.0.8" + }, + "require-dev": { + "doctrine/coding-standard": "^14.0.0", + "ext-zend-opcache": "*", + "phing/phing": "^3.1.1", + "php-standard-library/phpstan-extension": "^2.0.2", + "php-standard-library/psalm-plugin": "^2.3", + "phpstan/phpstan": "^2.1.33", + "phpunit/phpunit": "^12.5.4", + "psalm/plugin-phpunit": "^0.19.5", + "roave/infection-static-analysis-plugin": "^1.42.0", + "spatie/temporary-directory": "^2.3.0", + "vimeo/psalm": "^6.14.3" }, "bin": [ - "phpunit" + "bin/composer-require-checker" ], "type": "library", "extra": { "branch-alias": { - "dev-master": "9.6-dev" + "dev-master": "2.1-dev" } }, "autoload": { - "files": [ - "src/Framework/Assert/Functions.php" - ], - "classmap": [ - "src/" - ] + "psr-4": { + "ComposerRequireChecker\\": "src/ComposerRequireChecker" + } }, "notification-url": "https://packagist.org/downloads/", "license": [ - "BSD-3-Clause" + "MIT" ], "authors": [ { - "name": "Sebastian Bergmann", - "email": "sebastian@phpunit.de", - "role": "lead" + "name": "Marco Pivetta", + "email": "ocramius@gmail.com", + "homepage": "http://ocramius.github.io/" + }, + { + "name": "Matthias Glaub", + "email": "magl@magl.net", + "homepage": "http://magl.net" } ], - "description": "The PHP Unit Testing framework.", - "homepage": "https://phpunit.de/", + "description": "CLI tool to analyze composer dependencies and verify that no unknown symbols are used in the sources of a package", + "homepage": "https://github.com/maglnet/ComposerRequireChecker", "keywords": [ - "phpunit", - "testing", - "xunit" + "cli", + "composer", + "dependency", + "imports", + "require", + "requirements", + "static analysis" ], "support": { - "issues": "https://github.com/sebastianbergmann/phpunit/issues", - "security": "https://github.com/sebastianbergmann/phpunit/security/policy", - "source": "https://github.com/sebastianbergmann/phpunit/tree/9.6.13" + "issues": "https://github.com/maglnet/ComposerRequireChecker/issues", + "source": "https://github.com/maglnet/ComposerRequireChecker/tree/4.20.0" }, - "funding": [ - { - "url": "https://phpunit.de/sponsors.html", - "type": "custom" - }, - { - "url": "https://github.com/sebastianbergmann", - "type": "github" - }, - { - "url": "https://tidelift.com/funding/github/packagist/phpunit/phpunit", - "type": "tidelift" - } - ], - "time": "2023-09-19T05:39:22+00:00" + "time": "2025-12-29T11:34:42+00:00" }, { - "name": "pointybeard/reverse-regex", - "version": "1.0.0.3", + "name": "mockery/mockery", + "version": "1.6.15", "source": { "type": "git", - "url": "https://github.com/pointybeard-forks/ReverseRegex.git", - "reference": "a842e37c4f16367ad7b294a76a5e9671042683d8" + "url": "https://github.com/mockery/mockery.git", + "reference": "967a801bd188989a5669bd280f252d51c0fdc9ee" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/pointybeard-forks/ReverseRegex/zipball/a842e37c4f16367ad7b294a76a5e9671042683d8", - "reference": "a842e37c4f16367ad7b294a76a5e9671042683d8", + "url": "https://api.github.com/repos/mockery/mockery/zipball/967a801bd188989a5669bd280f252d51c0fdc9ee", + "reference": "967a801bd188989a5669bd280f252d51c0fdc9ee", "shasum": "" }, "require": { - "doctrine/collections": "^1.6", - "doctrine/lexer": "^1.2", - "php": ">=7.2", - "symfony/polyfill-mbstring": "^1.23" + "hamcrest/hamcrest-php": "^2.0 || ^3.0", + "php": ">=7.3" + }, + "conflict": { + "phpunit/phpunit": "<8.0" }, "require-dev": { - "damianopetrungaro/php-commitizen": "^0.1.2", - "friendsofphp/php-cs-fixer": "^3.0", - "php-parallel-lint/php-parallel-lint": "^1.2", - "phpunit/phpunit": "^9.5", - "squizlabs/php_codesniffer": "^3.0" + "phpunit/phpunit": "^9.6.36", + "symplify/easy-coding-standard": "^13.2.17" }, "type": "library", "autoload": { + "files": [ + "library/helpers.php", + "library/Mockery.php" + ], "psr-4": { - "PHPStats\\": "src/PHPStats", - "ReverseRegex\\": "src/ReverseRegex" + "Mockery\\": "library/Mockery" } }, "notification-url": "https://packagist.org/downloads/", "license": [ - "MIT" + "BSD-3-Clause" ], "authors": [ { - "name": "Alannah Kearney", - "email": "hi@alannahkearney.com", - "homepage": "https://github.com/pointybeard" + "name": "Pádraic Brady", + "email": "padraic.brady@gmail.com", + "homepage": "https://github.com/padraic", + "role": "Author" }, { - "name": "Lewis Dyer", - "email": "getintouch@icomefromthenet.com", - "homepage": "http://www.icomefromthenet.com" + "name": "Dave Marshall", + "email": "dave.marshall@atstsolutions.co.uk", + "homepage": "https://davedevelopment.co.uk", + "role": "Developer" + }, + { + "name": "Nathanael Esayeas", + "email": "nathanael.esayeas@protonmail.com", + "homepage": "https://github.com/ghostwriter", + "role": "Lead Developer" } ], - "description": "Convert Regular Expressions into text, for testing", - "homepage": "http://github.com/pointybeard-forks/ReverseRegex", + "description": "Mockery is a simple yet flexible PHP mock object framework", + "homepage": "https://github.com/mockery/mockery", "keywords": [ - "generator", - "regex", - "test data", + "BDD", + "TDD", + "library", + "mock", + "mock objects", + "mockery", + "stub", + "test", + "test double", "testing" ], "support": { - "issues": "https://github.com/pointybeard-forks/ReverseRegex/issues", - "source": "https://github.com/pointybeard-forks/ReverseRegex/tree/1.0.0.3", - "wiki": "https://github.com/pointybeard-forks/ReverseRegex/wiki" + "docs": "https://docs.mockery.io/", + "issues": "https://github.com/mockery/mockery/issues", + "rss": "https://github.com/mockery/mockery/releases.atom", + "security": "https://github.com/mockery/mockery/security/advisories", + "source": "https://github.com/mockery/mockery" }, - "time": "2022-04-20T04:32:05+00:00" + "time": "2026-08-19T19:37:52+00:00" }, { - "name": "psalm/plugin-phpunit", - "version": "0.18.4", + "name": "myclabs/deep-copy", + "version": "1.14.0", "source": { "type": "git", - "url": "https://github.com/psalm/psalm-plugin-phpunit.git", - "reference": "e4ab3096653d9eb6f6d0ea5f4461898d59ae4dbc" + "url": "https://github.com/myclabs/DeepCopy.git", + "reference": "8680aa248f8e07bc8fb43f56f0f5fc77a0c96aae" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/psalm/psalm-plugin-phpunit/zipball/e4ab3096653d9eb6f6d0ea5f4461898d59ae4dbc", - "reference": "e4ab3096653d9eb6f6d0ea5f4461898d59ae4dbc", + "url": "https://api.github.com/repos/myclabs/DeepCopy/zipball/8680aa248f8e07bc8fb43f56f0f5fc77a0c96aae", + "reference": "8680aa248f8e07bc8fb43f56f0f5fc77a0c96aae", "shasum": "" }, "require": { - "composer/package-versions-deprecated": "^1.10", - "composer/semver": "^1.4 || ^2.0 || ^3.0", - "ext-simplexml": "*", - "php": "^7.1 || ^8.0", - "vimeo/psalm": "dev-master || dev-4.x || ^4.7.1 || ^5@beta || ^5.0" + "php": "^8.0" }, "conflict": { - "phpunit/phpunit": "<7.5" + "doctrine/collections": "<1.6.8", + "doctrine/common": "<2.13.3 || >=3 <3.2.2" }, "require-dev": { - "codeception/codeception": "^4.0.3", - "php": "^7.3 || ^8.0", - "phpunit/phpunit": "^7.5 || ^8.0 || ^9.0", - "squizlabs/php_codesniffer": "^3.3.1", - "weirdan/codeception-psalm-module": "^0.11.0", - "weirdan/prophecy-shim": "^1.0 || ^2.0" - }, - "type": "psalm-plugin", - "extra": { - "psalm": { - "pluginClass": "Psalm\\PhpUnitPlugin\\Plugin" - } + "doctrine/collections": "^1.6.8", + "doctrine/common": "^2.13.3 || ^3.2.2", + "phpspec/prophecy": "^1.10", + "phpunit/phpunit": "^7.5.20 || ^8.5.23 || ^9.5.13" }, + "type": "library", "autoload": { + "files": [ + "src/DeepCopy/deep_copy.php" + ], "psr-4": { - "Psalm\\PhpUnitPlugin\\": "src" + "DeepCopy\\": "src/DeepCopy/" } }, "notification-url": "https://packagist.org/downloads/", "license": [ "MIT" ], - "authors": [ - { - "name": "Matt Brown", - "email": "github@muglug.com" - } + "description": "Create deep copies (clones) of your objects", + "keywords": [ + "clone", + "copy", + "duplicate", + "object", + "object graph" ], - "description": "Psalm plugin for PHPUnit", "support": { - "issues": "https://github.com/psalm/psalm-plugin-phpunit/issues", - "source": "https://github.com/psalm/psalm-plugin-phpunit/tree/0.18.4" + "issues": "https://github.com/myclabs/DeepCopy/issues", + "source": "https://github.com/myclabs/DeepCopy/tree/1.14.0" }, - "time": "2022-12-03T07:47:07+00:00" + "funding": [ + { + "url": "https://github.com/mnapoli", + "type": "github" + } + ], + "time": "2026-08-11T10:17:44+00:00" }, { - "name": "psr/cache", - "version": "3.0.0", + "name": "nikolaposa/version", + "version": "4.2.1", "source": { "type": "git", - "url": "https://github.com/php-fig/cache.git", - "reference": "aa5030cfa5405eccfdcb1083ce040c2cb8d253bf" + "url": "https://github.com/nikolaposa/version.git", + "reference": "2b9ee2f0b09333b6ce00bd6b63132cdf1d7a1428" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/php-fig/cache/zipball/aa5030cfa5405eccfdcb1083ce040c2cb8d253bf", - "reference": "aa5030cfa5405eccfdcb1083ce040c2cb8d253bf", + "url": "https://api.github.com/repos/nikolaposa/version/zipball/2b9ee2f0b09333b6ce00bd6b63132cdf1d7a1428", + "reference": "2b9ee2f0b09333b6ce00bd6b63132cdf1d7a1428", "shasum": "" }, "require": { - "php": ">=8.0.0" + "beberlei/assert": "^3.2", + "php": "^8.1" + }, + "require-dev": { + "friendsofphp/php-cs-fixer": "^3.44", + "phpstan/phpstan": "^1.10", + "phpstan/phpstan-beberlei-assert": "^1.1", + "phpstan/phpstan-phpunit": "^1.3", + "phpunit/phpunit": "^10.5" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "1.0.x-dev" + "dev-master": "4.2.x-dev" } }, "autoload": { "psr-4": { - "Psr\\Cache\\": "src/" + "Version\\": "src/" } }, "notification-url": "https://packagist.org/downloads/", @@ -6623,47 +7339,59 @@ ], "authors": [ { - "name": "PHP-FIG", - "homepage": "https://www.php-fig.org/" + "name": "Nikola Poša", + "email": "posa.nikola@gmail.com", + "homepage": "https://www.nikolaposa.in.rs" } ], - "description": "Common interface for caching libraries", + "description": "Value Object that represents a SemVer-compliant version number.", + "homepage": "https://github.com/nikolaposa/version", "keywords": [ - "cache", - "psr", - "psr-6" + "semantic", + "semver", + "version", + "versioning" ], "support": { - "source": "https://github.com/php-fig/cache/tree/3.0.0" + "issues": "https://github.com/nikolaposa/version/issues", + "source": "https://github.com/nikolaposa/version/tree/4.2.1" }, - "time": "2021-02-03T23:26:27+00:00" + "time": "2025-03-24T19:12:02+00:00" }, { - "name": "psr/container", - "version": "2.0.2", + "name": "ocramius/package-versions", + "version": "2.12.0", "source": { "type": "git", - "url": "https://github.com/php-fig/container.git", - "reference": "c71ecc56dfe541dbd90c5360474fbc405f8d5963" + "url": "https://github.com/Ocramius/PackageVersions.git", + "reference": "18b02a63e837246e812cae72e211db32d7980019" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/php-fig/container/zipball/c71ecc56dfe541dbd90c5360474fbc405f8d5963", - "reference": "c71ecc56dfe541dbd90c5360474fbc405f8d5963", + "url": "https://api.github.com/repos/Ocramius/PackageVersions/zipball/18b02a63e837246e812cae72e211db32d7980019", + "reference": "18b02a63e837246e812cae72e211db32d7980019", "shasum": "" }, "require": { - "php": ">=7.4.0" + "composer-runtime-api": "^2.2.0", + "php": "~8.4.0 || ~8.5.0" + }, + "replace": { + "composer/package-versions-deprecated": "*" + }, + "require-dev": { + "composer/composer": "^2.9.8", + "doctrine/coding-standard": "^14.0.0", + "ext-zip": "^1.15.0", + "phpunit/phpunit": "^13.1.11", + "psalm/plugin-phpunit": "^0.19.7", + "roave/infection-static-analysis-plugin": "^1.44.0", + "vimeo/psalm": "^6.16.1" }, "type": "library", - "extra": { - "branch-alias": { - "dev-master": "2.0.x-dev" - } - }, "autoload": { "psr-4": { - "Psr\\Container\\": "src/" + "PackageVersions\\": "src/PackageVersions" } }, "notification-url": "https://packagist.org/downloads/", @@ -6672,212 +7400,226 @@ ], "authors": [ { - "name": "PHP-FIG", - "homepage": "https://www.php-fig.org/" + "name": "Marco Pivetta", + "email": "ocramius@gmail.com" } ], - "description": "Common Container Interface (PHP FIG PSR-11)", - "homepage": "https://github.com/php-fig/container", - "keywords": [ - "PSR-11", - "container", - "container-interface", - "container-interop", - "psr" - ], + "description": "Provides efficient querying for installed package versions (no runtime IO)", "support": { - "issues": "https://github.com/php-fig/container/issues", - "source": "https://github.com/php-fig/container/tree/2.0.2" + "issues": "https://github.com/Ocramius/PackageVersions/issues", + "source": "https://github.com/Ocramius/PackageVersions/tree/2.12.0" }, - "time": "2021-11-05T16:47:00+00:00" + "funding": [ + { + "url": "https://github.com/Ocramius", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/ocramius/package-versions", + "type": "tidelift" + } + ], + "time": "2026-05-21T19:52:53+00:00" }, { - "name": "psr/http-client", - "version": "1.0.3", + "name": "phar-io/manifest", + "version": "2.0.4", "source": { "type": "git", - "url": "https://github.com/php-fig/http-client.git", - "reference": "bb5906edc1c324c9a05aa0873d40117941e5fa90" + "url": "https://github.com/phar-io/manifest.git", + "reference": "54750ef60c58e43759730615a392c31c80e23176" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/php-fig/http-client/zipball/bb5906edc1c324c9a05aa0873d40117941e5fa90", - "reference": "bb5906edc1c324c9a05aa0873d40117941e5fa90", + "url": "https://api.github.com/repos/phar-io/manifest/zipball/54750ef60c58e43759730615a392c31c80e23176", + "reference": "54750ef60c58e43759730615a392c31c80e23176", "shasum": "" }, "require": { - "php": "^7.0 || ^8.0", - "psr/http-message": "^1.0 || ^2.0" + "ext-dom": "*", + "ext-libxml": "*", + "ext-phar": "*", + "ext-xmlwriter": "*", + "phar-io/version": "^3.0.1", + "php": "^7.2 || ^8.0" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "1.0.x-dev" + "dev-master": "2.0.x-dev" } }, "autoload": { - "psr-4": { - "Psr\\Http\\Client\\": "src/" - } + "classmap": [ + "src/" + ] }, "notification-url": "https://packagist.org/downloads/", "license": [ - "MIT" + "BSD-3-Clause" ], "authors": [ { - "name": "PHP-FIG", - "homepage": "https://www.php-fig.org/" + "name": "Arne Blankerts", + "email": "arne@blankerts.de", + "role": "Developer" + }, + { + "name": "Sebastian Heuer", + "email": "sebastian@phpeople.de", + "role": "Developer" + }, + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de", + "role": "Developer" } ], - "description": "Common interface for HTTP clients", - "homepage": "https://github.com/php-fig/http-client", - "keywords": [ - "http", - "http-client", - "psr", - "psr-18" - ], + "description": "Component for reading phar.io manifest information from a PHP Archive (PHAR)", "support": { - "source": "https://github.com/php-fig/http-client" + "issues": "https://github.com/phar-io/manifest/issues", + "source": "https://github.com/phar-io/manifest/tree/2.0.4" }, - "time": "2023-09-23T14:17:50+00:00" + "funding": [ + { + "url": "https://github.com/theseer", + "type": "github" + } + ], + "time": "2024-03-03T12:33:53+00:00" }, { - "name": "psr/http-factory", - "version": "1.0.2", + "name": "phar-io/version", + "version": "3.2.1", "source": { "type": "git", - "url": "https://github.com/php-fig/http-factory.git", - "reference": "e616d01114759c4c489f93b099585439f795fe35" + "url": "https://github.com/phar-io/version.git", + "reference": "4f7fd7836c6f332bb2933569e566a0d6c4cbed74" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/php-fig/http-factory/zipball/e616d01114759c4c489f93b099585439f795fe35", - "reference": "e616d01114759c4c489f93b099585439f795fe35", + "url": "https://api.github.com/repos/phar-io/version/zipball/4f7fd7836c6f332bb2933569e566a0d6c4cbed74", + "reference": "4f7fd7836c6f332bb2933569e566a0d6c4cbed74", "shasum": "" }, "require": { - "php": ">=7.0.0", - "psr/http-message": "^1.0 || ^2.0" + "php": "^7.2 || ^8.0" }, "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.0.x-dev" - } - }, "autoload": { - "psr-4": { - "Psr\\Http\\Message\\": "src/" - } + "classmap": [ + "src/" + ] }, "notification-url": "https://packagist.org/downloads/", "license": [ - "MIT" + "BSD-3-Clause" ], "authors": [ { - "name": "PHP-FIG", - "homepage": "https://www.php-fig.org/" + "name": "Arne Blankerts", + "email": "arne@blankerts.de", + "role": "Developer" + }, + { + "name": "Sebastian Heuer", + "email": "sebastian@phpeople.de", + "role": "Developer" + }, + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de", + "role": "Developer" } ], - "description": "Common interfaces for PSR-7 HTTP message factories", - "keywords": [ - "factory", - "http", - "message", - "psr", - "psr-17", - "psr-7", - "request", - "response" - ], + "description": "Library for handling version information and constraints", "support": { - "source": "https://github.com/php-fig/http-factory/tree/1.0.2" + "issues": "https://github.com/phar-io/version/issues", + "source": "https://github.com/phar-io/version/tree/3.2.1" }, - "time": "2023-04-10T20:10:41+00:00" + "time": "2022-02-21T01:04:05+00:00" }, { - "name": "psr/http-message", - "version": "1.1", + "name": "php-parallel-lint/php-console-color", + "version": "v1.0.1", "source": { "type": "git", - "url": "https://github.com/php-fig/http-message.git", - "reference": "cb6ce4845ce34a8ad9e68117c10ee90a29919eba" + "url": "https://github.com/php-parallel-lint/PHP-Console-Color.git", + "reference": "7adfefd530aa2d7570ba87100a99e2483a543b88" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/php-fig/http-message/zipball/cb6ce4845ce34a8ad9e68117c10ee90a29919eba", - "reference": "cb6ce4845ce34a8ad9e68117c10ee90a29919eba", + "url": "https://api.github.com/repos/php-parallel-lint/PHP-Console-Color/zipball/7adfefd530aa2d7570ba87100a99e2483a543b88", + "reference": "7adfefd530aa2d7570ba87100a99e2483a543b88", "shasum": "" }, "require": { - "php": "^7.2 || ^8.0" + "php": ">=5.3.2" }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.1.x-dev" - } + "replace": { + "jakub-onderka/php-console-color": "*" + }, + "require-dev": { + "php-parallel-lint/php-code-style": "^2.0", + "php-parallel-lint/php-parallel-lint": "^1.0", + "php-parallel-lint/php-var-dump-check": "0.*", + "phpunit/phpunit": "^4.8.36 || ^5.7.21 || ^6.0 || ^7.0 || ^8.0 || ^9.0" }, + "type": "library", "autoload": { "psr-4": { - "Psr\\Http\\Message\\": "src/" + "PHP_Parallel_Lint\\PhpConsoleColor\\": "src/" } }, "notification-url": "https://packagist.org/downloads/", "license": [ - "MIT" + "BSD-2-Clause" ], "authors": [ { - "name": "PHP-FIG", - "homepage": "http://www.php-fig.org/" + "name": "Jakub Onderka", + "email": "jakub.onderka@gmail.com" } ], - "description": "Common interface for HTTP messages", - "homepage": "https://github.com/php-fig/http-message", - "keywords": [ - "http", - "http-message", - "psr", - "psr-7", - "request", - "response" - ], + "description": "Simple library for creating colored console ouput.", "support": { - "source": "https://github.com/php-fig/http-message/tree/1.1" + "issues": "https://github.com/php-parallel-lint/PHP-Console-Color/issues", + "source": "https://github.com/php-parallel-lint/PHP-Console-Color/tree/v1.0.1" }, - "time": "2023-04-04T09:50:52+00:00" + "time": "2021-12-25T06:49:29+00:00" }, { - "name": "psr/http-server-handler", - "version": "1.0.2", + "name": "php-parallel-lint/php-console-highlighter", + "version": "v1.0.0", "source": { "type": "git", - "url": "https://github.com/php-fig/http-server-handler.git", - "reference": "84c4fb66179be4caaf8e97bd239203245302e7d4" + "url": "https://github.com/php-parallel-lint/PHP-Console-Highlighter.git", + "reference": "5b4803384d3303cf8e84141039ef56c8a123138d" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/php-fig/http-server-handler/zipball/84c4fb66179be4caaf8e97bd239203245302e7d4", - "reference": "84c4fb66179be4caaf8e97bd239203245302e7d4", + "url": "https://api.github.com/repos/php-parallel-lint/PHP-Console-Highlighter/zipball/5b4803384d3303cf8e84141039ef56c8a123138d", + "reference": "5b4803384d3303cf8e84141039ef56c8a123138d", "shasum": "" }, "require": { - "php": ">=7.0", - "psr/http-message": "^1.0 || ^2.0" + "ext-tokenizer": "*", + "php": ">=5.3.2", + "php-parallel-lint/php-console-color": "^1.0.1" }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.0.x-dev" - } + "replace": { + "jakub-onderka/php-console-highlighter": "*" }, + "require-dev": { + "php-parallel-lint/php-code-style": "^2.0", + "php-parallel-lint/php-parallel-lint": "^1.0", + "php-parallel-lint/php-var-dump-check": "0.*", + "phpunit/phpunit": "^4.8.36 || ^5.7.21 || ^6.0 || ^7.0 || ^8.0 || ^9.0" + }, + "type": "library", "autoload": { "psr-4": { - "Psr\\Http\\Server\\": "src/" + "PHP_Parallel_Lint\\PhpConsoleHighlighter\\": "src/" } }, "notification-url": "https://packagist.org/downloads/", @@ -6886,159 +7628,150 @@ ], "authors": [ { - "name": "PHP-FIG", - "homepage": "https://www.php-fig.org/" + "name": "Jakub Onderka", + "email": "acci@acci.cz", + "homepage": "http://www.acci.cz/" } ], - "description": "Common interface for HTTP server-side request handler", - "keywords": [ - "handler", - "http", - "http-interop", - "psr", - "psr-15", - "psr-7", - "request", - "response", - "server" - ], + "description": "Highlight PHP code in terminal", "support": { - "source": "https://github.com/php-fig/http-server-handler/tree/1.0.2" + "issues": "https://github.com/php-parallel-lint/PHP-Console-Highlighter/issues", + "source": "https://github.com/php-parallel-lint/PHP-Console-Highlighter/tree/v1.0.0" }, - "time": "2023-04-10T20:06:20+00:00" + "time": "2022-02-18T08:23:19+00:00" }, { - "name": "psr/http-server-middleware", - "version": "1.0.2", + "name": "php-parallel-lint/php-parallel-lint", + "version": "v1.4.0", "source": { "type": "git", - "url": "https://github.com/php-fig/http-server-middleware.git", - "reference": "c1481f747daaa6a0782775cd6a8c26a1bf4a3829" + "url": "https://github.com/php-parallel-lint/PHP-Parallel-Lint.git", + "reference": "6db563514f27e19595a19f45a4bf757b6401194e" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/php-fig/http-server-middleware/zipball/c1481f747daaa6a0782775cd6a8c26a1bf4a3829", - "reference": "c1481f747daaa6a0782775cd6a8c26a1bf4a3829", + "url": "https://api.github.com/repos/php-parallel-lint/PHP-Parallel-Lint/zipball/6db563514f27e19595a19f45a4bf757b6401194e", + "reference": "6db563514f27e19595a19f45a4bf757b6401194e", "shasum": "" }, - "require": { - "php": ">=7.0", - "psr/http-message": "^1.0 || ^2.0", - "psr/http-server-handler": "^1.0" + "require": { + "ext-json": "*", + "php": ">=5.3.0" + }, + "replace": { + "grogy/php-parallel-lint": "*", + "jakub-onderka/php-parallel-lint": "*" + }, + "require-dev": { + "nette/tester": "^1.3 || ^2.0", + "php-parallel-lint/php-console-highlighter": "0.* || ^1.0", + "squizlabs/php_codesniffer": "^3.6" }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.0.x-dev" - } + "suggest": { + "php-parallel-lint/php-console-highlighter": "Highlight syntax in code snippet" }, + "bin": [ + "parallel-lint" + ], + "type": "library", "autoload": { - "psr-4": { - "Psr\\Http\\Server\\": "src/" - } + "classmap": [ + "./src/" + ] }, "notification-url": "https://packagist.org/downloads/", "license": [ - "MIT" + "BSD-2-Clause" ], "authors": [ { - "name": "PHP-FIG", - "homepage": "https://www.php-fig.org/" + "name": "Jakub Onderka", + "email": "ahoj@jakubonderka.cz" } ], - "description": "Common interface for HTTP server-side middleware", + "description": "This tool checks the syntax of PHP files about 20x faster than serial check.", + "homepage": "https://github.com/php-parallel-lint/PHP-Parallel-Lint", "keywords": [ - "http", - "http-interop", - "middleware", - "psr", - "psr-15", - "psr-7", - "request", - "response" + "lint", + "static analysis" ], "support": { - "issues": "https://github.com/php-fig/http-server-middleware/issues", - "source": "https://github.com/php-fig/http-server-middleware/tree/1.0.2" + "issues": "https://github.com/php-parallel-lint/PHP-Parallel-Lint/issues", + "source": "https://github.com/php-parallel-lint/PHP-Parallel-Lint/tree/v1.4.0" }, - "time": "2023-04-11T06:14:47+00:00" + "time": "2024-03-27T12:14:49+00:00" }, { - "name": "psr/log", - "version": "2.0.0", + "name": "phpstan/extension-installer", + "version": "1.4.3", "source": { "type": "git", - "url": "https://github.com/php-fig/log.git", - "reference": "ef29f6d262798707a9edd554e2b82517ef3a9376" + "url": "https://github.com/phpstan/extension-installer.git", + "reference": "85e90b3942d06b2326fba0403ec24fe912372936" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/php-fig/log/zipball/ef29f6d262798707a9edd554e2b82517ef3a9376", - "reference": "ef29f6d262798707a9edd554e2b82517ef3a9376", + "url": "https://api.github.com/repos/phpstan/extension-installer/zipball/85e90b3942d06b2326fba0403ec24fe912372936", + "reference": "85e90b3942d06b2326fba0403ec24fe912372936", "shasum": "" }, "require": { - "php": ">=8.0.0" + "composer-plugin-api": "^2.0", + "php": "^7.2 || ^8.0", + "phpstan/phpstan": "^1.9.0 || ^2.0" }, - "type": "library", + "require-dev": { + "composer/composer": "^2.0", + "php-parallel-lint/php-parallel-lint": "^1.2.0", + "phpstan/phpstan-strict-rules": "^0.11 || ^0.12 || ^1.0" + }, + "type": "composer-plugin", "extra": { - "branch-alias": { - "dev-master": "2.0.x-dev" - } + "class": "PHPStan\\ExtensionInstaller\\Plugin" }, "autoload": { "psr-4": { - "Psr\\Log\\": "src" + "PHPStan\\ExtensionInstaller\\": "src/" } }, "notification-url": "https://packagist.org/downloads/", "license": [ "MIT" ], - "authors": [ - { - "name": "PHP-FIG", - "homepage": "https://www.php-fig.org/" - } - ], - "description": "Common interface for logging libraries", - "homepage": "https://github.com/php-fig/log", + "description": "Composer plugin for automatic installation of PHPStan extensions", "keywords": [ - "log", - "psr", - "psr-3" + "dev", + "static analysis" ], "support": { - "source": "https://github.com/php-fig/log/tree/2.0.0" + "issues": "https://github.com/phpstan/extension-installer/issues", + "source": "https://github.com/phpstan/extension-installer/tree/1.4.3" }, - "time": "2021-07-14T16:41:46+00:00" + "time": "2024-09-04T20:21:43+00:00" }, { - "name": "ralouphie/getallheaders", - "version": "3.0.3", - "source": { - "type": "git", - "url": "https://github.com/ralouphie/getallheaders.git", - "reference": "120b605dfeb996808c31b6477290a714d356e822" - }, + "name": "phpstan/phpstan", + "version": "2.2.9", "dist": { "type": "zip", - "url": "https://api.github.com/repos/ralouphie/getallheaders/zipball/120b605dfeb996808c31b6477290a714d356e822", - "reference": "120b605dfeb996808c31b6477290a714d356e822", + "url": "https://api.github.com/repos/phpstan/phpstan/zipball/13d6b4f347bad222da436580c8304fa6f83e6bd0", + "reference": "13d6b4f347bad222da436580c8304fa6f83e6bd0", "shasum": "" }, "require": { - "php": ">=5.6" + "php": "^7.4|^8.0" }, - "require-dev": { - "php-coveralls/php-coveralls": "^2.1", - "phpunit/phpunit": "^5 || ^6.5" + "conflict": { + "phpstan/phpstan-shim": "*" }, + "bin": [ + "phpstan", + "phpstan.phar" + ], "type": "library", "autoload": { "files": [ - "src/getallheaders.php" + "bootstrap.php" ] }, "notification-url": "https://packagist.org/downloads/", @@ -7047,798 +7780,745 @@ ], "authors": [ { - "name": "Ralph Khattar", - "email": "ralph.khattar@gmail.com" + "name": "Ondřej Mirtes" + }, + { + "name": "Markus Staab" + }, + { + "name": "Vincent Langlet" } ], - "description": "A polyfill for getallheaders.", + "description": "PHPStan - PHP Static Analysis Tool", + "keywords": [ + "dev", + "static analysis" + ], "support": { - "issues": "https://github.com/ralouphie/getallheaders/issues", - "source": "https://github.com/ralouphie/getallheaders/tree/develop" + "docs": "https://phpstan.org/user-guide/getting-started", + "forum": "https://github.com/phpstan/phpstan/discussions", + "issues": "https://github.com/phpstan/phpstan/issues", + "security": "https://github.com/phpstan/phpstan/security/policy", + "source": "https://github.com/phpstan/phpstan-src" }, - "time": "2019-03-08T08:55:37+00:00" + "funding": [ + { + "url": "https://github.com/ondrejmirtes", + "type": "github" + }, + { + "url": "https://github.com/phpstan", + "type": "github" + } + ], + "time": "2026-08-22T07:38:16+00:00" }, { - "name": "react/async", - "version": "v4.1.0", + "name": "phpstan/phpstan-deprecation-rules", + "version": "2.0.5", "source": { "type": "git", - "url": "https://github.com/reactphp/async.git", - "reference": "b9641ac600b4b144e71a87dcf1be4d41dd3a3548" + "url": "https://github.com/phpstan/phpstan-deprecation-rules.git", + "reference": "67bedd65c24bc72840afc45aed48b1059dd44bec" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/reactphp/async/zipball/b9641ac600b4b144e71a87dcf1be4d41dd3a3548", - "reference": "b9641ac600b4b144e71a87dcf1be4d41dd3a3548", + "url": "https://api.github.com/repos/phpstan/phpstan-deprecation-rules/zipball/67bedd65c24bc72840afc45aed48b1059dd44bec", + "reference": "67bedd65c24bc72840afc45aed48b1059dd44bec", "shasum": "" }, "require": { - "php": ">=8.1", - "react/event-loop": "^1.2", - "react/promise": "^3.0 || ^2.8 || ^1.2.1" + "php": "^7.4 || ^8.0", + "phpstan/phpstan": "^2.1.39" }, "require-dev": { - "phpstan/phpstan": "1.10.18", - "phpunit/phpunit": "^9.5" + "php-parallel-lint/php-parallel-lint": "^1.2", + "phpstan/phpstan-phpunit": "^2.0", + "phpunit/phpunit": "^9.6", + "shipmonk/name-collision-detector": "^2.1" + }, + "type": "phpstan-extension", + "extra": { + "phpstan": { + "includes": [ + "rules.neon" + ] + } }, - "type": "library", "autoload": { - "files": [ - "src/functions_include.php" - ], "psr-4": { - "React\\Async\\": "src/" + "PHPStan\\": "src/" } }, "notification-url": "https://packagist.org/downloads/", "license": [ "MIT" ], - "authors": [ - { - "name": "Christian Lück", - "email": "christian@clue.engineering", - "homepage": "https://clue.engineering/" - }, - { - "name": "Cees-Jan Kiewiet", - "email": "reactphp@ceesjankiewiet.nl", - "homepage": "https://wyrihaximus.net/" - }, - { - "name": "Jan Sorgalla", - "email": "jsorgalla@gmail.com", - "homepage": "https://sorgalla.com/" - }, - { - "name": "Chris Boden", - "email": "cboden@gmail.com", - "homepage": "https://cboden.dev/" - } - ], - "description": "Async utilities and fibers for ReactPHP", + "description": "PHPStan rules for detecting usage of deprecated classes, methods, properties, constants and traits.", "keywords": [ - "async", - "reactphp" + "static analysis" ], "support": { - "issues": "https://github.com/reactphp/async/issues", - "source": "https://github.com/reactphp/async/tree/v4.1.0" + "issues": "https://github.com/phpstan/phpstan-deprecation-rules/issues", + "source": "https://github.com/phpstan/phpstan-deprecation-rules/tree/2.0.5" }, - "funding": [ - { - "url": "https://opencollective.com/reactphp", - "type": "open_collective" - } - ], - "time": "2023-06-22T14:10:50+00:00" + "time": "2026-07-22T06:50:43+00:00" }, { - "name": "react/cache", - "version": "v1.2.0", + "name": "phpstan/phpstan-mockery", + "version": "2.0.0", "source": { "type": "git", - "url": "https://github.com/reactphp/cache.git", - "reference": "d47c472b64aa5608225f47965a484b75c7817d5b" + "url": "https://github.com/phpstan/phpstan-mockery.git", + "reference": "89a949d0ac64298e88b7c7fa00caee565c198394" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/reactphp/cache/zipball/d47c472b64aa5608225f47965a484b75c7817d5b", - "reference": "d47c472b64aa5608225f47965a484b75c7817d5b", + "url": "https://api.github.com/repos/phpstan/phpstan-mockery/zipball/89a949d0ac64298e88b7c7fa00caee565c198394", + "reference": "89a949d0ac64298e88b7c7fa00caee565c198394", "shasum": "" }, "require": { - "php": ">=5.3.0", - "react/promise": "^3.0 || ^2.0 || ^1.1" + "php": "^7.4 || ^8.0", + "phpstan/phpstan": "^2.0" }, "require-dev": { - "phpunit/phpunit": "^9.5 || ^5.7 || ^4.8.35" + "mockery/mockery": "^1.6.11", + "php-parallel-lint/php-parallel-lint": "^1.2", + "phpstan/phpstan-phpunit": "^2.0", + "phpstan/phpstan-strict-rules": "^2.0", + "phpunit/phpunit": "^9.6" + }, + "type": "phpstan-extension", + "extra": { + "phpstan": { + "includes": [ + "extension.neon" + ] + } }, - "type": "library", "autoload": { "psr-4": { - "React\\Cache\\": "src/" + "PHPStan\\": "src/" } }, "notification-url": "https://packagist.org/downloads/", "license": [ "MIT" ], - "authors": [ - { - "name": "Christian Lück", - "email": "christian@clue.engineering", - "homepage": "https://clue.engineering/" - }, - { - "name": "Cees-Jan Kiewiet", - "email": "reactphp@ceesjankiewiet.nl", - "homepage": "https://wyrihaximus.net/" - }, - { - "name": "Jan Sorgalla", - "email": "jsorgalla@gmail.com", - "homepage": "https://sorgalla.com/" - }, - { - "name": "Chris Boden", - "email": "cboden@gmail.com", - "homepage": "https://cboden.dev/" - } - ], - "description": "Async, Promise-based cache interface for ReactPHP", - "keywords": [ - "cache", - "caching", - "promise", - "reactphp" - ], + "description": "PHPStan Mockery extension", "support": { - "issues": "https://github.com/reactphp/cache/issues", - "source": "https://github.com/reactphp/cache/tree/v1.2.0" + "issues": "https://github.com/phpstan/phpstan-mockery/issues", + "source": "https://github.com/phpstan/phpstan-mockery/tree/2.0.0" }, - "funding": [ - { - "url": "https://opencollective.com/reactphp", - "type": "open_collective" - } - ], - "time": "2022-11-30T15:59:55+00:00" + "time": "2024-10-14T03:18:12+00:00" }, { - "name": "react/dns", - "version": "v1.11.0", + "name": "phpstan/phpstan-phpunit", + "version": "2.0.18", "source": { "type": "git", - "url": "https://github.com/reactphp/dns.git", - "reference": "3be0fc8f1eb37d6875cd6f0c6c7d0be81435de9f" + "url": "https://github.com/phpstan/phpstan-phpunit.git", + "reference": "f5dc20ff8082d02339b60cab68ec3eb0d859fb30" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/reactphp/dns/zipball/3be0fc8f1eb37d6875cd6f0c6c7d0be81435de9f", - "reference": "3be0fc8f1eb37d6875cd6f0c6c7d0be81435de9f", + "url": "https://api.github.com/repos/phpstan/phpstan-phpunit/zipball/f5dc20ff8082d02339b60cab68ec3eb0d859fb30", + "reference": "f5dc20ff8082d02339b60cab68ec3eb0d859fb30", "shasum": "" }, "require": { - "php": ">=5.3.0", - "react/cache": "^1.0 || ^0.6 || ^0.5", - "react/event-loop": "^1.2", - "react/promise": "^3.0 || ^2.7 || ^1.2.1" + "phar-io/version": "^3.2", + "php": "^7.4 || ^8.0", + "phpstan/phpstan": "^2.2.3" + }, + "conflict": { + "phpunit/phpunit": "<7.0" }, "require-dev": { - "phpunit/phpunit": "^9.5 || ^4.8.35", - "react/async": "^4 || ^3 || ^2", - "react/promise-timer": "^1.9" + "nikic/php-parser": "^5", + "php-parallel-lint/php-parallel-lint": "^1.2", + "phpstan/phpstan-deprecation-rules": "^2.0", + "phpstan/phpstan-strict-rules": "^2.0", + "phpunit/phpunit": "^9.6", + "shipmonk/name-collision-detector": "^2.1" + }, + "type": "phpstan-extension", + "extra": { + "phpstan": { + "includes": [ + "extension.neon", + "rules.neon" + ] + } }, - "type": "library", "autoload": { "psr-4": { - "React\\Dns\\": "src/" + "PHPStan\\": "src/" } }, "notification-url": "https://packagist.org/downloads/", "license": [ "MIT" ], - "authors": [ - { - "name": "Christian Lück", - "email": "christian@clue.engineering", - "homepage": "https://clue.engineering/" - }, - { - "name": "Cees-Jan Kiewiet", - "email": "reactphp@ceesjankiewiet.nl", - "homepage": "https://wyrihaximus.net/" - }, - { - "name": "Jan Sorgalla", - "email": "jsorgalla@gmail.com", - "homepage": "https://sorgalla.com/" - }, - { - "name": "Chris Boden", - "email": "cboden@gmail.com", - "homepage": "https://cboden.dev/" - } - ], - "description": "Async DNS resolver for ReactPHP", + "description": "PHPUnit extensions and rules for PHPStan", "keywords": [ - "async", - "dns", - "dns-resolver", - "reactphp" + "static analysis" ], "support": { - "issues": "https://github.com/reactphp/dns/issues", - "source": "https://github.com/reactphp/dns/tree/v1.11.0" + "issues": "https://github.com/phpstan/phpstan-phpunit/issues", + "source": "https://github.com/phpstan/phpstan-phpunit/tree/2.0.18" }, - "funding": [ - { - "url": "https://opencollective.com/reactphp", - "type": "open_collective" - } - ], - "time": "2023-06-02T12:45:26+00:00" + "time": "2026-07-04T12:16:09+00:00" }, { - "name": "react/event-loop", - "version": "v1.4.0", + "name": "phpstan/phpstan-strict-rules", + "version": "2.0.12", "source": { "type": "git", - "url": "https://github.com/reactphp/event-loop.git", - "reference": "6e7e587714fff7a83dcc7025aee42ab3b265ae05" + "url": "https://github.com/phpstan/phpstan-strict-rules.git", + "reference": "2bc5ae19ae965663b62ac907ee6342c3903ec93b" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/reactphp/event-loop/zipball/6e7e587714fff7a83dcc7025aee42ab3b265ae05", - "reference": "6e7e587714fff7a83dcc7025aee42ab3b265ae05", + "url": "https://api.github.com/repos/phpstan/phpstan-strict-rules/zipball/2bc5ae19ae965663b62ac907ee6342c3903ec93b", + "reference": "2bc5ae19ae965663b62ac907ee6342c3903ec93b", "shasum": "" }, "require": { - "php": ">=5.3.0" + "php": "^7.4 || ^8.0", + "phpstan/phpstan": "^2.1.52" }, "require-dev": { - "phpunit/phpunit": "^9.6 || ^5.7 || ^4.8.36" + "php-parallel-lint/php-parallel-lint": "^1.2", + "phpstan/phpstan-deprecation-rules": "^2.0", + "phpstan/phpstan-phpunit": "^2.0", + "phpunit/phpunit": "^9.6", + "shipmonk/name-collision-detector": "^2.1" }, - "suggest": { - "ext-pcntl": "For signal handling support when using the StreamSelectLoop" + "type": "phpstan-extension", + "extra": { + "phpstan": { + "includes": [ + "rules.neon" + ] + } }, - "type": "library", "autoload": { "psr-4": { - "React\\EventLoop\\": "src/" + "PHPStan\\": "src/" } }, "notification-url": "https://packagist.org/downloads/", "license": [ "MIT" ], - "authors": [ - { - "name": "Christian Lück", - "email": "christian@clue.engineering", - "homepage": "https://clue.engineering/" - }, - { - "name": "Cees-Jan Kiewiet", - "email": "reactphp@ceesjankiewiet.nl", - "homepage": "https://wyrihaximus.net/" - }, - { - "name": "Jan Sorgalla", - "email": "jsorgalla@gmail.com", - "homepage": "https://sorgalla.com/" - }, - { - "name": "Chris Boden", - "email": "cboden@gmail.com", - "homepage": "https://cboden.dev/" - } - ], - "description": "ReactPHP's core reactor event loop that libraries can use for evented I/O.", + "description": "Extra strict and opinionated rules for PHPStan", "keywords": [ - "asynchronous", - "event-loop" + "static analysis" ], "support": { - "issues": "https://github.com/reactphp/event-loop/issues", - "source": "https://github.com/reactphp/event-loop/tree/v1.4.0" + "issues": "https://github.com/phpstan/phpstan-strict-rules/issues", + "source": "https://github.com/phpstan/phpstan-strict-rules/tree/2.0.12" }, - "funding": [ - { - "url": "https://opencollective.com/reactphp", - "type": "open_collective" - } - ], - "time": "2023-05-05T10:11:24+00:00" + "time": "2026-07-19T07:24:06+00:00" }, { - "name": "react/http", - "version": "v1.9.0", + "name": "phpunit/php-code-coverage", + "version": "14.3.1", "source": { "type": "git", - "url": "https://github.com/reactphp/http.git", - "reference": "bb3154dbaf2dfe3f0467f956a05f614a69d5f1d0" + "url": "https://github.com/sebastianbergmann/php-code-coverage.git", + "reference": "6ce313bb110384148d1dc7695a99175f59529069" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/reactphp/http/zipball/bb3154dbaf2dfe3f0467f956a05f614a69d5f1d0", - "reference": "bb3154dbaf2dfe3f0467f956a05f614a69d5f1d0", + "url": "https://api.github.com/repos/sebastianbergmann/php-code-coverage/zipball/6ce313bb110384148d1dc7695a99175f59529069", + "reference": "6ce313bb110384148d1dc7695a99175f59529069", "shasum": "" }, "require": { - "evenement/evenement": "^3.0 || ^2.0 || ^1.0", - "fig/http-message-util": "^1.1", - "php": ">=5.3.0", - "psr/http-message": "^1.0", - "react/event-loop": "^1.2", - "react/promise": "^3 || ^2.3 || ^1.2.1", - "react/socket": "^1.12", - "react/stream": "^1.2", - "ringcentral/psr7": "^1.2" + "ext-dom": "*", + "ext-libxml": "*", + "ext-mbstring": "*", + "ext-xmlwriter": "*", + "nikic/php-parser": "^5.8.0", + "php": ">=8.4", + "phpunit/php-text-template": "^6.0", + "sebastian/complexity": "^6.0", + "sebastian/environment": "^9.3.2", + "sebastian/git-state": "^1.0", + "sebastian/lines-of-code": "^5.0.2", + "sebastian/version": "^7.0", + "theseer/tokenizer": "^2.0.1" }, "require-dev": { - "clue/http-proxy-react": "^1.8", - "clue/reactphp-ssh-proxy": "^1.4", - "clue/socks-react": "^1.4", - "phpunit/phpunit": "^9.5 || ^5.7 || ^4.8.35", - "react/async": "^4 || ^3 || ^2", - "react/promise-stream": "^1.4", - "react/promise-timer": "^1.9" + "phpunit/phpunit": "^13.3.1" + }, + "suggest": { + "ext-pcov": "PHP extension that provides line coverage", + "ext-xdebug": "PHP extension that provides line coverage as well as branch and path coverage" }, "type": "library", - "autoload": { - "psr-4": { - "React\\Http\\": "src/" + "extra": { + "branch-alias": { + "dev-main": "14.3.x-dev" } }, + "autoload": { + "classmap": [ + "src/" + ] + }, "notification-url": "https://packagist.org/downloads/", "license": [ - "MIT" + "BSD-3-Clause" ], "authors": [ { - "name": "Christian Lück", - "email": "christian@clue.engineering", - "homepage": "https://clue.engineering/" - }, - { - "name": "Cees-Jan Kiewiet", - "email": "reactphp@ceesjankiewiet.nl", - "homepage": "https://wyrihaximus.net/" - }, - { - "name": "Jan Sorgalla", - "email": "jsorgalla@gmail.com", - "homepage": "https://sorgalla.com/" - }, - { - "name": "Chris Boden", - "email": "cboden@gmail.com", - "homepage": "https://cboden.dev/" + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de", + "role": "lead" } ], - "description": "Event-driven, streaming HTTP client and server implementation for ReactPHP", + "description": "Library that provides collection, processing, and rendering functionality for PHP code coverage information.", + "homepage": "https://github.com/sebastianbergmann/php-code-coverage", "keywords": [ - "async", - "client", - "event-driven", - "http", - "http client", - "http server", - "https", - "psr-7", - "reactphp", - "server", - "streaming" + "coverage", + "testing", + "xunit" ], "support": { - "issues": "https://github.com/reactphp/http/issues", - "source": "https://github.com/reactphp/http/tree/v1.9.0" + "issues": "https://github.com/sebastianbergmann/php-code-coverage/issues", + "security": "https://github.com/sebastianbergmann/php-code-coverage/security/policy", + "source": "https://github.com/sebastianbergmann/php-code-coverage/tree/14.3.1" }, "funding": [ { - "url": "https://opencollective.com/reactphp", - "type": "open_collective" + "url": "https://github.com/sebastianbergmann", + "type": "github" + }, + { + "url": "https://liberapay.com/sebastianbergmann", + "type": "liberapay" + }, + { + "url": "https://thanks.dev/u/gh/sebastianbergmann", + "type": "thanks_dev" + }, + { + "url": "https://tidelift.com/funding/github/packagist/phpunit/php-code-coverage", + "type": "tidelift" } ], - "time": "2023-04-26T10:29:24+00:00" + "time": "2026-08-16T05:23:47+00:00" }, { - "name": "react/promise", - "version": "v2.10.0", + "name": "phpunit/php-file-iterator", + "version": "7.0.2", "source": { "type": "git", - "url": "https://github.com/reactphp/promise.git", - "reference": "f913fb8cceba1e6644b7b90c4bfb678ed8a3ef38" + "url": "https://github.com/sebastianbergmann/php-file-iterator.git", + "reference": "9bb4e6c58b62c1e043be995c66abec7c97307aae" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/reactphp/promise/zipball/f913fb8cceba1e6644b7b90c4bfb678ed8a3ef38", - "reference": "f913fb8cceba1e6644b7b90c4bfb678ed8a3ef38", + "url": "https://api.github.com/repos/sebastianbergmann/php-file-iterator/zipball/9bb4e6c58b62c1e043be995c66abec7c97307aae", + "reference": "9bb4e6c58b62c1e043be995c66abec7c97307aae", "shasum": "" }, "require": { - "php": ">=5.4.0" + "php": ">=8.4" }, "require-dev": { - "phpunit/phpunit": "^9.5 || ^5.7 || ^4.8.36" + "phpunit/phpunit": "^13.3.1" }, "type": "library", - "autoload": { - "files": [ - "src/functions_include.php" - ], - "psr-4": { - "React\\Promise\\": "src/" + "extra": { + "branch-alias": { + "dev-main": "7.0-dev" } }, + "autoload": { + "classmap": [ + "src/" + ] + }, "notification-url": "https://packagist.org/downloads/", "license": [ - "MIT" + "BSD-3-Clause" ], "authors": [ { - "name": "Jan Sorgalla", - "email": "jsorgalla@gmail.com", - "homepage": "https://sorgalla.com/" - }, - { - "name": "Christian Lück", - "email": "christian@clue.engineering", - "homepage": "https://clue.engineering/" - }, - { - "name": "Cees-Jan Kiewiet", - "email": "reactphp@ceesjankiewiet.nl", - "homepage": "https://wyrihaximus.net/" - }, - { - "name": "Chris Boden", - "email": "cboden@gmail.com", - "homepage": "https://cboden.dev/" + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de", + "role": "lead" } ], - "description": "A lightweight implementation of CommonJS Promises/A for PHP", + "description": "FilterIterator implementation that filters files based on a list of suffixes.", + "homepage": "https://github.com/sebastianbergmann/php-file-iterator/", "keywords": [ - "promise", - "promises" + "filesystem", + "iterator" ], "support": { - "issues": "https://github.com/reactphp/promise/issues", - "source": "https://github.com/reactphp/promise/tree/v2.10.0" + "issues": "https://github.com/sebastianbergmann/php-file-iterator/issues", + "security": "https://github.com/sebastianbergmann/php-file-iterator/security/policy", + "source": "https://github.com/sebastianbergmann/php-file-iterator/tree/7.0.2" }, "funding": [ { - "url": "https://opencollective.com/reactphp", - "type": "open_collective" + "url": "https://github.com/sebastianbergmann", + "type": "github" + }, + { + "url": "https://liberapay.com/sebastianbergmann", + "type": "liberapay" + }, + { + "url": "https://thanks.dev/u/gh/sebastianbergmann", + "type": "thanks_dev" + }, + { + "url": "https://tidelift.com/funding/github/packagist/phpunit/php-file-iterator", + "type": "tidelift" } ], - "time": "2023-05-02T15:15:43+00:00" + "time": "2026-08-25T14:47:43+00:00" }, { - "name": "react/socket", - "version": "v1.14.0", + "name": "phpunit/php-invoker", + "version": "7.0.0", "source": { "type": "git", - "url": "https://github.com/reactphp/socket.git", - "reference": "21591111d3ea62e31f2254280ca0656bc2b1bda6" + "url": "https://github.com/sebastianbergmann/php-invoker.git", + "reference": "42e5c5cae0c65df12d1b1a3ab52bf3f50f244d88" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/reactphp/socket/zipball/21591111d3ea62e31f2254280ca0656bc2b1bda6", - "reference": "21591111d3ea62e31f2254280ca0656bc2b1bda6", + "url": "https://api.github.com/repos/sebastianbergmann/php-invoker/zipball/42e5c5cae0c65df12d1b1a3ab52bf3f50f244d88", + "reference": "42e5c5cae0c65df12d1b1a3ab52bf3f50f244d88", "shasum": "" }, "require": { - "evenement/evenement": "^3.0 || ^2.0 || ^1.0", - "php": ">=5.3.0", - "react/dns": "^1.11", - "react/event-loop": "^1.2", - "react/promise": "^3 || ^2.6 || ^1.2.1", - "react/stream": "^1.2" + "php": ">=8.4" }, "require-dev": { - "phpunit/phpunit": "^9.5 || ^5.7 || ^4.8.35", - "react/async": "^4 || ^3 || ^2", - "react/promise-stream": "^1.4", - "react/promise-timer": "^1.10" + "ext-pcntl": "*", + "phpunit/phpunit": "^13.0" + }, + "suggest": { + "ext-pcntl": "*" }, "type": "library", - "autoload": { - "psr-4": { - "React\\Socket\\": "src" + "extra": { + "branch-alias": { + "dev-main": "7.0-dev" } }, + "autoload": { + "classmap": [ + "src/" + ] + }, "notification-url": "https://packagist.org/downloads/", "license": [ - "MIT" + "BSD-3-Clause" ], "authors": [ { - "name": "Christian Lück", - "email": "christian@clue.engineering", - "homepage": "https://clue.engineering/" - }, - { - "name": "Cees-Jan Kiewiet", - "email": "reactphp@ceesjankiewiet.nl", - "homepage": "https://wyrihaximus.net/" - }, - { - "name": "Jan Sorgalla", - "email": "jsorgalla@gmail.com", - "homepage": "https://sorgalla.com/" - }, - { - "name": "Chris Boden", - "email": "cboden@gmail.com", - "homepage": "https://cboden.dev/" + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de", + "role": "lead" } ], - "description": "Async, streaming plaintext TCP/IP and secure TLS socket server and client connections for ReactPHP", + "description": "Invoke callables with a timeout", + "homepage": "https://github.com/sebastianbergmann/php-invoker/", "keywords": [ - "Connection", - "Socket", - "async", - "reactphp", - "stream" + "process" ], "support": { - "issues": "https://github.com/reactphp/socket/issues", - "source": "https://github.com/reactphp/socket/tree/v1.14.0" + "issues": "https://github.com/sebastianbergmann/php-invoker/issues", + "security": "https://github.com/sebastianbergmann/php-invoker/security/policy", + "source": "https://github.com/sebastianbergmann/php-invoker/tree/7.0.0" }, "funding": [ { - "url": "https://opencollective.com/reactphp", - "type": "open_collective" + "url": "https://github.com/sebastianbergmann", + "type": "github" + }, + { + "url": "https://liberapay.com/sebastianbergmann", + "type": "liberapay" + }, + { + "url": "https://thanks.dev/u/gh/sebastianbergmann", + "type": "thanks_dev" + }, + { + "url": "https://tidelift.com/funding/github/packagist/phpunit/php-invoker", + "type": "tidelift" } ], - "time": "2023-08-25T13:48:09+00:00" + "time": "2026-02-06T04:34:47+00:00" }, { - "name": "react/stream", - "version": "v1.3.0", + "name": "phpunit/php-text-template", + "version": "6.0.0", "source": { "type": "git", - "url": "https://github.com/reactphp/stream.git", - "reference": "6fbc9672905c7d5a885f2da2fc696f65840f4a66" + "url": "https://github.com/sebastianbergmann/php-text-template.git", + "reference": "a47af19f93f76aa3368303d752aa5272ca3299f4" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/reactphp/stream/zipball/6fbc9672905c7d5a885f2da2fc696f65840f4a66", - "reference": "6fbc9672905c7d5a885f2da2fc696f65840f4a66", + "url": "https://api.github.com/repos/sebastianbergmann/php-text-template/zipball/a47af19f93f76aa3368303d752aa5272ca3299f4", + "reference": "a47af19f93f76aa3368303d752aa5272ca3299f4", "shasum": "" }, "require": { - "evenement/evenement": "^3.0 || ^2.0 || ^1.0", - "php": ">=5.3.8", - "react/event-loop": "^1.2" + "php": ">=8.4" }, "require-dev": { - "clue/stream-filter": "~1.2", - "phpunit/phpunit": "^9.5 || ^5.7 || ^4.8.35" + "phpunit/phpunit": "^13.0" }, "type": "library", - "autoload": { - "psr-4": { - "React\\Stream\\": "src/" + "extra": { + "branch-alias": { + "dev-main": "6.0-dev" } }, + "autoload": { + "classmap": [ + "src/" + ] + }, "notification-url": "https://packagist.org/downloads/", "license": [ - "MIT" + "BSD-3-Clause" ], "authors": [ { - "name": "Christian Lück", - "email": "christian@clue.engineering", - "homepage": "https://clue.engineering/" - }, - { - "name": "Cees-Jan Kiewiet", - "email": "reactphp@ceesjankiewiet.nl", - "homepage": "https://wyrihaximus.net/" - }, - { - "name": "Jan Sorgalla", - "email": "jsorgalla@gmail.com", - "homepage": "https://sorgalla.com/" - }, - { - "name": "Chris Boden", - "email": "cboden@gmail.com", - "homepage": "https://cboden.dev/" + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de", + "role": "lead" } ], - "description": "Event-driven readable and writable streams for non-blocking I/O in ReactPHP", + "description": "Simple template engine.", + "homepage": "https://github.com/sebastianbergmann/php-text-template/", "keywords": [ - "event-driven", - "io", - "non-blocking", - "pipe", - "reactphp", - "readable", - "stream", - "writable" + "template" ], "support": { - "issues": "https://github.com/reactphp/stream/issues", - "source": "https://github.com/reactphp/stream/tree/v1.3.0" + "issues": "https://github.com/sebastianbergmann/php-text-template/issues", + "security": "https://github.com/sebastianbergmann/php-text-template/security/policy", + "source": "https://github.com/sebastianbergmann/php-text-template/tree/6.0.0" }, "funding": [ { - "url": "https://opencollective.com/reactphp", - "type": "open_collective" + "url": "https://github.com/sebastianbergmann", + "type": "github" + }, + { + "url": "https://liberapay.com/sebastianbergmann", + "type": "liberapay" + }, + { + "url": "https://thanks.dev/u/gh/sebastianbergmann", + "type": "thanks_dev" + }, + { + "url": "https://tidelift.com/funding/github/packagist/phpunit/php-text-template", + "type": "tidelift" } ], - "time": "2023-06-16T10:52:11+00:00" + "time": "2026-02-06T04:36:37+00:00" }, { - "name": "reactivex/rxphp", - "version": "2.0.11", + "name": "phpunit/php-timer", + "version": "9.0.0", "source": { "type": "git", - "url": "https://github.com/ReactiveX/RxPHP.git", - "reference": "dde8aec9b3a0f4913cd38203d29c6adad73194d6" + "url": "https://github.com/sebastianbergmann/php-timer.git", + "reference": "a0e12065831f6ab0d83120dc61513eb8d9a966f6" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/ReactiveX/RxPHP/zipball/dde8aec9b3a0f4913cd38203d29c6adad73194d6", - "reference": "dde8aec9b3a0f4913cd38203d29c6adad73194d6", + "url": "https://api.github.com/repos/sebastianbergmann/php-timer/zipball/a0e12065831f6ab0d83120dc61513eb8d9a966f6", + "reference": "a0e12065831f6ab0d83120dc61513eb8d9a966f6", "shasum": "" }, "require": { - "php": ">=7.0.0", - "react/promise": "~2.2" + "php": ">=8.4" }, "require-dev": { - "phpunit/phpunit": "^8.5 || ^9", - "react/event-loop": "^1.0 || ^0.5 || ^0.4.2", - "satooshi/php-coveralls": "~1.0" - }, - "suggest": { - "react/event-loop": "Used for scheduling async operations" + "phpunit/phpunit": "^13.0" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "2.0-dev" + "dev-main": "9.0-dev" } }, "autoload": { - "psr-4": { - "Rx\\": "src" - } + "classmap": [ + "src/" + ] }, "notification-url": "https://packagist.org/downloads/", "license": [ - "MIT" + "BSD-3-Clause" ], "authors": [ { - "name": "Alexander", - "email": "iam.asm89@gmail.com" - }, - { - "name": "David Dan", - "email": "davidwdan@gmail.com" - }, - { - "name": "Matt Bonneau", - "email": "matt@bonneau.net" + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de", + "role": "lead" } ], - "description": "Reactive extensions for php.", - "homepage": "https://github.com/ReactiveX/RxPHP", + "description": "Utility class for timing", + "homepage": "https://github.com/sebastianbergmann/php-timer/", "keywords": [ - "extensions", - "reactive", - "rx" + "timer" ], "support": { - "issues": "https://github.com/ReactiveX/RxPHP/issues", - "source": "https://github.com/ReactiveX/RxPHP/tree/2.0.11" + "issues": "https://github.com/sebastianbergmann/php-timer/issues", + "security": "https://github.com/sebastianbergmann/php-timer/security/policy", + "source": "https://github.com/sebastianbergmann/php-timer/tree/9.0.0" }, - "time": "2022-09-10T17:05:40+00:00" + "funding": [ + { + "url": "https://github.com/sebastianbergmann", + "type": "github" + }, + { + "url": "https://liberapay.com/sebastianbergmann", + "type": "liberapay" + }, + { + "url": "https://thanks.dev/u/gh/sebastianbergmann", + "type": "thanks_dev" + }, + { + "url": "https://tidelift.com/funding/github/packagist/phpunit/php-timer", + "type": "tidelift" + } + ], + "time": "2026-02-06T04:37:53+00:00" }, { - "name": "respect/stringifier", - "version": "0.2.0", + "name": "phpunit/phpunit", + "version": "13.3.2", "source": { "type": "git", - "url": "https://github.com/Respect/Stringifier.git", - "reference": "e55af3c8aeaeaa2abb5fa47a58a8e9688cc23b59" + "url": "https://github.com/sebastianbergmann/phpunit.git", + "reference": "22104a5ceb8d642e6b30ab00211d53d88e2db368" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/Respect/Stringifier/zipball/e55af3c8aeaeaa2abb5fa47a58a8e9688cc23b59", - "reference": "e55af3c8aeaeaa2abb5fa47a58a8e9688cc23b59", + "url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/22104a5ceb8d642e6b30ab00211d53d88e2db368", + "reference": "22104a5ceb8d642e6b30ab00211d53d88e2db368", "shasum": "" }, "require": { - "php": ">=7.1" - }, - "require-dev": { - "friendsofphp/php-cs-fixer": "^2.8", - "malukenho/docheader": "^0.1.7", - "phpunit/phpunit": "^6.4" + "ext-dom": "*", + "ext-filter": "*", + "ext-json": "*", + "ext-libxml": "*", + "ext-mbstring": "*", + "ext-xmlwriter": "*", + "myclabs/deep-copy": "^1.14.0", + "phar-io/manifest": "^2.0.4", + "phar-io/version": "^3.2.1", + "php": ">=8.4.1", + "phpunit/php-code-coverage": "^14.3.1", + "phpunit/php-file-iterator": "^7.0.2", + "phpunit/php-invoker": "^7.0.0", + "phpunit/php-text-template": "^6.0.0", + "phpunit/php-timer": "^9.0.0", + "sebastian/cli-parser": "^5.0.1", + "sebastian/comparator": "^8.4", + "sebastian/diff": "^9.0", + "sebastian/environment": "^9.3.2", + "sebastian/exporter": "^8.2.1", + "sebastian/file-filter": "^1.0", + "sebastian/git-state": "^1.0", + "sebastian/global-state": "^9.0.1", + "sebastian/object-enumerator": "^8.1.0", + "sebastian/recursion-context": "^8.0.1", + "sebastian/type": "^7.0.2", + "sebastian/version": "^7.0.0", + "staabm/side-effects-detector": "^1.0.5" }, + "bin": [ + "phpunit" + ], "type": "library", + "extra": { + "branch-alias": { + "dev-main": "13.3-dev" + } + }, "autoload": { "files": [ - "src/stringify.php" + "src/Framework/Assert/Functions.php" ], - "psr-4": { - "Respect\\Stringifier\\": "src/" - } + "classmap": [ + "src/" + ] }, "notification-url": "https://packagist.org/downloads/", "license": [ - "MIT" + "BSD-3-Clause" ], "authors": [ { - "name": "Respect/Stringifier Contributors", - "homepage": "https://github.com/Respect/Stringifier/graphs/contributors" + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de", + "role": "lead" } ], - "description": "Converts any value to a string", - "homepage": "http://respect.github.io/Stringifier/", + "description": "The PHP Unit Testing framework.", + "homepage": "https://phpunit.de/", "keywords": [ - "respect", - "stringifier", - "stringify" + "phpunit", + "testing", + "xunit" ], "support": { - "issues": "https://github.com/Respect/Stringifier/issues", - "source": "https://github.com/Respect/Stringifier/tree/0.2.0" + "issues": "https://github.com/sebastianbergmann/phpunit/issues", + "security": "https://github.com/sebastianbergmann/phpunit/security/policy", + "source": "https://github.com/sebastianbergmann/phpunit/tree/13.3.2" }, - "time": "2017-12-29T19:39:25+00:00" + "funding": [ + { + "url": "https://phpunit.de/sponsoring.html", + "type": "other" + } + ], + "time": "2026-08-27T08:40:49+00:00" }, { - "name": "respect/validation", - "version": "2.2.4", + "name": "psr/clock", + "version": "1.0.0", "source": { "type": "git", - "url": "https://github.com/Respect/Validation.git", - "reference": "d304ace5325efd7180daffb1f8627bb0affd4e3a" + "url": "https://github.com/php-fig/clock.git", + "reference": "e41a24703d4560fd0acb709162f73b8adfc3aa0d" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/Respect/Validation/zipball/d304ace5325efd7180daffb1f8627bb0affd4e3a", - "reference": "d304ace5325efd7180daffb1f8627bb0affd4e3a", + "url": "https://api.github.com/repos/php-fig/clock/zipball/e41a24703d4560fd0acb709162f73b8adfc3aa0d", + "reference": "e41a24703d4560fd0acb709162f73b8adfc3aa0d", "shasum": "" }, "require": { - "php": "^7.4 || ^8.0 || ^8.1 || ^8.2", - "respect/stringifier": "^0.2.0", - "symfony/polyfill-mbstring": "^1.2" - }, - "require-dev": { - "egulias/email-validator": "^3.0", - "malukenho/docheader": "^0.1", - "mikey179/vfsstream": "^1.6", - "phpstan/phpstan": "^1.9", - "phpstan/phpstan-deprecation-rules": "^1.1", - "phpstan/phpstan-phpunit": "^1.3", - "phpunit/phpunit": "^9.6", - "psr/http-message": "^1.0", - "respect/coding-standard": "^3.0", - "squizlabs/php_codesniffer": "^3.7", - "symfony/validator": "^3.0||^4.0" - }, - "suggest": { - "egulias/email-validator": "Strict (RFC compliant) email validation", - "ext-bcmath": "Arbitrary Precision Mathematics", - "ext-fileinfo": "File Information", - "ext-mbstring": "Multibyte String Functions" + "php": "^7.0 || ^8.0" }, "type": "library", "autoload": { "psr-4": { - "Respect\\Validation\\": "library/" + "Psr\\Clock\\": "src/" } }, "notification-url": "https://packagist.org/downloads/", @@ -7847,55 +8527,51 @@ ], "authors": [ { - "name": "Respect/Validation Contributors", - "homepage": "https://github.com/Respect/Validation/graphs/contributors" + "name": "PHP-FIG", + "homepage": "https://www.php-fig.org/" } ], - "description": "The most awesome validation engine ever created for PHP", - "homepage": "http://respect.github.io/Validation/", + "description": "Common interface for reading the clock.", + "homepage": "https://github.com/php-fig/clock", "keywords": [ - "respect", - "validation", - "validator" + "clock", + "now", + "psr", + "psr-20", + "time" ], "support": { - "issues": "https://github.com/Respect/Validation/issues", - "source": "https://github.com/Respect/Validation/tree/2.2.4" + "issues": "https://github.com/php-fig/clock/issues", + "source": "https://github.com/php-fig/clock/tree/1.0.0" }, - "time": "2023-02-15T01:05:24+00:00" + "time": "2022-11-25T14:36:26+00:00" }, { - "name": "revolt/event-loop", - "version": "v1.0.3", + "name": "psr/log", + "version": "3.0.2", "source": { "type": "git", - "url": "https://github.com/revoltphp/event-loop.git", - "reference": "0fe2d31e1cddd26664e55d383d3d5da613334c03" + "url": "https://github.com/php-fig/log.git", + "reference": "f16e1d5863e37f8d8c2a01719f5b34baa2b714d3" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/revoltphp/event-loop/zipball/0fe2d31e1cddd26664e55d383d3d5da613334c03", - "reference": "0fe2d31e1cddd26664e55d383d3d5da613334c03", + "url": "https://api.github.com/repos/php-fig/log/zipball/f16e1d5863e37f8d8c2a01719f5b34baa2b714d3", + "reference": "f16e1d5863e37f8d8c2a01719f5b34baa2b714d3", "shasum": "" }, "require": { - "php": ">=8.1" - }, - "require-dev": { - "ext-json": "*", - "jetbrains/phpstorm-stubs": "^2019.3", - "phpunit/phpunit": "^9", - "psalm/phar": "^4.7" + "php": ">=8.0.0" }, "type": "library", "extra": { "branch-alias": { - "dev-main": "1.x-dev" + "dev-master": "3.x-dev" } }, "autoload": { "psr-4": { - "Revolt\\": "src" + "Psr\\Log\\": "src" } }, "notification-url": "https://packagist.org/downloads/", @@ -7904,127 +8580,114 @@ ], "authors": [ { - "name": "Aaron Piotrowski", - "email": "aaron@trowski.com" - }, - { - "name": "Cees-Jan Kiewiet", - "email": "ceesjank@gmail.com" - }, - { - "name": "Christian Lück", - "email": "christian@clue.engineering" - }, - { - "name": "Niklas Keller", - "email": "me@kelunik.com" + "name": "PHP-FIG", + "homepage": "https://www.php-fig.org/" } ], - "description": "Rock-solid event loop for concurrent PHP applications.", + "description": "Common interface for logging libraries", + "homepage": "https://github.com/php-fig/log", "keywords": [ - "async", - "asynchronous", - "concurrency", - "event", - "event-loop", - "non-blocking", - "scheduler" + "log", + "psr", + "psr-3" ], "support": { - "issues": "https://github.com/revoltphp/event-loop/issues", - "source": "https://github.com/revoltphp/event-loop/tree/v1.0.3" + "source": "https://github.com/php-fig/log/tree/3.0.2" }, - "time": "2023-07-29T17:07:12+00:00" + "time": "2024-09-11T13:17:53+00:00" }, { - "name": "ringcentral/psr7", - "version": "1.3.0", + "name": "rector/rector", + "version": "2.6.4", "source": { "type": "git", - "url": "https://github.com/ringcentral/psr7.git", - "reference": "360faaec4b563958b673fb52bbe94e37f14bc686" + "url": "https://github.com/rectorphp/rector.git", + "reference": "6ff008471683591224951526247b7a2b86980ba9" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/ringcentral/psr7/zipball/360faaec4b563958b673fb52bbe94e37f14bc686", - "reference": "360faaec4b563958b673fb52bbe94e37f14bc686", + "url": "https://api.github.com/repos/rectorphp/rector/zipball/6ff008471683591224951526247b7a2b86980ba9", + "reference": "6ff008471683591224951526247b7a2b86980ba9", "shasum": "" }, "require": { - "php": ">=5.3", - "psr/http-message": "~1.0" + "php": "^7.4|^8.0", + "phpstan/phpstan": "^2.2.6" }, - "provide": { - "psr/http-message-implementation": "1.0" + "conflict": { + "rector/rector-doctrine": "*", + "rector/rector-downgrade-php": "*", + "rector/rector-phpunit": "*", + "rector/rector-symfony": "*" }, - "require-dev": { - "phpunit/phpunit": "~4.0" + "suggest": { + "ext-dom": "To manipulate phpunit.xml via the custom-rule command" }, + "bin": [ + "bin/rector" + ], "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.0-dev" - } - }, "autoload": { "files": [ - "src/functions_include.php" - ], - "psr-4": { - "RingCentral\\Psr7\\": "src/" - } + "bootstrap.php" + ] }, "notification-url": "https://packagist.org/downloads/", "license": [ "MIT" ], - "authors": [ - { - "name": "Michael Dowling", - "email": "mtdowling@gmail.com", - "homepage": "https://github.com/mtdowling" - } - ], - "description": "PSR-7 message implementation", + "description": "Instant Upgrade and Automated Refactoring of any PHP code", + "homepage": "https://getrector.com/", "keywords": [ - "http", - "message", - "stream", - "uri" + "automation", + "dev", + "migration", + "refactoring" ], "support": { - "source": "https://github.com/ringcentral/psr7/tree/master" + "issues": "https://github.com/rectorphp/rector/issues", + "source": "https://github.com/rectorphp/rector/tree/2.6.4" }, - "time": "2018-05-29T20:21:04+00:00" + "funding": [ + { + "url": "https://github.com/tomasvotruba", + "type": "github" + } + ], + "time": "2026-08-27T09:20:34+00:00" }, { - "name": "riverline/multipart-parser", - "version": "2.1.1", + "name": "revolt/event-loop", + "version": "v1.0.9", "source": { "type": "git", - "url": "https://github.com/Riverline/multipart-parser.git", - "reference": "2418bdfc2eab01e39bcffee808b1a365c166292a" + "url": "https://github.com/revoltphp/event-loop.git", + "reference": "44061cf513e53c6200372fc935ac42271566295d" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/Riverline/multipart-parser/zipball/2418bdfc2eab01e39bcffee808b1a365c166292a", - "reference": "2418bdfc2eab01e39bcffee808b1a365c166292a", + "url": "https://api.github.com/repos/revoltphp/event-loop/zipball/44061cf513e53c6200372fc935ac42271566295d", + "reference": "44061cf513e53c6200372fc935ac42271566295d", "shasum": "" }, "require": { - "ext-mbstring": "*", - "php": ">=5.6.0" + "php": ">=8.1" }, "require-dev": { - "laminas/laminas-diactoros": "^1.8.7 || ^2.11.1", - "phpunit/phpunit": "^5.7 || ^9.0", - "psr/http-message": "^1.0", - "symfony/psr-http-message-bridge": "^1.1 || ^2.0" + "ext-json": "*", + "jetbrains/phpstorm-stubs": "^2019.3", + "phpunit/phpunit": "^9", + "psalm/phar": "6.16.*" }, "type": "library", + "extra": { + "branch-alias": { + "dev-main": "1.x-dev" + } + }, "autoload": { "psr-4": { - "Riverline\\MultiPartParser\\": "src/" + "Revolt\\": "src" } }, "notification-url": "https://packagist.org/downloads/", @@ -8033,64 +8696,81 @@ ], "authors": [ { - "name": "Romain Cambien", - "email": "romain@cambien.net" + "name": "Aaron Piotrowski", + "email": "aaron@trowski.com" }, { - "name": "Riverline", - "homepage": "http://www.riverline.fr" + "name": "Cees-Jan Kiewiet", + "email": "ceesjank@gmail.com" + }, + { + "name": "Christian Lück", + "email": "christian@clue.engineering" + }, + { + "name": "Niklas Keller", + "email": "me@kelunik.com" } ], - "description": "One class library to parse multipart content with encoding and charset support.", + "description": "Rock-solid event loop for concurrent PHP applications.", "keywords": [ - "http", - "multipart", - "parser" + "async", + "asynchronous", + "concurrency", + "event", + "event-loop", + "non-blocking", + "scheduler" ], "support": { - "issues": "https://github.com/Riverline/multipart-parser/issues", - "source": "https://github.com/Riverline/multipart-parser/tree/2.1.1" + "issues": "https://github.com/revoltphp/event-loop/issues", + "source": "https://github.com/revoltphp/event-loop/tree/v1.0.9" }, - "time": "2023-04-28T18:53:59+00:00" + "time": "2026-05-16T17:55:38+00:00" }, { "name": "roave/backward-compatibility-check", - "version": "8.3.0", + "version": "8.19.0", "source": { "type": "git", "url": "https://github.com/Roave/BackwardCompatibilityCheck.git", - "reference": "40956d53832b80dd4025c87b4cf5e1756f42f43d" + "reference": "810eb88eeff37ef300653bcfb77ca51a314777a2" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/Roave/BackwardCompatibilityCheck/zipball/40956d53832b80dd4025c87b4cf5e1756f42f43d", - "reference": "40956d53832b80dd4025c87b4cf5e1756f42f43d", + "url": "https://api.github.com/repos/Roave/BackwardCompatibilityCheck/zipball/810eb88eeff37ef300653bcfb77ca51a314777a2", + "reference": "810eb88eeff37ef300653bcfb77ca51a314777a2", "shasum": "" }, "require": { - "azjezz/psl": "^2.3.1", - "composer/composer": "^2.5.1", + "azjezz/psl": "^4.2.1", + "composer/composer": "^2.9.5", + "ext-dom": "*", "ext-json": "*", - "nikic/php-parser": "^4.15.3", - "nikolaposa/version": "^4.1.0", - "ocramius/package-versions": "^2.7.0", - "php": "~8.1.0 || ~8.2.0", - "roave/better-reflection": "^6.5.0", - "symfony/console": "^6.2.3" + "ext-libxml": "*", + "ext-simplexml": "*", + "nikic/php-parser": "^5.7.0", + "nikolaposa/version": "^4.2.1", + "ocramius/package-versions": "^2.11.0", + "php": "~8.3.0 || ~8.4.0 || ~8.5.0", + "roave/better-reflection": "^6.69.0", + "symfony/console": "^7.4.4" }, "conflict": { + "marc-mabe/php-enum": "<4.7.2", "revolt/event-loop": "<0.2.5", "symfony/process": "<5.3.7" }, "require-dev": { - "doctrine/coding-standard": "^11.0.0", - "php-standard-library/psalm-plugin": "^2.2.1", - "phpunit/phpunit": "^9.5.27", - "psalm/plugin-phpunit": "^0.18.4", - "roave/infection-static-analysis-plugin": "^1.27.0", + "doctrine/coding-standard": "^14.0.0", + "justinrainbow/json-schema": "^6.6.4", + "php-standard-library/psalm-plugin": "^2.3.0", + "phpunit/phpunit": "^12.5.11", + "psalm/plugin-phpunit": "^0.19.5", + "roave/infection-static-analysis-plugin": "^1.43.0", "roave/security-advisories": "dev-master", - "squizlabs/php_codesniffer": "^3.7.1", - "vimeo/psalm": "^5.4.0" + "squizlabs/php_codesniffer": "^4.0.1", + "vimeo/psalm": "^6.15.1" }, "bin": [ "bin/roave-backward-compatibility-check" @@ -8118,41 +8798,36 @@ "description": "Tool to compare two revisions of a public API to check for BC breaks", "support": { "issues": "https://github.com/Roave/BackwardCompatibilityCheck/issues", - "source": "https://github.com/Roave/BackwardCompatibilityCheck/tree/8.3.0" + "source": "https://github.com/Roave/BackwardCompatibilityCheck/tree/8.19.0" }, - "time": "2023-02-11T17:26:11+00:00" + "time": "2026-02-13T19:14:25+00:00" }, { "name": "roave/better-reflection", - "version": "6.15.0", + "version": "6.72.0", "source": { "type": "git", "url": "https://github.com/Roave/BetterReflection.git", - "reference": "19b15d504ca61c5b5f10f5aafb329234c8eeaed2" + "reference": "b34deeed26ec22233b1a776591ef45abc154a17d" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/Roave/BetterReflection/zipball/19b15d504ca61c5b5f10f5aafb329234c8eeaed2", - "reference": "19b15d504ca61c5b5f10f5aafb329234c8eeaed2", + "url": "https://api.github.com/repos/Roave/BetterReflection/zipball/b34deeed26ec22233b1a776591ef45abc154a17d", + "reference": "b34deeed26ec22233b1a776591ef45abc154a17d", "shasum": "" }, "require": { "ext-json": "*", - "jetbrains/phpstorm-stubs": "2023.2", - "nikic/php-parser": "^4.17.1", - "php": "~8.1.0 || ~8.2.0", - "roave/signature": "^1.7" + "jetbrains/phpstorm-stubs": "2026.2", + "nikic/php-parser": "^5.8.0", + "php": "~8.4.1 || ~8.5.0" }, "conflict": { "thecodingmachine/safe": "<1.1.3" }, "require-dev": { - "doctrine/coding-standard": "^12.0.0", - "phpstan/phpstan": "^1.10.37", - "phpstan/phpstan-phpunit": "^1.3.14", - "phpunit/phpunit": "^10.4.0", - "roave/infection-static-analysis-plugin": "^1.33.0", - "vimeo/psalm": "5.15.0" + "phpbench/phpbench": "^1.7.0", + "phpunit/phpunit": "^13.2.4" }, "suggest": { "composer/composer": "Required to use the ComposerSourceLocator" @@ -8192,150 +8867,80 @@ "description": "Better Reflection - an improved code reflection API", "support": { "issues": "https://github.com/Roave/BetterReflection/issues", - "source": "https://github.com/Roave/BetterReflection/tree/6.15.0" - }, - "time": "2023-10-06T14:31:35+00:00" - }, - { - "name": "roave/infection-static-analysis-plugin", - "version": "1.33.0", - "source": { - "type": "git", - "url": "https://github.com/Roave/infection-static-analysis-plugin.git", - "reference": "3dd4ea3d5c4b380bb426c8b943328796a5664587" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/Roave/infection-static-analysis-plugin/zipball/3dd4ea3d5c4b380bb426c8b943328796a5664587", - "reference": "3dd4ea3d5c4b380bb426c8b943328796a5664587", - "shasum": "" - }, - "require": { - "composer-runtime-api": "^2.2", - "infection/infection": "0.27.0", - "php": "~8.1.0 || ~8.2.0 || ~8.3.0", - "sanmai/later": "^0.1.2", - "vimeo/psalm": "^4.30.0 || ^5.15" - }, - "require-dev": { - "doctrine/coding-standard": "^12.0.0", - "phpunit/phpunit": "^10.3.4" + "source": "https://github.com/Roave/BetterReflection/tree/6.72.0" }, - "bin": [ - "bin/roave-infection-static-analysis-plugin" - ], - "type": "library", - "autoload": { - "psr-4": { - "Roave\\InfectionStaticAnalysis\\": "src/Roave/InfectionStaticAnalysis" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Marco Pivetta", - "email": "ocramius@gmail.com" - } - ], - "description": "Static analysis on top of mutation testing - prevents escaped mutants from being invalid according to static analysis", - "support": { - "issues": "https://github.com/Roave/infection-static-analysis-plugin/issues", - "source": "https://github.com/Roave/infection-static-analysis-plugin/tree/1.33.0" - }, - "time": "2023-09-15T10:43:53+00:00" + "time": "2026-07-22T18:50:32+00:00" }, { - "name": "roave/signature", - "version": "1.7.0", + "name": "sanmai/di-container", + "version": "0.1.23", "source": { "type": "git", - "url": "https://github.com/Roave/Signature.git", - "reference": "2ab4eadcb9f9d449f673a97b67797403b35eca94" + "url": "https://github.com/sanmai/di-container.git", + "reference": "8cf59c091f33297389d0a5a27ea0d688df15c376" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/Roave/Signature/zipball/2ab4eadcb9f9d449f673a97b67797403b35eca94", - "reference": "2ab4eadcb9f9d449f673a97b67797403b35eca94", + "url": "https://api.github.com/repos/sanmai/di-container/zipball/8cf59c091f33297389d0a5a27ea0d688df15c376", + "reference": "8cf59c091f33297389d0a5a27ea0d688df15c376", "shasum": "" }, "require": { - "php": "8.0.*|8.1.*|8.2.*" + "php": ">=8.2", + "psr/container": "^1.1.2 || ^2.0", + "sanmai/pipeline": "^7.10" }, "require-dev": { - "doctrine/coding-standard": "^10.0.0", - "infection/infection": "^0.26.15", - "phpunit/phpunit": "^9.5.25", - "vimeo/psalm": "^4.28.0" + "ergebnis/composer-normalize": "^2.8", + "friendsofphp/php-cs-fixer": "^3.17", + "infection/infection": ">=0.31", + "php-coveralls/php-coveralls": "^2.4.1", + "phpbench/phpbench": "^1.4", + "phpstan/extension-installer": "^1.4", + "phpunit/phpunit": "^11.5.25", + "sanmai/phpstan-rules": "^0.3.10" }, "type": "library", - "autoload": { - "psr-4": { - "Roave\\Signature\\": "src" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "description": "Sign and verify stuff", - "support": { - "issues": "https://github.com/Roave/Signature/issues", - "source": "https://github.com/Roave/Signature/tree/1.7.0" - }, - "time": "2022-10-10T08:44:53+00:00" - }, - { - "name": "sanmai/later", - "version": "0.1.2", - "source": { - "type": "git", - "url": "https://github.com/sanmai/later.git", - "reference": "9b659fecef2030193fd02402955bc39629d5606f" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/sanmai/later/zipball/9b659fecef2030193fd02402955bc39629d5606f", - "reference": "9b659fecef2030193fd02402955bc39629d5606f", - "shasum": "" - }, - "require": { - "php": ">=7.1" - }, - "require-dev": { - "friendsofphp/php-cs-fixer": "^2.13", - "infection/infection": ">=0.10.5", - "phan/phan": ">=2", - "php-coveralls/php-coveralls": "^2.0", - "phpstan/phpstan": ">=0.10", - "phpunit/phpunit": ">=7.4", - "vimeo/psalm": ">=2" + "extra": { + "branch-alias": { + "dev-main": "0.1.x-dev" + }, + "preferred-install": "dist" }, - "type": "library", "autoload": { - "files": [ - "src/functions.php" - ], "psr-4": { - "Later\\": "src/" + "DIContainer\\": "src/" } }, "notification-url": "https://packagist.org/downloads/", "license": [ - "Apache-2.0" + "BSD-3-Clause" ], "authors": [ { "name": "Alexey Kopytko", - "email": "alexey@kopytko.com" + "email": "alexey@kopytko.com", + "homepage": "https://github.com/sanmai" + }, + { + "name": "Maks Rafalko", + "homepage": "https://twitter.com/maks_rafalko" + }, + { + "name": "Théo FIDRY", + "homepage": "https://twitter.com/tfidry" } ], - "description": "Later: deferred wrapper object", + "description": "dependency injection container with automatic constructor dependency resolution", + "keywords": [ + "Autowiring", + "constructor di", + "di container", + "psr 11" + ], "support": { - "issues": "https://github.com/sanmai/later/issues", - "source": "https://github.com/sanmai/later/tree/0.1.2" + "issues": "https://github.com/sanmai/di-container/issues", + "source": "https://github.com/sanmai/di-container/tree/0.1.23" }, "funding": [ { @@ -8343,48 +8948,46 @@ "type": "github" } ], - "time": "2021-01-02T10:26:44+00:00" + "time": "2026-08-11T00:58:41+00:00" }, { - "name": "sanmai/pipeline", - "version": "v6.9", + "name": "sanmai/duoclock", + "version": "0.1.3", "source": { "type": "git", - "url": "https://github.com/sanmai/pipeline.git", - "reference": "c48f45c22c3ce4140d071f7658fb151df1cc08ea" + "url": "https://github.com/sanmai/DuoClock.git", + "reference": "47461e3ff65b7308635047831a55615652e7be1a" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sanmai/pipeline/zipball/c48f45c22c3ce4140d071f7658fb151df1cc08ea", - "reference": "c48f45c22c3ce4140d071f7658fb151df1cc08ea", + "url": "https://api.github.com/repos/sanmai/DuoClock/zipball/47461e3ff65b7308635047831a55615652e7be1a", + "reference": "47461e3ff65b7308635047831a55615652e7be1a", "shasum": "" }, "require": { - "php": "^7.4 || ^8.0" + "php": ">=8.2", + "psr/clock": "^1.0" + }, + "provide": { + "psr/clock-implementation": "1.0" }, "require-dev": { "ergebnis/composer-normalize": "^2.8", "friendsofphp/php-cs-fixer": "^3.17", - "infection/infection": ">=0.10.5", - "league/pipeline": "^0.3 || ^1.0", - "phan/phan": ">=1.1", + "infection/infection": ">=0.29", "php-coveralls/php-coveralls": "^2.4.1", - "phpstan/phpstan": ">=0.10", - "phpunit/phpunit": ">=9.4", - "vimeo/psalm": ">=2" + "phpstan/extension-installer": "^1.4", + "phpstan/phpstan": "^2", + "phpunit/phpunit": "^11.5.25", + "sanmai/phpstan-rules": "^0.3.1" }, "type": "library", "extra": { - "branch-alias": { - "dev-main": "v6.x-dev" - } + "preferred-install": "dist" }, "autoload": { - "files": [ - "src/functions.php" - ], "psr-4": { - "Pipeline\\": "src/" + "DuoClock\\": "src/" } }, "notification-url": "https://packagist.org/downloads/", @@ -8397,10 +9000,10 @@ "email": "alexey@kopytko.com" } ], - "description": "General-purpose collections pipeline", + "description": "PHP time mocking for tests - PSR-20 clock with mockable sleep(), time(), and TimeSpy for PHPUnit testing", "support": { - "issues": "https://github.com/sanmai/pipeline/issues", - "source": "https://github.com/sanmai/pipeline/tree/v6.9" + "issues": "https://github.com/sanmai/DuoClock/issues", + "source": "https://github.com/sanmai/DuoClock/tree/0.1.3" }, "funding": [ { @@ -8408,144 +9011,164 @@ "type": "github" } ], - "time": "2023-10-08T11:56:54+00:00" + "time": "2025-12-26T06:12:34+00:00" }, { - "name": "sebastian/cli-parser", - "version": "1.0.1", + "name": "sanmai/later", + "version": "0.1.8", "source": { "type": "git", - "url": "https://github.com/sebastianbergmann/cli-parser.git", - "reference": "442e7c7e687e42adc03470c7b668bc4b2402c0b2" + "url": "https://github.com/sanmai/later.git", + "reference": "c56aeb8fa7fdf81eda2640a68b51884685963d13" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/cli-parser/zipball/442e7c7e687e42adc03470c7b668bc4b2402c0b2", - "reference": "442e7c7e687e42adc03470c7b668bc4b2402c0b2", + "url": "https://api.github.com/repos/sanmai/later/zipball/c56aeb8fa7fdf81eda2640a68b51884685963d13", + "reference": "c56aeb8fa7fdf81eda2640a68b51884685963d13", "shasum": "" }, "require": { - "php": ">=7.3" + "php": ">=8.2" }, "require-dev": { - "phpunit/phpunit": "^9.3" + "ergebnis/composer-normalize": "^2.8", + "friendsofphp/php-cs-fixer": "^3.35.1", + "infection/infection": ">=0.27.6", + "phan/phan": ">=2", + "php-coveralls/php-coveralls": "^2.0", + "phpstan/phpstan": ">=1.4.5", + "phpunit/phpunit": ">=9.5 <10", + "vimeo/psalm": ">=2" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "1.0-dev" + "dev-main": "0.1.x-dev" } }, "autoload": { - "classmap": [ - "src/" - ] + "files": [ + "src/functions.php" + ], + "psr-4": { + "Later\\": "src/" + } }, "notification-url": "https://packagist.org/downloads/", "license": [ - "BSD-3-Clause" + "Apache-2.0" ], "authors": [ { - "name": "Sebastian Bergmann", - "email": "sebastian@phpunit.de", - "role": "lead" + "name": "Alexey Kopytko", + "email": "alexey@kopytko.com" } ], - "description": "Library for parsing CLI options", - "homepage": "https://github.com/sebastianbergmann/cli-parser", + "description": "Later: deferred wrapper object", "support": { - "issues": "https://github.com/sebastianbergmann/cli-parser/issues", - "source": "https://github.com/sebastianbergmann/cli-parser/tree/1.0.1" + "issues": "https://github.com/sanmai/later/issues", + "source": "https://github.com/sanmai/later/tree/0.1.8" }, "funding": [ { - "url": "https://github.com/sebastianbergmann", + "url": "https://github.com/sanmai", "type": "github" } ], - "time": "2020-09-28T06:08:49+00:00" + "time": "2026-06-29T07:24:33+00:00" }, { - "name": "sebastian/code-unit", - "version": "1.0.8", + "name": "sanmai/pipeline", + "version": "7.10", "source": { "type": "git", - "url": "https://github.com/sebastianbergmann/code-unit.git", - "reference": "1fc9f64c0927627ef78ba436c9b17d967e68e120" + "url": "https://github.com/sanmai/pipeline.git", + "reference": "a8e4e57a6031efc7a92defd13fed9c1c4c73fc71" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/code-unit/zipball/1fc9f64c0927627ef78ba436c9b17d967e68e120", - "reference": "1fc9f64c0927627ef78ba436c9b17d967e68e120", + "url": "https://api.github.com/repos/sanmai/pipeline/zipball/a8e4e57a6031efc7a92defd13fed9c1c4c73fc71", + "reference": "a8e4e57a6031efc7a92defd13fed9c1c4c73fc71", "shasum": "" }, "require": { - "php": ">=7.3" + "php": ">=8.2" }, "require-dev": { - "phpunit/phpunit": "^9.3" + "ergebnis/composer-normalize": "^2.8", + "esi/phpunit-coverage-check": ">2", + "friendsofphp/php-cs-fixer": "^3.17", + "infection/infection": ">=0.32.3", + "league/pipeline": "^0.3 || ^1.0", + "php-coveralls/php-coveralls": "^2.4.1", + "phpstan/extension-installer": "^1.4", + "phpstan/phpstan": "^2", + "phpunit/phpunit": "^11 || ^12", + "sanmai/phpstan-rules": "^0.3.11", + "sanmai/phpunit-double-colon-syntax": "^0.1.1", + "vimeo/psalm": ">=2" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "1.0-dev" + "dev-main": "7.x-dev" } }, "autoload": { - "classmap": [ - "src/" - ] + "files": [ + "src/functions.php" + ], + "psr-4": { + "Pipeline\\": "src/" + } }, "notification-url": "https://packagist.org/downloads/", "license": [ - "BSD-3-Clause" + "Apache-2.0" ], "authors": [ { - "name": "Sebastian Bergmann", - "email": "sebastian@phpunit.de", - "role": "lead" + "name": "Alexey Kopytko", + "email": "alexey@kopytko.com" } ], - "description": "Collection of value objects that represent the PHP code units", - "homepage": "https://github.com/sebastianbergmann/code-unit", + "description": "General-purpose collections pipeline", "support": { - "issues": "https://github.com/sebastianbergmann/code-unit/issues", - "source": "https://github.com/sebastianbergmann/code-unit/tree/1.0.8" + "issues": "https://github.com/sanmai/pipeline/issues", + "source": "https://github.com/sanmai/pipeline/tree/7.10" }, "funding": [ { - "url": "https://github.com/sebastianbergmann", + "url": "https://github.com/sanmai", "type": "github" } ], - "time": "2020-10-26T13:08:54+00:00" + "time": "2026-08-03T04:56:22+00:00" }, { - "name": "sebastian/code-unit-reverse-lookup", - "version": "2.0.3", + "name": "sebastian/cli-parser", + "version": "5.0.1", "source": { "type": "git", - "url": "https://github.com/sebastianbergmann/code-unit-reverse-lookup.git", - "reference": "ac91f01ccec49fb77bdc6fd1e548bc70f7faa3e5" + "url": "https://github.com/sebastianbergmann/cli-parser.git", + "reference": "eeb759ad3146b7096fb59c3195d39e071cd409e3" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/code-unit-reverse-lookup/zipball/ac91f01ccec49fb77bdc6fd1e548bc70f7faa3e5", - "reference": "ac91f01ccec49fb77bdc6fd1e548bc70f7faa3e5", + "url": "https://api.github.com/repos/sebastianbergmann/cli-parser/zipball/eeb759ad3146b7096fb59c3195d39e071cd409e3", + "reference": "eeb759ad3146b7096fb59c3195d39e071cd409e3", "shasum": "" }, "require": { - "php": ">=7.3" + "php": ">=8.4" }, "require-dev": { - "phpunit/phpunit": "^9.3" + "phpunit/phpunit": "^13.2.6" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "2.0-dev" + "dev-main": "5.0-dev" } }, "autoload": { @@ -8560,49 +9183,68 @@ "authors": [ { "name": "Sebastian Bergmann", - "email": "sebastian@phpunit.de" + "email": "sebastian@phpunit.de", + "role": "lead" } ], - "description": "Looks up which function or method a line of code belongs to", - "homepage": "https://github.com/sebastianbergmann/code-unit-reverse-lookup/", + "description": "Library for parsing CLI options", + "homepage": "https://github.com/sebastianbergmann/cli-parser", "support": { - "issues": "https://github.com/sebastianbergmann/code-unit-reverse-lookup/issues", - "source": "https://github.com/sebastianbergmann/code-unit-reverse-lookup/tree/2.0.3" + "issues": "https://github.com/sebastianbergmann/cli-parser/issues", + "security": "https://github.com/sebastianbergmann/cli-parser/security/policy", + "source": "https://github.com/sebastianbergmann/cli-parser/tree/5.0.1" }, "funding": [ { "url": "https://github.com/sebastianbergmann", "type": "github" + }, + { + "url": "https://liberapay.com/sebastianbergmann", + "type": "liberapay" + }, + { + "url": "https://thanks.dev/u/gh/sebastianbergmann", + "type": "thanks_dev" + }, + { + "url": "https://tidelift.com/funding/github/packagist/sebastian/cli-parser", + "type": "tidelift" } ], - "time": "2020-09-28T05:30:19+00:00" + "time": "2026-08-01T04:27:14+00:00" }, { "name": "sebastian/comparator", - "version": "4.0.8", + "version": "8.4.0", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/comparator.git", - "reference": "fa0f136dd2334583309d32b62544682ee972b51a" + "reference": "3b070e608146cba00fd6fd1f0ffba89e5a8897fb" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/comparator/zipball/fa0f136dd2334583309d32b62544682ee972b51a", - "reference": "fa0f136dd2334583309d32b62544682ee972b51a", + "url": "https://api.github.com/repos/sebastianbergmann/comparator/zipball/3b070e608146cba00fd6fd1f0ffba89e5a8897fb", + "reference": "3b070e608146cba00fd6fd1f0ffba89e5a8897fb", "shasum": "" }, "require": { - "php": ">=7.3", - "sebastian/diff": "^4.0", - "sebastian/exporter": "^4.0" + "ext-dom": "*", + "ext-mbstring": "*", + "php": ">=8.4", + "sebastian/diff": "^9.0", + "sebastian/exporter": "^8.2" }, "require-dev": { - "phpunit/phpunit": "^9.3" + "phpunit/phpunit": "^13.3" + }, + "suggest": { + "ext-bcmath": "For comparing BcMath\\Number objects" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "4.0-dev" + "dev-main": "8.4-dev" } }, "autoload": { @@ -8641,41 +9283,54 @@ ], "support": { "issues": "https://github.com/sebastianbergmann/comparator/issues", - "source": "https://github.com/sebastianbergmann/comparator/tree/4.0.8" + "security": "https://github.com/sebastianbergmann/comparator/security/policy", + "source": "https://github.com/sebastianbergmann/comparator/tree/8.4.0" }, "funding": [ { "url": "https://github.com/sebastianbergmann", "type": "github" + }, + { + "url": "https://liberapay.com/sebastianbergmann", + "type": "liberapay" + }, + { + "url": "https://thanks.dev/u/gh/sebastianbergmann", + "type": "thanks_dev" + }, + { + "url": "https://tidelift.com/funding/github/packagist/sebastian/comparator", + "type": "tidelift" } ], - "time": "2022-09-14T12:41:17+00:00" + "time": "2026-08-07T07:23:13+00:00" }, { "name": "sebastian/complexity", - "version": "2.0.2", + "version": "6.0.0", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/complexity.git", - "reference": "739b35e53379900cc9ac327b2147867b8b6efd88" + "reference": "c5651c795c98093480df79350cb050813fc7a2f3" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/complexity/zipball/739b35e53379900cc9ac327b2147867b8b6efd88", - "reference": "739b35e53379900cc9ac327b2147867b8b6efd88", + "url": "https://api.github.com/repos/sebastianbergmann/complexity/zipball/c5651c795c98093480df79350cb050813fc7a2f3", + "reference": "c5651c795c98093480df79350cb050813fc7a2f3", "shasum": "" }, "require": { - "nikic/php-parser": "^4.7", - "php": ">=7.3" + "nikic/php-parser": "^5.0", + "php": ">=8.4" }, "require-dev": { - "phpunit/phpunit": "^9.3" + "phpunit/phpunit": "^13.0" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "2.0-dev" + "dev-main": "6.0-dev" } }, "autoload": { @@ -8698,41 +9353,54 @@ "homepage": "https://github.com/sebastianbergmann/complexity", "support": { "issues": "https://github.com/sebastianbergmann/complexity/issues", - "source": "https://github.com/sebastianbergmann/complexity/tree/2.0.2" + "security": "https://github.com/sebastianbergmann/complexity/security/policy", + "source": "https://github.com/sebastianbergmann/complexity/tree/6.0.0" }, "funding": [ { "url": "https://github.com/sebastianbergmann", "type": "github" + }, + { + "url": "https://liberapay.com/sebastianbergmann", + "type": "liberapay" + }, + { + "url": "https://thanks.dev/u/gh/sebastianbergmann", + "type": "thanks_dev" + }, + { + "url": "https://tidelift.com/funding/github/packagist/sebastian/complexity", + "type": "tidelift" } ], - "time": "2020-10-26T15:52:27+00:00" + "time": "2026-02-06T04:41:32+00:00" }, { "name": "sebastian/diff", - "version": "4.0.5", + "version": "9.0.1", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/diff.git", - "reference": "74be17022044ebaaecfdf0c5cd504fc9cd5a7131" + "reference": "a2df6626c1baf31d5a88674882a3072f151b5a26" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/diff/zipball/74be17022044ebaaecfdf0c5cd504fc9cd5a7131", - "reference": "74be17022044ebaaecfdf0c5cd504fc9cd5a7131", + "url": "https://api.github.com/repos/sebastianbergmann/diff/zipball/a2df6626c1baf31d5a88674882a3072f151b5a26", + "reference": "a2df6626c1baf31d5a88674882a3072f151b5a26", "shasum": "" }, "require": { - "php": ">=7.3" + "php": ">=8.4" }, "require-dev": { - "phpunit/phpunit": "^9.3", - "symfony/process": "^4.2 || ^5" + "phpunit/phpunit": "^13.3.1", + "symfony/process": "^7.4.17" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "4.0-dev" + "dev-main": "9.0-dev" } }, "autoload": { @@ -8764,35 +9432,48 @@ ], "support": { "issues": "https://github.com/sebastianbergmann/diff/issues", - "source": "https://github.com/sebastianbergmann/diff/tree/4.0.5" + "security": "https://github.com/sebastianbergmann/diff/security/policy", + "source": "https://github.com/sebastianbergmann/diff/tree/9.0.1" }, "funding": [ { "url": "https://github.com/sebastianbergmann", "type": "github" + }, + { + "url": "https://liberapay.com/sebastianbergmann", + "type": "liberapay" + }, + { + "url": "https://thanks.dev/u/gh/sebastianbergmann", + "type": "thanks_dev" + }, + { + "url": "https://tidelift.com/funding/github/packagist/sebastian/diff", + "type": "tidelift" } ], - "time": "2023-05-07T05:35:17+00:00" + "time": "2026-08-25T15:38:55+00:00" }, { "name": "sebastian/environment", - "version": "5.1.5", + "version": "9.3.2", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/environment.git", - "reference": "830c43a844f1f8d5b7a1f6d6076b784454d8b7ed" + "reference": "6c9e487c9eb706a8d258102a1c0b0a3e53e86c2e" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/environment/zipball/830c43a844f1f8d5b7a1f6d6076b784454d8b7ed", - "reference": "830c43a844f1f8d5b7a1f6d6076b784454d8b7ed", + "url": "https://api.github.com/repos/sebastianbergmann/environment/zipball/6c9e487c9eb706a8d258102a1c0b0a3e53e86c2e", + "reference": "6c9e487c9eb706a8d258102a1c0b0a3e53e86c2e", "shasum": "" }, "require": { - "php": ">=7.3" + "php": ">=8.4" }, "require-dev": { - "phpunit/phpunit": "^9.3" + "phpunit/phpunit": "^13.1.11" }, "suggest": { "ext-posix": "*" @@ -8800,7 +9481,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "5.1-dev" + "dev-main": "9.3-dev" } }, "autoload": { @@ -8819,7 +9500,7 @@ } ], "description": "Provides functionality to handle HHVM/PHP environments", - "homepage": "http://www.github.com/sebastianbergmann/environment", + "homepage": "https://github.com/sebastianbergmann/environment", "keywords": [ "Xdebug", "environment", @@ -8827,42 +9508,55 @@ ], "support": { "issues": "https://github.com/sebastianbergmann/environment/issues", - "source": "https://github.com/sebastianbergmann/environment/tree/5.1.5" + "security": "https://github.com/sebastianbergmann/environment/security/policy", + "source": "https://github.com/sebastianbergmann/environment/tree/9.3.2" }, "funding": [ { "url": "https://github.com/sebastianbergmann", "type": "github" + }, + { + "url": "https://liberapay.com/sebastianbergmann", + "type": "liberapay" + }, + { + "url": "https://thanks.dev/u/gh/sebastianbergmann", + "type": "thanks_dev" + }, + { + "url": "https://tidelift.com/funding/github/packagist/sebastian/environment", + "type": "tidelift" } ], - "time": "2023-02-03T06:03:51+00:00" + "time": "2026-05-25T13:41:38+00:00" }, { "name": "sebastian/exporter", - "version": "4.0.5", + "version": "8.2.1", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/exporter.git", - "reference": "ac230ed27f0f98f597c8a2b6eb7ac563af5e5b9d" + "reference": "24a3b69bba4a12ab615fca9d34680c5598d9ab7a" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/exporter/zipball/ac230ed27f0f98f597c8a2b6eb7ac563af5e5b9d", - "reference": "ac230ed27f0f98f597c8a2b6eb7ac563af5e5b9d", + "url": "https://api.github.com/repos/sebastianbergmann/exporter/zipball/24a3b69bba4a12ab615fca9d34680c5598d9ab7a", + "reference": "24a3b69bba4a12ab615fca9d34680c5598d9ab7a", "shasum": "" }, "require": { - "php": ">=7.3", - "sebastian/recursion-context": "^4.0" + "ext-mbstring": "*", + "php": ">=8.4", + "sebastian/recursion-context": "^8.0.1" }, "require-dev": { - "ext-mbstring": "*", - "phpunit/phpunit": "^9.3" + "phpunit/phpunit": "^13.3" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "4.0-dev" + "dev-main": "8.2-dev" } }, "autoload": { @@ -8904,46 +9598,53 @@ ], "support": { "issues": "https://github.com/sebastianbergmann/exporter/issues", - "source": "https://github.com/sebastianbergmann/exporter/tree/4.0.5" + "security": "https://github.com/sebastianbergmann/exporter/security/policy", + "source": "https://github.com/sebastianbergmann/exporter/tree/8.2.1" }, "funding": [ { "url": "https://github.com/sebastianbergmann", "type": "github" + }, + { + "url": "https://liberapay.com/sebastianbergmann", + "type": "liberapay" + }, + { + "url": "https://thanks.dev/u/gh/sebastianbergmann", + "type": "thanks_dev" + }, + { + "url": "https://tidelift.com/funding/github/packagist/sebastian/exporter", + "type": "tidelift" } ], - "time": "2022-09-14T06:03:37+00:00" + "time": "2026-08-07T07:22:06+00:00" }, { - "name": "sebastian/global-state", - "version": "5.0.6", + "name": "sebastian/file-filter", + "version": "1.0.0", "source": { "type": "git", - "url": "https://github.com/sebastianbergmann/global-state.git", - "reference": "bde739e7565280bda77be70044ac1047bc007e34" + "url": "https://github.com/sebastianbergmann/file-filter.git", + "reference": "33a26f394330f6faa7684bb9cc73afb7727aae93" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/global-state/zipball/bde739e7565280bda77be70044ac1047bc007e34", - "reference": "bde739e7565280bda77be70044ac1047bc007e34", + "url": "https://api.github.com/repos/sebastianbergmann/file-filter/zipball/33a26f394330f6faa7684bb9cc73afb7727aae93", + "reference": "33a26f394330f6faa7684bb9cc73afb7727aae93", "shasum": "" }, "require": { - "php": ">=7.3", - "sebastian/object-reflector": "^2.0", - "sebastian/recursion-context": "^4.0" + "php": ">=8.4" }, "require-dev": { - "ext-dom": "*", - "phpunit/phpunit": "^9.3" - }, - "suggest": { - "ext-uopz": "*" + "phpunit/phpunit": "^13.0" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "5.0-dev" + "dev-main": "1.0-dev" } }, "autoload": { @@ -8958,51 +9659,61 @@ "authors": [ { "name": "Sebastian Bergmann", - "email": "sebastian@phpunit.de" + "email": "sebastian@phpunit.de", + "role": "lead" } ], - "description": "Snapshotting of global state", - "homepage": "http://www.github.com/sebastianbergmann/global-state", - "keywords": [ - "global state" - ], + "description": "Library for filtering files", + "homepage": "https://github.com/sebastianbergmann/file-filter", "support": { - "issues": "https://github.com/sebastianbergmann/global-state/issues", - "source": "https://github.com/sebastianbergmann/global-state/tree/5.0.6" + "issues": "https://github.com/sebastianbergmann/file-filter/issues", + "security": "https://github.com/sebastianbergmann/file-filter/security/policy", + "source": "https://github.com/sebastianbergmann/file-filter/tree/1.0.0" }, "funding": [ { "url": "https://github.com/sebastianbergmann", "type": "github" + }, + { + "url": "https://liberapay.com/sebastianbergmann", + "type": "liberapay" + }, + { + "url": "https://thanks.dev/u/gh/sebastianbergmann", + "type": "thanks_dev" + }, + { + "url": "https://tidelift.com/funding/github/packagist/sebastian/file-filter", + "type": "tidelift" } ], - "time": "2023-08-02T09:26:13+00:00" + "time": "2026-04-22T07:20:04+00:00" }, { - "name": "sebastian/lines-of-code", - "version": "1.0.3", + "name": "sebastian/git-state", + "version": "1.0.0", "source": { "type": "git", - "url": "https://github.com/sebastianbergmann/lines-of-code.git", - "reference": "c1c2e997aa3146983ed888ad08b15470a2e22ecc" + "url": "https://github.com/sebastianbergmann/git-state.git", + "reference": "792a952e0eba55b6960a48aeceb9f371aad1f76b" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/lines-of-code/zipball/c1c2e997aa3146983ed888ad08b15470a2e22ecc", - "reference": "c1c2e997aa3146983ed888ad08b15470a2e22ecc", + "url": "https://api.github.com/repos/sebastianbergmann/git-state/zipball/792a952e0eba55b6960a48aeceb9f371aad1f76b", + "reference": "792a952e0eba55b6960a48aeceb9f371aad1f76b", "shasum": "" }, "require": { - "nikic/php-parser": "^4.6", - "php": ">=7.3" + "php": ">=8.4" }, "require-dev": { - "phpunit/phpunit": "^9.3" + "phpunit/phpunit": "^13.0" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "1.0-dev" + "dev-main": "1.0-dev" } }, "autoload": { @@ -9021,46 +9732,60 @@ "role": "lead" } ], - "description": "Library for counting the lines of code in PHP source code", - "homepage": "https://github.com/sebastianbergmann/lines-of-code", + "description": "Library for describing the state of a Git checkout", + "homepage": "https://github.com/sebastianbergmann/git-state", "support": { - "issues": "https://github.com/sebastianbergmann/lines-of-code/issues", - "source": "https://github.com/sebastianbergmann/lines-of-code/tree/1.0.3" + "issues": "https://github.com/sebastianbergmann/git-state/issues", + "security": "https://github.com/sebastianbergmann/git-state/security/policy", + "source": "https://github.com/sebastianbergmann/git-state/tree/1.0.0" }, "funding": [ { "url": "https://github.com/sebastianbergmann", "type": "github" + }, + { + "url": "https://liberapay.com/sebastianbergmann", + "type": "liberapay" + }, + { + "url": "https://thanks.dev/u/gh/sebastianbergmann", + "type": "thanks_dev" + }, + { + "url": "https://tidelift.com/funding/github/packagist/sebastian/git-state", + "type": "tidelift" } ], - "time": "2020-11-28T06:42:11+00:00" + "time": "2026-03-21T12:54:28+00:00" }, { - "name": "sebastian/object-enumerator", - "version": "4.0.4", + "name": "sebastian/global-state", + "version": "9.0.1", "source": { "type": "git", - "url": "https://github.com/sebastianbergmann/object-enumerator.git", - "reference": "5c9eeac41b290a3712d88851518825ad78f45c71" + "url": "https://github.com/sebastianbergmann/global-state.git", + "reference": "ba68ba79da690cf7eddefd3ce5b78b20b9ba9945" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/object-enumerator/zipball/5c9eeac41b290a3712d88851518825ad78f45c71", - "reference": "5c9eeac41b290a3712d88851518825ad78f45c71", + "url": "https://api.github.com/repos/sebastianbergmann/global-state/zipball/ba68ba79da690cf7eddefd3ce5b78b20b9ba9945", + "reference": "ba68ba79da690cf7eddefd3ce5b78b20b9ba9945", "shasum": "" }, "require": { - "php": ">=7.3", - "sebastian/object-reflector": "^2.0", - "sebastian/recursion-context": "^4.0" + "php": ">=8.4", + "sebastian/object-reflector": "^6.0", + "sebastian/recursion-context": "^8.0" }, "require-dev": { - "phpunit/phpunit": "^9.3" + "ext-dom": "*", + "phpunit/phpunit": "^13.1.13" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "4.0-dev" + "dev-main": "9.0-dev" } }, "autoload": { @@ -9078,44 +9803,61 @@ "email": "sebastian@phpunit.de" } ], - "description": "Traverses array structures and object graphs to enumerate all referenced objects", - "homepage": "https://github.com/sebastianbergmann/object-enumerator/", + "description": "Snapshotting of global state", + "homepage": "https://www.github.com/sebastianbergmann/global-state", + "keywords": [ + "global state" + ], "support": { - "issues": "https://github.com/sebastianbergmann/object-enumerator/issues", - "source": "https://github.com/sebastianbergmann/object-enumerator/tree/4.0.4" + "issues": "https://github.com/sebastianbergmann/global-state/issues", + "security": "https://github.com/sebastianbergmann/global-state/security/policy", + "source": "https://github.com/sebastianbergmann/global-state/tree/9.0.1" }, "funding": [ { "url": "https://github.com/sebastianbergmann", "type": "github" + }, + { + "url": "https://liberapay.com/sebastianbergmann", + "type": "liberapay" + }, + { + "url": "https://thanks.dev/u/gh/sebastianbergmann", + "type": "thanks_dev" + }, + { + "url": "https://tidelift.com/funding/github/packagist/sebastian/global-state", + "type": "tidelift" } ], - "time": "2020-10-26T13:12:34+00:00" + "time": "2026-06-01T15:11:33+00:00" }, { - "name": "sebastian/object-reflector", - "version": "2.0.4", + "name": "sebastian/lines-of-code", + "version": "5.0.2", "source": { "type": "git", - "url": "https://github.com/sebastianbergmann/object-reflector.git", - "reference": "b4f479ebdbf63ac605d183ece17d8d7fe49c15c7" + "url": "https://github.com/sebastianbergmann/lines-of-code.git", + "reference": "d1b6f8fce682505dbd048977f1abedf1b8ad3ff8" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/object-reflector/zipball/b4f479ebdbf63ac605d183ece17d8d7fe49c15c7", - "reference": "b4f479ebdbf63ac605d183ece17d8d7fe49c15c7", + "url": "https://api.github.com/repos/sebastianbergmann/lines-of-code/zipball/d1b6f8fce682505dbd048977f1abedf1b8ad3ff8", + "reference": "d1b6f8fce682505dbd048977f1abedf1b8ad3ff8", "shasum": "" }, "require": { - "php": ">=7.3" + "nikic/php-parser": "^5.8.0", + "php": ">=8.4" }, "require-dev": { - "phpunit/phpunit": "^9.3" + "phpunit/phpunit": "^13.2.4" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "2.0-dev" + "dev-main": "5.0-dev" } }, "autoload": { @@ -9130,47 +9872,62 @@ "authors": [ { "name": "Sebastian Bergmann", - "email": "sebastian@phpunit.de" + "email": "sebastian@phpunit.de", + "role": "lead" } ], - "description": "Allows reflection of object attributes, including inherited and non-public ones", - "homepage": "https://github.com/sebastianbergmann/object-reflector/", + "description": "Library for counting the lines of code in PHP source code", + "homepage": "https://github.com/sebastianbergmann/lines-of-code", "support": { - "issues": "https://github.com/sebastianbergmann/object-reflector/issues", - "source": "https://github.com/sebastianbergmann/object-reflector/tree/2.0.4" + "issues": "https://github.com/sebastianbergmann/lines-of-code/issues", + "security": "https://github.com/sebastianbergmann/lines-of-code/security/policy", + "source": "https://github.com/sebastianbergmann/lines-of-code/tree/5.0.2" }, "funding": [ { "url": "https://github.com/sebastianbergmann", "type": "github" + }, + { + "url": "https://liberapay.com/sebastianbergmann", + "type": "liberapay" + }, + { + "url": "https://thanks.dev/u/gh/sebastianbergmann", + "type": "thanks_dev" + }, + { + "url": "https://tidelift.com/funding/github/packagist/sebastian/lines-of-code", + "type": "tidelift" } ], - "time": "2020-10-26T13:14:26+00:00" + "time": "2026-07-09T08:42:34+00:00" }, { - "name": "sebastian/recursion-context", - "version": "4.0.5", + "name": "sebastian/object-enumerator", + "version": "8.1.0", "source": { "type": "git", - "url": "https://github.com/sebastianbergmann/recursion-context.git", - "reference": "e75bd0f07204fec2a0af9b0f3cfe97d05f92efc1" + "url": "https://github.com/sebastianbergmann/object-enumerator.git", + "reference": "511064ecde82bd747e2ba2fab3dda8d977b59576" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/recursion-context/zipball/e75bd0f07204fec2a0af9b0f3cfe97d05f92efc1", - "reference": "e75bd0f07204fec2a0af9b0f3cfe97d05f92efc1", + "url": "https://api.github.com/repos/sebastianbergmann/object-enumerator/zipball/511064ecde82bd747e2ba2fab3dda8d977b59576", + "reference": "511064ecde82bd747e2ba2fab3dda8d977b59576", "shasum": "" }, "require": { - "php": ">=7.3" + "php": ">=8.4", + "sebastian/recursion-context": "^8.0.1" }, "require-dev": { - "phpunit/phpunit": "^9.3" + "phpunit/phpunit": "^13.3.0" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "4.0-dev" + "dev-main": "8.1-dev" } }, "autoload": { @@ -9186,54 +9943,127 @@ { "name": "Sebastian Bergmann", "email": "sebastian@phpunit.de" + } + ], + "description": "Traverses array structures and object graphs to enumerate all referenced objects", + "homepage": "https://github.com/sebastianbergmann/object-enumerator/", + "support": { + "issues": "https://github.com/sebastianbergmann/object-enumerator/issues", + "security": "https://github.com/sebastianbergmann/object-enumerator/security/policy", + "source": "https://github.com/sebastianbergmann/object-enumerator/tree/8.1.0" + }, + "funding": [ + { + "url": "https://github.com/sebastianbergmann", + "type": "github" }, { - "name": "Jeff Welch", - "email": "whatthejeff@gmail.com" + "url": "https://liberapay.com/sebastianbergmann", + "type": "liberapay" }, { - "name": "Adam Harvey", - "email": "aharvey@php.net" + "url": "https://thanks.dev/u/gh/sebastianbergmann", + "type": "thanks_dev" + }, + { + "url": "https://tidelift.com/funding/github/packagist/sebastian/object-enumerator", + "type": "tidelift" + } + ], + "time": "2026-08-13T07:05:05+00:00" + }, + { + "name": "sebastian/object-reflector", + "version": "6.1.0", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/object-reflector.git", + "reference": "f71bbcdc4f95456b4622810bec64eb06372e25b2" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/object-reflector/zipball/f71bbcdc4f95456b4622810bec64eb06372e25b2", + "reference": "f71bbcdc4f95456b4622810bec64eb06372e25b2", + "shasum": "" + }, + "require": { + "php": ">=8.4" + }, + "require-dev": { + "phpunit/phpunit": "^13.3.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-main": "6.0-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de" } ], - "description": "Provides functionality to recursively process PHP variables", - "homepage": "https://github.com/sebastianbergmann/recursion-context", + "description": "Allows reflection of object attributes, including inherited and non-public ones", + "homepage": "https://github.com/sebastianbergmann/object-reflector/", "support": { - "issues": "https://github.com/sebastianbergmann/recursion-context/issues", - "source": "https://github.com/sebastianbergmann/recursion-context/tree/4.0.5" + "issues": "https://github.com/sebastianbergmann/object-reflector/issues", + "security": "https://github.com/sebastianbergmann/object-reflector/security/policy", + "source": "https://github.com/sebastianbergmann/object-reflector/tree/6.1.0" }, "funding": [ { "url": "https://github.com/sebastianbergmann", "type": "github" + }, + { + "url": "https://liberapay.com/sebastianbergmann", + "type": "liberapay" + }, + { + "url": "https://thanks.dev/u/gh/sebastianbergmann", + "type": "thanks_dev" + }, + { + "url": "https://tidelift.com/funding/github/packagist/sebastian/object-reflector", + "type": "tidelift" } ], - "time": "2023-02-03T06:07:39+00:00" + "time": "2026-08-13T06:34:36+00:00" }, { - "name": "sebastian/resource-operations", - "version": "3.0.3", + "name": "sebastian/recursion-context", + "version": "8.0.1", "source": { "type": "git", - "url": "https://github.com/sebastianbergmann/resource-operations.git", - "reference": "0f4443cb3a1d92ce809899753bc0d5d5a8dd19a8" + "url": "https://github.com/sebastianbergmann/recursion-context.git", + "reference": "32dba72f2b4642d6a93db22d6c0a9280ff2e3ca0" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/resource-operations/zipball/0f4443cb3a1d92ce809899753bc0d5d5a8dd19a8", - "reference": "0f4443cb3a1d92ce809899753bc0d5d5a8dd19a8", + "url": "https://api.github.com/repos/sebastianbergmann/recursion-context/zipball/32dba72f2b4642d6a93db22d6c0a9280ff2e3ca0", + "reference": "32dba72f2b4642d6a93db22d6c0a9280ff2e3ca0", "shasum": "" }, "require": { - "php": ">=7.3" + "php": ">=8.4" }, "require-dev": { - "phpunit/phpunit": "^9.0" + "phpunit/phpunit": "^13.2.6" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "3.0-dev" + "dev-main": "8.0-dev" } }, "autoload": { @@ -9249,46 +10079,67 @@ { "name": "Sebastian Bergmann", "email": "sebastian@phpunit.de" + }, + { + "name": "Jeff Welch", + "email": "whatthejeff@gmail.com" + }, + { + "name": "Adam Harvey", + "email": "aharvey@php.net" } ], - "description": "Provides a list of PHP built-in functions that operate on resources", - "homepage": "https://www.github.com/sebastianbergmann/resource-operations", + "description": "Provides functionality to recursively process PHP variables", + "homepage": "https://github.com/sebastianbergmann/recursion-context", "support": { - "issues": "https://github.com/sebastianbergmann/resource-operations/issues", - "source": "https://github.com/sebastianbergmann/resource-operations/tree/3.0.3" + "issues": "https://github.com/sebastianbergmann/recursion-context/issues", + "security": "https://github.com/sebastianbergmann/recursion-context/security/policy", + "source": "https://github.com/sebastianbergmann/recursion-context/tree/8.0.1" }, "funding": [ { "url": "https://github.com/sebastianbergmann", "type": "github" + }, + { + "url": "https://liberapay.com/sebastianbergmann", + "type": "liberapay" + }, + { + "url": "https://thanks.dev/u/gh/sebastianbergmann", + "type": "thanks_dev" + }, + { + "url": "https://tidelift.com/funding/github/packagist/sebastian/recursion-context", + "type": "tidelift" } ], - "time": "2020-09-28T06:45:17+00:00" + "time": "2026-08-03T05:58:12+00:00" }, { "name": "sebastian/type", - "version": "3.2.1", + "version": "7.0.2", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/type.git", - "reference": "75e2c2a32f5e0b3aef905b9ed0b179b953b3d7c7" + "reference": "bd1df467864cb95140414059a535b2d906173fcf" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/type/zipball/75e2c2a32f5e0b3aef905b9ed0b179b953b3d7c7", - "reference": "75e2c2a32f5e0b3aef905b9ed0b179b953b3d7c7", + "url": "https://api.github.com/repos/sebastianbergmann/type/zipball/bd1df467864cb95140414059a535b2d906173fcf", + "reference": "bd1df467864cb95140414059a535b2d906173fcf", "shasum": "" }, "require": { - "php": ">=7.3" + "php": ">=8.4" }, "require-dev": { - "phpunit/phpunit": "^9.5" + "phpunit/phpunit": "^13.3.0" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "3.2-dev" + "dev-main": "7.0-dev" } }, "autoload": { @@ -9311,37 +10162,50 @@ "homepage": "https://github.com/sebastianbergmann/type", "support": { "issues": "https://github.com/sebastianbergmann/type/issues", - "source": "https://github.com/sebastianbergmann/type/tree/3.2.1" + "security": "https://github.com/sebastianbergmann/type/security/policy", + "source": "https://github.com/sebastianbergmann/type/tree/7.0.2" }, "funding": [ { "url": "https://github.com/sebastianbergmann", "type": "github" + }, + { + "url": "https://liberapay.com/sebastianbergmann", + "type": "liberapay" + }, + { + "url": "https://thanks.dev/u/gh/sebastianbergmann", + "type": "thanks_dev" + }, + { + "url": "https://tidelift.com/funding/github/packagist/sebastian/type", + "type": "tidelift" } ], - "time": "2023-02-03T06:13:03+00:00" + "time": "2026-08-10T08:00:57+00:00" }, { "name": "sebastian/version", - "version": "3.0.2", + "version": "7.0.0", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/version.git", - "reference": "c6c1022351a901512170118436c764e473f6de8c" + "reference": "ad37a5552c8e2b88572249fdc19b6da7792e021b" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/version/zipball/c6c1022351a901512170118436c764e473f6de8c", - "reference": "c6c1022351a901512170118436c764e473f6de8c", + "url": "https://api.github.com/repos/sebastianbergmann/version/zipball/ad37a5552c8e2b88572249fdc19b6da7792e021b", + "reference": "ad37a5552c8e2b88572249fdc19b6da7792e021b", "shasum": "" }, "require": { - "php": ">=7.3" + "php": ">=8.4" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "3.0-dev" + "dev-main": "7.0-dev" } }, "autoload": { @@ -9364,35 +10228,48 @@ "homepage": "https://github.com/sebastianbergmann/version", "support": { "issues": "https://github.com/sebastianbergmann/version/issues", - "source": "https://github.com/sebastianbergmann/version/tree/3.0.2" + "security": "https://github.com/sebastianbergmann/version/security/policy", + "source": "https://github.com/sebastianbergmann/version/tree/7.0.0" }, "funding": [ { "url": "https://github.com/sebastianbergmann", "type": "github" + }, + { + "url": "https://liberapay.com/sebastianbergmann", + "type": "liberapay" + }, + { + "url": "https://thanks.dev/u/gh/sebastianbergmann", + "type": "thanks_dev" + }, + { + "url": "https://tidelift.com/funding/github/packagist/sebastian/version", + "type": "tidelift" } ], - "time": "2020-09-28T06:39:44+00:00" + "time": "2026-02-06T04:52:52+00:00" }, { "name": "seld/jsonlint", - "version": "1.10.0", + "version": "1.12.1", "source": { "type": "git", "url": "https://github.com/Seldaek/jsonlint.git", - "reference": "594fd6462aad8ecee0b45ca5045acea4776667f1" + "reference": "9a90eb5d32d5a500296bf43f946d60246444d5f7" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/Seldaek/jsonlint/zipball/594fd6462aad8ecee0b45ca5045acea4776667f1", - "reference": "594fd6462aad8ecee0b45ca5045acea4776667f1", + "url": "https://api.github.com/repos/Seldaek/jsonlint/zipball/9a90eb5d32d5a500296bf43f946d60246444d5f7", + "reference": "9a90eb5d32d5a500296bf43f946d60246444d5f7", "shasum": "" }, "require": { "php": "^5.3 || ^7.0 || ^8.0" }, "require-dev": { - "phpstan/phpstan": "^1.5", + "phpstan/phpstan": "^1.11", "phpunit/phpunit": "^4.8.35 || ^5.7 || ^6.0 || ^8.5.13" }, "bin": [ @@ -9412,7 +10289,7 @@ { "name": "Jordi Boggiano", "email": "j.boggiano@seld.be", - "homepage": "http://seld.be" + "homepage": "https://seld.be" } ], "description": "JSON Linter", @@ -9424,7 +10301,7 @@ ], "support": { "issues": "https://github.com/Seldaek/jsonlint/issues", - "source": "https://github.com/Seldaek/jsonlint/tree/1.10.0" + "source": "https://github.com/Seldaek/jsonlint/tree/1.12.1" }, "funding": [ { @@ -9436,20 +10313,20 @@ "type": "tidelift" } ], - "time": "2023-05-11T13:16:46+00:00" + "time": "2026-06-12T11:32:29+00:00" }, { "name": "seld/phar-utils", - "version": "1.2.1", + "version": "1.2.2", "source": { "type": "git", "url": "https://github.com/Seldaek/phar-utils.git", - "reference": "ea2f4014f163c1be4c601b9b7bd6af81ba8d701c" + "reference": "990bbd0e92caa216d52eca0935f6e35e589bfaa5" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/Seldaek/phar-utils/zipball/ea2f4014f163c1be4c601b9b7bd6af81ba8d701c", - "reference": "ea2f4014f163c1be4c601b9b7bd6af81ba8d701c", + "url": "https://api.github.com/repos/Seldaek/phar-utils/zipball/990bbd0e92caa216d52eca0935f6e35e589bfaa5", + "reference": "990bbd0e92caa216d52eca0935f6e35e589bfaa5", "shasum": "" }, "require": { @@ -9482,295 +10359,45 @@ ], "support": { "issues": "https://github.com/Seldaek/phar-utils/issues", - "source": "https://github.com/Seldaek/phar-utils/tree/1.2.1" + "source": "https://github.com/Seldaek/phar-utils/tree/1.2.2" }, - "time": "2022-08-31T10:31:18+00:00" + "time": "2026-08-01T12:48:55+00:00" }, { "name": "seld/signal-handler", "version": "2.0.2", "source": { "type": "git", - "url": "https://github.com/Seldaek/signal-handler.git", - "reference": "04a6112e883ad76c0ada8e4a9f7520bbfdb6bb98" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/Seldaek/signal-handler/zipball/04a6112e883ad76c0ada8e4a9f7520bbfdb6bb98", - "reference": "04a6112e883ad76c0ada8e4a9f7520bbfdb6bb98", - "shasum": "" - }, - "require": { - "php": ">=7.2.0" - }, - "require-dev": { - "phpstan/phpstan": "^1", - "phpstan/phpstan-deprecation-rules": "^1.0", - "phpstan/phpstan-phpunit": "^1", - "phpstan/phpstan-strict-rules": "^1.3", - "phpunit/phpunit": "^7.5.20 || ^8.5.23", - "psr/log": "^1 || ^2 || ^3" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-main": "2.x-dev" - } - }, - "autoload": { - "psr-4": { - "Seld\\Signal\\": "src/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Jordi Boggiano", - "email": "j.boggiano@seld.be", - "homepage": "http://seld.be" - } - ], - "description": "Simple unix signal handler that silently fails where signals are not supported for easy cross-platform development", - "keywords": [ - "posix", - "sigint", - "signal", - "sigterm", - "unix" - ], - "support": { - "issues": "https://github.com/Seldaek/signal-handler/issues", - "source": "https://github.com/Seldaek/signal-handler/tree/2.0.2" - }, - "time": "2023-09-03T09:24:00+00:00" - }, - { - "name": "slevomat/coding-standard", - "version": "8.14.1", - "source": { - "type": "git", - "url": "https://github.com/slevomat/coding-standard.git", - "reference": "fea1fd6f137cc84f9cba0ae30d549615dbc6a926" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/slevomat/coding-standard/zipball/fea1fd6f137cc84f9cba0ae30d549615dbc6a926", - "reference": "fea1fd6f137cc84f9cba0ae30d549615dbc6a926", - "shasum": "" - }, - "require": { - "dealerdirect/phpcodesniffer-composer-installer": "^0.6.2 || ^0.7 || ^1.0", - "php": "^7.2 || ^8.0", - "phpstan/phpdoc-parser": "^1.23.1", - "squizlabs/php_codesniffer": "^3.7.1" - }, - "require-dev": { - "phing/phing": "2.17.4", - "php-parallel-lint/php-parallel-lint": "1.3.2", - "phpstan/phpstan": "1.10.37", - "phpstan/phpstan-deprecation-rules": "1.1.4", - "phpstan/phpstan-phpunit": "1.3.14", - "phpstan/phpstan-strict-rules": "1.5.1", - "phpunit/phpunit": "8.5.21|9.6.8|10.3.5" - }, - "type": "phpcodesniffer-standard", - "extra": { - "branch-alias": { - "dev-master": "8.x-dev" - } - }, - "autoload": { - "psr-4": { - "SlevomatCodingStandard\\": "SlevomatCodingStandard/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "description": "Slevomat Coding Standard for PHP_CodeSniffer complements Consistence Coding Standard by providing sniffs with additional checks.", - "keywords": [ - "dev", - "phpcs" - ], - "support": { - "issues": "https://github.com/slevomat/coding-standard/issues", - "source": "https://github.com/slevomat/coding-standard/tree/8.14.1" - }, - "funding": [ - { - "url": "https://github.com/kukulich", - "type": "github" - }, - { - "url": "https://tidelift.com/funding/github/packagist/slevomat/coding-standard", - "type": "tidelift" - } - ], - "time": "2023-10-08T07:28:08+00:00" - }, - { - "name": "spatie/array-to-xml", - "version": "3.2.0", - "source": { - "type": "git", - "url": "https://github.com/spatie/array-to-xml.git", - "reference": "f9ab39c808500c347d5a8b6b13310bd5221e39e7" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/spatie/array-to-xml/zipball/f9ab39c808500c347d5a8b6b13310bd5221e39e7", - "reference": "f9ab39c808500c347d5a8b6b13310bd5221e39e7", - "shasum": "" - }, - "require": { - "ext-dom": "*", - "php": "^8.0" - }, - "require-dev": { - "mockery/mockery": "^1.2", - "pestphp/pest": "^1.21", - "spatie/pest-plugin-snapshots": "^1.1" - }, - "type": "library", - "autoload": { - "psr-4": { - "Spatie\\ArrayToXml\\": "src" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Freek Van der Herten", - "email": "freek@spatie.be", - "homepage": "https://freek.dev", - "role": "Developer" - } - ], - "description": "Convert an array to xml", - "homepage": "https://github.com/spatie/array-to-xml", - "keywords": [ - "array", - "convert", - "xml" - ], - "support": { - "source": "https://github.com/spatie/array-to-xml/tree/3.2.0" - }, - "funding": [ - { - "url": "https://spatie.be/open-source/support-us", - "type": "custom" - }, - { - "url": "https://github.com/spatie", - "type": "github" - } - ], - "time": "2023-07-19T18:30:26+00:00" - }, - { - "name": "squizlabs/php_codesniffer", - "version": "3.7.2", - "source": { - "type": "git", - "url": "https://github.com/squizlabs/PHP_CodeSniffer.git", - "reference": "ed8e00df0a83aa96acf703f8c2979ff33341f879" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/squizlabs/PHP_CodeSniffer/zipball/ed8e00df0a83aa96acf703f8c2979ff33341f879", - "reference": "ed8e00df0a83aa96acf703f8c2979ff33341f879", - "shasum": "" - }, - "require": { - "ext-simplexml": "*", - "ext-tokenizer": "*", - "ext-xmlwriter": "*", - "php": ">=5.4.0" - }, - "require-dev": { - "phpunit/phpunit": "^4.0 || ^5.0 || ^6.0 || ^7.0" - }, - "bin": [ - "bin/phpcs", - "bin/phpcbf" - ], - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "3.x-dev" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause" - ], - "authors": [ - { - "name": "Greg Sherwood", - "role": "lead" - } - ], - "description": "PHP_CodeSniffer tokenizes PHP, JavaScript and CSS files and detects violations of a defined set of coding standards.", - "homepage": "https://github.com/squizlabs/PHP_CodeSniffer", - "keywords": [ - "phpcs", - "standards", - "static analysis" - ], - "support": { - "issues": "https://github.com/squizlabs/PHP_CodeSniffer/issues", - "source": "https://github.com/squizlabs/PHP_CodeSniffer", - "wiki": "https://github.com/squizlabs/PHP_CodeSniffer/wiki" - }, - "time": "2023-02-22T23:07:41+00:00" - }, - { - "name": "symfony/config", - "version": "v6.3.2", - "source": { - "type": "git", - "url": "https://github.com/symfony/config.git", - "reference": "b47ca238b03e7b0d7880ffd1cf06e8d637ca1467" + "url": "https://github.com/Seldaek/signal-handler.git", + "reference": "04a6112e883ad76c0ada8e4a9f7520bbfdb6bb98" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/config/zipball/b47ca238b03e7b0d7880ffd1cf06e8d637ca1467", - "reference": "b47ca238b03e7b0d7880ffd1cf06e8d637ca1467", + "url": "https://api.github.com/repos/Seldaek/signal-handler/zipball/04a6112e883ad76c0ada8e4a9f7520bbfdb6bb98", + "reference": "04a6112e883ad76c0ada8e4a9f7520bbfdb6bb98", "shasum": "" }, "require": { - "php": ">=8.1", - "symfony/deprecation-contracts": "^2.5|^3", - "symfony/filesystem": "^5.4|^6.0", - "symfony/polyfill-ctype": "~1.8" - }, - "conflict": { - "symfony/finder": "<5.4", - "symfony/service-contracts": "<2.5" + "php": ">=7.2.0" }, "require-dev": { - "symfony/event-dispatcher": "^5.4|^6.0", - "symfony/finder": "^5.4|^6.0", - "symfony/messenger": "^5.4|^6.0", - "symfony/service-contracts": "^2.5|^3", - "symfony/yaml": "^5.4|^6.0" + "phpstan/phpstan": "^1", + "phpstan/phpstan-deprecation-rules": "^1.0", + "phpstan/phpstan-phpunit": "^1", + "phpstan/phpstan-strict-rules": "^1.3", + "phpunit/phpunit": "^7.5.20 || ^8.5.23", + "psr/log": "^1 || ^2 || ^3" }, "type": "library", + "extra": { + "branch-alias": { + "dev-main": "2.x-dev" + } + }, "autoload": { "psr-4": { - "Symfony\\Component\\Config\\": "" - }, - "exclude-from-classmap": [ - "/Tests/" - ] + "Seld\\Signal\\": "src/" + } }, "notification-url": "https://packagist.org/downloads/", "license": [ @@ -9778,519 +10405,484 @@ ], "authors": [ { - "name": "Fabien Potencier", - "email": "fabien@symfony.com" - }, - { - "name": "Symfony Community", - "homepage": "https://symfony.com/contributors" + "name": "Jordi Boggiano", + "email": "j.boggiano@seld.be", + "homepage": "http://seld.be" } ], - "description": "Helps you find, load, combine, autofill and validate configuration values of any kind", - "homepage": "https://symfony.com", + "description": "Simple unix signal handler that silently fails where signals are not supported for easy cross-platform development", + "keywords": [ + "posix", + "sigint", + "signal", + "sigterm", + "unix" + ], "support": { - "source": "https://github.com/symfony/config/tree/v6.3.2" + "issues": "https://github.com/Seldaek/signal-handler/issues", + "source": "https://github.com/Seldaek/signal-handler/tree/2.0.2" }, - "funding": [ - { - "url": "https://symfony.com/sponsor", - "type": "custom" - }, - { - "url": "https://github.com/fabpot", - "type": "github" - }, - { - "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", - "type": "tidelift" - } - ], - "time": "2023-07-19T20:22:16+00:00" + "time": "2023-09-03T09:24:00+00:00" }, { - "name": "symfony/console", - "version": "v6.3.4", + "name": "shipmonk/dead-code-detector", + "version": "1.3.3", "source": { "type": "git", - "url": "https://github.com/symfony/console.git", - "reference": "eca495f2ee845130855ddf1cf18460c38966c8b6" + "url": "https://github.com/shipmonk-rnd/dead-code-detector.git", + "reference": "781c0b26c920da8a5e18d290ffb8c1b323de3ce5" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/console/zipball/eca495f2ee845130855ddf1cf18460c38966c8b6", - "reference": "eca495f2ee845130855ddf1cf18460c38966c8b6", + "url": "https://api.github.com/repos/shipmonk-rnd/dead-code-detector/zipball/781c0b26c920da8a5e18d290ffb8c1b323de3ce5", + "reference": "781c0b26c920da8a5e18d290ffb8c1b323de3ce5", "shasum": "" }, "require": { - "php": ">=8.1", - "symfony/deprecation-contracts": "^2.5|^3", - "symfony/polyfill-mbstring": "~1.0", - "symfony/service-contracts": "^2.5|^3", - "symfony/string": "^5.4|^6.0" - }, - "conflict": { - "symfony/dependency-injection": "<5.4", - "symfony/dotenv": "<5.4", - "symfony/event-dispatcher": "<5.4", - "symfony/lock": "<5.4", - "symfony/process": "<5.4" - }, - "provide": { - "psr/log-implementation": "1.0|2.0|3.0" + "php": "^8.1", + "phpstan/phpstan": "^2.1.41" }, "require-dev": { - "psr/log": "^1|^2|^3", - "symfony/config": "^5.4|^6.0", - "symfony/dependency-injection": "^5.4|^6.0", - "symfony/event-dispatcher": "^5.4|^6.0", - "symfony/lock": "^5.4|^6.0", - "symfony/process": "^5.4|^6.0", - "symfony/var-dumper": "^5.4|^6.0" + "behat/behat": "^3.14", + "composer-runtime-api": "^2.0", + "composer/semver": "^3.4", + "doctrine/orm": "^2.19 || ^3.0", + "editorconfig-checker/editorconfig-checker": "^10.7.0", + "ergebnis/composer-normalize": "^2.48.1", + "laravel/framework": "^10.0 || ^11.0 || ^12.0", + "nette/application": "^3.1", + "nette/component-model": "^3.0", + "nette/neon": "^3.4", + "nette/tester": "^2.4", + "nette/utils": "^3.0 || ^4.0", + "nikic/php-parser": "^5.4.0", + "phpat/phpat": "^0.12", + "phpbench/phpbench": "^1.2", + "phpstan/phpstan-phpunit": "^2.0.16", + "phpstan/phpstan-strict-rules": "^2.0.10", + "phpstan/phpstan-symfony": "^2.0.15", + "phpunit/phpcov": "^9.0.2", + "phpunit/phpunit": "^10.5.46", + "shipmonk/coding-standard": "^0.3.0", + "shipmonk/composer-dependency-analyser": "^1.8.4", + "shipmonk/coverage-guard": "^1.1.0", + "shipmonk/name-collision-detector": "^2.1.1", + "shipmonk/phpstan-dev": "^0.1.6", + "shipmonk/phpstan-rules": "^4.3.6", + "symfony/contracts": "^2.5 || ^3.0 || ^4.0", + "symfony/dependency-injection": "^5.4 || ^6.0 || ^7.0 || ^8.0", + "symfony/doctrine-bridge": "^5.4 || ^6.0 || ^7.0 || ^8.0", + "symfony/event-dispatcher": "^5.4 || ^6.0 || ^7.0 || ^8.0", + "symfony/form": "^5.4 || ^6.0 || ^7.0 || ^8.0", + "symfony/framework-bundle": "^5.4 || ^6.0 || ^7.0 || ^8.0", + "symfony/http-kernel": "^5.4 || ^6.0 || ^7.0 || ^8.0", + "symfony/routing": "^5.4 || ^6.0 || ^7.0 || ^8.0", + "symfony/scheduler": "^6.3 || ^7.0 || ^8.0", + "symfony/ux-live-component": "^2.34", + "symfony/ux-twig-component": "^2.34", + "symfony/validator": "^5.4 || ^6.0 || ^7.0 || ^8.0", + "twig/twig": "^3.0" + }, + "type": "phpstan-extension", + "extra": { + "phpstan": { + "includes": [ + "rules.neon" + ] + } }, - "type": "library", "autoload": { "psr-4": { - "Symfony\\Component\\Console\\": "" - }, - "exclude-from-classmap": [ - "/Tests/" - ] + "ShipMonk\\PHPStan\\DeadCode\\": "src/" + } }, "notification-url": "https://packagist.org/downloads/", "license": [ "MIT" ], - "authors": [ - { - "name": "Fabien Potencier", - "email": "fabien@symfony.com" - }, - { - "name": "Symfony Community", - "homepage": "https://symfony.com/contributors" - } - ], - "description": "Eases the creation of beautiful and testable command line interfaces", - "homepage": "https://symfony.com", + "description": "Dead code detector to find unused PHP code via PHPStan extension. Can automatically remove dead PHP code. Supports libraries like Symfony, Doctrine, PHPUnit etc. Detects dead cycles. Can detect dead code that is tested.", "keywords": [ - "cli", - "command-line", - "console", - "terminal" + "PHPStan", + "dead code", + "static analysis", + "unused code" ], "support": { - "source": "https://github.com/symfony/console/tree/v6.3.4" + "issues": "https://github.com/shipmonk-rnd/dead-code-detector/issues", + "source": "https://github.com/shipmonk-rnd/dead-code-detector/tree/1.3.3" }, - "funding": [ - { - "url": "https://symfony.com/sponsor", - "type": "custom" - }, - { - "url": "https://github.com/fabpot", - "type": "github" - }, - { - "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", - "type": "tidelift" - } - ], - "time": "2023-08-16T10:10:12+00:00" + "time": "2026-08-06T14:08:28+00:00" }, { - "name": "symfony/dependency-injection", - "version": "v6.3.5", + "name": "shipmonk/phpstan-rules", + "version": "4.4.0", "source": { "type": "git", - "url": "https://github.com/symfony/dependency-injection.git", - "reference": "2ed62b3bf98346e1f45529a7b6be2196739bb993" + "url": "https://github.com/shipmonk-rnd/phpstan-rules.git", + "reference": "5c972b16fa6d202d0d0d2c888e29f7d9fc0a9908" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/dependency-injection/zipball/2ed62b3bf98346e1f45529a7b6be2196739bb993", - "reference": "2ed62b3bf98346e1f45529a7b6be2196739bb993", + "url": "https://api.github.com/repos/shipmonk-rnd/phpstan-rules/zipball/5c972b16fa6d202d0d0d2c888e29f7d9fc0a9908", + "reference": "5c972b16fa6d202d0d0d2c888e29f7d9fc0a9908", "shasum": "" }, "require": { - "php": ">=8.1", - "psr/container": "^1.1|^2.0", - "symfony/deprecation-contracts": "^2.5|^3", - "symfony/service-contracts": "^2.5|^3.0", - "symfony/var-exporter": "^6.2.10" - }, - "conflict": { - "ext-psr": "<1.1|>=2", - "symfony/config": "<6.1", - "symfony/finder": "<5.4", - "symfony/proxy-manager-bridge": "<6.3", - "symfony/yaml": "<5.4" - }, - "provide": { - "psr/container-implementation": "1.1|2.0", - "symfony/service-implementation": "1.1|2.0|3.0" + "php": "^8.1", + "phpstan/phpstan": "^2.1.33" + }, + "require-dev": { + "editorconfig-checker/editorconfig-checker": "^10.6.0", + "ergebnis/composer-normalize": "^2.45.0", + "phpstan/phpstan-deprecation-rules": "^2.0.1", + "phpstan/phpstan-phpunit": "^2.0.4", + "phpstan/phpstan-strict-rules": "^2.0.3", + "phpunit/phpunit": "^10.5.46", + "shipmonk/coding-standard": "^0.2.0", + "shipmonk/composer-dependency-analyser": "^1.8.1", + "shipmonk/coverage-guard": "^1.0.0", + "shipmonk/dead-code-detector": "^1.0", + "shipmonk/name-collision-detector": "^2.1.1", + "shipmonk/phpstan-dev": "^0.1.5" }, - "require-dev": { - "symfony/config": "^6.1", - "symfony/expression-language": "^5.4|^6.0", - "symfony/yaml": "^5.4|^6.0" + "type": "phpstan-extension", + "extra": { + "phpstan": { + "includes": [ + "rules.neon" + ] + } }, - "type": "library", "autoload": { "psr-4": { - "Symfony\\Component\\DependencyInjection\\": "" - }, - "exclude-from-classmap": [ - "/Tests/" - ] + "ShipMonk\\PHPStan\\": "src/" + } }, "notification-url": "https://packagist.org/downloads/", "license": [ "MIT" ], - "authors": [ - { - "name": "Fabien Potencier", - "email": "fabien@symfony.com" - }, - { - "name": "Symfony Community", - "homepage": "https://symfony.com/contributors" - } + "description": "Various extra strict PHPStan rules we found useful in ShipMonk.", + "keywords": [ + "PHPStan", + "static analysis" ], - "description": "Allows you to standardize and centralize the way objects are constructed in your application", - "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/dependency-injection/tree/v6.3.5" + "issues": "https://github.com/shipmonk-rnd/phpstan-rules/issues", + "source": "https://github.com/shipmonk-rnd/phpstan-rules/tree/4.4.0" }, - "funding": [ - { - "url": "https://symfony.com/sponsor", - "type": "custom" - }, - { - "url": "https://github.com/fabpot", - "type": "github" - }, - { - "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", - "type": "tidelift" - } - ], - "time": "2023-09-25T16:46:40+00:00" + "time": "2026-05-18T12:07:24+00:00" }, { - "name": "symfony/deprecation-contracts", - "version": "v3.3.0", + "name": "slevomat/coding-standard", + "version": "8.31.1", "source": { "type": "git", - "url": "https://github.com/symfony/deprecation-contracts.git", - "reference": "7c3aff79d10325257a001fcf92d991f24fc967cf" + "url": "https://github.com/slevomat/coding-standard.git", + "reference": "0a40807a48873948bfa7ffce2a4e69ba40cf5e76" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/deprecation-contracts/zipball/7c3aff79d10325257a001fcf92d991f24fc967cf", - "reference": "7c3aff79d10325257a001fcf92d991f24fc967cf", + "url": "https://api.github.com/repos/slevomat/coding-standard/zipball/0a40807a48873948bfa7ffce2a4e69ba40cf5e76", + "reference": "0a40807a48873948bfa7ffce2a4e69ba40cf5e76", "shasum": "" }, "require": { - "php": ">=8.1" + "dealerdirect/phpcodesniffer-composer-installer": "^0.7 || ^1.2.1", + "php": "^7.4 || ^8.0", + "phpstan/phpdoc-parser": "^2.3.3", + "squizlabs/php_codesniffer": "^4.0.1" }, - "type": "library", + "require-dev": { + "phing/phing": "3.0.1|3.1.2", + "php-parallel-lint/php-parallel-lint": "1.4.0", + "phpstan/phpstan": "2.2.7", + "phpstan/phpstan-deprecation-rules": "2.0.5", + "phpstan/phpstan-phpunit": "2.0.18", + "phpstan/phpstan-strict-rules": "2.0.12", + "phpunit/phpunit": "9.6.34|10.5.63|11.4.4|11.5.56|12.5.33" + }, + "type": "phpcodesniffer-standard", "extra": { "branch-alias": { - "dev-main": "3.4-dev" - }, - "thanks": { - "name": "symfony/contracts", - "url": "https://github.com/symfony/contracts" + "dev-master": "8.x-dev" } }, "autoload": { - "files": [ - "function.php" - ] + "psr-4": { + "SlevomatCodingStandard\\": "SlevomatCodingStandard/" + } }, "notification-url": "https://packagist.org/downloads/", "license": [ "MIT" ], - "authors": [ - { - "name": "Nicolas Grekas", - "email": "p@tchwork.com" - }, - { - "name": "Symfony Community", - "homepage": "https://symfony.com/contributors" - } + "description": "Slevomat Coding Standard for PHP_CodeSniffer complements Consistence Coding Standard by providing sniffs with additional checks.", + "keywords": [ + "dev", + "phpcs" ], - "description": "A generic function and convention to trigger deprecation notices", - "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/deprecation-contracts/tree/v3.3.0" + "issues": "https://github.com/slevomat/coding-standard/issues", + "source": "https://github.com/slevomat/coding-standard/tree/8.31.1" }, "funding": [ { - "url": "https://symfony.com/sponsor", - "type": "custom" - }, - { - "url": "https://github.com/fabpot", + "url": "https://github.com/kukulich", "type": "github" }, { - "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "url": "https://tidelift.com/funding/github/packagist/slevomat/coding-standard", "type": "tidelift" } ], - "time": "2023-05-23T14:45:45+00:00" + "time": "2026-07-31T10:42:43+00:00" }, { - "name": "symfony/filesystem", - "version": "v6.3.1", + "name": "squizlabs/php_codesniffer", + "version": "4.0.4", "source": { "type": "git", - "url": "https://github.com/symfony/filesystem.git", - "reference": "edd36776956f2a6fcf577edb5b05eb0e3bdc52ae" + "url": "https://github.com/PHPCSStandards/PHP_CodeSniffer.git", + "reference": "bbdc3d0532623e21838b7041a4364383a8126f96" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/filesystem/zipball/edd36776956f2a6fcf577edb5b05eb0e3bdc52ae", - "reference": "edd36776956f2a6fcf577edb5b05eb0e3bdc52ae", + "url": "https://api.github.com/repos/PHPCSStandards/PHP_CodeSniffer/zipball/bbdc3d0532623e21838b7041a4364383a8126f96", + "reference": "bbdc3d0532623e21838b7041a4364383a8126f96", "shasum": "" }, "require": { - "php": ">=8.1", - "symfony/polyfill-ctype": "~1.8", - "symfony/polyfill-mbstring": "~1.8" + "ext-libxml": "*", + "ext-simplexml": "*", + "ext-tokenizer": "*", + "ext-xmlwriter": "*", + "php": ">=7.2.0" }, - "type": "library", - "autoload": { - "psr-4": { - "Symfony\\Component\\Filesystem\\": "" - }, - "exclude-from-classmap": [ - "/Tests/" - ] + "require-dev": { + "phpunit/phpunit": "^8.4.0 || ^9.3.4 || ^10.5.32 || 11.3.3 - 11.5.28 || ^11.5.31" + }, + "suggest": { + "ext-iconv": "For accurate character length calculation when the checked files contain multi-byte characters.", + "ext-pcntl": "For parallel processing support via the --parallel CLI option." }, + "bin": [ + "bin/phpcbf", + "bin/phpcs" + ], + "type": "library", "notification-url": "https://packagist.org/downloads/", "license": [ - "MIT" + "BSD-3-Clause" ], "authors": [ { - "name": "Fabien Potencier", - "email": "fabien@symfony.com" + "name": "Greg Sherwood", + "role": "Former lead" + }, + { + "name": "Juliette Reinders Folmer", + "role": "Current lead" }, { - "name": "Symfony Community", - "homepage": "https://symfony.com/contributors" + "name": "Contributors", + "homepage": "https://github.com/PHPCSStandards/PHP_CodeSniffer/graphs/contributors" } ], - "description": "Provides basic utilities for the filesystem", - "homepage": "https://symfony.com", + "description": "PHP_CodeSniffer tokenizes PHP files and detects violations of a defined set of coding standards.", + "homepage": "https://github.com/PHPCSStandards/PHP_CodeSniffer", + "keywords": [ + "phpcs", + "standards", + "static analysis" + ], "support": { - "source": "https://github.com/symfony/filesystem/tree/v6.3.1" + "issues": "https://github.com/PHPCSStandards/PHP_CodeSniffer/issues", + "security": "https://github.com/PHPCSStandards/PHP_CodeSniffer/security/policy", + "source": "https://github.com/PHPCSStandards/PHP_CodeSniffer", + "wiki": "https://github.com/PHPCSStandards/PHP_CodeSniffer/wiki" }, "funding": [ { - "url": "https://symfony.com/sponsor", - "type": "custom" + "url": "https://github.com/PHPCSStandards", + "type": "github" }, { - "url": "https://github.com/fabpot", + "url": "https://github.com/jrfnl", "type": "github" }, { - "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", - "type": "tidelift" + "url": "https://opencollective.com/php_codesniffer", + "type": "open_collective" + }, + { + "url": "https://thanks.dev/u/gh/phpcsstandards", + "type": "thanks_dev" } ], - "time": "2023-06-01T08:30:39+00:00" + "time": "2026-08-06T02:45:27+00:00" }, { - "name": "symfony/finder", - "version": "v6.3.5", + "name": "staabm/phpstan-psr3", + "version": "1.0.3", "source": { "type": "git", - "url": "https://github.com/symfony/finder.git", - "reference": "a1b31d88c0e998168ca7792f222cbecee47428c4" + "url": "https://github.com/staabm/phpstan-psr3.git", + "reference": "eb28b6f4cde754a8950547d633fc983cbfc59651" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/finder/zipball/a1b31d88c0e998168ca7792f222cbecee47428c4", - "reference": "a1b31d88c0e998168ca7792f222cbecee47428c4", + "url": "https://api.github.com/repos/staabm/phpstan-psr3/zipball/eb28b6f4cde754a8950547d633fc983cbfc59651", + "reference": "eb28b6f4cde754a8950547d633fc983cbfc59651", "shasum": "" }, "require": { - "php": ">=8.1" + "php": "^7.4 || ^8.0", + "phpstan/phpstan": "^2.0", + "psr/log": "^1.0 || ^2.0 || ^3.0" + }, + "require-dev": { + "illuminate/log": "^8 || ^9 || ^10 || ^11 || ^12", + "illuminate/support": "^8 || ^9 || ^10 || ^11 || ^12", + "monolog/monolog": "^2 || ^3.9", + "php-parallel-lint/php-parallel-lint": "^1.4", + "phpstan/extension-installer": "^1.4.3", + "phpstan/phpstan-deprecation-rules": "^2.0.1", + "phpstan/phpstan-phpunit": "^2.0.6", + "phpstan/phpstan-strict-rules": "^2.0.4", + "phpunit/phpunit": "^9 || ^10.5.45", + "redaxo/source": "^5", + "symplify/easy-coding-standard": "^12.5.11", + "tomasvotruba/unused-public": "^2.0.1" }, - "require-dev": { - "symfony/filesystem": "^6.0" + "type": "phpstan-extension", + "extra": { + "phpstan": { + "includes": [ + "config/extension.neon" + ] + } }, - "type": "library", "autoload": { "psr-4": { - "Symfony\\Component\\Finder\\": "" - }, - "exclude-from-classmap": [ - "/Tests/" - ] + "staabm\\PHPStanPsr3\\": "src/" + } }, "notification-url": "https://packagist.org/downloads/", "license": [ "MIT" ], - "authors": [ - { - "name": "Fabien Potencier", - "email": "fabien@symfony.com" - }, - { - "name": "Symfony Community", - "homepage": "https://symfony.com/contributors" - } + "keywords": [ + "PHPStan", + "dev", + "monolog", + "phpstan-extension", + "psr-3", + "psr-log", + "static analysis" ], - "description": "Finds files and directories via an intuitive fluent interface", - "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/finder/tree/v6.3.5" + "issues": "https://github.com/staabm/phpstan-psr3/issues", + "source": "https://github.com/staabm/phpstan-psr3/tree/1.0.3" }, "funding": [ { - "url": "https://symfony.com/sponsor", - "type": "custom" - }, - { - "url": "https://github.com/fabpot", + "url": "https://github.com/staabm", "type": "github" - }, - { - "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", - "type": "tidelift" } ], - "time": "2023-09-26T12:56:25+00:00" + "time": "2025-04-22T16:20:54+00:00" }, { - "name": "symfony/polyfill-ctype", - "version": "v1.28.0", + "name": "staabm/side-effects-detector", + "version": "1.0.5", "source": { "type": "git", - "url": "https://github.com/symfony/polyfill-ctype.git", - "reference": "ea208ce43cbb04af6867b4fdddb1bdbf84cc28cb" + "url": "https://github.com/staabm/side-effects-detector.git", + "reference": "d8334211a140ce329c13726d4a715adbddd0a163" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-ctype/zipball/ea208ce43cbb04af6867b4fdddb1bdbf84cc28cb", - "reference": "ea208ce43cbb04af6867b4fdddb1bdbf84cc28cb", + "url": "https://api.github.com/repos/staabm/side-effects-detector/zipball/d8334211a140ce329c13726d4a715adbddd0a163", + "reference": "d8334211a140ce329c13726d4a715adbddd0a163", "shasum": "" }, "require": { - "php": ">=7.1" - }, - "provide": { - "ext-ctype": "*" + "ext-tokenizer": "*", + "php": "^7.4 || ^8.0" }, - "suggest": { - "ext-ctype": "For best performance" + "require-dev": { + "phpstan/extension-installer": "^1.4.3", + "phpstan/phpstan": "^1.12.6", + "phpunit/phpunit": "^9.6.21", + "symfony/var-dumper": "^5.4.43", + "tomasvotruba/type-coverage": "1.0.0", + "tomasvotruba/unused-public": "1.0.0" }, "type": "library", - "extra": { - "branch-alias": { - "dev-main": "1.28-dev" - }, - "thanks": { - "name": "symfony/polyfill", - "url": "https://github.com/symfony/polyfill" - } - }, "autoload": { - "files": [ - "bootstrap.php" - ], - "psr-4": { - "Symfony\\Polyfill\\Ctype\\": "" - } + "classmap": [ + "lib/" + ] }, "notification-url": "https://packagist.org/downloads/", "license": [ "MIT" ], - "authors": [ - { - "name": "Gert de Pagter", - "email": "BackEndTea@gmail.com" - }, - { - "name": "Symfony Community", - "homepage": "https://symfony.com/contributors" - } - ], - "description": "Symfony polyfill for ctype functions", - "homepage": "https://symfony.com", + "description": "A static analysis tool to detect side effects in PHP code", "keywords": [ - "compatibility", - "ctype", - "polyfill", - "portable" + "static analysis" ], "support": { - "source": "https://github.com/symfony/polyfill-ctype/tree/v1.28.0" + "issues": "https://github.com/staabm/side-effects-detector/issues", + "source": "https://github.com/staabm/side-effects-detector/tree/1.0.5" }, "funding": [ { - "url": "https://symfony.com/sponsor", - "type": "custom" - }, - { - "url": "https://github.com/fabpot", + "url": "https://github.com/staabm", "type": "github" - }, - { - "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", - "type": "tidelift" } ], - "time": "2023-01-26T09:26:14+00:00" + "time": "2024-10-20T05:08:20+00:00" }, { - "name": "symfony/polyfill-intl-grapheme", - "version": "v1.28.0", + "name": "symfony/config", + "version": "v8.1.5", "source": { "type": "git", - "url": "https://github.com/symfony/polyfill-intl-grapheme.git", - "reference": "875e90aeea2777b6f135677f618529449334a612" + "url": "https://github.com/symfony/config.git", + "reference": "ec711a6c14ae287d9618fbd2c9de4e223a1a4b02" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-intl-grapheme/zipball/875e90aeea2777b6f135677f618529449334a612", - "reference": "875e90aeea2777b6f135677f618529449334a612", + "url": "https://api.github.com/repos/symfony/config/zipball/ec711a6c14ae287d9618fbd2c9de4e223a1a4b02", + "reference": "ec711a6c14ae287d9618fbd2c9de4e223a1a4b02", "shasum": "" }, "require": { - "php": ">=7.1" + "php": ">=8.4.1", + "symfony/deprecation-contracts": "^2.5|^3", + "symfony/filesystem": "^7.4|^8.0", + "symfony/polyfill-ctype": "^1.8" }, - "suggest": { - "ext-intl": "For best performance" + "conflict": { + "symfony/service-contracts": "<2.5" }, - "type": "library", - "extra": { - "branch-alias": { - "dev-main": "1.28-dev" - }, - "thanks": { - "name": "symfony/polyfill", - "url": "https://github.com/symfony/polyfill" - } + "require-dev": { + "symfony/event-dispatcher": "^7.4|^8.0", + "symfony/finder": "^7.4|^8.0", + "symfony/messenger": "^7.4|^8.0", + "symfony/service-contracts": "^2.5|^3", + "symfony/yaml": "^7.4|^8.0" }, + "type": "library", "autoload": { - "files": [ - "bootstrap.php" - ], "psr-4": { - "Symfony\\Polyfill\\Intl\\Grapheme\\": "" - } + "Symfony\\Component\\Config\\": "" + }, + "exclude-from-classmap": [ + "/Tests/" + ] }, "notification-url": "https://packagist.org/downloads/", "license": [ @@ -10298,26 +10890,18 @@ ], "authors": [ { - "name": "Nicolas Grekas", - "email": "p@tchwork.com" + "name": "Fabien Potencier", + "email": "fabien@symfony.com" }, { "name": "Symfony Community", "homepage": "https://symfony.com/contributors" } ], - "description": "Symfony polyfill for intl's grapheme_* functions", + "description": "Helps you find, load, combine, autofill and validate configuration values of any kind", "homepage": "https://symfony.com", - "keywords": [ - "compatibility", - "grapheme", - "intl", - "polyfill", - "portable", - "shim" - ], "support": { - "source": "https://github.com/symfony/polyfill-intl-grapheme/tree/v1.28.0" + "source": "https://github.com/symfony/config/tree/v8.1.5" }, "funding": [ { @@ -10328,52 +10912,57 @@ "url": "https://github.com/fabpot", "type": "github" }, + { + "url": "https://github.com/nicolas-grekas", + "type": "github" + }, { "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", "type": "tidelift" } ], - "time": "2023-01-26T09:26:14+00:00" + "time": "2026-08-20T09:59:12+00:00" }, { - "name": "symfony/polyfill-intl-normalizer", - "version": "v1.28.0", + "name": "symfony/dependency-injection", + "version": "v8.1.5", "source": { "type": "git", - "url": "https://github.com/symfony/polyfill-intl-normalizer.git", - "reference": "8c4ad05dd0120b6a53c1ca374dca2ad0a1c4ed92" + "url": "https://github.com/symfony/dependency-injection.git", + "reference": "e79d512848b75f92374e473f8e9ead4202c965c5" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-intl-normalizer/zipball/8c4ad05dd0120b6a53c1ca374dca2ad0a1c4ed92", - "reference": "8c4ad05dd0120b6a53c1ca374dca2ad0a1c4ed92", + "url": "https://api.github.com/repos/symfony/dependency-injection/zipball/e79d512848b75f92374e473f8e9ead4202c965c5", + "reference": "e79d512848b75f92374e473f8e9ead4202c965c5", "shasum": "" }, "require": { - "php": ">=7.1" + "php": ">=8.4.1", + "psr/container": "^1.1|^2.0", + "symfony/deprecation-contracts": "^2.5|^3", + "symfony/service-contracts": "^3.6", + "symfony/var-exporter": "^8.1" }, - "suggest": { - "ext-intl": "For best performance" + "conflict": { + "ext-psr": "<1.1|>=2" }, - "type": "library", - "extra": { - "branch-alias": { - "dev-main": "1.28-dev" - }, - "thanks": { - "name": "symfony/polyfill", - "url": "https://github.com/symfony/polyfill" - } + "provide": { + "psr/container-implementation": "1.1|2.0", + "symfony/service-implementation": "1.1|2.0|3.0" + }, + "require-dev": { + "symfony/config": "^7.4|^8.0", + "symfony/expression-language": "^7.4|^8.0", + "symfony/yaml": "^7.4|^8.0" }, + "type": "library", "autoload": { - "files": [ - "bootstrap.php" - ], "psr-4": { - "Symfony\\Polyfill\\Intl\\Normalizer\\": "" + "Symfony\\Component\\DependencyInjection\\": "" }, - "classmap": [ - "Resources/stubs" + "exclude-from-classmap": [ + "/Tests/" ] }, "notification-url": "https://packagist.org/downloads/", @@ -10382,26 +10971,18 @@ ], "authors": [ { - "name": "Nicolas Grekas", - "email": "p@tchwork.com" + "name": "Fabien Potencier", + "email": "fabien@symfony.com" }, { "name": "Symfony Community", "homepage": "https://symfony.com/contributors" } ], - "description": "Symfony polyfill for intl's Normalizer class and related functions", + "description": "Allows you to standardize and centralize the way objects are constructed in your application", "homepage": "https://symfony.com", - "keywords": [ - "compatibility", - "intl", - "normalizer", - "polyfill", - "portable", - "shim" - ], "support": { - "source": "https://github.com/symfony/polyfill-intl-normalizer/tree/v1.28.0" + "source": "https://github.com/symfony/dependency-injection/tree/v8.1.5" }, "funding": [ { @@ -10412,53 +10993,48 @@ "url": "https://github.com/fabpot", "type": "github" }, + { + "url": "https://github.com/nicolas-grekas", + "type": "github" + }, { "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", "type": "tidelift" } ], - "time": "2023-01-26T09:26:14+00:00" + "time": "2026-08-21T17:47:34+00:00" }, { - "name": "symfony/polyfill-mbstring", - "version": "v1.28.0", + "name": "symfony/filesystem", + "version": "v8.1.5", "source": { "type": "git", - "url": "https://github.com/symfony/polyfill-mbstring.git", - "reference": "42292d99c55abe617799667f454222c54c60e229" + "url": "https://github.com/symfony/filesystem.git", + "reference": "6b2f4a0eeb28b5d74f90862592923a654bc629b3" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-mbstring/zipball/42292d99c55abe617799667f454222c54c60e229", - "reference": "42292d99c55abe617799667f454222c54c60e229", + "url": "https://api.github.com/repos/symfony/filesystem/zipball/6b2f4a0eeb28b5d74f90862592923a654bc629b3", + "reference": "6b2f4a0eeb28b5d74f90862592923a654bc629b3", "shasum": "" }, "require": { - "php": ">=7.1" - }, - "provide": { - "ext-mbstring": "*" + "php": ">=8.4.1", + "symfony/deprecation-contracts": "^2.5|^3", + "symfony/polyfill-ctype": "~1.8", + "symfony/polyfill-mbstring": "~1.8" }, - "suggest": { - "ext-mbstring": "For best performance" + "require-dev": { + "symfony/process": "^7.4|^8.0" }, "type": "library", - "extra": { - "branch-alias": { - "dev-main": "1.28-dev" - }, - "thanks": { - "name": "symfony/polyfill", - "url": "https://github.com/symfony/polyfill" - } - }, "autoload": { - "files": [ - "bootstrap.php" - ], "psr-4": { - "Symfony\\Polyfill\\Mbstring\\": "" - } + "Symfony\\Component\\Filesystem\\": "" + }, + "exclude-from-classmap": [ + "/Tests/" + ] }, "notification-url": "https://packagist.org/downloads/", "license": [ @@ -10466,25 +11042,18 @@ ], "authors": [ { - "name": "Nicolas Grekas", - "email": "p@tchwork.com" + "name": "Fabien Potencier", + "email": "fabien@symfony.com" }, { "name": "Symfony Community", "homepage": "https://symfony.com/contributors" - } - ], - "description": "Symfony polyfill for the Mbstring extension", - "homepage": "https://symfony.com", - "keywords": [ - "compatibility", - "mbstring", - "polyfill", - "portable", - "shim" + } ], + "description": "Provides basic utilities for the filesystem", + "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/polyfill-mbstring/tree/v1.28.0" + "source": "https://github.com/symfony/filesystem/tree/v8.1.5" }, "funding": [ { @@ -10495,49 +11064,44 @@ "url": "https://github.com/fabpot", "type": "github" }, + { + "url": "https://github.com/nicolas-grekas", + "type": "github" + }, { "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", "type": "tidelift" } ], - "time": "2023-07-28T09:04:16+00:00" + "time": "2026-08-21T12:16:08+00:00" }, { - "name": "symfony/polyfill-php73", - "version": "v1.28.0", + "name": "symfony/finder", + "version": "v8.1.5", "source": { "type": "git", - "url": "https://github.com/symfony/polyfill-php73.git", - "reference": "fe2f306d1d9d346a7fee353d0d5012e401e984b5" + "url": "https://github.com/symfony/finder.git", + "reference": "8d7acede2b2ae07605783d1c43e49b5767036474" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-php73/zipball/fe2f306d1d9d346a7fee353d0d5012e401e984b5", - "reference": "fe2f306d1d9d346a7fee353d0d5012e401e984b5", + "url": "https://api.github.com/repos/symfony/finder/zipball/8d7acede2b2ae07605783d1c43e49b5767036474", + "reference": "8d7acede2b2ae07605783d1c43e49b5767036474", "shasum": "" }, "require": { - "php": ">=7.1" + "php": ">=8.4.1" }, - "type": "library", - "extra": { - "branch-alias": { - "dev-main": "1.28-dev" - }, - "thanks": { - "name": "symfony/polyfill", - "url": "https://github.com/symfony/polyfill" - } + "require-dev": { + "symfony/filesystem": "^7.4|^8.0" }, + "type": "library", "autoload": { - "files": [ - "bootstrap.php" - ], "psr-4": { - "Symfony\\Polyfill\\Php73\\": "" + "Symfony\\Component\\Finder\\": "" }, - "classmap": [ - "Resources/stubs" + "exclude-from-classmap": [ + "/Tests/" ] }, "notification-url": "https://packagist.org/downloads/", @@ -10546,24 +11110,18 @@ ], "authors": [ { - "name": "Nicolas Grekas", - "email": "p@tchwork.com" + "name": "Fabien Potencier", + "email": "fabien@symfony.com" }, { "name": "Symfony Community", "homepage": "https://symfony.com/contributors" } ], - "description": "Symfony polyfill backporting some PHP 7.3+ features to lower PHP versions", + "description": "Finds files and directories via an intuitive fluent interface", "homepage": "https://symfony.com", - "keywords": [ - "compatibility", - "polyfill", - "portable", - "shim" - ], "support": { - "source": "https://github.com/symfony/polyfill-php73/tree/v1.28.0" + "source": "https://github.com/symfony/finder/tree/v8.1.5" }, "funding": [ { @@ -10574,38 +11132,45 @@ "url": "https://github.com/fabpot", "type": "github" }, + { + "url": "https://github.com/nicolas-grekas", + "type": "github" + }, { "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", "type": "tidelift" } ], - "time": "2023-01-26T09:26:14+00:00" + "time": "2026-08-21T12:16:08+00:00" }, { - "name": "symfony/polyfill-php80", - "version": "v1.28.0", + "name": "symfony/polyfill-deepclone", + "version": "v1.42.0", "source": { "type": "git", - "url": "https://github.com/symfony/polyfill-php80.git", - "reference": "6caa57379c4aec19c0a12a38b59b26487dcfe4b5" + "url": "https://github.com/symfony/polyfill-deepclone.git", + "reference": "70ba0627efc68e97ea392843458a2dd9d6dbd156" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-php80/zipball/6caa57379c4aec19c0a12a38b59b26487dcfe4b5", - "reference": "6caa57379c4aec19c0a12a38b59b26487dcfe4b5", + "url": "https://api.github.com/repos/symfony/polyfill-deepclone/zipball/70ba0627efc68e97ea392843458a2dd9d6dbd156", + "reference": "70ba0627efc68e97ea392843458a2dd9d6dbd156", "shasum": "" }, "require": { - "php": ">=7.1" + "php": ">=8.1" + }, + "provide": { + "ext-deepclone": "*" + }, + "suggest": { + "ext-deepclone": "For best performance" }, "type": "library", "extra": { - "branch-alias": { - "dev-main": "1.28-dev" - }, "thanks": { - "name": "symfony/polyfill", - "url": "https://github.com/symfony/polyfill" + "url": "https://github.com/symfony/polyfill", + "name": "symfony/polyfill" } }, "autoload": { @@ -10613,7 +11178,7 @@ "bootstrap.php" ], "psr-4": { - "Symfony\\Polyfill\\Php80\\": "" + "Symfony\\Polyfill\\DeepClone\\": "" }, "classmap": [ "Resources/stubs" @@ -10624,10 +11189,6 @@ "MIT" ], "authors": [ - { - "name": "Ion Bazan", - "email": "ion.bazan@gmail.com" - }, { "name": "Nicolas Grekas", "email": "p@tchwork.com" @@ -10637,16 +11198,17 @@ "homepage": "https://symfony.com/contributors" } ], - "description": "Symfony polyfill backporting some PHP 8.0+ features to lower PHP versions", + "description": "Symfony polyfill for the deepclone extension", "homepage": "https://symfony.com", "keywords": [ "compatibility", + "deepclone", "polyfill", "portable", "shim" ], "support": { - "source": "https://github.com/symfony/polyfill-php80/tree/v1.28.0" + "source": "https://github.com/symfony/polyfill-deepclone/tree/v1.42.0" }, "funding": [ { @@ -10657,38 +11219,39 @@ "url": "https://github.com/fabpot", "type": "github" }, + { + "url": "https://github.com/nicolas-grekas", + "type": "github" + }, { "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", "type": "tidelift" } ], - "time": "2023-01-26T09:26:14+00:00" + "time": "2026-08-07T06:33:24+00:00" }, { - "name": "symfony/polyfill-php81", - "version": "v1.28.0", + "name": "symfony/polyfill-php73", + "version": "v1.37.0", "source": { "type": "git", - "url": "https://github.com/symfony/polyfill-php81.git", - "reference": "7581cd600fa9fd681b797d00b02f068e2f13263b" + "url": "https://github.com/symfony/polyfill-php73.git", + "reference": "0f68c03565dcaaf25a890667542e8bd75fe7e5bb" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-php81/zipball/7581cd600fa9fd681b797d00b02f068e2f13263b", - "reference": "7581cd600fa9fd681b797d00b02f068e2f13263b", + "url": "https://api.github.com/repos/symfony/polyfill-php73/zipball/0f68c03565dcaaf25a890667542e8bd75fe7e5bb", + "reference": "0f68c03565dcaaf25a890667542e8bd75fe7e5bb", "shasum": "" }, "require": { - "php": ">=7.1" + "php": ">=7.2" }, "type": "library", "extra": { - "branch-alias": { - "dev-main": "1.28-dev" - }, "thanks": { - "name": "symfony/polyfill", - "url": "https://github.com/symfony/polyfill" + "url": "https://github.com/symfony/polyfill", + "name": "symfony/polyfill" } }, "autoload": { @@ -10696,7 +11259,7 @@ "bootstrap.php" ], "psr-4": { - "Symfony\\Polyfill\\Php81\\": "" + "Symfony\\Polyfill\\Php73\\": "" }, "classmap": [ "Resources/stubs" @@ -10716,7 +11279,7 @@ "homepage": "https://symfony.com/contributors" } ], - "description": "Symfony polyfill backporting some PHP 8.1+ features to lower PHP versions", + "description": "Symfony polyfill backporting some PHP 7.3+ features to lower PHP versions", "homepage": "https://symfony.com", "keywords": [ "compatibility", @@ -10725,7 +11288,7 @@ "shim" ], "support": { - "source": "https://github.com/symfony/polyfill-php81/tree/v1.28.0" + "source": "https://github.com/symfony/polyfill-php73/tree/v1.37.0" }, "funding": [ { @@ -10736,37 +11299,50 @@ "url": "https://github.com/fabpot", "type": "github" }, + { + "url": "https://github.com/nicolas-grekas", + "type": "github" + }, { "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", "type": "tidelift" } ], - "time": "2023-01-26T09:26:14+00:00" + "time": "2024-09-09T11:45:10+00:00" }, { - "name": "symfony/process", - "version": "v6.3.4", + "name": "symfony/polyfill-php81", + "version": "v1.38.1", "source": { "type": "git", - "url": "https://github.com/symfony/process.git", - "reference": "0b5c29118f2e980d455d2e34a5659f4579847c54" + "url": "https://github.com/symfony/polyfill-php81.git", + "reference": "6bfb9c766cacffbc8e118cb87217d08ed84e5cd7" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/process/zipball/0b5c29118f2e980d455d2e34a5659f4579847c54", - "reference": "0b5c29118f2e980d455d2e34a5659f4579847c54", + "url": "https://api.github.com/repos/symfony/polyfill-php81/zipball/6bfb9c766cacffbc8e118cb87217d08ed84e5cd7", + "reference": "6bfb9c766cacffbc8e118cb87217d08ed84e5cd7", "shasum": "" }, "require": { - "php": ">=8.1" + "php": ">=7.2" }, "type": "library", + "extra": { + "thanks": { + "url": "https://github.com/symfony/polyfill", + "name": "symfony/polyfill" + } + }, "autoload": { + "files": [ + "bootstrap.php" + ], "psr-4": { - "Symfony\\Component\\Process\\": "" + "Symfony\\Polyfill\\Php81\\": "" }, - "exclude-from-classmap": [ - "/Tests/" + "classmap": [ + "Resources/stubs" ] }, "notification-url": "https://packagist.org/downloads/", @@ -10775,18 +11351,24 @@ ], "authors": [ { - "name": "Fabien Potencier", - "email": "fabien@symfony.com" + "name": "Nicolas Grekas", + "email": "p@tchwork.com" }, { "name": "Symfony Community", "homepage": "https://symfony.com/contributors" } ], - "description": "Executes commands in sub-processes", + "description": "Symfony polyfill backporting some PHP 8.1+ features to lower PHP versions", "homepage": "https://symfony.com", + "keywords": [ + "compatibility", + "polyfill", + "portable", + "shim" + ], "support": { - "source": "https://github.com/symfony/process/tree/v6.3.4" + "source": "https://github.com/symfony/polyfill-php81/tree/v1.38.1" }, "funding": [ { @@ -10797,42 +11379,50 @@ "url": "https://github.com/fabpot", "type": "github" }, + { + "url": "https://github.com/nicolas-grekas", + "type": "github" + }, { "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", "type": "tidelift" } ], - "time": "2023-08-07T10:39:22+00:00" + "time": "2026-05-26T12:45:58+00:00" }, { - "name": "symfony/property-access", - "version": "v6.3.2", + "name": "symfony/polyfill-php84", + "version": "v1.38.1", "source": { "type": "git", - "url": "https://github.com/symfony/property-access.git", - "reference": "2dc4f9da444b8f8ff592e95d570caad67924f1d0" + "url": "https://github.com/symfony/polyfill-php84.git", + "reference": "f4e1dfaee5b74aba5964fe1fd4dfc7ba5e3085fa" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/property-access/zipball/2dc4f9da444b8f8ff592e95d570caad67924f1d0", - "reference": "2dc4f9da444b8f8ff592e95d570caad67924f1d0", + "url": "https://api.github.com/repos/symfony/polyfill-php84/zipball/f4e1dfaee5b74aba5964fe1fd4dfc7ba5e3085fa", + "reference": "f4e1dfaee5b74aba5964fe1fd4dfc7ba5e3085fa", "shasum": "" }, "require": { - "php": ">=8.1", - "symfony/deprecation-contracts": "^2.5|^3", - "symfony/property-info": "^5.4|^6.0" - }, - "require-dev": { - "symfony/cache": "^5.4|^6.0" + "php": ">=7.2" }, "type": "library", + "extra": { + "thanks": { + "url": "https://github.com/symfony/polyfill", + "name": "symfony/polyfill" + } + }, "autoload": { + "files": [ + "bootstrap.php" + ], "psr-4": { - "Symfony\\Component\\PropertyAccess\\": "" + "Symfony\\Polyfill\\Php84\\": "" }, - "exclude-from-classmap": [ - "/Tests/" + "classmap": [ + "Resources/stubs" ] }, "notification-url": "https://packagist.org/downloads/", @@ -10841,29 +11431,24 @@ ], "authors": [ { - "name": "Fabien Potencier", - "email": "fabien@symfony.com" + "name": "Nicolas Grekas", + "email": "p@tchwork.com" }, { "name": "Symfony Community", "homepage": "https://symfony.com/contributors" } ], - "description": "Provides functions to read and write from/to an object or array using a simple string notation", + "description": "Symfony polyfill backporting some PHP 8.4+ features to lower PHP versions", "homepage": "https://symfony.com", "keywords": [ - "access", - "array", - "extraction", - "index", - "injection", - "object", - "property", - "property-path", - "reflection" + "compatibility", + "polyfill", + "portable", + "shim" ], "support": { - "source": "https://github.com/symfony/property-access/tree/v6.3.2" + "source": "https://github.com/symfony/polyfill-php84/tree/v1.38.1" }, "funding": [ { @@ -10874,51 +11459,50 @@ "url": "https://github.com/fabpot", "type": "github" }, + { + "url": "https://github.com/nicolas-grekas", + "type": "github" + }, { "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", "type": "tidelift" } ], - "time": "2023-07-13T15:26:11+00:00" + "time": "2026-05-26T12:51:13+00:00" }, { - "name": "symfony/property-info", - "version": "v6.3.0", + "name": "symfony/polyfill-php85", + "version": "v1.41.0", "source": { "type": "git", - "url": "https://github.com/symfony/property-info.git", - "reference": "7f3a03716112269741fe2a809f8f791a371d1fcd" + "url": "https://github.com/symfony/polyfill-php85.git", + "reference": "255fab485aaa1006ed411040c42aecd7b5302d7a" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/property-info/zipball/7f3a03716112269741fe2a809f8f791a371d1fcd", - "reference": "7f3a03716112269741fe2a809f8f791a371d1fcd", + "url": "https://api.github.com/repos/symfony/polyfill-php85/zipball/255fab485aaa1006ed411040c42aecd7b5302d7a", + "reference": "255fab485aaa1006ed411040c42aecd7b5302d7a", "shasum": "" }, "require": { - "php": ">=8.1", - "symfony/string": "^5.4|^6.0" - }, - "conflict": { - "phpdocumentor/reflection-docblock": "<5.2", - "phpdocumentor/type-resolver": "<1.5.1", - "symfony/dependency-injection": "<5.4" - }, - "require-dev": { - "doctrine/annotations": "^1.10.4|^2", - "phpdocumentor/reflection-docblock": "^5.2", - "phpstan/phpdoc-parser": "^1.0", - "symfony/cache": "^5.4|^6.0", - "symfony/dependency-injection": "^5.4|^6.0", - "symfony/serializer": "^5.4|^6.0" + "php": ">=7.2" }, "type": "library", + "extra": { + "thanks": { + "url": "https://github.com/symfony/polyfill", + "name": "symfony/polyfill" + } + }, "autoload": { + "files": [ + "bootstrap.php" + ], "psr-4": { - "Symfony\\Component\\PropertyInfo\\": "" + "Symfony\\Polyfill\\Php85\\": "" }, - "exclude-from-classmap": [ - "/Tests/" + "classmap": [ + "Resources/stubs" ] }, "notification-url": "https://packagist.org/downloads/", @@ -10927,26 +11511,24 @@ ], "authors": [ { - "name": "Kévin Dunglas", - "email": "dunglas@gmail.com" + "name": "Nicolas Grekas", + "email": "p@tchwork.com" }, { "name": "Symfony Community", "homepage": "https://symfony.com/contributors" } ], - "description": "Extracts information about PHP class' properties using metadata of popular sources", + "description": "Symfony polyfill backporting some PHP 8.5+ features to lower PHP versions", "homepage": "https://symfony.com", "keywords": [ - "doctrine", - "phpdoc", - "property", - "symfony", - "type", - "validator" + "compatibility", + "polyfill", + "portable", + "shim" ], "support": { - "source": "https://github.com/symfony/property-info/tree/v6.3.0" + "source": "https://github.com/symfony/polyfill-php85/tree/v1.41.0" }, "funding": [ { @@ -10957,67 +11539,38 @@ "url": "https://github.com/fabpot", "type": "github" }, + { + "url": "https://github.com/nicolas-grekas", + "type": "github" + }, { "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", "type": "tidelift" } ], - "time": "2023-05-19T08:06:44+00:00" + "time": "2026-07-01T12:47:55+00:00" }, { - "name": "symfony/serializer", - "version": "v6.3.5", + "name": "symfony/process", + "version": "v8.1.5", "source": { "type": "git", - "url": "https://github.com/symfony/serializer.git", - "reference": "855fc058c8bdbb69f53834f2fdb3876c9bc0ab7c" + "url": "https://github.com/symfony/process.git", + "reference": "d863f5e70d7c87abb906ac11b61f83036093000b" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/serializer/zipball/855fc058c8bdbb69f53834f2fdb3876c9bc0ab7c", - "reference": "855fc058c8bdbb69f53834f2fdb3876c9bc0ab7c", + "url": "https://api.github.com/repos/symfony/process/zipball/d863f5e70d7c87abb906ac11b61f83036093000b", + "reference": "d863f5e70d7c87abb906ac11b61f83036093000b", "shasum": "" }, "require": { - "php": ">=8.1", - "symfony/deprecation-contracts": "^2.5|^3", - "symfony/polyfill-ctype": "~1.8" - }, - "conflict": { - "doctrine/annotations": "<1.12", - "phpdocumentor/reflection-docblock": "<3.2.2", - "phpdocumentor/type-resolver": "<1.4.0", - "symfony/dependency-injection": "<5.4", - "symfony/property-access": "<5.4", - "symfony/property-info": "<5.4.24|>=6,<6.2.11", - "symfony/uid": "<5.4", - "symfony/yaml": "<5.4" - }, - "require-dev": { - "doctrine/annotations": "^1.12|^2", - "phpdocumentor/reflection-docblock": "^3.2|^4.0|^5.0", - "symfony/cache": "^5.4|^6.0", - "symfony/config": "^5.4|^6.0", - "symfony/console": "^5.4|^6.0", - "symfony/dependency-injection": "^5.4|^6.0", - "symfony/error-handler": "^5.4|^6.0", - "symfony/filesystem": "^5.4|^6.0", - "symfony/form": "^5.4|^6.0", - "symfony/http-foundation": "^5.4|^6.0", - "symfony/http-kernel": "^5.4|^6.0", - "symfony/mime": "^5.4|^6.0", - "symfony/property-access": "^5.4|^6.0", - "symfony/property-info": "^5.4.24|^6.2.11", - "symfony/uid": "^5.4|^6.0", - "symfony/validator": "^5.4|^6.0", - "symfony/var-dumper": "^5.4|^6.0", - "symfony/var-exporter": "^5.4|^6.0", - "symfony/yaml": "^5.4|^6.0" + "php": ">=8.4.1" }, "type": "library", "autoload": { "psr-4": { - "Symfony\\Component\\Serializer\\": "" + "Symfony\\Component\\Process\\": "" }, "exclude-from-classmap": [ "/Tests/" @@ -11037,10 +11590,10 @@ "homepage": "https://symfony.com/contributors" } ], - "description": "Handles serializing and deserializing data structures, including object graphs, into array structures or other formats like XML and JSON.", + "description": "Executes commands in sub-processes", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/serializer/tree/v6.3.5" + "source": "https://github.com/symfony/process/tree/v8.1.5" }, "funding": [ { @@ -11051,50 +11604,46 @@ "url": "https://github.com/fabpot", "type": "github" }, + { + "url": "https://github.com/nicolas-grekas", + "type": "github" + }, { "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", "type": "tidelift" } ], - "time": "2023-09-29T16:18:53+00:00" + "time": "2026-08-21T17:47:34+00:00" }, { - "name": "symfony/service-contracts", - "version": "v3.3.0", + "name": "symfony/property-access", + "version": "v8.1.4", "source": { "type": "git", - "url": "https://github.com/symfony/service-contracts.git", - "reference": "40da9cc13ec349d9e4966ce18b5fbcd724ab10a4" + "url": "https://github.com/symfony/property-access.git", + "reference": "1a41232c678972b93ce499a504e19ea09dfcd0b2" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/service-contracts/zipball/40da9cc13ec349d9e4966ce18b5fbcd724ab10a4", - "reference": "40da9cc13ec349d9e4966ce18b5fbcd724ab10a4", + "url": "https://api.github.com/repos/symfony/property-access/zipball/1a41232c678972b93ce499a504e19ea09dfcd0b2", + "reference": "1a41232c678972b93ce499a504e19ea09dfcd0b2", "shasum": "" }, "require": { - "php": ">=8.1", - "psr/container": "^2.0" + "php": ">=8.4.1", + "symfony/property-info": "^7.4.4|^8.0.4" }, - "conflict": { - "ext-psr": "<1.1|>=2" + "require-dev": { + "symfony/cache": "^7.4|^8.0", + "symfony/var-exporter": "^7.4|^8.0" }, "type": "library", - "extra": { - "branch-alias": { - "dev-main": "3.4-dev" - }, - "thanks": { - "name": "symfony/contracts", - "url": "https://github.com/symfony/contracts" - } - }, "autoload": { "psr-4": { - "Symfony\\Contracts\\Service\\": "" + "Symfony\\Component\\PropertyAccess\\": "" }, "exclude-from-classmap": [ - "/Test/" + "/Tests/" ] }, "notification-url": "https://packagist.org/downloads/", @@ -11103,26 +11652,29 @@ ], "authors": [ { - "name": "Nicolas Grekas", - "email": "p@tchwork.com" + "name": "Fabien Potencier", + "email": "fabien@symfony.com" }, { "name": "Symfony Community", "homepage": "https://symfony.com/contributors" } ], - "description": "Generic abstractions related to writing services", + "description": "Provides functions to read and write from/to an object or array using a simple string notation", "homepage": "https://symfony.com", "keywords": [ - "abstractions", - "contracts", - "decoupling", - "interfaces", - "interoperability", - "standards" + "access", + "array", + "extraction", + "index", + "injection", + "object", + "property", + "property-path", + "reflection" ], "support": { - "source": "https://github.com/symfony/service-contracts/tree/v3.3.0" + "source": "https://github.com/symfony/property-access/tree/v8.1.4" }, "funding": [ { @@ -11133,35 +11685,51 @@ "url": "https://github.com/fabpot", "type": "github" }, + { + "url": "https://github.com/nicolas-grekas", + "type": "github" + }, { "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", "type": "tidelift" } ], - "time": "2023-05-23T14:45:45+00:00" + "time": "2026-07-30T12:40:56+00:00" }, { - "name": "symfony/stopwatch", - "version": "v6.3.0", + "name": "symfony/property-info", + "version": "v8.1.5", "source": { "type": "git", - "url": "https://github.com/symfony/stopwatch.git", - "reference": "fc47f1015ec80927ff64ba9094dfe8b9d48fe9f2" + "url": "https://github.com/symfony/property-info.git", + "reference": "b335f8e7fb1440ed3448fb33340efc6127678e53" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/stopwatch/zipball/fc47f1015ec80927ff64ba9094dfe8b9d48fe9f2", - "reference": "fc47f1015ec80927ff64ba9094dfe8b9d48fe9f2", + "url": "https://api.github.com/repos/symfony/property-info/zipball/b335f8e7fb1440ed3448fb33340efc6127678e53", + "reference": "b335f8e7fb1440ed3448fb33340efc6127678e53", "shasum": "" }, "require": { - "php": ">=8.1", - "symfony/service-contracts": "^2.5|^3" + "php": ">=8.4.1", + "symfony/string": "^7.4|^8.0", + "symfony/type-info": "^7.4.7|^8.0.7" + }, + "conflict": { + "phpdocumentor/reflection-docblock": "<5.2|>=7", + "phpdocumentor/type-resolver": "<1.5.1" + }, + "require-dev": { + "phpdocumentor/reflection-docblock": "^5.2|^6.0", + "phpstan/phpdoc-parser": "^1.0|^2.0", + "symfony/cache": "^7.4|^8.0", + "symfony/dependency-injection": "^7.4|^8.0", + "symfony/serializer": "^7.4|^8.0" }, "type": "library", "autoload": { "psr-4": { - "Symfony\\Component\\Stopwatch\\": "" + "Symfony\\Component\\PropertyInfo\\": "" }, "exclude-from-classmap": [ "/Tests/" @@ -11173,18 +11741,26 @@ ], "authors": [ { - "name": "Fabien Potencier", - "email": "fabien@symfony.com" + "name": "Kévin Dunglas", + "email": "dunglas@gmail.com" }, { "name": "Symfony Community", "homepage": "https://symfony.com/contributors" } ], - "description": "Provides a way to profile code", + "description": "Extracts information about PHP class' properties using metadata of popular sources", "homepage": "https://symfony.com", + "keywords": [ + "doctrine", + "phpdoc", + "property", + "symfony", + "type", + "validator" + ], "support": { - "source": "https://github.com/symfony/stopwatch/tree/v6.3.0" + "source": "https://github.com/symfony/property-info/tree/v8.1.5" }, "funding": [ { @@ -11195,51 +11771,72 @@ "url": "https://github.com/fabpot", "type": "github" }, + { + "url": "https://github.com/nicolas-grekas", + "type": "github" + }, { "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", "type": "tidelift" } ], - "time": "2023-02-16T10:14:28+00:00" + "time": "2026-08-21T17:47:34+00:00" }, { - "name": "symfony/string", - "version": "v6.3.5", + "name": "symfony/serializer", + "version": "v8.1.5", "source": { "type": "git", - "url": "https://github.com/symfony/string.git", - "reference": "13d76d0fb049051ed12a04bef4f9de8715bea339" + "url": "https://github.com/symfony/serializer.git", + "reference": "9c064d505c661e3e17aa8999870f4fb0ed05e024" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/string/zipball/13d76d0fb049051ed12a04bef4f9de8715bea339", - "reference": "13d76d0fb049051ed12a04bef4f9de8715bea339", + "url": "https://api.github.com/repos/symfony/serializer/zipball/9c064d505c661e3e17aa8999870f4fb0ed05e024", + "reference": "9c064d505c661e3e17aa8999870f4fb0ed05e024", "shasum": "" }, "require": { - "php": ">=8.1", - "symfony/polyfill-ctype": "~1.8", - "symfony/polyfill-intl-grapheme": "~1.0", - "symfony/polyfill-intl-normalizer": "~1.0", - "symfony/polyfill-mbstring": "~1.0" + "php": ">=8.4.1", + "symfony/deprecation-contracts": "^2.5|^3", + "symfony/polyfill-ctype": "^1.8" }, "conflict": { - "symfony/translation-contracts": "<2.5" - }, - "require-dev": { - "symfony/error-handler": "^5.4|^6.0", - "symfony/http-client": "^5.4|^6.0", - "symfony/intl": "^6.2", - "symfony/translation-contracts": "^2.5|^3.0", - "symfony/var-exporter": "^5.4|^6.0" + "phpdocumentor/reflection-docblock": "<5.2|>=7", + "phpdocumentor/type-resolver": "<1.5.1", + "symfony/property-access": "<8.1", + "symfony/property-info": "<7.4.15", + "symfony/type-info": "<7.4" + }, + "require-dev": { + "phpdocumentor/reflection-docblock": "^5.2|^6.0", + "phpstan/phpdoc-parser": "^1.0|^2.0", + "seld/jsonlint": "^1.10", + "symfony/cache": "^7.4|^8.0", + "symfony/config": "^7.4|^8.0", + "symfony/console": "^7.4|^8.0", + "symfony/dependency-injection": "^7.4|^8.0", + "symfony/error-handler": "^7.4|^8.0", + "symfony/filesystem": "^7.4|^8.0", + "symfony/form": "^7.4|^8.0", + "symfony/http-foundation": "^7.4|^8.0", + "symfony/http-kernel": "^7.4|^8.0", + "symfony/messenger": "^7.4|^8.0", + "symfony/mime": "^7.4|^8.0", + "symfony/property-access": "^8.1", + "symfony/property-info": "^7.4.15|~8.0.15|^8.1.2", + "symfony/translation-contracts": "^2.5|^3", + "symfony/type-info": "^7.4|^8.0", + "symfony/uid": "^7.4|^8.0", + "symfony/validator": "^7.4|^8.0", + "symfony/var-dumper": "^7.4|^8.0", + "symfony/var-exporter": "^7.4|^8.0", + "symfony/yaml": "^7.4|^8.0" }, "type": "library", "autoload": { - "files": [ - "Resources/functions.php" - ], "psr-4": { - "Symfony\\Component\\String\\": "" + "Symfony\\Component\\Serializer\\": "" }, "exclude-from-classmap": [ "/Tests/" @@ -11251,26 +11848,18 @@ ], "authors": [ { - "name": "Nicolas Grekas", - "email": "p@tchwork.com" + "name": "Fabien Potencier", + "email": "fabien@symfony.com" }, { "name": "Symfony Community", "homepage": "https://symfony.com/contributors" } ], - "description": "Provides an object-oriented API to strings and deals with bytes, UTF-8 code points and grapheme clusters in a unified way", + "description": "Handles serializing and deserializing data structures, including object graphs, into array structures or other formats like XML and JSON.", "homepage": "https://symfony.com", - "keywords": [ - "grapheme", - "i18n", - "string", - "unicode", - "utf-8", - "utf8" - ], "support": { - "source": "https://github.com/symfony/string/tree/v6.3.5" + "source": "https://github.com/symfony/serializer/tree/v8.1.5" }, "funding": [ { @@ -11281,37 +11870,45 @@ "url": "https://github.com/fabpot", "type": "github" }, + { + "url": "https://github.com/nicolas-grekas", + "type": "github" + }, { "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", "type": "tidelift" } ], - "time": "2023-09-18T10:38:32+00:00" + "time": "2026-08-22T09:06:25+00:00" }, { - "name": "symfony/var-exporter", - "version": "v6.3.4", + "name": "symfony/type-info", + "version": "v8.1.5", "source": { "type": "git", - "url": "https://github.com/symfony/var-exporter.git", - "reference": "df1f8aac5751871b83d30bf3e2c355770f8f0691" + "url": "https://github.com/symfony/type-info.git", + "reference": "ceb48db5b38d6a48640c414be0c69d53980ae5c5" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/var-exporter/zipball/df1f8aac5751871b83d30bf3e2c355770f8f0691", - "reference": "df1f8aac5751871b83d30bf3e2c355770f8f0691", + "url": "https://api.github.com/repos/symfony/type-info/zipball/ceb48db5b38d6a48640c414be0c69d53980ae5c5", + "reference": "ceb48db5b38d6a48640c414be0c69d53980ae5c5", "shasum": "" }, "require": { - "php": ">=8.1" + "php": ">=8.4.1", + "psr/container": "^1.1|^2.0" + }, + "conflict": { + "phpstan/phpdoc-parser": "<1.30" }, "require-dev": { - "symfony/var-dumper": "^5.4|^6.0" + "phpstan/phpdoc-parser": "^1.30|^2.0" }, "type": "library", "autoload": { "psr-4": { - "Symfony\\Component\\VarExporter\\": "" + "Symfony\\Component\\TypeInfo\\": "" }, "exclude-from-classmap": [ "/Tests/" @@ -11323,28 +11920,28 @@ ], "authors": [ { - "name": "Nicolas Grekas", - "email": "p@tchwork.com" + "name": "Mathias Arlaud", + "email": "mathias.arlaud@gmail.com" + }, + { + "name": "Baptiste LEDUC", + "email": "baptiste.leduc@gmail.com" }, { "name": "Symfony Community", "homepage": "https://symfony.com/contributors" } ], - "description": "Allows exporting any serializable PHP data structure to plain PHP code", + "description": "Extracts PHP types information.", "homepage": "https://symfony.com", "keywords": [ - "clone", - "construct", - "export", - "hydrate", - "instantiate", - "lazy-loading", - "proxy", - "serialize" + "PHPStan", + "phpdoc", + "symfony", + "type" ], "support": { - "source": "https://github.com/symfony/var-exporter/tree/v6.3.4" + "source": "https://github.com/symfony/type-info/tree/v8.1.5" }, "funding": [ { @@ -11355,45 +11952,45 @@ "url": "https://github.com/fabpot", "type": "github" }, + { + "url": "https://github.com/nicolas-grekas", + "type": "github" + }, { "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", "type": "tidelift" } ], - "time": "2023-08-16T18:14:47+00:00" + "time": "2026-08-21T17:47:34+00:00" }, { - "name": "symfony/yaml", - "version": "v6.3.3", + "name": "symfony/var-exporter", + "version": "v8.1.5", "source": { "type": "git", - "url": "https://github.com/symfony/yaml.git", - "reference": "e23292e8c07c85b971b44c1c4b87af52133e2add" + "url": "https://github.com/symfony/var-exporter.git", + "reference": "b8f7dd85493e8372c7c81a1547caaaf86b9c16d1" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/yaml/zipball/e23292e8c07c85b971b44c1c4b87af52133e2add", - "reference": "e23292e8c07c85b971b44c1c4b87af52133e2add", + "url": "https://api.github.com/repos/symfony/var-exporter/zipball/b8f7dd85493e8372c7c81a1547caaaf86b9c16d1", + "reference": "b8f7dd85493e8372c7c81a1547caaaf86b9c16d1", "shasum": "" }, "require": { - "php": ">=8.1", + "php": ">=8.4.1", "symfony/deprecation-contracts": "^2.5|^3", - "symfony/polyfill-ctype": "^1.8" - }, - "conflict": { - "symfony/console": "<5.4" + "symfony/polyfill-deepclone": "^1.40" }, "require-dev": { - "symfony/console": "^5.4|^6.0" + "symfony/property-access": "^7.4|^8.0", + "symfony/serializer": "^7.4|^8.0", + "symfony/var-dumper": "^7.4|^8.0" }, - "bin": [ - "Resources/bin/yaml-lint" - ], "type": "library", "autoload": { "psr-4": { - "Symfony\\Component\\Yaml\\": "" + "Symfony\\Component\\VarExporter\\": "" }, "exclude-from-classmap": [ "/Tests/" @@ -11405,18 +12002,29 @@ ], "authors": [ { - "name": "Fabien Potencier", - "email": "fabien@symfony.com" + "name": "Nicolas Grekas", + "email": "p@tchwork.com" }, { "name": "Symfony Community", "homepage": "https://symfony.com/contributors" } ], - "description": "Loads and dumps YAML files", + "description": "Provides tools to export, instantiate, hydrate, clone and lazy-load PHP objects", "homepage": "https://symfony.com", + "keywords": [ + "clone", + "construct", + "deep-clone", + "export", + "hydrate", + "instantiate", + "lazy-loading", + "proxy", + "serialize" + ], "support": { - "source": "https://github.com/symfony/yaml/tree/v6.3.3" + "source": "https://github.com/symfony/var-exporter/tree/v8.1.5" }, "funding": [ { @@ -11427,167 +12035,101 @@ "url": "https://github.com/fabpot", "type": "github" }, + { + "url": "https://github.com/nicolas-grekas", + "type": "github" + }, { "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", "type": "tidelift" } ], - "time": "2023-07-31T07:08:24+00:00" + "time": "2026-08-13T16:11:28+00:00" }, { - "name": "thecodingmachine/phpstan-safe-rule", - "version": "v1.2.0", + "name": "symplify/phpstan-extensions", + "version": "12.0.2", "source": { "type": "git", - "url": "https://github.com/thecodingmachine/phpstan-safe-rule.git", - "reference": "8a7b88e0d54f209a488095085f183e9174c40e1e" + "url": "https://github.com/symplify/phpstan-extensions.git", + "reference": "5ce15cb084eb3bc7f92b77020c59ff3d318746d5" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/thecodingmachine/phpstan-safe-rule/zipball/8a7b88e0d54f209a488095085f183e9174c40e1e", - "reference": "8a7b88e0d54f209a488095085f183e9174c40e1e", + "url": "https://api.github.com/repos/symplify/phpstan-extensions/zipball/5ce15cb084eb3bc7f92b77020c59ff3d318746d5", + "reference": "5ce15cb084eb3bc7f92b77020c59ff3d318746d5", "shasum": "" }, "require": { - "php": "^7.1 || ^8.0", - "phpstan/phpstan": "^1.0", - "thecodingmachine/safe": "^1.0 || ^2.0" - }, - "require-dev": { - "php-coveralls/php-coveralls": "^2.1", - "phpunit/phpunit": "^7.5.2 || ^8.0", - "squizlabs/php_codesniffer": "^3.4" + "php": "^7.4 || ^8.0", + "phpstan/phpstan": "^2.0" }, "type": "phpstan-extension", "extra": { - "branch-alias": { - "dev-master": "1.1-dev" - }, "phpstan": { "includes": [ - "phpstan-safe-rule.neon" + "config/config.neon" ] } }, "autoload": { "psr-4": { - "TheCodingMachine\\Safe\\PHPStan\\": "src/" + "Symplify\\PHPStanExtensions\\": "src" } }, "notification-url": "https://packagist.org/downloads/", "license": [ "MIT" ], - "authors": [ - { - "name": "David Négrier", - "email": "d.negrier@thecodingmachine.com" - } + "description": "Pre-escaped error messages in 'symplify' error format, container aware test case and other useful extensions for PHPStan", + "keywords": [ + "phpstan-extension", + "static analysis" ], - "description": "A PHPStan rule to detect safety issues. Must be used in conjunction with thecodingmachine/safe", "support": { - "issues": "https://github.com/thecodingmachine/phpstan-safe-rule/issues", - "source": "https://github.com/thecodingmachine/phpstan-safe-rule/tree/v1.2.0" - }, - "time": "2022-01-17T10:12:29+00:00" - }, - { - "name": "thecodingmachine/phpstan-strict-rules", - "version": "v1.0.0", - "source": { - "type": "git", - "url": "https://github.com/thecodingmachine/phpstan-strict-rules.git", - "reference": "2ba8fa8b328c45f3b149c05def5bf96793c594b6" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/thecodingmachine/phpstan-strict-rules/zipball/2ba8fa8b328c45f3b149c05def5bf96793c594b6", - "reference": "2ba8fa8b328c45f3b149c05def5bf96793c594b6", - "shasum": "" - }, - "require": { - "php": "^7.1|^8.0", - "phpstan/phpstan": "^1.0" - }, - "require-dev": { - "php-coveralls/php-coveralls": "^2.1", - "phpunit/phpunit": "^7.1" + "issues": "https://github.com/symplify/phpstan-extensions/issues", + "source": "https://github.com/symplify/phpstan-extensions/tree/12.0.2" }, - "type": "phpstan-extension", - "extra": { - "branch-alias": { - "dev-master": "1.0-dev" + "funding": [ + { + "url": "https://www.paypal.me/rectorphp", + "type": "custom" }, - "phpstan": { - "includes": [ - "phpstan-strict-rules.neon" - ] - } - }, - "autoload": { - "psr-4": { - "TheCodingMachine\\PHPStan\\": "src/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ { - "name": "David Négrier", - "email": "d.negrier@thecodingmachine.com" + "url": "https://github.com/tomasvotruba", + "type": "github" } ], - "description": "A set of additional rules for PHPStan based on best practices followed at TheCodingMachine", - "support": { - "issues": "https://github.com/thecodingmachine/phpstan-strict-rules/issues", - "source": "https://github.com/thecodingmachine/phpstan-strict-rules/tree/v1.0.0" - }, - "time": "2021-11-08T09:10:49+00:00" + "abandoned": "symplify/phpstan-rules", + "time": "2025-11-12T16:46:04+00:00" }, { "name": "thecodingmachine/safe", - "version": "v2.5.0", + "version": "v3.4.0", "source": { "type": "git", "url": "https://github.com/thecodingmachine/safe.git", - "reference": "3115ecd6b4391662b4931daac4eba6b07a2ac1f0" + "reference": "705683a25bacf0d4860c7dea4d7947bfd09eea19" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/thecodingmachine/safe/zipball/3115ecd6b4391662b4931daac4eba6b07a2ac1f0", - "reference": "3115ecd6b4391662b4931daac4eba6b07a2ac1f0", + "url": "https://api.github.com/repos/thecodingmachine/safe/zipball/705683a25bacf0d4860c7dea4d7947bfd09eea19", + "reference": "705683a25bacf0d4860c7dea4d7947bfd09eea19", "shasum": "" }, "require": { - "php": "^8.0" + "php": "^8.1" }, "require-dev": { - "phpstan/phpstan": "^1.5", - "phpunit/phpunit": "^9.5", - "squizlabs/php_codesniffer": "^3.2", - "thecodingmachine/phpstan-strict-rules": "^1.0" + "php-parallel-lint/php-parallel-lint": "^1.4", + "phpstan/phpstan": "^2", + "phpunit/phpunit": "^10", + "squizlabs/php_codesniffer": "^3.2" }, "type": "library", - "extra": { - "branch-alias": { - "dev-master": "2.2.x-dev" - } - }, "autoload": { "files": [ - "deprecated/apc.php", - "deprecated/array.php", - "deprecated/datetime.php", - "deprecated/libevent.php", - "deprecated/misc.php", - "deprecated/password.php", - "deprecated/mssql.php", - "deprecated/stats.php", - "deprecated/strings.php", "lib/special_cases.php", - "deprecated/mysqli.php", "generated/apache.php", "generated/apcu.php", "generated/array.php", @@ -11627,6 +12169,7 @@ "generated/mbstring.php", "generated/misc.php", "generated/mysql.php", + "generated/mysqli.php", "generated/network.php", "generated/oci8.php", "generated/opcache.php", @@ -11639,6 +12182,7 @@ "generated/ps.php", "generated/pspell.php", "generated/readline.php", + "generated/rnp.php", "generated/rpminfo.php", "generated/rrd.php", "generated/sem.php", @@ -11670,7 +12214,6 @@ "lib/DateTime.php", "lib/DateTimeImmutable.php", "lib/Exceptions/", - "deprecated/Exceptions/", "generated/Exceptions/" ] }, @@ -11681,310 +12224,161 @@ "description": "PHP core functions that throw exceptions instead of returning FALSE on error", "support": { "issues": "https://github.com/thecodingmachine/safe/issues", - "source": "https://github.com/thecodingmachine/safe/tree/v2.5.0" - }, - "time": "2023-04-05T11:54:14+00:00" - }, - { - "name": "theseer/tokenizer", - "version": "1.2.1", - "source": { - "type": "git", - "url": "https://github.com/theseer/tokenizer.git", - "reference": "34a41e998c2183e22995f158c581e7b5e755ab9e" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/theseer/tokenizer/zipball/34a41e998c2183e22995f158c581e7b5e755ab9e", - "reference": "34a41e998c2183e22995f158c581e7b5e755ab9e", - "shasum": "" - }, - "require": { - "ext-dom": "*", - "ext-tokenizer": "*", - "ext-xmlwriter": "*", - "php": "^7.2 || ^8.0" - }, - "type": "library", - "autoload": { - "classmap": [ - "src/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause" - ], - "authors": [ - { - "name": "Arne Blankerts", - "email": "arne@blankerts.de", - "role": "Developer" - } - ], - "description": "A small library for converting tokenized PHP source code into XML and potentially other formats", - "support": { - "issues": "https://github.com/theseer/tokenizer/issues", - "source": "https://github.com/theseer/tokenizer/tree/1.2.1" + "source": "https://github.com/thecodingmachine/safe/tree/v3.4.0" }, "funding": [ { - "url": "https://github.com/theseer", + "url": "https://github.com/OskarStark", "type": "github" - } - ], - "time": "2021-07-28T10:34:58+00:00" - }, - { - "name": "twig/twig", - "version": "v3.7.1", - "source": { - "type": "git", - "url": "https://github.com/twigphp/Twig.git", - "reference": "a0ce373a0ca3bf6c64b9e3e2124aca502ba39554" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/twigphp/Twig/zipball/a0ce373a0ca3bf6c64b9e3e2124aca502ba39554", - "reference": "a0ce373a0ca3bf6c64b9e3e2124aca502ba39554", - "shasum": "" - }, - "require": { - "php": ">=7.2.5", - "symfony/polyfill-ctype": "^1.8", - "symfony/polyfill-mbstring": "^1.3" - }, - "require-dev": { - "psr/container": "^1.0|^2.0", - "symfony/phpunit-bridge": "^5.4.9|^6.3" - }, - "type": "library", - "autoload": { - "psr-4": { - "Twig\\": "src/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause" - ], - "authors": [ - { - "name": "Fabien Potencier", - "email": "fabien@symfony.com", - "homepage": "http://fabien.potencier.org", - "role": "Lead Developer" - }, - { - "name": "Twig Team", - "role": "Contributors" }, { - "name": "Armin Ronacher", - "email": "armin.ronacher@active-4.com", - "role": "Project Founder" - } - ], - "description": "Twig, the flexible, fast, and secure template language for PHP", - "homepage": "https://twig.symfony.com", - "keywords": [ - "templating" - ], - "support": { - "issues": "https://github.com/twigphp/Twig/issues", - "source": "https://github.com/twigphp/Twig/tree/v3.7.1" - }, - "funding": [ - { - "url": "https://github.com/fabpot", + "url": "https://github.com/shish", "type": "github" }, { - "url": "https://tidelift.com/funding/github/packagist/twig/twig", - "type": "tidelift" + "url": "https://github.com/silasjoisten", + "type": "github" + }, + { + "url": "https://github.com/staabm", + "type": "github" } ], - "time": "2023-08-28T11:09:02+00:00" + "time": "2026-02-04T18:08:13+00:00" }, { - "name": "vimeo/psalm", - "version": "5.15.0", + "name": "theseer/tokenizer", + "version": "2.0.1", "source": { "type": "git", - "url": "https://github.com/vimeo/psalm.git", - "reference": "5c774aca4746caf3d239d9c8cadb9f882ca29352" + "url": "https://github.com/theseer/tokenizer.git", + "reference": "7989e43bf381af0eac72e4f0ca5bcbfa81658be4" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/vimeo/psalm/zipball/5c774aca4746caf3d239d9c8cadb9f882ca29352", - "reference": "5c774aca4746caf3d239d9c8cadb9f882ca29352", + "url": "https://api.github.com/repos/theseer/tokenizer/zipball/7989e43bf381af0eac72e4f0ca5bcbfa81658be4", + "reference": "7989e43bf381af0eac72e4f0ca5bcbfa81658be4", "shasum": "" }, "require": { - "amphp/amp": "^2.4.2", - "amphp/byte-stream": "^1.5", - "composer-runtime-api": "^2", - "composer/semver": "^1.4 || ^2.0 || ^3.0", - "composer/xdebug-handler": "^2.0 || ^3.0", - "dnoegel/php-xdg-base-dir": "^0.1.1", - "ext-ctype": "*", "ext-dom": "*", - "ext-json": "*", - "ext-libxml": "*", - "ext-mbstring": "*", - "ext-simplexml": "*", "ext-tokenizer": "*", - "felixfbecker/advanced-json-rpc": "^3.1", - "felixfbecker/language-server-protocol": "^1.5.2", - "fidry/cpu-core-counter": "^0.4.1 || ^0.5.1", - "netresearch/jsonmapper": "^1.0 || ^2.0 || ^3.0 || ^4.0", - "nikic/php-parser": "^4.16", - "php": "^7.4 || ~8.0.0 || ~8.1.0 || ~8.2.0 || ~8.3.0", - "sebastian/diff": "^4.0 || ^5.0", - "spatie/array-to-xml": "^2.17.0 || ^3.0", - "symfony/console": "^4.1.6 || ^5.0 || ^6.0", - "symfony/filesystem": "^5.4 || ^6.0" - }, - "conflict": { - "nikic/php-parser": "4.17.0" - }, - "provide": { - "psalm/psalm": "self.version" - }, - "require-dev": { - "amphp/phpunit-util": "^2.0", - "bamarni/composer-bin-plugin": "^1.4", - "brianium/paratest": "^6.9", - "ext-curl": "*", - "mockery/mockery": "^1.5", - "nunomaduro/mock-final-classes": "^1.1", - "php-parallel-lint/php-parallel-lint": "^1.2", - "phpstan/phpdoc-parser": "^1.6", - "phpunit/phpunit": "^9.6", - "psalm/plugin-mockery": "^1.1", - "psalm/plugin-phpunit": "^0.18", - "slevomat/coding-standard": "^8.4", - "squizlabs/php_codesniffer": "^3.6", - "symfony/process": "^4.4 || ^5.0 || ^6.0" - }, - "suggest": { - "ext-curl": "In order to send data to shepherd", - "ext-igbinary": "^2.0.5 is required, used to serialize caching data" + "ext-xmlwriter": "*", + "php": "^8.1" }, - "bin": [ - "psalm", - "psalm-language-server", - "psalm-plugin", - "psalm-refactor", - "psalter" - ], "type": "library", - "extra": { - "branch-alias": { - "dev-master": "5.x-dev", - "dev-4.x": "4.x-dev", - "dev-3.x": "3.x-dev", - "dev-2.x": "2.x-dev", - "dev-1.x": "1.x-dev" - } - }, "autoload": { - "psr-4": { - "Psalm\\": "src/Psalm/" - } + "classmap": [ + "src/" + ] }, "notification-url": "https://packagist.org/downloads/", "license": [ - "MIT" + "BSD-3-Clause" ], "authors": [ { - "name": "Matthew Brown" + "name": "Arne Blankerts", + "email": "arne@blankerts.de", + "role": "Developer" } ], - "description": "A static analysis tool for finding errors in PHP applications", - "keywords": [ - "code", - "inspection", - "php", - "static analysis" - ], + "description": "A small library for converting tokenized PHP source code into XML and potentially other formats", "support": { - "issues": "https://github.com/vimeo/psalm/issues", - "source": "https://github.com/vimeo/psalm/tree/5.15.0" + "issues": "https://github.com/theseer/tokenizer/issues", + "source": "https://github.com/theseer/tokenizer/tree/2.0.1" }, - "time": "2023-08-20T23:07:30+00:00" + "funding": [ + { + "url": "https://github.com/theseer", + "type": "github" + } + ], + "time": "2025-12-08T11:19:18+00:00" }, { - "name": "webmozart/assert", - "version": "1.11.0", + "name": "tomasvotruba/type-coverage", + "version": "2.3.4", "source": { "type": "git", - "url": "https://github.com/webmozarts/assert.git", - "reference": "11cb2199493b2f8a3b53e7f19068fc6aac760991" + "url": "https://github.com/TomasVotruba/type-coverage.git", + "reference": "7b4aec57af15514dac9a3c5a9671da501444ecd0" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/webmozarts/assert/zipball/11cb2199493b2f8a3b53e7f19068fc6aac760991", - "reference": "11cb2199493b2f8a3b53e7f19068fc6aac760991", + "url": "https://api.github.com/repos/TomasVotruba/type-coverage/zipball/7b4aec57af15514dac9a3c5a9671da501444ecd0", + "reference": "7b4aec57af15514dac9a3c5a9671da501444ecd0", "shasum": "" }, "require": { - "ext-ctype": "*", - "php": "^7.2 || ^8.0" - }, - "conflict": { - "phpstan/phpstan": "<0.12.20", - "vimeo/psalm": "<4.6.1 || 4.6.2" + "php": "^8.4", + "phpstan/phpstan": "^2.2", + "webmozart/assert": "^1.11 || ^2.1" }, "require-dev": { - "phpunit/phpunit": "^8.5.13" + "doctrine/collections": "^2.3", + "phpstan/extension-installer": "^1.4", + "phpunit/phpunit": "^13.2", + "rector/jack": "^1.1", + "rector/rector": "^2.5", + "shipmonk/composer-dependency-analyser": "^1.8", + "symfony/dom-crawler": "^8.1", + "symfony/form": "^8.1", + "symplify/easy-coding-standard": "^13.2", + "tomasvotruba/unused-public": "^2.2", + "tracy/tracy": "^2.12" }, - "type": "library", + "type": "phpstan-extension", "extra": { - "branch-alias": { - "dev-master": "1.10-dev" + "phpstan": { + "includes": [ + "config/extension.neon" + ] } }, "autoload": { "psr-4": { - "Webmozart\\Assert\\": "src/" + "Rector\\TypePerfect\\": "packages/type-perfect/src", + "TomasVotruba\\TypeCoverage\\": "src" } }, "notification-url": "https://packagist.org/downloads/", "license": [ "MIT" ], - "authors": [ - { - "name": "Bernhard Schussek", - "email": "bschussek@gmail.com" - } - ], - "description": "Assertions to validate method input/output with nice error messages.", + "description": "Measure type coverage of your project", "keywords": [ - "assert", - "check", - "validate" + "phpstan-extension", + "static analysis" ], "support": { - "issues": "https://github.com/webmozarts/assert/issues", - "source": "https://github.com/webmozarts/assert/tree/1.11.0" + "issues": "https://github.com/TomasVotruba/type-coverage/issues", + "source": "https://github.com/TomasVotruba/type-coverage/tree/2.3.4" }, - "time": "2022-06-03T18:03:27+00:00" + "funding": [ + { + "url": "https://www.paypal.me/rectorphp", + "type": "custom" + }, + { + "url": "https://github.com/tomasvotruba", + "type": "github" + } + ], + "time": "2026-08-18T07:48:32+00:00" }, { "name": "webmozart/glob", - "version": "4.6.0", + "version": "4.7.0", "source": { "type": "git", "url": "https://github.com/webmozarts/glob.git", - "reference": "3c17f7dec3d9d0e87b575026011f2e75a56ed655" + "reference": "8a2842112d6916e61e0e15e316465b611f3abc17" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/webmozarts/glob/zipball/3c17f7dec3d9d0e87b575026011f2e75a56ed655", - "reference": "3c17f7dec3d9d0e87b575026011f2e75a56ed655", + "url": "https://api.github.com/repos/webmozarts/glob/zipball/8a2842112d6916e61e0e15e316465b611f3abc17", + "reference": "8a2842112d6916e61e0e15e316465b611f3abc17", "shasum": "" }, "require": { @@ -12018,40 +12412,49 @@ "description": "A PHP implementation of Ant's glob.", "support": { "issues": "https://github.com/webmozarts/glob/issues", - "source": "https://github.com/webmozarts/glob/tree/4.6.0" + "source": "https://github.com/webmozarts/glob/tree/4.7.0" }, - "time": "2022-05-24T19:45:58+00:00" + "time": "2024-03-07T20:33:40+00:00" }, { "name": "wyrihaximus/async-test-utilities", - "version": "7.2.0", + "version": "13.5.2", "source": { "type": "git", "url": "https://github.com/WyriHaximus/php-async-test-utilities.git", - "reference": "3cac9f58ec6674b4e30decd31958e4999cd22db7" + "reference": "89036249981c3d860510ad98748f5862b21574d4" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/WyriHaximus/php-async-test-utilities/zipball/3cac9f58ec6674b4e30decd31958e4999cd22db7", - "reference": "3cac9f58ec6674b4e30decd31958e4999cd22db7", + "url": "https://api.github.com/repos/WyriHaximus/php-async-test-utilities/zipball/89036249981c3d860510ad98748f5862b21574d4", + "reference": "89036249981c3d860510ad98748f5862b21574d4", "shasum": "" }, "require": { - "php": "^8.2", - "phpunit/phpunit": "^9.6.10", - "react/async": "^4.1.0", - "react/event-loop": "^1.4.0", - "react/promise": "^2.10 || ^3.0", - "wyrihaximus/test-utilities": "^5.5.4 || ^6" + "php": "^8.4", + "phpunit/phpunit": "^13.2.6", + "react/async": "^4.3.0", + "react/event-loop": "^1.6.0", + "react/promise": "^3.3.0", + "wyrihaximus/phpstan-react": "^2.0.0", + "wyrihaximus/react-phpunit-run-tests-in-fiber": "^4.0.0", + "wyrihaximus/test-utilities": "^13.5.2" }, "conflict": { "composer/compoer": "<2.6.0" }, "require-dev": { - "react/promise-timer": "^1.10.0", - "wyrihaximus/iterator-or-array-to-array": "^1.2" + "react/promise-timer": "^1.11.0", + "wyrihaximus/makefiles": "^0.13.3" }, "type": "library", + "extra": { + "phpstan": { + "includes": [ + "extension.neon" + ] + } + }, "autoload": { "psr-4": { "WyriHaximus\\AsyncTestUtilities\\": "src/" @@ -12070,7 +12473,7 @@ "description": "Test utilities for api-clients packages", "support": { "issues": "https://github.com/WyriHaximus/php-async-test-utilities/issues", - "source": "https://github.com/WyriHaximus/php-async-test-utilities/tree/7.2.0" + "source": "https://github.com/WyriHaximus/php-async-test-utilities/tree/13.5.2" }, "funding": [ { @@ -12078,30 +12481,43 @@ "type": "github" } ], - "time": "2023-09-07T13:00:15+00:00" + "time": "2026-08-07T17:36:53+00:00" }, { "name": "wyrihaximus/coding-standard", - "version": "2.14.0", + "version": "4.3.0", "source": { "type": "git", "url": "https://github.com/WyriHaximus/php-coding-standard.git", - "reference": "7530678d70ced4d41540df0e60e8811d14813058" + "reference": "6efccf79994a0a4fc3692a47a5b72448900fdc38" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/WyriHaximus/php-coding-standard/zipball/7530678d70ced4d41540df0e60e8811d14813058", - "reference": "7530678d70ced4d41540df0e60e8811d14813058", + "url": "https://api.github.com/repos/WyriHaximus/php-coding-standard/zipball/6efccf79994a0a4fc3692a47a5b72448900fdc38", + "reference": "6efccf79994a0a4fc3692a47a5b72448900fdc38", "shasum": "" }, "require": { - "dealerdirect/phpcodesniffer-composer-installer": "^1.0.0", - "doctrine/coding-standard": "^12.0.0", - "php": "^8.1", - "slevomat/coding-standard": "^8.11.1", - "squizlabs/php_codesniffer": "^3.7.2" + "dealerdirect/phpcodesniffer-composer-installer": "^1.2.1", + "doctrine/coding-standard": "^14.0.0", + "php": "^8.4", + "slevomat/coding-standard": "^8.31.1", + "squizlabs/php_codesniffer": "^4.0.4" + }, + "require-dev": { + "wyrihaximus/makefiles": "^0.13.3" }, "type": "phpcodesniffer-standard", + "extra": { + "wyrihaximus": { + "supported-features": { + "code-style": false, + "unit-tests": false, + "static-analysis": false, + "composer-dependency-checkers": false + } + } + }, "notification-url": "https://packagist.org/downloads/", "license": [ "MIT" @@ -12109,7 +12525,7 @@ "description": "WyriHaximus Coding Standard", "support": { "issues": "https://github.com/WyriHaximus/php-coding-standard/issues", - "source": "https://github.com/WyriHaximus/php-coding-standard/tree/2.14.0" + "source": "https://github.com/WyriHaximus/php-coding-standard/tree/4.3.0" }, "funding": [ { @@ -12117,49 +12533,61 @@ "type": "github" } ], - "time": "2023-05-06T11:54:10+00:00" + "time": "2026-08-06T23:29:46+00:00" }, { - "name": "wyrihaximus/composer-update-bin-autoload-path", - "version": "1.1.1", + "name": "wyrihaximus/makefiles", + "version": "0.13.3", "source": { "type": "git", - "url": "https://github.com/WyriHaximus/php-composer-update-bin-autoload-path.git", - "reference": "33413e3af4f4d7ab4de3653a706aed57f51e84af" + "url": "https://github.com/WyriHaximus/Makefiles.git", + "reference": "258162a89005f0c0ff920d00e2e5cd851ebb74cf" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/WyriHaximus/php-composer-update-bin-autoload-path/zipball/33413e3af4f4d7ab4de3653a706aed57f51e84af", - "reference": "33413e3af4f4d7ab4de3653a706aed57f51e84af", + "url": "https://api.github.com/repos/WyriHaximus/Makefiles/zipball/258162a89005f0c0ff920d00e2e5cd851ebb74cf", + "reference": "258162a89005f0c0ff920d00e2e5cd851ebb74cf", "shasum": "" }, "require": { "composer-plugin-api": "^2", - "php": "^8 || ^7.4" + "ext-json": "^8.4", + "php": "^8.4" + }, + "conflict": { + "infection/infection": "<0.32.0" }, "require-dev": { - "wyrihaximus/test-utilities": "^3" + "wyrihaximus/test-utilities": "^13.4.0" }, "type": "composer-plugin", "extra": { - "class": "WyriHaximus\\Composer\\BinAutoloadPathUpdater", - "unused": [ - "php" - ] + "class": "WyriHaximus\\Makefiles\\Composer\\Installer", + "wyrihaximus": { + "supported-features": { + "composer-plugin": true + } + } }, "autoload": { "psr-4": { - "WyriHaximus\\Composer\\": "src" + "WyriHaximus\\Makefiles\\": "src" } }, "notification-url": "https://packagist.org/downloads/", "license": [ "MIT" ], - "description": "🏰 Composer plugin that fills a bin file with the absolute composer autoload path", + "authors": [ + { + "name": "Cees-Jan Kiewiet", + "email": "ceesjank@gmail.com" + } + ], + "description": "🧱 Makefile building blocks", "support": { - "issues": "https://github.com/WyriHaximus/php-composer-update-bin-autoload-path/issues", - "source": "https://github.com/WyriHaximus/php-composer-update-bin-autoload-path/tree/1.1.1" + "issues": "https://github.com/WyriHaximus/Makefiles/issues", + "source": "https://github.com/WyriHaximus/Makefiles/tree/0.13.3" }, "funding": [ { @@ -12167,50 +12595,53 @@ "type": "github" } ], - "time": "2021-03-14T20:55:38+00:00" + "time": "2026-07-29T18:27:30+00:00" }, { - "name": "wyrihaximus/phpstan-rules-wrapper", - "version": "3.3.0", + "name": "wyrihaximus/phpstan-no-safe", + "version": "1.1.0", "source": { "type": "git", - "url": "https://github.com/WyriHaximus/php-phpstan-rules-wrapper.git", - "reference": "8e65ee7749a3e10100f0abec58b7e53ee540c43d" + "url": "https://github.com/WyriHaximus/phpstan-no-safe.git", + "reference": "7f31edbca02397aa6297ba96906962f01d15c911" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/WyriHaximus/php-phpstan-rules-wrapper/zipball/8e65ee7749a3e10100f0abec58b7e53ee540c43d", - "reference": "8e65ee7749a3e10100f0abec58b7e53ee540c43d", + "url": "https://api.github.com/repos/WyriHaximus/phpstan-no-safe/zipball/7f31edbca02397aa6297ba96906962f01d15c911", + "reference": "7f31edbca02397aa6297ba96906962f01d15c911", "shasum": "" }, "require": { - "ergebnis/phpstan-rules": "^2.1.0", - "jangregor/phpstan-prophecy": "^1.0", - "pepakriz/phpstan-exception-rules": "^0.12.0", - "php": "^8.2", - "phpstan/phpstan-deprecation-rules": "^1.1.4", - "phpstan/phpstan-mockery": "^1.1", - "phpstan/phpstan-php-parser": "^1.1", - "phpstan/phpstan-phpunit": "^1.3.14", - "phpstan/phpstan-strict-rules": "^1.5.1", - "thecodingmachine/phpstan-safe-rule": "^1.2", - "thecodingmachine/phpstan-strict-rules": "^1.0" + "php": "^8.4" + }, + "require-dev": { + "jawira/case-converter": "^3.6", + "nikic/php-parser": "^5.6.1", + "phpstan/phpdoc-parser": "^2.2.0", + "wyrihaximus/makefiles": "^0.13.3", + "wyrihaximus/test-utilities": "^13.1.0" }, "type": "library", + "extra": { + "phpstan": { + "includes": [ + "extension.neon" + ] + } + }, + "autoload": { + "psr-4": { + "WyriHaximus\\PHPStan\\": "src/" + } + }, "notification-url": "https://packagist.org/downloads/", "license": [ "MIT" ], - "authors": [ - { - "name": "Cees-Jan Kiewiet", - "email": "ceesjank@gmail.com" - } - ], - "description": "🌯 PHPStan rules wrapper", + "description": "⛔🔐 PHPStan extension that detects and blocks any usage of `thecodingmachine/safe`", "support": { - "issues": "https://github.com/WyriHaximus/php-phpstan-rules-wrapper/issues", - "source": "https://github.com/WyriHaximus/php-phpstan-rules-wrapper/tree/3.3.0" + "issues": "https://github.com/WyriHaximus/phpstan-no-safe/issues", + "source": "https://github.com/WyriHaximus/phpstan-no-safe/tree/1.1.0" }, "funding": [ { @@ -12218,54 +12649,53 @@ "type": "github" } ], - "time": "2023-09-26T09:07:47+00:00" + "time": "2026-08-07T14:23:53+00:00" }, { - "name": "wyrihaximus/react-awaitable-observable", - "version": "1.0.0", + "name": "wyrihaximus/phpstan-react", + "version": "2.0.0", "source": { "type": "git", - "url": "https://github.com/WyriHaximus/reactphp-awaitable-observable.git", - "reference": "d8423f506342f15d4c30a4da404bd25f457caddb" + "url": "https://github.com/WyriHaximus/phpstan-reactphp.git", + "reference": "1b7464948b62b569e049d576da967bd980d7d2a9" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/WyriHaximus/reactphp-awaitable-observable/zipball/d8423f506342f15d4c30a4da404bd25f457caddb", - "reference": "d8423f506342f15d4c30a4da404bd25f457caddb", + "url": "https://api.github.com/repos/WyriHaximus/phpstan-reactphp/zipball/1b7464948b62b569e049d576da967bd980d7d2a9", + "reference": "1b7464948b62b569e049d576da967bd980d7d2a9", "shasum": "" }, "require": { - "php": "^8.1", - "react/async": "^4", - "react/promise": "^2.9", - "reactivex/rxphp": "^2.0.10" + "php": "^8.3" }, "require-dev": { - "wyrihaximus/async-test-utilities": "^5.0.11" + "jawira/case-converter": "^3.5", + "nikic/php-parser": "^5.4.0", + "phpstan/phpdoc-parser": "^2.1.0", + "wyrihaximus/makefiles": "^0.3.0", + "wyrihaximus/test-utilities": "^7.0.0" }, "type": "library", + "extra": { + "phpstan": { + "includes": [ + "extension.neon" + ] + } + }, "autoload": { - "files": [ - "src/functions_include.php" - ], "psr-4": { - "WyriHaximus\\React\\": "src/" + "WyriHaximus\\React\\PHPStan\\": "src/" } }, "notification-url": "https://packagist.org/downloads/", "license": [ "MIT" ], - "authors": [ - { - "name": "Cees-Jan Kiewiet", - "email": "ceesjank@gmail.com" - } - ], - "description": "🛠️ Make observables foreachable using async & await", + "description": "👎 ReactPHP extension for PHPStan", "support": { - "issues": "https://github.com/WyriHaximus/reactphp-awaitable-observable/issues", - "source": "https://github.com/WyriHaximus/reactphp-awaitable-observable/tree/1.0.0" + "issues": "https://github.com/WyriHaximus/phpstan-reactphp/issues", + "source": "https://github.com/WyriHaximus/phpstan-reactphp/tree/2.0.0" }, "funding": [ { @@ -12273,36 +12703,45 @@ "type": "github" } ], - "time": "2022-08-11T13:15:09+00:00" + "time": "2025-04-26T22:37:11+00:00" }, { - "name": "wyrihaximus/simple-twig", - "version": "2.1.0", + "name": "wyrihaximus/phpstan-rules-wrapper", + "version": "14.5.0", "source": { "type": "git", - "url": "https://github.com/WyriHaximus/php-simple-twig.git", - "reference": "aa0d055c13a25b0318aa55edaea13fe12af15939" + "url": "https://github.com/WyriHaximus/php-phpstan-rules-wrapper.git", + "reference": "24c4878d3410c845a269d12311083aac766a4a1c" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/WyriHaximus/php-simple-twig/zipball/aa0d055c13a25b0318aa55edaea13fe12af15939", - "reference": "aa0d055c13a25b0318aa55edaea13fe12af15939", + "url": "https://api.github.com/repos/WyriHaximus/php-phpstan-rules-wrapper/zipball/24c4878d3410c845a269d12311083aac766a4a1c", + "reference": "24c4878d3410c845a269d12311083aac766a4a1c", "shasum": "" }, "require": { - "php": "^8 || ^7.4", - "twig/twig": "^3.3.2" - }, - "require-dev": { - "wyrihaximus/test-utilities": "^3.7.3" + "ergebnis/phpstan-rules": "^2.13.1", + "php": "^8.4", + "phpstan/extension-installer": "^1.4.3", + "phpstan/phpstan": "^2.2.9", + "phpstan/phpstan-deprecation-rules": "^2.0.5", + "phpstan/phpstan-mockery": "^2.0.0", + "phpstan/phpstan-phpunit": "^2.0.18", + "phpstan/phpstan-strict-rules": "^2.0.12", + "shipmonk/dead-code-detector": "^1.3.3", + "shipmonk/phpstan-rules": "^4.4.0", + "staabm/phpstan-psr3": "^1.0.3", + "symplify/phpstan-extensions": "^12.0.2", + "tomasvotruba/type-coverage": "^2.3.4", + "wyrihaximus/phpstan-no-safe": "^1.1.0", + "yamadashy/phpstan-friendly-formatter": "^1.4.0" }, "type": "library", - "autoload": { - "files": [ - "src/functions_include.php" - ], - "psr-4": { - "WyriHaximus\\Twig\\": "src/" + "extra": { + "phpstan": { + "includes": [ + "extension.neon" + ] } }, "notification-url": "https://packagist.org/downloads/", @@ -12315,10 +12754,10 @@ "email": "ceesjank@gmail.com" } ], - "description": "🌱 Wrapper around Twig making rendering a string template trivial", + "description": "🌯 PHPStan rules wrapper", "support": { - "issues": "https://github.com/WyriHaximus/php-simple-twig/issues", - "source": "https://github.com/WyriHaximus/php-simple-twig/tree/2.1.0" + "issues": "https://github.com/WyriHaximus/php-phpstan-rules-wrapper/issues", + "source": "https://github.com/WyriHaximus/php-phpstan-rules-wrapper/tree/14.5.0" }, "funding": [ { @@ -12326,38 +12765,40 @@ "type": "github" } ], - "time": "2021-09-08T22:05:38+00:00" + "time": "2026-08-22T12:54:27+00:00" }, { - "name": "wyrihaximus/subsplit-tools", - "version": "dev-main", + "name": "wyrihaximus/react-phpunit-run-tests-in-fiber", + "version": "4.0.0", "source": { "type": "git", - "url": "https://github.com/WyriHaximus/php-subsplit-tools.git", - "reference": "22db9bbeced36051af9eb13f8cc4d5d6ec8c4765" + "url": "https://github.com/WyriHaximus/reactphp-phpunit-run-tests-in-fiber.git", + "reference": "9ff2c42452909ff0a19f74882c07a1833bd58941" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/WyriHaximus/php-subsplit-tools/zipball/22db9bbeced36051af9eb13f8cc4d5d6ec8c4765", - "reference": "22db9bbeced36051af9eb13f8cc4d5d6ec8c4765", + "url": "https://api.github.com/repos/WyriHaximus/reactphp-phpunit-run-tests-in-fiber/zipball/9ff2c42452909ff0a19f74882c07a1833bd58941", + "reference": "9ff2c42452909ff0a19f74882c07a1833bd58941", "shasum": "" }, "require": { - "api-clients/github": "^0.2@dev", - "devizzent/cebe-php-openapi": "^1", - "php": "^8.2", - "react/http": "^1.8", - "thecodingmachine/safe": "^2.4", - "wyrihaximus/simple-twig": "^2.1" + "php": "^8.4", + "react/async": "^4.3.0", + "react/event-loop": "^1.5.0", + "react/promise": "^3.3" + }, + "conflict": { + "phpunit/phpunit": "<13" }, "require-dev": { - "wyrihaximus/test-utilities": "^5.4" + "react/promise-timer": "^1.11.0", + "wyrihaximus/makefiles": "^0.10.6", + "wyrihaximus/test-utilities": "^13.0.0" }, - "default-branch": true, "type": "library", "autoload": { "psr-4": { - "WyriHaximus\\SubSplitTools\\": "src/" + "WyriHaximus\\React\\PHPUnit\\": "src/" } }, "notification-url": "https://packagist.org/downloads/", @@ -12370,10 +12811,10 @@ "email": "ceesjank@gmail.com" } ], - "description": "Tools to do initial code generation for sub split set up", + "description": "Trait to run all tests in a fiber", "support": { - "issues": "https://github.com/WyriHaximus/php-subsplit-tools/issues", - "source": "https://github.com/WyriHaximus/php-subsplit-tools/tree/main" + "issues": "https://github.com/WyriHaximus/reactphp-phpunit-run-tests-in-fiber/issues", + "source": "https://github.com/WyriHaximus/reactphp-phpunit-run-tests-in-fiber/tree/4.0.0" }, "funding": [ { @@ -12381,74 +12822,66 @@ "type": "github" } ], - "time": "2023-10-05T10:18:29+00:00" + "time": "2026-06-08T21:25:02+00:00" }, { "name": "wyrihaximus/test-utilities", - "version": "5.6.0", + "version": "13.5.2", "source": { "type": "git", "url": "https://github.com/WyriHaximus/php-test-utilities.git", - "reference": "5b6d2484119f72625307b096b8297c933cc765d6" + "reference": "e87f761d9ac480fba66e94913ec5879716a87e64" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/WyriHaximus/php-test-utilities/zipball/5b6d2484119f72625307b096b8297c933cc765d6", - "reference": "5b6d2484119f72625307b096b8297c933cc765d6", + "url": "https://api.github.com/repos/WyriHaximus/php-test-utilities/zipball/e87f761d9ac480fba66e94913ec5879716a87e64", + "reference": "e87f761d9ac480fba66e94913ec5879716a87e64", "shasum": "" }, "require": { - "ergebnis/composer-normalize": "^2.33.0", - "icanhazstring/composer-unused": "^0.8.10", - "infection/infection": "^0.27.0", - "jakobbuis/simple-slow-test-reporter": "^1.0", - "maglnet/composer-require-checker": "^4.6.0", - "nunomaduro/collision": "^7.1.0", - "orklah/psalm-insane-comparison": "^2.2.0", - "php": "^8.2", - "php-coveralls/php-coveralls": "^2.6.0", - "php-parallel-lint/php-console-highlighter": "^1.0", - "php-parallel-lint/php-parallel-lint": "^1.3.2", - "php-standard-library/psalm-plugin": "^1.1.5 || ^2.2.1", - "phpspec/prophecy": "^1.17", - "phpspec/prophecy-phpunit": "^2.0.2", - "phpstan/phpstan": "^1.10.26", - "phpunit/phpunit": "^9.6.10", - "psalm/plugin-phpunit": "^0.18.4", - "roave/backward-compatibility-check": "^8.3.0", - "roave/infection-static-analysis-plugin": "^1.32.0", - "squizlabs/php_codesniffer": "^3.7.2", - "thecodingmachine/safe": "^2.5.0", - "vimeo/psalm": "^5.13.1", - "wyrihaximus/coding-standard": "^2.14.0", - "wyrihaximus/phpstan-rules-wrapper": "^3.0.0" + "composer-plugin-api": "^2", + "ergebnis/composer-normalize": "^2.52.0", + "ergebnis/phpunit-slow-test-detector": "^2.24.0", + "ext-hash": "^8.4", + "ext-json": "^8.4", + "icanhazstring/composer-unused": "^0.9.6", + "infection/infection": "^0.34.2", + "maglnet/composer-require-checker": "^4.20.0", + "mockery/mockery": "^1.6.12", + "php": "^8.4", + "php-parallel-lint/php-console-highlighter": "^1.0.0", + "php-parallel-lint/php-parallel-lint": "^1.4.0", + "phpstan/phpstan": "^2.2.8", + "phpunit/phpunit": "^13.3.0", + "rector/rector": "^2.6.1", + "roave/backward-compatibility-check": "^8.19.0", + "squizlabs/php_codesniffer": "^4.0.4", + "wyrihaximus/coding-standard": "^4.3.0", + "wyrihaximus/phpstan-rules-wrapper": "^14.4.0" }, "conflict": { - "symfony/dependency-injection": "<5.0.0" + "composer-unused/symbol-parser": "<0.3.3", + "composer/composer": "<2.10.2", + "composer/pcre": "<3.3.2", + "sanmai/di-container": "<0.1.17", + "sanmai/pipeline": "<7.9", + "wyrihaximus/makefiles": "<0.5.0" }, - "type": "library", + "require-dev": { + "wyrihaximus/makefiles": "^0.13.3" + }, + "suggest": { + "wyrihaximus/async-test-utilities": "The recommended addition to this package when building ReactPHP packages and projects.", + "wyrihaximus/makefiles": "Provides autogenerated Makefile utilizing all utilities provided through this package." + }, + "type": "composer-plugin", "extra": { - "unused": [ - "ergebnis/composer-normalize", - "icanhazstring/composer-unused", - "infection/infection", - "jakobbuis/simple-slow-test-reporter", - "maglnet/composer-require-checker", - "nunomaduro/collision", - "orklah/psalm-insane-comparison", - "php-coveralls/php-coveralls", - "php-parallel-lint/php-console-highlighter", - "php-parallel-lint/php-parallel-lint", - "php-standard-library/psalm-plugin", - "phpstan/phpstan", - "psalm/plugin-phpunit", - "roave/backward-compatibility-check", - "roave/infection-static-analysis-plugin", - "squizlabs/php_codesniffer", - "vimeo/psalm", - "wyrihaximus/coding-standard", - "wyrihaximus/phpstan-rules-wrapper" - ] + "class": "WyriHaximus\\TestUtilities\\Composer\\Installer", + "phpstan": { + "includes": [ + "extension.neon" + ] + } }, "autoload": { "psr-4": { @@ -12468,7 +12901,7 @@ "description": "🛠️ Test utilities for api-clients packages", "support": { "issues": "https://github.com/WyriHaximus/php-test-utilities/issues", - "source": "https://github.com/WyriHaximus/php-test-utilities/tree/5.6.0" + "source": "https://github.com/WyriHaximus/php-test-utilities/tree/13.5.2" }, "funding": [ { @@ -12476,25 +12909,84 @@ "type": "github" } ], - "time": "2023-07-26T21:51:43+00:00" + "time": "2026-08-07T14:59:43+00:00" + }, + { + "name": "yamadashy/phpstan-friendly-formatter", + "version": "v1.4.0", + "source": { + "type": "git", + "url": "https://github.com/yamadashy/phpstan-friendly-formatter.git", + "reference": "cd4882c7293591c13230b5be35e742b33d2ab2ff" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/yamadashy/phpstan-friendly-formatter/zipball/cd4882c7293591c13230b5be35e742b33d2ab2ff", + "reference": "cd4882c7293591c13230b5be35e742b33d2ab2ff", + "shasum": "" + }, + "require": { + "php": "^8.1", + "php-parallel-lint/php-console-highlighter": "^0.3 || ^0.4 || ^0.5 || ^1.0", + "phpstan/phpstan": "^1.0 || ^2.0" + }, + "require-dev": { + "friendsofphp/php-cs-fixer": "^3.93.0", + "phpstan/phpstan-phpunit": "^2.0.12", + "phpunit/phpunit": "^10.0 || ^11.0" + }, + "type": "phpstan-extension", + "extra": { + "phpstan": { + "includes": [ + "extension.neon" + ] + } + }, + "autoload": { + "psr-4": { + "Yamadashy\\PhpStanFriendlyFormatter\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Kazuki Yamada", + "email": "koukun0120@gmail.com" + } + ], + "description": "Simple error formatter for PHPStan that display code frame", + "keywords": [ + "PHPStan", + "package", + "php", + "static analysis" + ], + "support": { + "issues": "https://github.com/yamadashy/phpstan-friendly-formatter/issues", + "source": "https://github.com/yamadashy/phpstan-friendly-formatter/tree/v1.4.0" + }, + "time": "2026-01-26T15:12:47+00:00" } ], - "packages-dev": [], "aliases": [], - "minimum-stability": "stable", + "minimum-stability": "dev", "stability-flags": { "api-clients/github": 20, "api-clients/openapi-client-utils": 20, - "wyrihaximus/subsplit-tools": 20 + "openapi-tools/generator-psr-15-webhook-middleware": 20 }, - "prefer-stable": false, + "prefer-stable": true, "prefer-lowest": false, "platform": { - "php": "^8.2" + "php": "^8.4" }, - "platform-dev": [], + "platform-dev": {}, "platform-overrides": { - "php": "8.2.13" + "php": "8.4.13" }, - "plugin-api-version": "2.3.0" + "plugin-api-version": "2.9.0" } diff --git a/etc/Makefile b/etc/Makefile new file mode 100644 index 0000000..31efd76 --- /dev/null +++ b/etc/Makefile @@ -0,0 +1,18 @@ +OPENAPI_GENERATOR=$(DOCKER_RUN) php ./vendor/bin/openapi-generator + +generate-example-clients: generate-example-client-one generate-example-client-subsplit generate-example-client-miele + +generate-example-client-one: + $(OPENAPI_GENERATOR) ./example/openapi-client-one.php + +generate-example-client-subsplit: + $(OPENAPI_GENERATOR) ./example/openapi-client-subsplit.php + +generate-example-client-miele: + $(OPENAPI_GENERATOR) ./example/openapi-client-miele.php + +generate-test-client: + $(OPENAPI_GENERATOR) ./tests/openapi-client-petstore.php + +generate-packages: + $(OPENAPI_GENERATOR) ./example/client-gitub-one.php diff --git a/etc/ci/markdown-link-checker.json b/etc/ci/markdown-link-checker.json index fecc007..9269e03 100644 --- a/etc/ci/markdown-link-checker.json +++ b/etc/ci/markdown-link-checker.json @@ -1,15 +1,12 @@ { - "ignorePatterns": [ - { - "pattern": "^(.*){{[^}]+([^{])*}}(.*)$" - } - ], - "httpHeaders": [ - { - "urls": ["https://docs.github.com/"], - "headers": { - "Accept-Encoding": "zstd, br, gzip, deflate" - } - } - ] + "httpHeaders": [ + { + "urls": [ + "https://docs.github.com/" + ], + "headers": { + "Accept-Encoding": "zstd, br, gzip, deflate" + } + } + ] } diff --git a/etc/qa/composer-require-checker.json b/etc/qa/composer-require-checker.json index 85b3904..57da4f6 100644 --- a/etc/qa/composer-require-checker.json +++ b/etc/qa/composer-require-checker.json @@ -3,8 +3,17 @@ "null", "true", "false", "static", "self", "parent", "array", "string", "int", "float", "bool", "iterable", "callable", "void", "object", - "Safe\\date", "WyriHaximus\\Constants\\Boolean\\FALSE_", "WyriHaximus\\Constants\\Boolean\\TRUE_", - "WyriHaximus\\Constants\\Numeric\\ONE", "WyriHaximus\\Constants\\Numeric\\ZERO" + "PHPStan\\Analyser\\Scope", + "PHPStan\\PhpDoc\\TypeStringResolver", + "PHPStan\\Reflection\\MethodReflection", + "PHPStan\\Type\\DynamicMethodReturnTypeExtension", + "PHPStan\\Type\\Type", + "Prophecy\\Argument", + "React\\Stream\\ReadableStreamInterface", + "Symfony\\Component\\Console\\Formatter\\OutputFormatterInterface", + "Symfony\\Component\\Console\\Output\\ConsoleOutput", + "Symfony\\Component\\Console\\Output\\OutputInterface", + "WyriHaximus\\AsyncTestUtilities\\AsyncTestCase" ], "php-core-extensions" : [ "Core", diff --git a/etc/qa/composer-unused.php b/etc/qa/composer-unused.php new file mode 100644 index 0000000..f60d94e --- /dev/null +++ b/etc/qa/composer-unused.php @@ -0,0 +1,14 @@ + $config + ->addNamedFilter(NamedFilter::fromString('api-clients/github')) + ->addNamedFilter(NamedFilter::fromString('delight-im/random')) + ->addNamedFilter(NamedFilter::fromString('react/async')) + ->addNamedFilter(NamedFilter::fromString('ringcentral/psr7')) + ->addNamedFilter(NamedFilter::fromString('twig/twig')) + ->addNamedFilter(NamedFilter::fromString('wyrihaximus/react-awaitable-observable')); diff --git a/etc/qa/infection.json5 b/etc/qa/infection.json5 new file mode 100644 index 0000000..3526bd0 --- /dev/null +++ b/etc/qa/infection.json5 @@ -0,0 +1,21 @@ +{ + "timeout": 120, + "source": { + "directories": [ + "../../src" + ] + }, + "logs": { + "text": "../../var/infection.log", + "summary": "../../var/infection-summary.log", + "json": "../../var/infection.json", + "perMutator": "../../var/infection-per-mutator.md", + "github": true + }, + "minMsi": 100, + "minCoveredMsi": 100, + "ignoreMsiWithNoMutations": true, + "mutators": { + "@default": true + } +} diff --git a/etc/qa/phpcs.xml b/etc/qa/phpcs.xml index 8794baf..30a944f 100644 --- a/etc/qa/phpcs.xml +++ b/etc/qa/phpcs.xml @@ -3,13 +3,16 @@ - + + ../../etc ../../src ../../tests - */tests/app/* - */tests/test-app/* + + */tests/app/* + */tests/test-app/* + */etc/qa/stubs/* diff --git a/etc/qa/phpstan.neon b/etc/qa/phpstan.neon index 8e45712..9e2f22e 100644 --- a/etc/qa/phpstan.neon +++ b/etc/qa/phpstan.neon @@ -1,16 +1,51 @@ parameters: + level: max + paths: + - ../../etc + - ../../src + - ../../tests excludePaths: - - ../../tests/app/* - - ../../tests/test-app/* - ignoreErrors: - - '#cebe\\openapi\\spec\\Reference#' - - '#Call to function in_array\(\) requires parameter \#3 to be true.#' - - '#with a nullable type declaration.#' - - '#Casting class ReflectionType to string is deprecated.#' + analyseAndScan: + - ../../tests/app + - ../../tests/test-app + - ../../src/phpstan-assertType-mock.php + stubFiles: + - stubs/prophecy.stub.php ergebnis: noExtends: classesAllowedToBeExtended: - - ApiClients\Tools\OpenApiClientGenerator\Contract\Voter\AbstractListOperation - - PhpParser\Builder\Param -includes: - - ../../vendor/wyrihaximus/async-test-utilities/rules.neon + - ApiClients\Tools\OpenApiClientGenerator\Contract\Voter\AbstractListOperation + ignoreErrors: + - + identifier: shipmonk.deadMethod + path: ../../src/Contract/* + - + identifier: shipmonk.deadMethod + path: ../../src/Output/* + - + identifier: shipmonk.deadMethod + path: ../../src/State/* + - + identifier: shipmonk.deadMethod + path: ../../src/SectionGenerator/* + - + identifier: shipmonk.deadMethod + path: ../../src/Voter/* + - + identifier: shipmonk.deadMethod + path: ../../src/ConfigurationFactory.php + - + identifier: shipmonk.deadMethod + path: ../../src/Generator/Helper/Types.php + - + identifier: shipmonk.deadProperty.neverRead + path: ../../src/State/File.php + - + identifier: wyrihaximus.reactphp.blocking.function.fileGetContents + path: ../../tests/* + - + identifier: wyrihaximus.reactphp.blocking.function.filePutContents + path: ../../src/Output/Error.php + - + identifier: missingType.iterableValue + path: ../../src/Output/Status/OverWritingOutPut.php diff --git a/etc/qa/phpunit.xml b/etc/qa/phpunit.xml index 8f3ceb3..9c6027d 100644 --- a/etc/qa/phpunit.xml +++ b/etc/qa/phpunit.xml @@ -1,13 +1,27 @@ - + - ../../tests/unit/ + ../../tests/unit - - + + ../../src/ - - + + + + + diff --git a/etc/qa/psalm.xml b/etc/qa/psalm.xml deleted file mode 100644 index ab7c765..0000000 --- a/etc/qa/psalm.xml +++ /dev/null @@ -1,52 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/etc/qa/rector.php b/etc/qa/rector.php new file mode 100644 index 0000000..ce6b5c9 --- /dev/null +++ b/etc/qa/rector.php @@ -0,0 +1,7 @@ + 0 %} @@ -63,15 +64,18 @@ "config": { "sort-packages": true, "platform": { - "php": "8.2.13" + "php": "8.4.13" }, "allow-plugins": { - "dealerdirect/phpcodesniffer-composer-installer": true, "composer/package-versions-deprecated": true, + "dealerdirect/phpcodesniffer-composer-installer": true, "ergebnis/composer-normalize": true, "icanhazstring/composer-unused": true, + "infection/extension-installer": true, + "phpstan/extension-installer": true, "wyrihaximus/composer-update-bin-autoload-path": true, - "infection/extension-installer": true + "wyrihaximus/makefiles": true, + "wyrihaximus/test-utilities": true } } } diff --git a/example/templates/etc/qa/rector.php b/example/templates/etc/qa/rector.php new file mode 100644 index 0000000..61d7c18 --- /dev/null +++ b/example/templates/etc/qa/rector.php @@ -0,0 +1 @@ +withoutParallel(); diff --git a/src/ClassString.php b/src/ClassString.php deleted file mode 100644 index c334c65..0000000 --- a/src/ClassString.php +++ /dev/null @@ -1,41 +0,0 @@ -source, '\\') . '\\' . $relative), - Utils::cleanUpNamespace(trim($namespace->test, '\\') . '\\' . $relative), - ); - - return new self( - $namespace, - new Namespace_( - Utils::dirname($fullyQualified->source), - Utils::dirname($fullyQualified->test), - ), - $fullyQualified, - $relative, - Utils::basename($relative), - ); - } - - private function __construct( - public Namespace_ $baseNamespaces, - public Namespace_ $namespace, - public Namespace_ $fullyQualified, - public string $relative, - public string $className, - ) { - } -} diff --git a/src/Configuration.php b/src/Configuration.php deleted file mode 100644 index a993bb2..0000000 --- a/src/Configuration.php +++ /dev/null @@ -1,39 +0,0 @@ ->|null $contentType */ - public function __construct( - public State $state, - public string $spec, - #[MapFrom('entryPoints')] - public EntryPoints $entryPoints, - public Templates|null $templates, - public Namespace_ $namespace, - public Destination $destination, - #[MapFrom('contentType')] - public array|null $contentType, - #[MapFrom('subSplit')] - public SubSplit|null $subSplit, - public Schemas|null $schemas, - public Voter|null $voter, - public QA|null $qa, - ) { - } -} diff --git a/src/Configuration/Destination.php b/src/Configuration/Destination.php deleted file mode 100644 index 4477248..0000000 --- a/src/Configuration/Destination.php +++ /dev/null @@ -1,15 +0,0 @@ - $additionalFiles */ - public function __construct( - public string $file, - #[MapFrom('additionalFiles')] - #[CastListToType('string')] - public array|null $additionalFiles, - ) { - } -} diff --git a/src/Configuration/SubSplit.php b/src/Configuration/SubSplit.php deleted file mode 100644 index 1dbc648..0000000 --- a/src/Configuration/SubSplit.php +++ /dev/null @@ -1,34 +0,0 @@ ->|null $sectionGenerator */ - public function __construct( - #[MapFrom('subSplitsDestination')] - public string $subSplitsDestination, - public string $branch, - #[MapFrom('targetVersion')] - public string $targetVersion, - #[MapFrom('subSplitConfiguration')] - public string $subSplitConfiguration, - #[MapFrom('fullName')] - public string $fullName, - public string $vendor, - #[MapFrom('sectionGenerator')] - public array|null $sectionGenerator, - #[MapFrom('rootPackage')] - public RootPackage $rootPackage, - #[MapFrom('sectionPackage')] - public SectionPackage $sectionPackage, - ) { - } -} diff --git a/src/Configuration/SubSplit/RootPackage.php b/src/Configuration/SubSplit/RootPackage.php deleted file mode 100644 index 2cad1dc..0000000 --- a/src/Configuration/SubSplit/RootPackage.php +++ /dev/null @@ -1,14 +0,0 @@ -|null $variables */ - public function __construct( - public string $dir, - public array|null $variables, - ) { - } -} diff --git a/src/Configuration/Voter.php b/src/Configuration/Voter.php deleted file mode 100644 index 6c59e7c..0000000 --- a/src/Configuration/Voter.php +++ /dev/null @@ -1,23 +0,0 @@ ->|null $listOperation - * @param array>|null $streamOperation - */ - public function __construct( - #[MapFrom('listOperation')] - public array|null $listOperation, - #[MapFrom('streamOperation')] - public array|null $streamOperation, - ) { - } -} diff --git a/src/ConfigurationFactory.php b/src/ConfigurationFactory.php new file mode 100644 index 0000000..e922476 --- /dev/null +++ b/src/ConfigurationFactory.php @@ -0,0 +1,277 @@ + $yaml */ + public static function fromYaml(array $yaml, string $configurationDirectory): Configuration + { + $builderFactory = new BuilderFactory(); + + /** @var array{file: string, additionalFiles?: list} $stateConfig */ + $stateConfig = $yaml['state']; + + /** @var array{source: string, test: string} $namespaceConfig */ + $namespaceConfig = $yaml['namespace']; + + /** @var array{root: string, source: string, test: string} $destinationConfig */ + $destinationConfig = $yaml['destination']; + + /** @var array{call?: bool, operations?: bool, webHooks?: bool, webHookMiddleware?: bool|array{paths?: list}} $entryPoints */ + $entryPoints = $yaml['entryPoints'] ?? []; + + $call = $entryPoints['call'] ?? false; + $operations = $entryPoints['operations'] ?? false; + $webHooks = $entryPoints['webHooks'] ?? false; + + $webHookMiddlewarePaths = self::webHookMiddlewarePaths($entryPoints['webHookMiddleware'] ?? false); + if ($webHookMiddlewarePaths !== null) { + $webHooks = true; + } + + /** @var array{dir?: string, variables?: array}|null $templatesConfig */ + $templatesConfig = $yaml['templates'] ?? null; + + /** @var array{allowDuplication?: bool, useAliasesForDuplication?: bool} $schemasConfig */ + $schemasConfig = $yaml['schemas'] ?? []; + + /** @var array $qaConfig */ + $qaConfig = $yaml['qa'] ?? []; + + $variables = is_array($templatesConfig) ? ($templatesConfig['variables'] ?? null) : null; + if (! is_array($variables)) { + $variables = null; + } + + $packageName = 'client'; + $fullName = 'Client'; + if ($variables !== null) { + if (is_string($variables['packageName'] ?? null)) { + $packageName = $variables['packageName']; + } + + if (is_string($variables['fullName'] ?? null)) { + $fullName = $variables['fullName']; + } elseif (is_string($variables['fullname'] ?? null)) { + $fullName = $variables['fullname']; + } + } + + if ($webHookMiddlewarePaths !== null) { + $variables ??= []; + /** @var list $existingRequires */ + $existingRequires = is_array($variables['requires'] ?? null) ? $variables['requires'] : []; + $requiredPackages = [ + 'openapi-tools/contract' => ['name' => 'openapi-tools/contract', 'version' => 'dev-main'], + 'psr/http-server-handler' => ['name' => 'psr/http-server-handler', 'version' => '^2 || ^1'], + 'psr/http-server-middleware' => ['name' => 'psr/http-server-middleware', 'version' => '^2 || ^1'], + ]; + + foreach ($existingRequires as $require) { + unset($requiredPackages[$require['name']]); + } + + $variables['requires'] = [...$existingRequires, ...array_values($requiredPackages)]; + } + + $templates = null; + if (is_array($templatesConfig) && array_key_exists('dir', $templatesConfig)) { + $templates = new Templates( + $configurationDirectory . $templatesConfig['dir'], + $variables, + ); + } + + $generators = [ + new Schema($builderFactory), + new Hydrator($builderFactory, $webHookMiddlewarePaths === null), + new GeneratorTemplates(), + new Paths($builderFactory, $call, $operations), + new ClientInterface($builderFactory, $call, $operations), + new Client($builderFactory, $call, $operations), + ]; + + if ($webHooks) { + if ($webHookMiddlewarePaths === null) { + $generators[] = new WebHooks($builderFactory); + $generators[] = new WebHook($builderFactory); + } + } + + if ($webHookMiddlewarePaths !== null) { + $generators[] = new WebHookMiddlewareGenerator($builderFactory, $webHookMiddlewarePaths); + } + + /** @var array{listOperation?: list>, streamOperation?: list}|null $voterConfig */ + $voterConfig = $yaml['voter'] ?? null; + + if (! is_string($yaml['spec'])) { + throw new InvalidArgumentException('Configuration must contain a string spec path.'); + } + + $gathering = new Gathering( + $yaml['spec'], + is_array($voterConfig) + ? new Voter( + $voterConfig['listOperation'] ?? null, + $voterConfig['streamOperation'] ?? null, + ) + : null, + new Schemas( + $schemasConfig['allowDuplication'] ?? false, + $schemasConfig['useAliasesForDuplication'] ?? false, + ), + ); + + $package = new Package( + new Metadata( + $fullName, + $fullName . ' API client', + [], + ), + 'api-clients', + $packageName, + null, + null, + null, + $templates, + new Destination( + $destinationConfig['root'], + $destinationConfig['source'], + $destinationConfig['test'], + ), + new Namespace_( + $namespaceConfig['source'], + $namespaceConfig['test'], + ), + self::qaFromYaml($qaConfig), + new PackageState($stateConfig['additionalFiles'] ?? []), + $generators, + ); + + return new Configuration( + new State($stateConfig['file']), + $gathering, + [$package], + ); + } + + public static function fromYamlFile(string $configurationFile): Configuration + { + /** @var array $yaml */ + $yaml = Yaml::parseFile($configurationFile); + + return self::fromYaml($yaml, dirname($configurationFile) . DIRECTORY_SEPARATOR); + } + + /** @return list|null */ + private static function webHookMiddlewarePaths(mixed $config): array|null + { + if ($config === false || $config === null) { + return null; + } + + if ($config === true) { + return ['/webhook']; + } + + if (! is_array($config)) { + throw new InvalidArgumentException('entryPoints.webHookMiddleware must be a boolean or an object with an optional paths list.'); + } + + if (! array_key_exists('paths', $config)) { + return ['/webhook']; + } + + $paths = $config['paths']; + if (! is_array($paths)) { + throw new InvalidArgumentException('entryPoints.webHookMiddleware.paths must be a list of strings.'); + } + + /** @var list $normalizedPaths */ + $normalizedPaths = []; + foreach ($paths as $path) { + if (! is_string($path)) { + throw new InvalidArgumentException('entryPoints.webHookMiddleware.paths must be a list of strings.'); + } + + $normalizedPaths[] = $path; + } + + return $normalizedPaths; + } + + /** @param array $qaConfig */ + private static function qaFromYaml(array $qaConfig): QA + { + return new QA( + self::toolFromConfigOrNull($qaConfig['phpcs'] ?? null), + self::toolFromConfigOrNull($qaConfig['phpstan'] ?? null), + self::toolFromConfigOrNull($qaConfig['psalm'] ?? null), + ); + } + + private static function toolFromConfigOrNull(mixed $config): Tool|null + { + if (! is_array($config)) { + return null; + } + + /** @var array $typedConfig */ + $typedConfig = $config; + + return self::toolFromConfig($typedConfig); + } + + /** @param array $config */ + private static function toolFromConfig(array $config): Tool + { + $configFilePath = null; + if (array_key_exists('configFilePath', $config) && is_string($config['configFilePath'])) { + $configFilePath = $config['configFilePath']; + } + + return new Tool( + ($config['enabled'] ?? false) === true, + $configFilePath, + ); + } +} diff --git a/src/ContentType/Json.php b/src/ContentType/Json.php index 19d08eb..0c345e3 100644 --- a/src/ContentType/Json.php +++ b/src/ContentType/Json.php @@ -8,6 +8,7 @@ use PhpParser\Node; use PhpParser\Node\Arg; use PhpParser\Node\Expr; +use PhpParser\Node\Expr\FuncCall; final class Json implements ContentType { @@ -18,7 +19,7 @@ public static function contentType(): iterable yield 'application/scim+json'; } - public static function parse(Expr $expr): Expr + public static function parse(Expr $expr): FuncCall { return new Node\Expr\FuncCall( new Node\Name('json_decode'), diff --git a/src/Contract/SectionGenerator.php b/src/Contract/SectionGenerator.php index 875fd83..8b6c05d 100644 --- a/src/Contract/SectionGenerator.php +++ b/src/Contract/SectionGenerator.php @@ -4,12 +4,11 @@ namespace ApiClients\Tools\OpenApiClientGenerator\Contract; -use ApiClients\Tools\OpenApiClientGenerator\Representation\Path; -use ApiClients\Tools\OpenApiClientGenerator\Representation\WebHook; +use OpenAPITools\Representation; interface SectionGenerator { - public static function path(Path $path): string|false; + public static function path(Representation\Namespaced\Path $path): string|false; - public static function webHook(WebHook ...$webHooks): string|false; + public static function webHook(Representation\WebHook ...$webHooks): string|false; } diff --git a/src/Contract/Voter/AbstractListOperation.php b/src/Contract/Voter/AbstractListOperation.php index be1aa5b..7bd5036 100644 --- a/src/Contract/Voter/AbstractListOperation.php +++ b/src/Contract/Voter/AbstractListOperation.php @@ -4,22 +4,26 @@ namespace ApiClients\Tools\OpenApiClientGenerator\Contract\Voter; -use ApiClients\Tools\OpenApiClientGenerator\Representation\Operation; -use ApiClients\Tools\OpenApiClientGenerator\Representation\PropertyType; -use ApiClients\Tools\OpenApiClientGenerator\Representation\Schema; +use OpenAPITools\Representation\Namespaced\Operation; +use OpenAPITools\Representation\Namespaced\Schema; use function array_key_exists; +use function in_array; abstract class AbstractListOperation implements ListOperation { final public static function list(Operation $operation): bool { foreach ($operation->response as $response) { - if ($response->code === 200 && $response->content instanceof Schema) { + if ($response->code !== 200) { + continue; + } + + if ($response->content instanceof Schema) { return false; } - if ($response->code === 200 && $response->content instanceof PropertyType && $response->content->type !== 'array') { + if ($response->content->type !== 'array') { return false; } } @@ -41,12 +45,6 @@ final public static function list(Operation $operation): bool $match[$parameter->name] = true; } - foreach ($match as $matched) { - if ($matched === false) { - return false; - } - } - - return true; + return ! in_array(false, $match, true); } } diff --git a/src/Contract/Voter/ListOperation.php b/src/Contract/Voter/ListOperation.php index d1f1bcc..c7adf2c 100644 --- a/src/Contract/Voter/ListOperation.php +++ b/src/Contract/Voter/ListOperation.php @@ -4,7 +4,7 @@ namespace ApiClients\Tools\OpenApiClientGenerator\Contract\Voter; -use ApiClients\Tools\OpenApiClientGenerator\Representation\Operation; +use OpenAPITools\Representation\Namespaced\Operation; interface ListOperation { diff --git a/src/Contract/Voter/StreamOperation.php b/src/Contract/Voter/StreamOperation.php index 6711bf8..6ebc315 100644 --- a/src/Contract/Voter/StreamOperation.php +++ b/src/Contract/Voter/StreamOperation.php @@ -4,7 +4,7 @@ namespace ApiClients\Tools\OpenApiClientGenerator\Contract\Voter; -use ApiClients\Tools\OpenApiClientGenerator\Representation\Operation; +use OpenAPITools\Representation\Namespaced\Operation; interface StreamOperation { diff --git a/src/File.php b/src/File.php deleted file mode 100644 index a2a50ea..0000000 --- a/src/File.php +++ /dev/null @@ -1,17 +0,0 @@ -servers ?? [] as $server) { - if (strlen($server->url) === 0) { - continue; - } - - $baseUrl = $server->url; - break; - } - - return new \ApiClients\Tools\OpenApiClientGenerator\Representation\Client( - $baseUrl, - $paths, - ); - } -} diff --git a/src/Gatherer/CompositSchema.php b/src/Gatherer/CompositSchema.php deleted file mode 100644 index 5e5ec33..0000000 --- a/src/Gatherer/CompositSchema.php +++ /dev/null @@ -1,97 +0,0 @@ -type === 'array'; - $properties = []; - $example = []; - - if ($isArray) { - $schema = $schema->items; - } - - foreach ($schema->properties as $propertyName => $property) { - $gatheredProperty = Property::gather( - $baseNamespace, - $className, - (string) $propertyName, - in_array( - (string) $propertyName, - $schema->required ?? [], - false, - ), - $property, - $schemaRegistry, - $contractRegistry, - $compositSchemaRegistry, - ); - $properties[] = $gatheredProperty; - - $example[$gatheredProperty->sourceName] = $gatheredProperty->example->raw; - - foreach (['examples', 'example'] as $examplePropertyName) { - if (array_key_exists($gatheredProperty->sourceName, $example)) { - break; - } - - if (! property_exists($schema, $examplePropertyName) || ! is_array($schema->$examplePropertyName) || ! array_key_exists($gatheredProperty->sourceName, $schema->$examplePropertyName)) { - continue; - } - - $example[$gatheredProperty->sourceName] = $schema->$examplePropertyName[$gatheredProperty->sourceName]; - } - - foreach ($property->enum ?? [] as $value) { - $example[$gatheredProperty->sourceName] = $value; - break; - } - - if ($example[$gatheredProperty->sourceName] !== null || $schema->required) { - continue; - } - - unset($example[$gatheredProperty->sourceName]); - } - - return new Schema( - ClassString::factory($baseNamespace, 'Schema\\' . $className), - ClassString::factory($baseNamespace, 'Contract\\' . $className), - ClassString::factory($baseNamespace, 'Error\\' . $className), - ClassString::factory($baseNamespace, 'ErrorSchemas\\' . $className), - $schema->title ?? '', - $schema->description ?? '', - $example, - $properties, - $schema, - $isArray, - ($schema->type === null ? ['object'] : (is_array($schema->type) ? $schema->type : [$schema->type])), - ); - } -} diff --git a/src/Gatherer/ExampleData.php b/src/Gatherer/ExampleData.php deleted file mode 100644 index f9c4ec1..0000000 --- a/src/Gatherer/ExampleData.php +++ /dev/null @@ -1,232 +0,0 @@ -type === 'array' || $type->type === 'union') { - if ($type->payload instanceof Schema) { - $exampleData = ArrayMerger::doMerge( - $type->payload->example, - is_array($exampleData) ? $exampleData : [], - ArrayMerger::FLAG_OVERWRITE_NUMERIC_KEY | ArrayMerger::FLAG_ALLOW_SCALAR_TO_ARRAY_CONVERSION, - ); - } elseif ($type->payload instanceof PropertyType) { - return self::gather($exampleData, $type->payload, $propertyName); - } - - return new Representation\ExampleData($exampleData, $exampleData instanceof Node\Expr ? $exampleData : self::turnArrayIntoNode((array) $exampleData)); - } - - if ($type->payload instanceof Schema) { - $exampleData = ArrayMerger::doMerge($type->payload->example, is_array($exampleData) ? $exampleData : [], ArrayMerger::FLAG_OVERWRITE_NUMERIC_KEY | ArrayMerger::FLAG_ALLOW_SCALAR_TO_ARRAY_CONVERSION); - - return new Representation\ExampleData($exampleData, self::turnArrayIntoNode($exampleData)); - } - - if ($exampleData === null && $type->type === 'scalar' && is_string($type->payload)) { - return self::scalarData(strlen($propertyName), $type->payload, $type->format, $type->pattern); - } - - return self::determiteType($exampleData); - } - - public static function determiteType(mixed $exampleData): Representation\ExampleData - { - return match (gettype($exampleData)) { - 'boolean' => new Representation\ExampleData( - $exampleData, - new Node\Expr\ConstFetch( - new Node\Name( - $exampleData ? 'true' : 'false', - ), - ), - ), - 'integer' => new Representation\ExampleData( - $exampleData, - new Node\Scalar\LNumber($exampleData), - ), - 'double' => new Representation\ExampleData( - $exampleData, - new Node\Scalar\DNumber($exampleData), - ), - 'string' => new Representation\ExampleData( - $exampleData, - new Node\Scalar\String_($exampleData), - ), - 'array' => new Representation\ExampleData($exampleData, self::turnArrayIntoNode($exampleData)), - default => new Representation\ExampleData( - null, - new Node\Expr\ConstFetch( - new Node\Name( - 'null', - ), - ), - ), - }; - } - - /** @phpstan-ignore-next-line */ - public static function scalarData(int $seed, string $type, string|null $format, string|null $pattern = null): Representation\ExampleData - { - if (strpos($type, '|') !== false) { - [$firstType] = explode('|', $type); - - return self::scalarData($seed, $firstType, $format, $pattern); - } - - if ($type === 'int' || $type === '?int') { - return new Representation\ExampleData($seed, new Node\Scalar\LNumber($seed)); - } - - if ($type === 'float' || $type === '?float' || $type === 'int|float' || $type === 'null|int|float') { - return new Representation\ExampleData($seed / 10, new Node\Scalar\DNumber($seed / 10)); - } - - if ($type === 'bool' || $type === '?bool') { - return new Representation\ExampleData( - false, - new Node\Expr\ConstFetch( - new Node\Name( - 'false', - ), - ), - ); - } - - if ($type === 'string' || $type === '?string') { - if ($pattern !== null) { - $result = ''; - - /** @phpstan-ignore-next-line */ - @(new Parser(new Lexer($pattern), new Scope(), new Scope()))->parse()->getResult()->generate( - $result, - new IntegerReturnerPretendingToBeARandomNumberGenerator(strlen($pattern)), - ); - - return new Representation\ExampleData($result, new Node\Scalar\String_($result)); - } - - if ($format === 'uri') { - return new Representation\ExampleData('https://example.com/', new Node\Scalar\String_('https://example.com/')); - } - - if ($format === 'email') { - return new Representation\ExampleData('hi@example.com', new Node\Scalar\String_('hi@example.com')); - } - - if ($format === 'date-time') { - return new Representation\ExampleData(date(DateTimeInterface::RFC3339, 0), new Node\Scalar\String_(date(DateTimeInterface::RFC3339, 0))); - } - - if ($format === 'uuid') { - return new Representation\ExampleData('4ccda740-74c3-4cfa-8571-ebf83c8f300a', new Node\Scalar\String_('4ccda740-74c3-4cfa-8571-ebf83c8f300a')); - } - - if ($format === 'ipv4') { - return new Representation\ExampleData('127.0.0.1', new Node\Scalar\String_('127.0.0.1')); - } - - if ($format === 'ipv6') { - return new Representation\ExampleData('::1', new Node\Scalar\String_('::1')); - } - - return new Representation\ExampleData('generated', new Node\Scalar\String_('generated')); - } - - if ($type === 'array' || $type === '?array') { - $string = self::scalarData($seed, 'string', $format, $pattern); - - return new Representation\ExampleData( - [ - $string->raw, - ], - new Node\Expr\Array_( - [ - new Node\Expr\ArrayItem( - $string->node, - ), - ], - ), - ); - } - - return new Representation\ExampleData( - null, - new Node\Expr\ConstFetch( - new Node\Name( - 'null', - ), - ), - ); - } - - /** @param array $array */ - private static function turnArrayIntoNode(array $array): Node\Expr - { - return new Node\Expr\FuncCall( - new Node\Name('\json_decode'), - [ - new Node\Arg( - new Node\Scalar\String_( - json_encode([...self::arrayToRaw($array)]), - ), - ), - new Node\Arg( - new Node\Expr\ConstFetch( - new Node\Name( - 'false', - ), - ), - ), - ], - ); - } - - /** - * @param array $exampleData - * - * @return iterable - */ - private static function arrayToRaw(array $exampleData): iterable - { - foreach ($exampleData as $key => $value) { - if ($value instanceof Representation\ExampleData) { - $value = $value->raw; - } - - if (is_array($value)) { - $value = [...self::arrayToRaw($value)]; - } - - yield $key => $value; - } - } -} diff --git a/src/Gatherer/Hydrator.php b/src/Gatherer/Hydrator.php deleted file mode 100644 index a40aa4a..0000000 --- a/src/Gatherer/Hydrator.php +++ /dev/null @@ -1,28 +0,0 @@ - */ - public static function listSchemas(Schema $schema): iterable - { - yield $schema; - - foreach ($schema->properties as $property) { - yield from self::listSchemasFromPropertyType($property->type); - } - } - - /** @return iterable */ - private static function listSchemasFromPropertyType(PropertyType $propertyType): iterable - { - if ($propertyType->payload instanceof Schema) { - yield from self::listSchemas($propertyType->payload); - } elseif ($propertyType->payload instanceof PropertyType) { - yield from self::listSchemasFromPropertyType($propertyType->payload); - } - } -} diff --git a/src/Gatherer/IntegerReturnerPretendingToBeARandomNumberGenerator.php b/src/Gatherer/IntegerReturnerPretendingToBeARandomNumberGenerator.php deleted file mode 100644 index 9752698..0000000 --- a/src/Gatherer/IntegerReturnerPretendingToBeARandomNumberGenerator.php +++ /dev/null @@ -1,37 +0,0 @@ -randomNumber > $max ? $max : $this->randomNumber; - } - - /** - * @phpstan-ignore-next-line - */ - public function seed($seed = null) - { - return $this->randomNumber; - } - - public function max() - { - return $this->randomNumber; - } -} diff --git a/src/Gatherer/IntersectionSchema.php b/src/Gatherer/IntersectionSchema.php deleted file mode 100644 index 3ef12a7..0000000 --- a/src/Gatherer/IntersectionSchema.php +++ /dev/null @@ -1,106 +0,0 @@ -allOf as $schema) { - $gatheredProperties = []; - foreach ($schema->properties as $propertyName => $property) { - $gatheredProperty = $gatheredProperties[(string) $propertyName] = Property::gather( - $baseNamespace, - $className, - (string) $propertyName, - in_array( - (string) $propertyName, - $schema->required ?? [], - false, - ), - $property, - $schemaRegistry, - $contractRegistry, - $compositSchemaRegistry, - ); - - $example[$gatheredProperty->sourceName] = $gatheredProperty->example->raw; - - foreach (['examples', 'example'] as $examplePropertyName) { - if (array_key_exists($gatheredProperty->sourceName, $example)) { - break; - } - - if (! property_exists($schema, $examplePropertyName) || ! is_array($schema->$examplePropertyName) || ! array_key_exists($gatheredProperty->sourceName, $schema->$examplePropertyName)) { - continue; - } - - $example[$gatheredProperty->sourceName] = $schema->$examplePropertyName[$gatheredProperty->sourceName]; - } - - foreach ($property->enum ?? [] as $value) { - $example[$gatheredProperty->sourceName] = $value; - break; - } - - if ($example[$gatheredProperty->sourceName] !== null || $property->required || $baseProperty->required) { - continue; - } - - unset($example[$gatheredProperty->sourceName]); - } - - $contracts[] = new Contract( - ClassString::factory( - $baseNamespace, - $contractRegistry->get($schema, 'Contract\\' . $className . '\\' . $schema->title), - ), - $gatheredProperties, - ); - - $properties = [...$properties, ...$gatheredProperties]; - } - - return new Schema( - ClassString::factory($baseNamespace, 'Schema\\' . $className), - $contracts, - ClassString::factory($baseNamespace, 'Error\\' . $className), - ClassString::factory($baseNamespace, 'ErrorSchemas\\' . $className), - $baseProperty->title ?? '', - $baseProperty->description ?? '', - $example, - $properties, - $baseProperty, - false, - ($baseProperty->type === null ? ['object'] : (is_array($baseProperty->type) ? $baseProperty->type : [$baseProperty->type])), - ); - } -} diff --git a/src/Gatherer/Operation.php b/src/Gatherer/Operation.php deleted file mode 100644 index 0985a1e..0000000 --- a/src/Gatherer/Operation.php +++ /dev/null @@ -1,203 +0,0 @@ - $metaData */ - public static function gather( - Namespace_ $baseNamespace, - string $className, - string $matchMethod, - string $method, - string $path, - array $metaData, - openAPIOperation $operation, - ThrowableSchema $throwableSchemaRegistry, - SchemaRegistry $schemaRegistry, - ContractRegistry $contractRegistry, - CompositSchemaRegistry $compositSchemaRegistry, - ): \ApiClients\Tools\OpenApiClientGenerator\Representation\Operation { - $returnType = []; - $parameters = []; - $empties = []; - foreach ($operation->parameters as $parameter) { - $types = is_array($parameter->schema->type) ? $parameter->schema->type : [$parameter->schema->type]; - if (count($parameter->schema->oneOf ?? []) > 0) { - $types = []; - foreach ($parameter->schema->oneOf as $oneOfSchema) { - $types[] = $oneOfSchema->type; - } - } - - $parameterType = str_replace([ - 'integer', - 'any', - 'boolean', - ], [ - 'int', - 'string|object', - 'bool', - ], implode('|', $types)); - - $parameters[] = new Parameter( - (new Convert($parameter->name))->toCamel(), - $parameter->name, - $parameter->description ?? '', - $parameterType, - $parameter->schema->format, - $parameter->in, - $parameter->schema->default, - ExampleData::scalarData($parameter->name === 'page' ? 1 : strlen($parameter->name), $parameterType, $parameter->schema->format), - ); - } - - $classNameSanitized = str_replace('/', '\\', Utils::className($className)); - $requestBody = []; - if ($operation->requestBody !== null) { - foreach ($operation->requestBody->content as $contentType => $requestBodyDetails) { - $requestBodyClassname = $schemaRegistry->get( - $requestBodyDetails->schema, - $classNameSanitized . '\\Request\\' . Utils::className(str_replace('/', '_', $contentType)), - ); - $requestBody[] = new OperationRequestBody( - $contentType, - Schema::gather($baseNamespace, $requestBodyClassname, $requestBodyDetails->schema, $schemaRegistry, $contractRegistry, $compositSchemaRegistry), - ); - } - } - - $response = []; - foreach ($operation->responses ?? [] as $code => $spec) { - $isError = $code === 'default' || $code >= 400; - $contentCount = 0; - foreach ($spec->content as $contentType => $contentTypeMediaType) { - $contentCount++; - $responseClassname = $schemaRegistry->get( - $contentTypeMediaType->schema, - 'Operations\\' . $classNameSanitized . '\\Response\\' . Utils::className( - str_replace( - '/', - '_', - $contentType, - ) . '\\' . ($code === 'default' ? 'Default' : (HttpReasonPhraseLookup::getReasonPhrase($code) ?? 'Unknown')), - ), - ); - - $response[] = new OperationResponse( - $code, - $contentType, - $spec->description, - Type::gather( - $baseNamespace, - $responseClassname, - $contentType, - $contentTypeMediaType->schema, - true, - $schemaRegistry, - $contractRegistry, - $compositSchemaRegistry, - ), - ); - if ($isError) { - $throwableSchemaRegistry->add('Schema\\' . $responseClassname); - continue; - } - - $returnType[] = $responseClassname; - } - - if ($contentCount !== 0) { - continue; - } - - $headers = []; - foreach ($spec->headers as $headerName => $headerSpec) { - $headers[$headerName] = new Header($headerName, Schema::gather( - $baseNamespace, - $schemaRegistry->get( - $headerSpec->schema, - 'WebHookHeader\\' . ucfirst(preg_replace('/\PL/u', '', $headerName)), - ), - $headerSpec->schema, - $schemaRegistry, - $contractRegistry, - $compositSchemaRegistry, - ), ExampleData::determiteType($headerSpec->example)); - } - - $empties[] = new OperationEmptyResponse($code, $spec->description, $headers); - } - - if (count($returnType) === 0) { - $returnType[] = '\\' . ResponseInterface::class; - } - - $name = lcfirst(trim(Utils::basename($className), '\\')); - $group = strlen(trim(trim(Utils::dirname($className), '\\'), '.')) > 0 ? trim(str_replace('\\', '', Utils::dirname($className)), '\\') : null; - - return new \ApiClients\Tools\OpenApiClientGenerator\Representation\Operation( - ClassString::factory($baseNamespace, 'Internal\\Operation\\' . Utils::fixKeyword($className)), - ClassString::factory($baseNamespace, $classNameSanitized), - ClassString::factory($baseNamespace, 'Internal\\Operator\\' . Utils::fixKeyword($className)), - lcfirst( - str_replace( - ['\\'], - ['👷'], - ClassString::factory($baseNamespace, Utils::fixKeyword($className))->relative, - ), - ), - $name, - (new Convert($name))->toCamel(), - $group, - $group === null ? null : (new Convert($group))->toCamel(), - $operation->operationId, - strtoupper($matchMethod), - strtoupper($method), - $operation->summary, - $operation->externalDocs, - $path, - $metaData, - array_unique($returnType), - [ - ...array_filter($parameters, static fn (Parameter $parameter): bool => $parameter->default === null), - ...array_filter($parameters, static fn (Parameter $parameter): bool => $parameter->default !== null), - ], - $requestBody, - $response, - $empties, - ); - } -} diff --git a/src/Gatherer/OperationHydrator.php b/src/Gatherer/OperationHydrator.php deleted file mode 100644 index 2156c17..0000000 --- a/src/Gatherer/OperationHydrator.php +++ /dev/null @@ -1,39 +0,0 @@ -response as $response) { - if (! ($response->content->payload instanceof Schema)) { - continue; - } - - foreach (HydratorUtils::listSchemas($response->content->payload) as $schema) { - $schemaClasses[] = $schema; - } - } - } - - return Hydrator::gather( - $baseNamespace, - 'Operation\\' . $className, - '🌀', - ...$schemaClasses, - ); - } -} diff --git a/src/Gatherer/Path.php b/src/Gatherer/Path.php deleted file mode 100644 index a8a85b8..0000000 --- a/src/Gatherer/Path.php +++ /dev/null @@ -1,131 +0,0 @@ -getOperations() as $method => $operation) { - $operationClassName = Utils::className($operation->operationId); - if (strlen($operationClassName) === 0) { - continue; - } - - $operations[] = $opp = Operation::gather( - $baseNamespace, - $operationClassName, - $method, - $method, - $path, - [], - $operation, - $throwableSchemaRegistry, - $schemaRegistry, - $contractRegistry, - $compositSchemaRegistry, - ); - - if ($voters !== null && is_array($voters->listOperation)) { - $shouldStream = false; - $voter = null; - /** @phpstan-ignore-next-line */ - foreach ($voters->listOperation as $voter) { - if ($voter::list($opp)) { - $shouldStream = true; - break; - } - } - - if ($voter !== null && $shouldStream) { - $operations[] = Operation::gather( - $baseNamespace, - $operationClassName . 'Listing', - 'LIST', - $method, - $path, - [ - 'listOperation' => [ - 'key' => $voter::incrementorKey(), - 'initialValue' => $voter::incrementorInitialValue(), - 'keys' => $voter::keys(), - ], - ], - $operation, - $throwableSchemaRegistry, - $schemaRegistry, - $contractRegistry, - $compositSchemaRegistry, - ); - } - } - - if ($voters === null || ! is_array($voters->streamOperation)) { - continue; - } - - $shouldStream = false; - foreach ($voters->streamOperation as $voter) { - if ($voter::stream($opp)) { - $shouldStream = true; - break; - } - } - - if (! $shouldStream) { - continue; - } - - $operations[] = Operation::gather( - $baseNamespace, - $operationClassName . 'Streaming', - 'STREAM', - $method, - $path, - [], - $operation, - $throwableSchemaRegistry, - $schemaRegistry, - $contractRegistry, - $compositSchemaRegistry, - ); - } - - return new \ApiClients\Tools\OpenApiClientGenerator\Representation\Path( - ClassString::factory($baseNamespace, $className), - OperationHydrator::gather( - $baseNamespace, - $className, - ...$operations, - ), - $operations, - ); - } -} diff --git a/src/Gatherer/Property.php b/src/Gatherer/Property.php deleted file mode 100644 index ae71253..0000000 --- a/src/Gatherer/Property.php +++ /dev/null @@ -1,129 +0,0 @@ -examples ?? []) > 0) { - $examples = array_values(array_filter($property->examples, static fn (mixed $value): bool => $value !== null)); - // Main reason we're doing this is so we cause more variety in the example data when a list of examples is provided, but also consistently pick the same item so we do don't cause code churn - /** @phpstan-ignore-next-line */ - $exampleData = $examples[strlen($sourcePropertyName) % 2 ? 0 : count($examples) - 1]; - } - - if ($exampleData === null && $property->example !== null) { - $exampleData = $property->example; - } - - if ($exampleData === null && count($property->enum ?? []) > 0) { - $enum = $property->enum; - $enums = array_values(array_filter($property->enum, static fn (mixed $value): bool => $value !== null)); - // Main reason we're doing this is so we cause more variety in the enum based example data, but also consistently pick the same item so we do don't cause code churn - /** @phpstan-ignore-next-line */ - $exampleData = $enums[strlen($sourcePropertyName) % 2 ? 0 : count($enums) - 1]; - } - - $propertyName = str_replace([ - '@', - '+', - '-', - '$', - ], [ - '_AT_', - '_PLUS_', - '_MIN_', - '_DOLLAR_', - ], $sourcePropertyName); - $propertyName = preg_replace_callback( - '/[0-9]+/', - static function ($matches) { - return '_' . str_replace(['-', ' '], '_', NumberToWords::transformNumber('en', (int) $matches[0])) . '_'; - }, - $propertyName, - ); - - $type = Type::gather( - $baseNamespace, - $className, - $propertyName, - $property, - $required, - $schemaRegistry, - $contractRegistry, - $compositSchemaRegistry, - ); - - if ($property->type === 'array' && is_array($type->payload)) { - $arrayItemsRaw = []; - $arrayItemsNode = []; - - foreach ($type->payload as $index => $arrayItem) { - $arrayItemExampleData = ExampleData::gather( - $exampleData, - $arrayItem->type === 'union' ? $arrayItem->payload[(array_key_exists($index, $arrayItem->payload) ? $index : 0)] : $arrayItem, - $propertyName . str_pad('', $index + 1, '_'), - ); - $arrayItemsRaw[] = $arrayItemExampleData->raw; - $arrayItemsNode[] = new Node\Expr\ArrayItem($arrayItemExampleData->node); - } - - $exampleData = new Representation\ExampleData($arrayItemsRaw, new Node\Expr\Array_($arrayItemsNode)); - } elseif ($type->type === 'union') { - foreach ($type->payload as $index => $arrayItem) { - $exampleData = ExampleData::gather( - $arrayItem->payload instanceof Representation\PropertyType ? $exampleData : null, - $arrayItem->payload instanceof Representation\PropertyType ? $arrayItem->payload : $arrayItem, - $propertyName . str_pad('', $index + 1, '_'), - ); - } - } else { - $exampleData = ExampleData::gather($exampleData, $type, $propertyName); - } - - return new Representation\Property( - (new Convert($propertyName))->toCamel(), - $sourcePropertyName, - $property->description ?? '', - $exampleData, - $type, - $type->nullable, - $enum, - ); - } -} diff --git a/src/Gatherer/Schema.php b/src/Gatherer/Schema.php deleted file mode 100644 index 36d0cd2..0000000 --- a/src/Gatherer/Schema.php +++ /dev/null @@ -1,116 +0,0 @@ -allOf) && count($schema->allOf) > 0) { - return IntersectionSchema::gather( - $baseNamespace, - $className, - $schema, - $schemaRegistry, - $contractRegistry, - $compositSchemaRegistry, - ); - } - - $className = Utils::className($className); - $isArray = $schema->type === 'array'; - $properties = []; - $example = []; - - if ($isArray) { - $schema = $schema->items; - } - - foreach ($schema->properties as $propertyName => $property) { - $gatheredProperty = $properties[] = Property::gather( - $baseNamespace, - $className, - (string) $propertyName, - in_array( - (string) $propertyName, - $schema->required ?? [], - false, - ), - $property, - $schemaRegistry, - $contractRegistry, - $compositSchemaRegistry, - ); - - $example[$gatheredProperty->sourceName] = $gatheredProperty->example->raw; - - foreach (['examples', 'example'] as $examplePropertyName) { - if (array_key_exists($gatheredProperty->sourceName, $example)) { - break; - } - - if (! property_exists($schema, $examplePropertyName) || ! is_array($schema->$examplePropertyName) || ! array_key_exists($gatheredProperty->sourceName, $schema->$examplePropertyName)) { - continue; - } - - $example[$gatheredProperty->sourceName] = $schema->$examplePropertyName[$gatheredProperty->sourceName]; - } - - foreach ($property->enum ?? [] as $value) { - $example[$gatheredProperty->sourceName] = $value; - break; - } - - if ($example[$gatheredProperty->sourceName] !== null || $schema->required) { - continue; - } - - unset($example[$gatheredProperty->sourceName]); - } - - return new \ApiClients\Tools\OpenApiClientGenerator\Representation\Schema( - ClassString::factory($baseNamespace, 'Schema\\' . $className), - [ - new Contract( - ClassString::factory( - $baseNamespace, - $contractRegistry->get($schema, 'Contract\\' . $className), - ), - $properties, - ), - ], - ClassString::factory($baseNamespace, 'Error\\' . $className), - ClassString::factory($baseNamespace, 'ErrorSchemas\\' . $className), - $schema->title ?? '', - $schema->description ?? '', - $example, - $properties, - $schema, - $isArray, - ($schema->type === null ? ['object'] : (is_array($schema->type) ? $schema->type : [$schema->type])), - ); - } -} diff --git a/src/Gatherer/Type.php b/src/Gatherer/Type.php deleted file mode 100644 index 470fb06..0000000 --- a/src/Gatherer/Type.php +++ /dev/null @@ -1,280 +0,0 @@ -type; - $nullable = ! $required; - - if (is_array($property->allOf) && count($property->allOf) > 0) { - return new PropertyType( - 'object', - null, - null, - IntersectionSchema::gather( - $baseNamespace, - $schemaRegistry->get( - $property, - Utils::className($className . '\\' . $propertyName), - ), - $property, - $schemaRegistry, - $contractRegistry, - $compositSchemaRegistry, - ), - $nullable, - ); - } - - if (is_array($property->oneOf) && count($property->oneOf) > 0) { - // Check if nullable - if ( - count($property->oneOf) === 2 && - count(array_filter($property->oneOf, static fn (BaseSchema $schema): bool => $schema->type === 'null')) === 1 - ) { - return self::gather( - $baseNamespace, - $className, - $propertyName, - current(array_filter($property->oneOf, static fn (BaseSchema $schema): bool => $schema->type !== 'null')), - false, - $schemaRegistry, - $contractRegistry, - $compositSchemaRegistry, - ); - } - - return new PropertyType( - 'union', - null, - null, - [ - ...(static function ( - Namespace_ $baseNamespace, - string $className, - string $propertyName, - array $properties, - bool $required, - SchemaRegistry $schemaRegistry, - ContractRegistry $contractRegistry, - CompositSchemaRegistry $compositSchemaRegistry, - ): iterable { - foreach ($properties as $index => $property) { - yield self::gather( - $baseNamespace, - $className, - $propertyName . '\\' . NumberToWords::transformNumber('en', $index), - $property, - $required, - $schemaRegistry, - $contractRegistry, - $compositSchemaRegistry, - ); - } - })( - $baseNamespace, - $className, - $propertyName, - $property->oneOf, - $required, - $schemaRegistry, - $contractRegistry, - $compositSchemaRegistry, - ), - ], - $nullable, - ); - } - - if (is_array($property->anyOf) && count($property->anyOf) > 0) { - // Check if nullable - if ( - count($property->anyOf) === 2 && - count(array_filter($property->anyOf, static fn (BaseSchema $schema): bool => $schema->type === 'null')) === 1 - ) { - return self::gather( - $baseNamespace, - $className, - $propertyName, - current(array_filter($property->anyOf, static fn (BaseSchema $schema): bool => $schema->type !== 'null')), - false, - $schemaRegistry, - $contractRegistry, - $compositSchemaRegistry, - ); - } - - return new PropertyType( - 'union', - null, - null, - [ - ...(static function ( - Namespace_ $baseNamespace, - string $className, - string $propertyName, - array $properties, - bool $required, - SchemaRegistry $schemaRegistry, - ContractRegistry $contractRegistry, - CompositSchemaRegistry $compositSchemaRegistry, - ): iterable { - foreach ($properties as $index => $property) { - yield self::gather( - $baseNamespace, - $className, - $propertyName . '\\' . NumberToWords::transformNumber('en', $index), - $property, - $required, - $schemaRegistry, - $contractRegistry, - $compositSchemaRegistry, - ); - } - })( - $baseNamespace, - $className, - $propertyName, - $property->anyOf, - $required, - $schemaRegistry, - $contractRegistry, - $compositSchemaRegistry, - ), - ], - $nullable, - ); - } - - if ( - is_array($type) && - count($type) === 2 && - ( - in_array(null, $type, false) || - in_array('null', $type, false) - ) - ) { - foreach ($type as $pt) { - /** @phpstan-ignore-next-line */ - if ($pt !== null && $pt !== 'null') { - $type = $pt; - break; - } - } - - $nullable = true; - } - - if ($type === 'array') { - $arrayItems = []; - - foreach (range(0, ($property->maxItems ?? $property->minItems ?? 2) - 1) as $index) { - $arrayItems[] = self::gather( - $baseNamespace, - $className, - $propertyName, - $property->items, - $required, - $schemaRegistry, - $contractRegistry, - $compositSchemaRegistry, - ); - } - - return new PropertyType( - 'array', - null, - null, - $arrayItems, - $nullable, - ); - } - - if (is_string($type)) { - $type = str_replace([ - 'integer', - 'number', - 'any', - 'null', - 'boolean', - ], [ - 'int', - 'int|float', - '', - '', - 'bool', - ], $type); - } else { - $type = ''; - } - - if ($type === '') { - return new PropertyType( - 'scalar', - null, - null, - 'string', - false, - ); - } - - if ($type === 'object') { - return new PropertyType( - 'object', - null, - null, - Schema::gather( - $baseNamespace, - $schemaRegistry->get( - $property, - Utils::className($className . '\\' . $propertyName), - ), - $property, - $schemaRegistry, - $contractRegistry, - $compositSchemaRegistry, - ), - $nullable, - ); - } - - return new PropertyType( - 'scalar', - $property->format ?? null, - $property->pattern ?? null, - $type, - $nullable, - ); - } -} diff --git a/src/Gatherer/WebHook.php b/src/Gatherer/WebHook.php deleted file mode 100644 index 182c733..0000000 --- a/src/Gatherer/WebHook.php +++ /dev/null @@ -1,77 +0,0 @@ -post?->requestBody === null && ! property_exists($webhook->post->requestBody, 'content')) { - throw new RuntimeException('Missing request body content to deal with'); - } - - [$event] = explode('/', $webhook->post->operationId); - - $headers = []; - foreach ($webhook->post->parameters ?? [] as $header) { - if ($header->in !== 'header') { - continue; - } - - $headers[] = new Header($header->name, Schema::gather( - $baseNamespace, - $schemaRegistry->get( - $header->schema, - 'WebHookHeader\\' . ucfirst(preg_replace('/\PL/u', '', $header->name)), - ), - $header->schema, - $schemaRegistry, - $contractRegistry, - $compositSchemaRegistry, - ), ExampleData::determiteType($header->example)); - } - - return new \ApiClients\Tools\OpenApiClientGenerator\Representation\WebHook( - $event, - $webhook->post->summary ?? '', - $webhook->post->description ?? '', - $webhook->post->operationId, - $webhook->post->externalDocs->url ?? '', - $headers, - iterator_to_array((static function (array $content, SchemaRegistry $schemaRegistry, ContractRegistry $contractRegistry, CompositSchemaRegistry $compositSchemaRegistry, Namespace_ $baseNamespace): iterable { - foreach ($content as $type => $schema) { - yield $type => Schema::gather( - $baseNamespace, - $schemaRegistry->get($schema->schema, 'T' . time()), - $schema->schema, - $schemaRegistry, - $contractRegistry, - $compositSchemaRegistry, - ); - } - })($webhook->post->requestBody->content, $schemaRegistry, $contractRegistry, $compositSchemaRegistry, $baseNamespace)), - ); - } -} diff --git a/src/Gatherer/WebHookHydrator.php b/src/Gatherer/WebHookHydrator.php deleted file mode 100644 index 413a651..0000000 --- a/src/Gatherer/WebHookHydrator.php +++ /dev/null @@ -1,34 +0,0 @@ -schema as $webHookSchema) { - foreach (HydratorUtils::listSchemas($webHookSchema) as $schema) { - $schemaClasses[] = $schema; - } - } - } - - return Hydrator::gather( - $baseNamespace, - 'WebHook\\' . Utils::className($event), - '🪝', - ...$schemaClasses, - ); - } -} diff --git a/src/Generator.php b/src/Generator.php deleted file mode 100644 index 30c1daf..0000000 --- a/src/Generator.php +++ /dev/null @@ -1,1089 +0,0 @@ -forceGeneration = is_string(getenv('FORCE_GENERATION')) && strlen(getenv('FORCE_GENERATION')) > 0; - - $this->statusOutput = new Output\Status( - ! (new CiDetector())->isCiDetected(), - new Step('hash_current_spec', 'Hashing current spec', false), - new Step('loading_state', 'Loading state', false), - new Step('loading_spec', 'Loading spec', false), - new Step('gathering_schemas', 'Gathering: Schemas', true), - new Step('gathering_webhooks', 'Gathering: WebHooks', true), - new Step('gathering_paths', 'Gathering: Paths', true), - new Step('client_single', 'Client: Single package', false), - new Step('client_subsplit', 'Client: SubSplit across multiple package', false), - new Step('generating_operations', 'Generating: Operations', true), - new Step('gathering_unknown_schemas', 'Gathering: Unknown Schemas', true), - new Step('generating_contracts', 'Generating: Contracts', true), - new Step('generating_schemas', 'Generating: Schemas', true), - new Step('generating_clientinterface', 'Generating: ClientInterface', false), - new Step('generating_client', 'Generating: Client', false), - new Step('generating_operationsinterface_entry_point', 'Generating: OperationsInterface Entry Point', false), - new Step('generating_operations_entry_point', 'Generating: Operations Entry Point', false), - new Step('generating_webhooks', 'Generating: WebHooks', true), - new Step('generating_webhooks_entry_point', 'Generating: WebHooks Entry Point', false), - new Step('generating_hydrators', 'Generating: Hydrators', true), - new Step('generating_hydrators_entry_point', 'Generating: Hydrators Entry Point', false), - new Step('generating_templated_files', 'Generating: Templated files', false), - new Step('generating_templates_files_root_package', 'Generating: Templates Files: Root Package', false), - new Step('generating_templates_files_common_package', 'Generating: Templates Files: Common Package', false), - new Step('generating_templates_files_subsplit_package', 'Generating: Templates Files: SubSplit Packages', true), - new Step('generating_subsplit_configuration', 'Generating: SubSplit Configuration', false), - ); - - if (! $this->configuration->entryPoints->operations) { - $this->statusOutput->markStepWontDo('generating_operationsinterface_entry_point'); - $this->statusOutput->markStepWontDo('generating_operations_entry_point'); - } - - if (! $this->configuration->entryPoints->webHooks) { - $this->statusOutput->markStepWontDo('generating_webhooks'); - $this->statusOutput->markStepWontDo('generating_webhooks_entry_point'); - } - - if ($this->configuration->templates === null) { - $this->statusOutput->markStepWontDo('generating_templated_files'); - $this->statusOutput->markStepWontDo('generating_templates_files_root_package'); - $this->statusOutput->markStepWontDo('generating_templates_files_common_package'); - $this->statusOutput->markStepWontDo('generating_templates_files_subsplit_package'); - } - - $specLocation = $this->configuration->spec; - if (strpos($specLocation, '://') === false) { - $specLocation = realpath($configurationLocation . $specLocation); - } - - $this->statusOutput->markStepBusy('hash_current_spec'); - $this->currentSpecHash = md5(file_get_contents($specLocation)); - $this->statusOutput->markStepDone('hash_current_spec'); - - $this->statusOutput->markStepBusy('loading_state'); - $this->state = (new ObjectMapperUsingReflection())->hydrateObject( - State::class, - /** @phpstan-ignore-next-line */ - file_exists($configurationLocation . $this->configuration->destination->root . DIRECTORY_SEPARATOR . $this->configuration->state->file) ? json_decode( - file_get_contents( - $configurationLocation . $this->configuration->destination->root . DIRECTORY_SEPARATOR . $this->configuration->state->file, - ), - true, - ) : [ - 'specHash' => '', - 'generatedFiles' => [ - 'files' => [], - ], - 'additionalFiles' => [ - 'files' => [], - ], - ], - ); - $this->statusOutput->markStepDone('loading_state'); - - if ( - ! $this->forceGeneration && - $this->state->specHash === $this->currentSpecHash && - (static function (string $root, Files $files, string ...$additionalFiles): bool { - foreach ($additionalFiles as $additionalFile) { - if (! $files->has($additionalFile)) { - return false; - } - - if ($files->has($additionalFile) && (! file_exists($root . $additionalFile) || $files->get($additionalFile)->hash !== md5(file_get_contents($root . $additionalFile)))) { - return false; - } - } - - return true; - })($configurationLocation . $this->configuration->destination->root . DIRECTORY_SEPARATOR, $this->state->additionalFiles, ...($this->configuration->state->additionalFiles ?? [])) - ) { - throw new RuntimeException('Neither spec or marker files has changed so no need to regenerate'); - } - - $this->state->specHash = $this->currentSpecHash; - - $this->statusOutput->markStepBusy('loading_spec'); - $this->spec = Reader::readFromYamlFile($specLocation); - $this->statusOutput->markStepDone('loading_spec'); - } - - public function generate(string $namespace, string $namespaceTest, string $configurationLocation): void - { - $existingFiles = array_map( - static fn (StateFile $file): string => $file->name, - $this->state->generatedFiles->files(), - ); - $codePrinter = new Standard(); - - foreach ($this->all($configurationLocation) as $file) { - $fileName = $configurationLocation . $this->configuration->destination->root . DIRECTORY_SEPARATOR . $file->pathPrefix . DIRECTORY_SEPARATOR . str_replace('\\', DIRECTORY_SEPARATOR, $file->fqcn) . (strpos($file->fqcn, '.') !== false ? '' : '.php'); - if ($file->contents instanceof Node\Stmt\Namespace_) { - array_unshift($file->contents->stmts, ...(static function (array $uses): iterable { - foreach ($uses as $use => $alias) { - yield new Node\Stmt\Use_([ - new Node\Stmt\UseUse( - new Node\Name( - $use, - ), - $alias, - ), - ]); - } - })([ - ltrim($namespace, '\\') . 'Contract' => null, - ltrim($namespace, '\\') . 'Error' => 'ErrorSchemas', - ltrim($namespace, '\\') . 'Internal' => null, - ltrim($namespace, '\\') . 'Operation' => null, - ltrim($namespace, '\\') . 'Schema' => null, - 'League\OpenAPIValidation' => null, - 'React\Http' => null, - 'ApiClients\Contracts' => null, - ])); - } - - $fileContents = (! is_string($file->contents) ? $codePrinter->prettyPrintFile([ - new Node\Stmt\Declare_([ - new Node\Stmt\DeclareDeclare('strict_types', new Node\Scalar\LNumber(1)), - ]), - $file->contents, - ]) : $file->contents) . PHP_EOL; - $fileContentsHash = md5($fileContents); - if ( - ! $this->state->generatedFiles->has($fileName) || - $this->state->generatedFiles->get($fileName)->hash !== $fileContentsHash || - $this->forceGeneration - ) { - try { - /** @phpstan-ignore-next-line */ - @mkdir(dirname($fileName), 0744, true); - } catch (FilesystemException) { - // @ignoreException - } - - file_put_contents($fileName, $fileContents); - $this->state->generatedFiles->upsert($fileName, $fileContentsHash); - - while (! file_exists($fileName) || $fileContentsHash !== md5(file_get_contents($fileName))) { - usleep(100); - } - } - - if (! (strpos($fileName, DIRECTORY_SEPARATOR . 'Types' . DIRECTORY_SEPARATOR) !== false) && substr($fileName, -4) === '.php') { - include_once $fileName; - } - - $existingFiles = array_filter( - $existingFiles, - static fn (string $file): bool => $file !== $fileName, - ); - } - - foreach ($existingFiles as $existingFile) { - $this->state->generatedFiles->remove($existingFile); - unlink($existingFile); - } - - foreach ($this->state->additionalFiles->files() as $file) { - $this->state->additionalFiles->remove($file->name); - } - - foreach ($this->configuration->state->additionalFiles ?? [] as $additionalFile) { - $this->state->additionalFiles->upsert( - $additionalFile, - file_exists($configurationLocation . $this->configuration->destination->root . DIRECTORY_SEPARATOR . $additionalFile) ? md5(file_get_contents($configurationLocation . $this->configuration->destination->root . DIRECTORY_SEPARATOR . $additionalFile)) : '', - ); - } - - try { - /** @phpstan-ignore-next-line */ - @mkdir(dirname($configurationLocation . $this->configuration->destination->root . DIRECTORY_SEPARATOR . $this->configuration->state->file), 0744, true); - } catch (FilesystemException) { - // @ignoreException - } - - file_put_contents( - $configurationLocation . $this->configuration->destination->root . DIRECTORY_SEPARATOR . $this->configuration->state->file, - json_encode( - (new ObjectMapperUsingReflection())->serializeObject( - $this->state, - ), - JSON_PRETTY_PRINT, - ), - ); - } - - /** @return iterable */ - private function all(string $configurationLocation): iterable - { - $schemaRegistry = new SchemaRegistry( - $this->configuration->namespace, - $this->configuration->schemas->allowDuplication ?? false, - $this->configuration->schemas->useAliasesForDuplication ?? false, - ); - $contractRegistry = new ContractRegistry(); - $compositSchemaRegistry = new CompositSchemaRegistry( - $this->configuration->namespace, - ); - - $contracts = []; - $schemas = []; - $throwableSchemaRegistry = new ThrowableSchema(); - if (count($this->spec->components->schemas ?? []) > 0) { - /** @phpstan-ignore-next-line */ - $this->statusOutput->itemForStep('gathering_schemas', count($this->spec->components->schemas)); - /** - * Do this loop twice to ensure we added all schemas to the schema registry BEFORE we start to gather them - * which will trigger looking up schemas as properties and end up with weird naming. - * - * @phpstan-ignore-next-line - */ - foreach ($this->spec->components->schemas as $name => $schema) { - assert($schema instanceof \cebe\openapi\spec\Schema); - $schemaRegistry->addClassName(Utils::className($name), $schema); - } - - /** - * Gather all the schemas now that we've added all of them to the schema registry. - * - * @phpstan-ignore-next-line - */ - foreach ($this->spec->components->schemas as $name => $schema) { - assert($schema instanceof \cebe\openapi\spec\Schema); - $schema = Gatherer\Schema::gather($this->configuration->namespace, Utils::className($name), $schema, $schemaRegistry, $contractRegistry, $compositSchemaRegistry); - $schemas[] = $schema; - $contracts = [...$contracts, ...$schema->contracts]; - $this->statusOutput->advanceStep('gathering_schemas'); - } - } - - $this->statusOutput->markStepDone('gathering_schemas'); - - /** @var array> $webHooks */ - $webHooks = []; - if (count($this->spec->webhooks ?? []) > 0) { - $this->statusOutput->itemForStep('gathering_webhooks', count($this->spec->webhooks)); - foreach ($this->spec->webhooks as $webHook) { - try { - $webHookje = Gatherer\WebHook::gather($this->configuration->namespace, $webHook, $schemaRegistry, $contractRegistry, $compositSchemaRegistry); - if (! array_key_exists($webHookje->event, $webHooks)) { - $webHooks[$webHookje->event] = []; - } - - $webHooks[$webHookje->event][] = $webHookje; - /** @phpstan-ignore-next-line */ - } catch (RuntimeException) { - // @ignoreException - } - - $this->statusOutput->advanceStep('gathering_webhooks'); - } - } - - $this->statusOutput->markStepDone('gathering_webhooks'); - - $paths = []; - if (count($this->spec->paths ?? []) > 0) { - $this->statusOutput->itemForStep('gathering_paths', count($this->spec->paths)); - foreach ($this->spec->paths as $path => $pathItem) { - if ($path === '/') { - $pathClassName = 'Root'; - } else { - $pathClassName = trim(Utils::className($path), '\\'); - } - - if (strlen($path) === 0 || strlen($pathClassName) === 0) { - continue; - } - - $paths[] = Gatherer\Path::gather( - $this->configuration->namespace, - $pathClassName, - $path, - $pathItem, - $schemaRegistry, - $contractRegistry, - $compositSchemaRegistry, - $throwableSchemaRegistry, - $this->configuration->voter, - ); - $this->statusOutput->advanceStep('gathering_paths'); - } - - $this->statusOutput->markStepDone('gathering_paths'); - } - - if ($this->configuration->subSplit === null) { - $this->statusOutput->markStepWontDo( - 'client_subsplit', - 'generating_templates_files_root_package', - 'generating_templates_files_common_package', - 'generating_templates_files_subsplit_package', - 'generating_subsplit_configuration', - ); - - $this->statusOutput->markStepBusy('client_single'); - - /** @phpstan-ignore-next-line */ - yield from $this->oneClient($configurationLocation, $schemaRegistry, $contractRegistry, $compositSchemaRegistry, $throwableSchemaRegistry, $contracts, $schemas, $paths, $webHooks); - - $this->statusOutput->markStepDone('client_single'); - } else { - $this->statusOutput->markStepWontDo( - 'client_single', - 'generating_templated_files', - ); - - $this->statusOutput->markStepBusy('client_subsplit'); - - /** @phpstan-ignore-next-line */ - yield from $this->subSplitClient($configurationLocation, $schemaRegistry, $contractRegistry, $compositSchemaRegistry, $throwableSchemaRegistry, $contracts, $schemas, $paths, $webHooks); - - $this->statusOutput->markStepDone('client_subsplit'); - } - } - - /** - * @param array $contracts - * @param array $schemas - * @param array $paths - * @param array> $webHooks - * - * @return iterable - */ - private function oneClient( - string $configurationLocation, - SchemaRegistry $schemaRegistry, - ContractRegistry $contractRegistry, - CompositSchemaRegistry $compositSchemaRegistry, - ThrowableSchema $throwableSchemaRegistry, - array $contracts, - array $schemas, - array $paths, - array $webHooks, - ): iterable { - $hydrators = []; - $operations = []; - $this->statusOutput->itemForStep('generating_operations', count($paths)); - foreach ($paths as $path) { - $hydrators[] = $path->hydrator; - $operations = [...$operations, ...$path->operations]; - foreach ($path->operations as $operation) { - yield from Operation::generate( - $this->configuration->destination->source . DIRECTORY_SEPARATOR, - $operation, - $path->hydrator, - $throwableSchemaRegistry, - $this->configuration, - ); - - yield from Operator::generate( - $this->configuration->destination->source . DIRECTORY_SEPARATOR, - $operation, - $path->hydrator, - $throwableSchemaRegistry, - $this->configuration, - ); - - yield from OperationTest::generate( - $this->configuration->destination->test . DIRECTORY_SEPARATOR, - $operation, - $path->hydrator, - $throwableSchemaRegistry, - $this->configuration, - ); - } - - $this->statusOutput->advanceStep('generating_operations'); - } - - $this->statusOutput->markStepDone('generating_operations'); - - $unknownSchemaCount = 0; - while ($schemaRegistry->hasUnknownSchemas()) { - $unknownSchemas = [...$schemaRegistry->unknownSchemas()]; - $unknownSchemaCount += count($unknownSchemas); - $this->statusOutput->itemForStep('gathering_unknown_schemas', $unknownSchemaCount); - foreach ($unknownSchemas as $schema) { - $schema = Gatherer\Schema::gather($this->configuration->namespace, $schema->className, $schema->schema, $schemaRegistry, $contractRegistry, $compositSchemaRegistry); - $schemas[] = $schema; - $contracts = [...$contracts, ...$schema->contracts]; - $this->statusOutput->advanceStep('gathering_unknown_schemas'); - } - } - - $this->statusOutput->markStepDone('gathering_unknown_schemas'); - - $this->statusOutput->itemForStep('generating_contracts', count($contracts)); - foreach ($contracts as $contract) { - yield from Contract::generate( - $this->configuration->destination->source . DIRECTORY_SEPARATOR, - $contract, - ); - - $this->statusOutput->advanceStep('generating_contracts'); - } - - $this->statusOutput->markStepDone('generating_contracts'); - - $this->statusOutput->itemForStep('generating_schemas', count($schemas)); - foreach ($schemas as $schema) { - yield from Schema::generate( - $this->configuration->destination->source . DIRECTORY_SEPARATOR, - $schema, - [...$schemaRegistry->aliasesForClassName($schema->className->relative)], - ); - - if ($throwableSchemaRegistry->has($schema->className->relative)) { - yield from Error::generate( - $this->configuration->destination->source . DIRECTORY_SEPARATOR, - $schema, - ); - } - - $this->statusOutput->advanceStep('generating_schemas'); - } - - $this->statusOutput->markStepDone('generating_schemas'); - - $client = Gatherer\Client::gather($this->spec, ...$paths); - $routers = new Client\Routers(); - - $this->statusOutput->markStepBusy('generating_clientinterface'); - - yield from ClientInterface::generate( - $this->configuration, - $this->configuration->destination->source . DIRECTORY_SEPARATOR, - $operations, - ); - - $this->statusOutput->markStepDone('generating_clientinterface'); - - $this->statusOutput->markStepBusy('generating_client'); - - yield from Client::generate( - $this->configuration, - $this->configuration->destination->source . DIRECTORY_SEPARATOR, - $this->configuration->destination->test . DIRECTORY_SEPARATOR, - $client, - $routers, - ); - - $this->statusOutput->markStepDone('generating_client'); - - if ($this->configuration->entryPoints->operations) { - $this->statusOutput->markStepBusy('generating_operationsinterface_entry_point'); - - yield from OperationsInterface::generate( - $this->configuration, - $this->configuration->destination->source . DIRECTORY_SEPARATOR, - $operations, - ); - - $this->statusOutput->markStepDone('generating_operationsinterface_entry_point'); - - $this->statusOutput->markStepBusy('generating_operations_entry_point'); - - yield from Operations::generate( - $this->configuration, - $this->configuration->destination->source . DIRECTORY_SEPARATOR, - $paths, - $operations, - ); - - $this->statusOutput->markStepDone('generating_operations_entry_point'); - } - - if ($this->configuration->entryPoints->webHooks) { - $webHooksHydrators = []; - $this->statusOutput->itemForStep('generating_webhooks', count($webHooks)); - foreach ($webHooks as $event => $webHook) { - $webHooksHydrators[$event] = $hydrators[] = WebHookHydrator::gather( - $this->configuration->namespace, - $event, - ...$webHook, - ); - - yield from WebHook::generate( - $this->configuration->destination->source . DIRECTORY_SEPARATOR, - $this->configuration->namespace->source . '\\', - $event, - $schemaRegistry, - ...$webHook, - ); - - $this->statusOutput->advanceStep('generating_webhooks'); - } - - $this->statusOutput->markStepDone('generating_webhooks'); - - $this->statusOutput->markStepBusy('generating_webhooks_entry_point'); - - yield from WebHooks::generate($this->configuration->destination->source . DIRECTORY_SEPARATOR, $this->configuration->namespace->source . '\\', $webHooksHydrators, $webHooks); - - $this->statusOutput->markStepDone('generating_webhooks_entry_point'); - } - - $this->statusOutput->itemForStep('generating_hydrators', count($hydrators)); - foreach ($hydrators as $hydrator) { - yield from Hydrator::generate($this->configuration->destination->source . DIRECTORY_SEPARATOR, $hydrator); - - $this->statusOutput->advanceStep('generating_hydrators'); - } - - $this->statusOutput->markStepDone('generating_hydrators'); - - $this->statusOutput->markStepBusy('generating_hydrators_entry_point'); - - yield from Hydrators::generate($this->configuration->destination->source . DIRECTORY_SEPARATOR, $this->configuration->namespace->source . '\\', ...$hydrators); - - $this->statusOutput->markStepDone('generating_hydrators_entry_point'); - - if (! ($this->configuration->templates instanceof Templates)) { - return; - } - - $this->statusOutput->markStepBusy('generating_templated_files'); - \WyriHaximus\SubSplitTools\Files::setUp( - $configurationLocation . $this->configuration->templates->dir, - $configurationLocation . $this->configuration->destination->root . DIRECTORY_SEPARATOR, - (static function (string $namespace, array|null $variables, array $operations, array $webHooks, Configuration $configuration): array { - $vars = $variables ?? []; - $vars['namespace'] = $namespace; - $vars['client'] = [ - 'configuration' => $configuration, - 'operations' => $operations, - 'webHooks' => $webHooks, - ]; - $vars['qa'] = $configuration->qa; - - return $vars; - })( - $this->configuration->namespace->source . '\\', - $this->configuration->templates->variables, - $operations, - $webHooks, - $this->configuration, - ), - ); - $this->statusOutput->markStepDone('generating_templated_files'); - } - - /** - * @param array $contracts - * @param array $schemas - * @param array $paths - * @param array> $webHooks - * - * @return iterable - */ - private function subSplitClient( - string $configurationLocation, - SchemaRegistry $schemaRegistry, - ContractRegistry $contractRegistry, - CompositSchemaRegistry $compositSchemaRegistry, - ThrowableSchema $throwableSchemaRegistry, - array $contracts, - array $schemas, - array $paths, - array $webHooks, - ): iterable { - if ($this->configuration->subSplit === null) { - throw new RuntimeException('Subsplit configuration must be present'); - } - - $splits = []; - /** @var array> $hydrators */ - $hydrators = []; - $operations = []; - $this->statusOutput->itemForStep('generating_operations', count($paths)); - foreach ($paths as $path) { - $split = null; - foreach ($this->configuration->subSplit->sectionGenerator ?? [] as $generator) { - $split = $generator::path($path); - if (is_string($split)) { - break; - } - } - - if (! is_string($split)) { - continue; - } - - $splits[] = $split; - $hydrators[$split][] = $path->hydrator; - $operations = [...$operations, ...$path->operations]; - foreach ($path->operations as $operation) { - yield from Operation::generate( - $this->configuration->subSplit->subSplitsDestination . DIRECTORY_SEPARATOR . $this->splitPathPrefix($this->configuration->subSplit->sectionPackage, $split) . $this->configuration->destination->source, - $operation, - $path->hydrator, - $throwableSchemaRegistry, - $this->configuration, - ); - - yield from Operator::generate( - $this->configuration->subSplit->subSplitsDestination . DIRECTORY_SEPARATOR . $this->splitPathPrefix($this->configuration->subSplit->sectionPackage, $split) . $this->configuration->destination->source, - $operation, - $path->hydrator, - $throwableSchemaRegistry, - $this->configuration, - ); - - yield from OperationTest::generate( - $this->configuration->subSplit->subSplitsDestination . DIRECTORY_SEPARATOR . $this->splitPathPrefix($this->configuration->subSplit->sectionPackage, $split) . $this->configuration->destination->test, - $operation, - $path->hydrator, - $throwableSchemaRegistry, - $this->configuration, - ); - } - - $this->statusOutput->advanceStep('generating_operations'); - } - - $this->statusOutput->markStepDone('generating_operations'); - - $webHooksHydrators = []; - foreach ($webHooks as $event => $webHook) { - $split = null; - foreach ($this->configuration->subSplit->sectionGenerator ?? [] as $generator) { - $split = $generator::webHook(...$webHook); - if (is_string($split)) { - break; - } - } - - if (! is_string($split)) { - continue; - } - - $splits[] = $split; - $webHooksHydrators[$event] = $hydrators[$split][] = WebHookHydrator::gather( - $this->configuration->namespace, - $event, - ...$webHook, - ); - } - - $unknownSchemaCount = 0; - while ($schemaRegistry->hasUnknownSchemas()) { - $unknownSchemas = [...$schemaRegistry->unknownSchemas()]; - $unknownSchemaCount += count($unknownSchemas); - $this->statusOutput->itemForStep('gathering_unknown_schemas', $unknownSchemaCount); - foreach ($unknownSchemas as $schema) { - $schema = Gatherer\Schema::gather($this->configuration->namespace, $schema->className, $schema->schema, $schemaRegistry, $contractRegistry, $compositSchemaRegistry); - $schemas[] = $schema; - $contracts = [...$contracts, ...$schema->contracts]; - $this->statusOutput->advanceStep('gathering_unknown_schemas'); - } - } - - $this->statusOutput->markStepDone('gathering_unknown_schemas'); - -// $contractCount = 0; -// while ($contractRegistry->hasContracts()) { -// $contracts = [...$contractRegistry->contracts()]; -// $contractCount += count($unknownSchemas); -// $this->statusOutput->itemForStep('generating_contracts', $contractCount); -// foreach ($contracts as $contract) { -// yield from Contract::generate( -// $this->configuration->destination->source . DIRECTORY_SEPARATOR, -// $contract, -// ); -// $this->statusOutput->advanceStep('generating_contracts'); -// } -// } -// -// $this->statusOutput->markStepDone('generating_contracts'); - - $sortedSchemas = []; - foreach ($schemas as $schema) { - if (array_key_exists($schema->className->relative, $sortedSchemas)) { - continue; - } - - $sortedSchemas[$schema->className->relative] = [ - 'section' => 'common', - 'sections' => [], - ]; - } - - foreach ($hydrators as $section => $sectionHydrators) { - foreach ($sectionHydrators as $hydrator) { - foreach ($hydrator->schemas as $schema) { - if ($throwableSchemaRegistry->has($schema->className->relative)) { - continue; - } - - $sortedSchemas[$schema->className->relative]['sections'][] = $section; - } - } - } - - foreach ($sortedSchemas as $className => $sortedSchema) { - $sortedSchemas[$className]['sections'] = array_values(array_unique($sortedSchemas[$className]['sections'])); - if (count($sortedSchemas[$className]['sections']) !== 1) { - continue; - } - - $sortedSchemas[$className]['section'] = array_pop($sortedSchemas[$className]['sections']); - $sortedSchemas[$className]['sections'] = [ - $sortedSchemas[$className]['section'], - ]; - } - - $this->statusOutput->itemForStep('generating_schemas', count($schemas)); - foreach ($schemas as $schema) { - yield from Schema::generate( - $this->configuration->subSplit->subSplitsDestination . DIRECTORY_SEPARATOR . $this->splitPathPrefix($this->configuration->subSplit->sectionPackage, 'common') . $this->configuration->destination->source, - $schema, - [...$schemaRegistry->aliasesForClassName($schema->className->relative)], - ); - - if ($throwableSchemaRegistry->has($schema->className->relative)) { - yield from Error::generate( - $this->configuration->subSplit->subSplitsDestination . DIRECTORY_SEPARATOR . $this->splitPathPrefix($this->configuration->subSplit->sectionPackage, 'common') . $this->configuration->destination->source, - $schema, - ); - } - - $this->statusOutput->advanceStep('generating_schemas'); - } - - $this->statusOutput->markStepDone('generating_schemas'); - - $client = Gatherer\Client::gather($this->spec, ...$paths); - $routers = new Client\Routers(); - - $this->statusOutput->markStepBusy('generating_clientinterface'); - - yield from ClientInterface::generate( - $this->configuration, - $this->configuration->subSplit->subSplitsDestination . DIRECTORY_SEPARATOR . $this->splitPathPrefix($this->configuration->subSplit->rootPackage, '') . $this->configuration->destination->source, - $operations, - ); - - $this->statusOutput->markStepDone('generating_clientinterface'); - - $this->statusOutput->markStepBusy('generating_client'); - - yield from Client::generate( - $this->configuration, - $this->configuration->subSplit->subSplitsDestination . DIRECTORY_SEPARATOR . $this->splitPathPrefix($this->configuration->subSplit->rootPackage, '') . $this->configuration->destination->source, - $this->configuration->subSplit->subSplitsDestination . DIRECTORY_SEPARATOR . $this->splitPathPrefix($this->configuration->subSplit->rootPackage, '') . $this->configuration->destination->test, - $client, - $routers, - ); - - $this->statusOutput->markStepDone('generating_client'); - - if ($this->configuration->entryPoints->operations) { - $this->statusOutput->markStepBusy('generating_operationsinterface_entry_point'); - - yield from OperationsInterface::generate( - $this->configuration, - $this->configuration->subSplit->subSplitsDestination . DIRECTORY_SEPARATOR . $this->splitPathPrefix($this->configuration->subSplit->rootPackage, '') . $this->configuration->destination->source, - $operations, - ); - - $this->statusOutput->markStepDone('generating_operationsinterface_entry_point'); - - $this->statusOutput->markStepBusy('generating_operations_entry_point'); - - yield from Operations::generate( - $this->configuration, - $this->configuration->subSplit->subSplitsDestination . DIRECTORY_SEPARATOR . $this->splitPathPrefix($this->configuration->subSplit->rootPackage, '') . $this->configuration->destination->source, - $paths, - $operations, - ); - - $this->statusOutput->markStepDone('generating_operations_entry_point'); - } - - if ($this->configuration->entryPoints->webHooks) { - $this->statusOutput->itemForStep('generating_webhooks', count($webHooks)); - foreach ($webHooks as $event => $webHook) { - $split = null; - foreach ($this->configuration->subSplit->sectionGenerator ?? [] as $generator) { - $split = $generator::webHook(...$webHook); - if (is_string($split)) { - break; - } - } - - if (! is_string($split)) { - continue; - } - - $splits[] = $split; - - yield from WebHook::generate( - $this->configuration->subSplit->subSplitsDestination . DIRECTORY_SEPARATOR . $this->splitPathPrefix($this->configuration->subSplit->sectionPackage, $split) . $this->configuration->destination->source, - $this->configuration->namespace->source, - $event, - $schemaRegistry, - ...$webHook, - ); - - $this->statusOutput->advanceStep('generating_webhooks'); - } - - $this->statusOutput->markStepDone('generating_webhooks'); - - $this->statusOutput->markStepBusy('generating_webhooks_entry_point'); - - yield from WebHooks::generate( - $this->configuration->subSplit->subSplitsDestination . DIRECTORY_SEPARATOR . $this->splitPathPrefix($this->configuration->subSplit->rootPackage, '') . $this->configuration->destination->source, - $this->configuration->namespace->source, - $webHooksHydrators, - $webHooks, - ); - - $this->statusOutput->markStepDone('generating_webhooks_entry_point'); - } - - $this->statusOutput->itemForStep('generating_hydrators', count($hydrators)); - foreach ($hydrators as $section => $sectionHydrators) { - foreach ($sectionHydrators as $hydrator) { - yield from Hydrator::generate( - $this->configuration->subSplit->subSplitsDestination . DIRECTORY_SEPARATOR . $this->splitPathPrefix($this->configuration->subSplit->sectionPackage, $section) . $this->configuration->destination->source, - $hydrator, - ); - } - - $this->statusOutput->advanceStep('generating_hydrators'); - } - - $this->statusOutput->markStepDone('generating_hydrators'); - - $this->statusOutput->markStepBusy('generating_hydrators_entry_point'); - - yield from Hydrators::generate( - $this->configuration->subSplit->subSplitsDestination . DIRECTORY_SEPARATOR . $this->splitPathPrefix($this->configuration->subSplit->rootPackage, '') . $this->configuration->destination->source, - $this->configuration->namespace->source . '\\', - ...(static function (array $hydratorSplit): iterable { - foreach ($hydratorSplit as $hydrators) { - yield from [...$hydrators]; - } - })($hydrators), - ); - - $this->statusOutput->markStepDone('generating_hydrators_entry_point'); - - $subSplitConfig = []; - $splits = array_values(array_unique($splits)); - - if ($this->configuration->templates instanceof Templates) { - $this->statusOutput->markStepBusy('generating_templates_files_root_package'); - $subSplitConfig['root'] = [ - 'name' => $this->packageName($this->configuration->subSplit->rootPackage->name, ''), - 'directory' => $this->packageName($this->configuration->subSplit->rootPackage->name, ''), - 'target' => 'git@github.com:php-api-clients/' . $this->packageName($this->configuration->subSplit->rootPackage->name, '') . '.git', - 'target-branch' => $this->configuration->subSplit->branch, - ]; - \WyriHaximus\SubSplitTools\Files::setUp( - $configurationLocation . $this->configuration->templates->dir, - $configurationLocation . $this->configuration->destination->root . DIRECTORY_SEPARATOR . $this->configuration->subSplit->subSplitsDestination . DIRECTORY_SEPARATOR . $this->packageName($this->configuration->subSplit->rootPackage->name, ''), - [ - 'packageName' => $this->configuration->subSplit->rootPackage->name, - 'fullName' => render($this->configuration->subSplit->fullName, ['section' => '']), - 'namespace' => $this->configuration->namespace->source, - 'requires' => [ - [ - 'name' => $this->configuration->subSplit->vendor . '/' . $this->packageName($this->configuration->subSplit->sectionPackage->name, 'common'), - 'version' => '^0.3', - ], - ], - 'suggests' => [ - ...(function (string $sectionPackageName, string ...$splits): iterable { - foreach ($splits as $split) { - yield [ - 'name' => $this->packageName($sectionPackageName, $split), - 'reason' => '*', - ]; - } - })($this->configuration->subSplit->sectionPackage->name, ...$splits), - ], - 'qa' => $this->configuration->qa, - ], - ); - $this->statusOutput->markStepDone('generating_templates_files_root_package'); - - $this->statusOutput->markStepBusy('generating_templates_files_common_package'); - $subSplitConfig['common'] = [ - 'name' => $this->packageName($this->configuration->subSplit->sectionPackage->name, 'common'), - 'directory' => $this->packageName($this->configuration->subSplit->sectionPackage->name, 'common'), - 'target' => 'git@github.com:php-api-clients/' . $this->packageName($this->configuration->subSplit->sectionPackage->name, 'common') . '.git', - 'target-branch' => $this->configuration->subSplit->branch, - ]; - \WyriHaximus\SubSplitTools\Files::setUp( - $configurationLocation . $this->configuration->templates->dir, - $configurationLocation . $this->configuration->destination->root . DIRECTORY_SEPARATOR . $this->configuration->subSplit->subSplitsDestination . DIRECTORY_SEPARATOR . $this->packageName($this->configuration->subSplit->sectionPackage->name, 'common'), - [ - 'packageName' => $this->packageName($this->configuration->subSplit->sectionPackage->name, 'common'), - 'fullName' => render($this->configuration->subSplit->fullName, ['section' => 'common']), - 'namespace' => $this->configuration->namespace->source, - 'requires-dev' => [ - [ - 'name' => $this->configuration->subSplit->vendor . '/' . $this->configuration->subSplit->rootPackage->name, - 'version' => $this->configuration->subSplit->targetVersion, - ], - ], - 'qa' => $this->configuration->qa, - ], - ); - $this->statusOutput->markStepDone('generating_templates_files_common_package'); - - $this->statusOutput->itemForStep('generating_templates_files_subsplit_package', count($splits)); - foreach ($splits as $split) { - $subSplitConfig[$split] = [ - 'name' => $this->packageName($this->configuration->subSplit->sectionPackage->name, $split), - 'directory' => $this->packageName($this->configuration->subSplit->sectionPackage->name, $split), - 'target' => 'git@github.com:php-api-clients/' . $this->packageName($this->configuration->subSplit->sectionPackage->name, $split) . '.git', - 'target-branch' => $this->configuration->subSplit->branch, - ]; - \WyriHaximus\SubSplitTools\Files::setUp( - $configurationLocation . $this->configuration->templates->dir, - $configurationLocation . $this->configuration->destination->root . DIRECTORY_SEPARATOR . $this->configuration->subSplit->subSplitsDestination . DIRECTORY_SEPARATOR . $this->packageName($this->configuration->subSplit->sectionPackage->name, $split), - [ - 'packageName' => $this->packageName($this->configuration->subSplit->sectionPackage->name, $split), - 'fullName' => render($this->configuration->subSplit->fullName, ['section' => $split]), - 'namespace' => $this->configuration->namespace->source, - 'requires' => [ - [ - 'name' => $this->configuration->subSplit->vendor . '/' . $this->packageName($this->configuration->subSplit->sectionPackage->name, 'common'), - 'version' => $this->configuration->subSplit->targetVersion, - ], - ], - 'requires-dev' => [ - [ - 'name' => $this->configuration->subSplit->vendor . '/' . $this->configuration->subSplit->rootPackage->name, - 'version' => $this->configuration->subSplit->targetVersion, - ], - ], - 'qa' => $this->configuration->qa, - ], - ); - $this->statusOutput->advanceStep('generating_templates_files_subsplit_package'); - } - - $this->statusOutput->markStepDone('generating_templates_files_subsplit_package'); - } - - $this->statusOutput->markStepBusy('generating_subsplit_configuration'); - try { - /** @phpstan-ignore-next-line */ - @mkdir(dirname($configurationLocation . $this->configuration->subSplit->subSplitConfiguration), 0744, true); - } catch (FilesystemException) { - // @ignoreException - } - - file_put_contents( - $configurationLocation . $this->configuration->subSplit->subSplitConfiguration, - json_encode( - [ - 'sub-splits' => array_values($subSplitConfig), - ], - JSON_PRETTY_PRINT, - ) . PHP_EOL, - ); - $this->statusOutput->markStepDone('generating_subsplit_configuration'); - } - - private function packageName(string $name, string $split): string - { - return render( - $name, - ['section' => $split], - ); - } - - private function splitPathPrefix(RootPackage|SectionPackage $package, string $section): string - { - return $this->packageName($package->name, $section) . '/'; - } -} diff --git a/src/Generator/Client.php b/src/Generator/Client.php index b9b8741..ac281f7 100644 --- a/src/Generator/Client.php +++ b/src/Generator/Client.php @@ -6,21 +6,24 @@ use ApiClients\Contracts\HTTP\Headers\AuthenticationInterface; use ApiClients\Contracts\OpenAPI\WebHooksInterface; -use ApiClients\Tools\OpenApiClientGenerator\Configuration; -use ApiClients\Tools\OpenApiClientGenerator\File; use ApiClients\Tools\OpenApiClientGenerator\Generator\Client\Methods\ChunkCount; use ApiClients\Tools\OpenApiClientGenerator\Generator\Client\PHPStan\ClientCallReturnTypes; use ApiClients\Tools\OpenApiClientGenerator\Generator\Client\PHPStan\ClientCallReturnTypesTest; use ApiClients\Tools\OpenApiClientGenerator\Generator\Client\Routers; use ApiClients\Tools\OpenApiClientGenerator\Generator\Client\Routers\RouterClass; +use ApiClients\Tools\OpenApiClientGenerator\Generator\Helper\ConfigurationPackage; use ApiClients\Tools\OpenApiClientGenerator\Generator\Helper\Operation; use ApiClients\Tools\OpenApiClientGenerator\Generator\Helper\Types; -use ApiClients\Tools\OpenApiClientGenerator\PrivatePromotedPropertyAsParam; -use ApiClients\Tools\OpenApiClientGenerator\Representation; -use ApiClients\Tools\OpenApiClientGenerator\Utils; use Jawira\CaseConverter\Convert; +use League\OpenAPIValidation\Schema\SchemaValidator; use NumberToWords\NumberToWords; -use PhpParser\Builder\Param; +use OpenAPITools\Configuration\Package as ConfigurationPackageType; +use OpenAPITools\Configuration\Package\QA\Tool; +use OpenAPITools\Contract\FileGenerator; +use OpenAPITools\Contract\Package; +use OpenAPITools\Representation\Namespaced; +use OpenAPITools\Utils\File; +use OpenAPITools\Utils\Utils; use PhpParser\BuilderFactory; use PhpParser\Comment\Doc; use PhpParser\Node; @@ -42,61 +45,66 @@ use function dirname; use function explode; use function implode; -use function PHPStan\Testing\assertType; -use function strlen; -use function strpos; +use function str_starts_with; use function trim; use function ucfirst; use const DIRECTORY_SEPARATOR; use const PHP_EOL; -final class Client +/** + * @phpstan-type OperationTreeEntry array{operation: Namespaced\Operation, path: Namespaced\Path} + * @phpstan-type OperationTree array{operations: list, paths: array} + */ +final readonly class Client implements FileGenerator { + public function __construct( + private BuilderFactory $builderFactory, + private bool $call, + private bool $operations, + ) { + } + /** @return iterable */ - public static function generate(Configuration $configuration, string $pathPrefix, string $pathPrefixTests, Representation\Client $client, Routers $routers): iterable + public function generate(Package $package, Namespaced\Representation $representation): iterable { + $package = ConfigurationPackage::unwrap($package); + + $routers = new Routers(); $operations = []; - foreach ($client->paths as $path) { + foreach ($representation->client->paths as $path) { $operations = [...$operations, ...$path->operations]; } - $factory = new BuilderFactory(); - $stmt = $factory->namespace(trim($configuration->namespace->source, '\\')); - - $class = $factory->class('Client')->implement(new Node\Name('ClientInterface'))->makeFinal(); + $stmt = $this->builderFactory->namespace(trim($package->namespace->source, '\\')); - if ($configuration->entryPoints->call) { - $class->addStmt( - $factory->property('router')->setType('array')->setDefault([])->makePrivate(), - ); - } + $class = $this->builderFactory->class('Client')->implement(new Node\Name('ClientInterface'))->makeFinal(); - if ($configuration->entryPoints->operations) { + if ($this->call) { $class->addStmt( - $factory->property('operations')->setType('OperationsInterface')->makeReadonly()->makePrivate(), + $this->builderFactory->property('router')->setType('array')->setDefault([])->makePrivate(), ); } - if ($configuration->entryPoints->webHooks) { + if ($this->operations) { $class->addStmt( - $factory->property('webHooks')->setType('WebHooks')->makeReadonly()->makePrivate(), + $this->builderFactory->property('operations')->setType('OperationsInterface')->makeReadonly()->makePrivate(), ); } $class->addStmt( - $factory->property('routers')->setType('Internal\\Routers')->makeReadonly()->makePrivate(), + $this->builderFactory->property('routers')->setType('\\' . $package->namespace->source . '\\Internal\\Routers')->makeReadonly()->makePrivate(), )->addStmt( - $factory->method('__construct')->makePublic()->addParam( - (new Param('authentication'))->setType('\\' . AuthenticationInterface::class), + $this->builderFactory->method('__construct')->makePublic()->addParam( + $this->builderFactory->param('authentication')->makePrivate()->makeReadonly()->setType('\\' . AuthenticationInterface::class), )->addParam( - (new Param('browser'))->setType('\\' . Browser::class), - )->addStmt((static function (Representation\Client $client): Node\Expr { - $assignExpr = new Node\Expr\Variable('browser'); - - if ($client->baseUrl !== null) { - $assignExpr = new Node\Expr\MethodCall( - $assignExpr, + $this->builderFactory->param('browser')->makePrivate()->setType('\\' . Browser::class), + )->addStmt((static function (Namespaced\Client $client): Node\Stmt\Expression { + $browserVariable = new Node\Expr\Variable('browser'); + $browserWithBase = $client->baseUrl === null + ? $browserVariable + : new Node\Expr\MethodCall( + $browserVariable, 'withBase', [ new Arg( @@ -104,12 +112,11 @@ public static function generate(Configuration $configuration, string $pathPrefix ), ], ); - } - return new Node\Expr\Assign( + return new Node\Stmt\Expression(new Node\Expr\Assign( new Node\Expr\Variable('browser'), new Node\Expr\MethodCall( - $assignExpr, + $browserWithBase, 'withFollowRedirects', [ new Arg( @@ -117,15 +124,15 @@ public static function generate(Configuration $configuration, string $pathPrefix ), ], ), - ); - })($client))->addStmt( + )); + })($representation->client))->addStmt( new Node\Expr\Assign( new Node\Expr\Variable('requestSchemaValidator'), new Node\Expr\New_( - new Node\Name('\League\OpenAPIValidation\Schema\SchemaValidator'), + new Node\Name('\\' . SchemaValidator::class), [ new Node\Arg(new Node\Expr\ClassConstFetch( - new Node\Name('\League\OpenAPIValidation\Schema\SchemaValidator'), + new Node\Name('\\' . SchemaValidator::class), 'VALIDATE_AS_REQUEST', )), ], @@ -135,10 +142,10 @@ public static function generate(Configuration $configuration, string $pathPrefix new Node\Expr\Assign( new Node\Expr\Variable('responseSchemaValidator'), new Node\Expr\New_( - new Node\Name('\League\OpenAPIValidation\Schema\SchemaValidator'), + new Node\Name('\\' . SchemaValidator::class), [ new Node\Arg(new Node\Expr\ClassConstFetch( - new Node\Name('\League\OpenAPIValidation\Schema\SchemaValidator'), + new Node\Name('\\' . SchemaValidator::class), 'VALIDATE_AS_RESPONSE', )), ], @@ -148,13 +155,13 @@ public static function generate(Configuration $configuration, string $pathPrefix new Node\Expr\Assign( new Node\Expr\Variable('hydrators'), new Node\Expr\New_( - new Node\Name('Internal\\Hydrators'), + new Node\Name('\\' . $package->namespace->source . '\\Internal\\Hydrators'), [], ), ), )->addStmts([ - ...($configuration->entryPoints->operations ? [ - new Node\Expr\Assign( + ...($this->operations ? [ + new Node\Stmt\Expression(new Node\Expr\Assign( new Node\Expr\PropertyFetch( new Node\Expr\Variable('this'), 'operations', @@ -164,21 +171,21 @@ public static function generate(Configuration $configuration, string $pathPrefix [ new Arg( new Node\Expr\New_( - new Node\Name('Internal\\Operators'), + new Node\Name('\\' . $package->namespace->source . '\\Internal\\Operators'), [ new Arg( - new Node\Expr\Variable('browser'), + new Node\Expr\Variable('authentication'), false, false, [], - new Node\Identifier('browser'), + new Node\Identifier('authentication'), ), new Arg( - new Node\Expr\Variable('authentication'), + new Node\Expr\Variable('browser'), false, false, [], - new Node\Identifier('authentication'), + new Node\Identifier('browser'), ), new Arg( new Node\Expr\Variable('requestSchemaValidator'), @@ -206,90 +213,106 @@ public static function generate(Configuration $configuration, string $pathPrefix ), ], ), - ), + )), ] : []), - ])->addStmts([ - ...($configuration->entryPoints->webHooks ? [ + ])->addStmt( + new Node\Stmt\Expression( new Node\Expr\Assign( new Node\Expr\PropertyFetch( new Node\Expr\Variable('this'), - 'webHooks', + 'routers', ), new Node\Expr\New_( - new Node\Name('WebHooks'), + new Node\Name('\\' . $package->namespace->source . '\\Internal\\Routers'), [ new Arg( - new Node\Expr\Variable('requestSchemaValidator'), + new Node\Expr\Variable('authentication'), false, false, [], - new Node\Identifier('requestSchemaValidator'), + new Node\Identifier('authentication'), ), new Arg( - new Node\Expr\Variable('hydrators'), + new Node\Expr\Variable('browser'), false, false, [], - new Node\Identifier('hydrator'), + new Node\Identifier('browser'), ), - ], - ), - ), - ] : []), - ])->addStmt( - new Node\Stmt\Expression( - new Node\Expr\Assign( - new Node\Expr\PropertyFetch( - new Node\Expr\Variable('this'), - 'routers', - ), - new Node\Expr\New_( - new Node\Name('Internal\\Routers'), - [ new Arg( - new Node\Expr\Variable('browser'), + new Node\Expr\Variable('requestSchemaValidator'), false, false, [], - new Node\Identifier('browser'), + new Node\Identifier('requestSchemaValidator'), ), new Arg( - new Node\Expr\Variable('authentication'), + new Node\Expr\Variable('responseSchemaValidator'), false, false, [], - new Node\Identifier('authentication'), + new Node\Identifier('responseSchemaValidator'), ), new Arg( - new Node\Expr\Variable('requestSchemaValidator'), + new Node\Expr\Variable('hydrators'), false, false, [], - new Node\Identifier('requestSchemaValidator'), + new Node\Identifier('hydrators'), ), + ], + ), + ), + ), + )->addStmts([ + ...($representation->webHooks === [] ? [] : [ + new Node\Stmt\Expression(new Node\Expr\Assign( + new Node\Expr\PropertyFetch( + new Node\Expr\Variable('this'), + 'webHooks', + ), + new Node\Expr\New_( + new Node\Name('\\' . $package->namespace->source . '\\WebHooks'), + [ new Arg( - new Node\Expr\Variable('responseSchemaValidator'), + new Node\Expr\Variable('requestSchemaValidator'), false, false, [], - new Node\Identifier('responseSchemaValidator'), + new Node\Identifier('requestSchemaValidator'), ), new Arg( new Node\Expr\Variable('hydrators'), false, false, [], - new Node\Identifier('hydrators'), + new Node\Identifier('hydrator'), ), ], ), + )), + ]), + ]), + ); + + if ($representation->webHooks !== []) { + $class->addStmt( + $this->builderFactory->property('webHooks')->setType('\\' . $package->namespace->source . '\\WebHooks')->makeReadonly()->makePrivate(), + )->addStmt( + $this->builderFactory->method('webHooks')->makePublic()->setReturnType('\\' . WebHooksInterface::class)->addStmt( + new Node\Stmt\Return_( + new Node\Expr\PropertyFetch( + new Node\Expr\Variable('this'), + 'webHooks', + ), ), ), - ), - ); + ); + } + /** @var array> $sortedOperations */ $sortedOperations = []; - foreach ($client->paths as $path) { + foreach ($representation->client->paths as $path) { foreach ($path->operations as $operation) { if ($operation->path === '/') { $operationPath = ['']; @@ -310,57 +333,61 @@ public static function generate(Configuration $configuration, string $pathPrefix ]; } - $sortedOperations[$operation->matchMethod][$operationPathCount] = self::traverseOperationPaths($sortedOperations[$operation->matchMethod][$operationPathCount], $operationPath, $operation, $path); + /** @var OperationTree $operationTree */ + $operationTree = $sortedOperations[$operation->matchMethod][$operationPathCount]; + $sortedOperations[$operation->matchMethod][$operationPathCount] = self::traverseOperationPaths($operationTree, $operationPath, $operation, $path); } } - if ($configuration->entryPoints->call) { - $chunkCountClasses = []; - $operationsIfs = []; + $chunkCountClasses = []; + if ($this->call) { + $operationsIfs = []; foreach ($sortedOperations as $method => $ops) { $opsTmts = []; - foreach ($ops as $chunkCount => $moar) { - $returnTypes = []; - $docBlockReturnTypes = []; - $traverseForReturnTypes = static function (array $moar) use (&$returnTypes, &$docBlockReturnTypes, &$traverseForReturnTypes): void { - foreach ( - array_map( - static fn (array $a): Representation\Operation => $a['operation'], - $moar['operations'], - ) as $operation - ) { - $returnTypes = [ - ...$returnTypes, + foreach ($ops as $chunkCount => $operationTree) { + /** @var OperationTree $operationTree */ + $returnTypesList = []; + $docBlockReturnTypesList = []; + $traverseForReturnTypes = static function (array $tree) use (&$returnTypesList, &$docBlockReturnTypesList, &$traverseForReturnTypes): void { + /** @var list $operationEntries */ + $operationEntries = $tree['operations']; + foreach ($operationEntries as $operationEntry) { + $operation = $operationEntry['operation']; + $returnTypesList = [ + ...$returnTypesList, ...explode('|', Operation::getResultTypeFromOperation($operation)), ]; - $docBlockReturnTypes = [ - ...$docBlockReturnTypes, + $docBlockReturnTypesList = [ + ...$docBlockReturnTypesList, ...explode('|', Operation::getDocBlockResultTypeFromOperation($operation)), ]; } - foreach ($moar['paths'] as $path) { - $traverseForReturnTypes($path); + /** @var array $nestedPaths */ + $nestedPaths = $tree['paths']; + foreach ($nestedPaths as $nestedTree) { + /** @var OperationTree $nestedTree */ + $traverseForReturnTypes($nestedTree); } }; - $traverseForReturnTypes($moar); + $traverseForReturnTypes($operationTree); $returnTypesUnfilterred = implode( '|', array_map( - 'trim', + trim(...), array_unique( - [...Types::filterDuplicatesAndIncompatibleRawTypes(...$returnTypes)], + [...Types::filterDuplicatesAndIncompatibleRawTypes(...$returnTypesList)], ), ), ); $returnTypes = implode( '|', array_map( - 'trim', + trim(...), array_filter( array_unique( - [...Types::filterDuplicatesAndIncompatibleRawTypes(...$returnTypes)], + [...Types::filterDuplicatesAndIncompatibleRawTypes(...$returnTypesList)], ), static fn (string $type): bool => $type !== 'void', ), @@ -369,22 +396,23 @@ public static function generate(Configuration $configuration, string $pathPrefix $docBlockReturnTypes = implode( '|', array_map( - 'trim', + trim(...), array_filter( array_unique( - $docBlockReturnTypes, + $docBlockReturnTypesList, ), static fn (string $type): bool => $type !== 'void', ), ), ); $chunkCountClasses[] = $cc = new ChunkCount( - 'Internal\\Router\\' . (new Convert($method))->toPascal() . '\\' . (new Convert(NumberToWords::transformNumber('en', $chunkCount)))->toPascal(), + 'Internal\\Router\\' . new Convert($method)->toPascal() . '\\' . new Convert(NumberToWords::transformNumber('en', $chunkCount))->toPascal(), $returnTypes, $docBlockReturnTypes, self::traverseOperations( - $moar['operations'], /** @phpstan-ignore-line */ - $moar['paths'], /** @phpstan-ignore-line */ + $package, + $operationTree['operations'], + $operationTree['paths'], 0, $routers, ), @@ -398,7 +426,7 @@ public static function generate(Configuration $configuration, string $pathPrefix ), [ new Node\Stmt\If_( - new Node\Expr\BinaryOp\Equal( + new Node\Expr\BinaryOp\Identical( new Node\Expr\FuncCall( new Node\Name('\array_key_exists'), [ @@ -480,7 +508,11 @@ public static function generate(Configuration $configuration, string $pathPrefix new Node\Scalar\String_($method), ), (static function (array $opsTmts): array { - $first = array_shift($opsTmts); + $first = array_shift($opsTmts); + if ($first === null) { + return []; + } + $elseIfs = []; foreach ($opsTmts as $opsTmt) { @@ -500,11 +532,16 @@ public static function generate(Configuration $configuration, string $pathPrefix ]; } - $firstOperationsIfs = array_shift($operationsIfs); - $operationsIf = new Node\Stmt\If_( - $firstOperationsIfs[0], /** @phpstan-ignore-line */ + if ($operationsIfs === []) { + return; + } + + $firstOperationsIf = array_shift($operationsIfs); + + $operationsIf = new Node\Stmt\If_( + $firstOperationsIf[0], [ - 'stmts' => $firstOperationsIfs[1], /** @phpstan-ignore-line */ + 'stmts' => $firstOperationsIf[1], 'elseifs' => (static function (array $operationsIfs): array { $elseIfs = []; @@ -518,9 +555,9 @@ public static function generate(Configuration $configuration, string $pathPrefix ); $class->addStmt( - $factory->method('call')->makePublic()->setDocComment( + $this->builderFactory->method('call')->makePublic()->setDocComment( new Doc(implode(PHP_EOL, [ - ...($configuration->qa?->phpcs ? ['// phpcs:disable'] : []), + ...($package->qa->phpcs instanceof Tool && $package->qa->phpcs->enabled ? ['// phpcs:disable'] : []), '/**', // ' * @return ' . (static function (array $operations): string { // $count = count($operations); @@ -541,9 +578,9 @@ public static function generate(Configuration $configuration, string $pathPrefix // return $left . $right; // })($operations), ' */', - ...($configuration->qa?->phpcs ? ['// phpcs:enable'] : []), + ...($package->qa->phpcs instanceof Tool && $package->qa->phpcs->enabled ? ['// phpcs:enable'] : []), ])), - )->addParam((new Param('call'))->setType('string'))->addParam((new Param('params'))->setType('array')->setDefault([]))->setReturnType( + )->addParam($this->builderFactory->param('call')->setType('string'))->addParam($this->builderFactory->param('params')->setType('array')->setDefault([]))->setReturnType( new UnionType( array_map( static fn (string $type): Name => new Name($type), @@ -610,18 +647,20 @@ public static function generate(Configuration $configuration, string $pathPrefix ), ), )->addStmt($operationsIf)->addStmt( - new Node\Stmt\Throw_( - new Node\Expr\New_( - new Node\Name('\InvalidArgumentException'), + new Node\Stmt\Expression( + new Node\Expr\Throw_( + new Node\Expr\New_( + new Node\Name('\InvalidArgumentException'), + ), ), ), ), ); } - if ($configuration->entryPoints->operations) { + if ($this->operations) { $class->addStmt( - $factory->method('operations')->makePublic()->setReturnType('OperationsInterface')->addStmt(new Node\Stmt\Return_( + $this->builderFactory->method('operations')->makePublic()->setReturnType('OperationsInterface')->addStmt(new Node\Stmt\Return_( new Node\Expr\PropertyFetch( new Node\Expr\Variable('this'), 'operations', @@ -630,76 +669,57 @@ public static function generate(Configuration $configuration, string $pathPrefix ); } - if ($configuration->entryPoints->webHooks) { - $class->addStmt( - $factory->method('webHooks')->makePublic()->setReturnType('\\' . WebHooksInterface::class)->addStmt(new Node\Stmt\Return_( - new Node\Expr\PropertyFetch( - new Node\Expr\Variable('this'), - 'webHooks', - ), - )), - ); - } - - yield new File($pathPrefix, 'Client', $stmt->addStmt($class)->getNode()); + yield new File($package->destination->source, 'Client', $stmt->addStmt($class)->getNode(), File::DO_LOAD_ON_WRITE); foreach ($routers->get() as $router) { - yield from self::createRouter( - $pathPrefix, - $configuration->namespace->source . '\\', + yield from $this->createRouter( + $package, $router, $routers, ); } - /** @phpstan-ignore-next-line */ - if (! isset($chunkCountClasses)) { - return; - } + yield from \ApiClients\Tools\OpenApiClientGenerator\Generator\Routers::generate($package, $routers); foreach ($chunkCountClasses as $chunkCountClass) { - yield from self::createRouterChunkSize( - $pathPrefix, - $configuration->namespace->source . '\\', + yield from $this->createRouterChunkSize( + $package, $chunkCountClass, ); } - yield from \ApiClients\Tools\OpenApiClientGenerator\Generator\Routers::generate($configuration, $pathPrefix, $routers); - - if (! $configuration->qa?->phpstan) { + if (! $package->qa->phpstan instanceof Tool || ! $package->qa->phpstan->enabled) { return; } require_once dirname(__DIR__) . DIRECTORY_SEPARATOR . 'phpstan-assertType-mock.php'; - assertType('bool', true); - yield from ClientCallReturnTypes::generate($configuration, $pathPrefix, $client); - yield from ClientCallReturnTypesTest::generate($configuration, $pathPrefixTests, $client); + yield from ClientCallReturnTypes::generate($package, $representation->client); + yield from ClientCallReturnTypesTest::generate($package, $representation->client); - if ($configuration->qa->phpstan->configFilePath === null) { + if ($package->qa->phpstan->configFilePath === null) { return; } - yield new File($pathPrefix, '../' . $configuration->qa->phpstan->configFilePath, implode(PHP_EOL, [ + yield new File($package->destination->source, '../' . $package->qa->phpstan->configFilePath, implode(PHP_EOL, [ 'services:', - ' - class: ' . $configuration->namespace->source . '\PHPStan\ClientCallReturnTypes', + ' - class: ' . $package->namespace->source . '\PHPStan\ClientCallReturnTypes', ' tags:', ' - phpstan.broker.dynamicMethodReturnTypeExtension', '', - ])); + ]), File::DO_NOT_LOAD_ON_WRITE); } /** - * @param array $operations - * @param array $operationPath + * @param OperationTree $operations + * @param list $operationPath * - * @return array + * @return OperationTree */ - private static function traverseOperationPaths(array $operations, array &$operationPath, Representation\Operation $operation, Representation\Path $path): array + private static function traverseOperationPaths(array $operations, array $operationPath, Namespaced\Operation $operation, Namespaced\Path $path): array { if (count($operationPath) === 0) { - $operations['operations'][] = [ /** @phpstan-ignore-line */ + $operations['operations'][] = [ 'operation' => $operation, 'path' => $path, ]; @@ -708,29 +728,33 @@ private static function traverseOperationPaths(array $operations, array &$operat } $chunk = array_shift($operationPath); - if (! array_key_exists($chunk, $operations['paths'])) { /** @phpstan-ignore-line */ - $operations['paths'][$chunk] = [ /** @phpstan-ignore-line */ + + if (! array_key_exists($chunk, $operations['paths'])) { + $operations['paths'][$chunk] = [ 'operations' => [], 'paths' => [], ]; } - $operations['paths'][$chunk] = self::traverseOperationPaths($operations['paths'][$chunk], $operationPath, $operation, $path); /** @phpstan-ignore-line */ + /** @var OperationTree $childTree */ + $childTree = $operations['paths'][$chunk]; + $operations['paths'][$chunk] = self::traverseOperationPaths($childTree, $operationPath, $operation, $path); return $operations; } /** - * @param array $paths + * @param array $paths * - * @return iterable + * @return iterable */ private static function operationsInThisThree(array $paths, int $level, Routers $routers): iterable { foreach ($paths as $path) { + /** @var OperationTree $path */ yield from $path['operations']; yield from self::operationsInThisThree( - $path['paths'], /** @phpstan-ignore-line */ + $path['paths'], $level + 1, $routers, ); @@ -738,16 +762,16 @@ private static function operationsInThisThree(array $paths, int $level, Routers } /** - * @param array $operations - * @param array $paths + * @param list $operations + * @param array $paths * - * @return array + * @return list */ - private static function traverseOperations(array $operations, array $paths, int $level, Routers $routers): array + private static function traverseOperations(ConfigurationPackageType $package, array $operations, array $paths, int $level, Routers $routers): array { $nonArgumentPathChunks = []; foreach (array_keys($paths) as $pathChunk) { - if (strpos($pathChunk, '{') === 0) { + if (str_starts_with($pathChunk, '{')) { continue; } @@ -772,18 +796,21 @@ private static function traverseOperations(array $operations, array $paths, int $ifs[] = [ new Node\Expr\BinaryOp\Equal( new Node\Expr\Variable('call'), - new Node\Scalar\String_($operation['operation']->matchMethod . ' ' . $operation['operation']->path), /** @phpstan-ignore-line */ + new Node\Scalar\String_($operation['operation']->matchMethod . ' ' . $operation['operation']->path), ), - static::callOperation( + self::callOperation( + $package, $routers, - ...$operation, /** @phpstan-ignore-line */ + ...$operation, ), ]; } // if (count($opsIntree) > 13) { - foreach ($paths as $pathChunk => $path) { - $ifs[] = [ + foreach ($paths as $pathChunk => $pathTreeValue) { + /** @var OperationTree $pathTree */ + $pathTree = $pathTreeValue; + $ifs[] = [ new Node\Expr\BinaryOp\Equal( new Node\Expr\ArrayDimFetch( new Node\Expr\Variable('pathChunks'), @@ -792,8 +819,9 @@ private static function traverseOperations(array $operations, array $paths, int new Node\Scalar\String_($pathChunk), ), self::traverseOperations( - $path['operations'], /** @phpstan-ignore-line */ - $path['paths'], /** @phpstan-ignore-line */ + $package, + $pathTree['operations'], + $pathTree['paths'], $level + 1, $routers, ), @@ -823,8 +851,8 @@ private static function traverseOperations(array $operations, array $paths, int ]; } - /** @return array */ - private static function callOperation(Routers $routers, Representation\Operation $operation, Representation\Path $path): array + /** @return list */ + private static function callOperation(ConfigurationPackageType $package, Routers $routers, Namespaced\Operation $operation, Namespaced\Path $path): array { $returnType = implode( '|', @@ -837,9 +865,20 @@ private static function callOperation(Routers $routers, Representation\Operation ), ], ); - $router = $routers->add( + + $listOperationKey = ''; + $listOperationInitialValue = 0; + if ($operation->matchMethod === 'LIST') { + /** @var array{key: string, initialValue: int} $listOperationMeta */ + $listOperationMeta = $operation->metaData['listOperation']; + $listOperationKey = $listOperationMeta['key']; + $listOperationInitialValue = $listOperationMeta['initialValue']; + } + + $router = $routers->add( + $package, $operation->matchMethod, - $operation->group, + $operation->group ?? '', $operation->name, $returnType, Operation::getDocBlockResultTypeFromOperation($operation), @@ -868,14 +907,16 @@ private static function callOperation(Routers $routers, Representation\Operation ), [ 'stmts' => [ - new Node\Stmt\Throw_( - new Node\Expr\New_( - new Node\Name('\InvalidArgumentException'), - [ - new Arg( - new Node\Scalar\String_('Missing mandatory field: ' . $param->targetName), - ), - ], + new Node\Stmt\Expression( + new Node\Expr\Throw_( + new Node\Expr\New_( + new Node\Name('\InvalidArgumentException'), + [ + new Arg( + new Node\Scalar\String_('Missing mandatory field: ' . $param->targetName), + ), + ], + ), ), ), ], @@ -905,15 +946,15 @@ private static function callOperation(Routers $routers, Representation\Operation ...($operation->matchMethod !== 'LIST' ? self::makeCall( $operation, $path, - $returnType === 'void' ? static fn (Expr $expr): Node\Stmt\Expression => new Node\Stmt\Expression($expr) : static fn (Expr $expr): Node\Stmt\Return_ => new Node\Stmt\Return_($expr) + $returnType === 'void' ? static fn (Expr $expr): Node\Stmt\Expression => new Node\Stmt\Expression($expr) : static fn (Expr $expr): Node\Stmt\Return_ => new Node\Stmt\Return_($expr), ) : [ new Node\Stmt\Expression( new Node\Expr\Assign( new Expr\ArrayDimFetch( new Expr\Variable('arguments'), - new Node\Scalar\String_($operation->metaData['listOperation']['key']), /** @phpstan-ignore-line */ + new Node\Scalar\String_($listOperationKey), ), - new Node\Scalar\LNumber($operation->metaData['listOperation']['initialValue']), /** @phpstan-ignore-line */ + new Node\Scalar\LNumber($listOperationInitialValue), ), ), new Node\Stmt\Do_( @@ -950,7 +991,7 @@ private static function callOperation(Routers $routers, Representation\Operation new Expr\PostInc( new Expr\ArrayDimFetch( new Expr\Variable('arguments'), - new Node\Scalar\String_($operation->metaData['listOperation']['key']), /** @phpstan-ignore-line */ + new Node\Scalar\String_($listOperationKey), ), ), ), @@ -972,7 +1013,7 @@ private static function callOperation(Routers $routers, Representation\Operation ), $router->loopUpMethod, ), - (new Convert(Utils::fixKeyword($router->method)))->toCamel(), + new Convert(Utils::fixKeyword($router->method))->toCamel(), [ new Arg( new Node\Expr\Variable( @@ -985,14 +1026,19 @@ private static function callOperation(Routers $routers, Representation\Operation ]; } - /** @return array */ - private static function makeCall(Representation\Operation $operation, Representation\Path $path, callable $calWrap): array + /** @return list */ + private static function makeCall(Namespaced\Operation $operation, Namespaced\Path $path, callable $calWrap): array { + /** @var class-string $className */ + $className = $operation->className->fullyQualified->source; + $constructor = new ReflectionClass($className)->getConstructor(); + $needsHydratorAndValidator = $constructor !== null && count(array_filter($constructor->getParameters(), static fn (ReflectionParameter $parameter): bool => $parameter->name === 'responseSchemaValidator' || $parameter->name === 'hydrator')) > 0; + return [ new Node\Stmt\Expression(new Node\Expr\Assign( new Node\Expr\Variable('operator'), new Node\Expr\New_( - new Node\Name($operation->operatorClassName->relative), + new Node\Name($operation->operatorClassName->fullyQualified->source), [ new Arg(new Node\Expr\PropertyFetch( new Node\Expr\Variable('this'), @@ -1008,8 +1054,7 @@ private static function makeCall(Representation\Operation $operation, Representa 'requestSchemaValidator', )), ] : []), - /** @phpstan-ignore-next-line */ - ...(count(array_filter((new ReflectionClass($operation->className->fullyQualified->source))->getConstructor()->getParameters(), static fn (ReflectionParameter $parameter): bool => $parameter->name === 'responseSchemaValidator' || $parameter->name === 'hydrator')) > 0 ? [ + ...($needsHydratorAndValidator ? [ new Arg(new Node\Expr\PropertyFetch( new Node\Expr\Variable('this'), 'responseSchemaValidator', @@ -1045,31 +1090,30 @@ private static function makeCall(Representation\Operation $operation, Representa } /** @return iterable */ - private static function createRouter(string $pathPrefix, string $namespace, RouterClass $router, Routers $routers): iterable + private function createRouter(ConfigurationPackageType $package, RouterClass $router, Routers $routers): iterable { - $className = $routers->createClassName(Utils::fixKeyword($router->method), $router->group, '')->class; - $factory = new BuilderFactory(); - $stmt = $factory->namespace(Utils::dirname($namespace . $className)); - $class = $factory->class(Utils::basename($namespace . $className))->makeFinal()->addStmt( - $factory->method('__construct')->makePublic()->addParam( - (new PrivatePromotedPropertyAsParam('requestSchemaValidator'))->setType('\League\OpenAPIValidation\Schema\SchemaValidator'), + $className = $routers->createClassName($package, Utils::fixKeyword($router->method), $router->group, '')->class; + $stmt = $this->builderFactory->namespace($className->namespace->source); + $class = $this->builderFactory->class($className->className)->makeFinal()->addStmt( + $this->builderFactory->method('__construct')->makePublic()->addParam( + $this->builderFactory->param('requestSchemaValidator')->makePrivate()->setType('\\' . SchemaValidator::class), )->addParam( - (new PrivatePromotedPropertyAsParam('responseSchemaValidator'))->setType('\League\OpenAPIValidation\Schema\SchemaValidator'), + $this->builderFactory->param('responseSchemaValidator')->makePrivate()->setType('\\' . SchemaValidator::class), )->addParam( - (new PrivatePromotedPropertyAsParam('hydrators'))->setType('Internal\\Hydrators'), + $this->builderFactory->param('hydrators')->makePrivate()->setType('\\' . $package->namespace->source . '\\Internal\\Hydrators'), )->addParam( - (new PrivatePromotedPropertyAsParam('browser'))->setType('\\' . Browser::class), + $this->builderFactory->param('browser')->makePrivate()->setType('\\' . Browser::class), )->addParam( - (new PrivatePromotedPropertyAsParam('authentication'))->setType('\\' . AuthenticationInterface::class), + $this->builderFactory->param('authentication')->makePrivate()->setType('\\' . AuthenticationInterface::class), ), ); foreach ($router->methods as $method) { $class->addStmt( - $factory->method( - (new Convert($method->name))->toCamel(), + $this->builderFactory->method( + new Convert($method->name)->toCamel(), )->makePublic()->addParam( - (new Param('params'))->setType('array'), + $this->builderFactory->param('params')->setType('array'), )->addStmts($method->nodes)->setReturnType( $method->returnType, )->setDocComment( @@ -1087,25 +1131,25 @@ private static function createRouter(string $pathPrefix, string $namespace, Rout ); } - yield new File($pathPrefix, $className, $stmt->addStmt($class)->getNode()); + yield new File($package->destination->source, $className->relative, $stmt->addStmt($class)->getNode(), File::DO_LOAD_ON_WRITE); } /** @return iterable */ - private static function createRouterChunkSize(string $pathPrefix, string $namespace, ChunkCount $chunkCount): iterable + private function createRouterChunkSize(ConfigurationPackageType $package, ChunkCount $chunkCount): iterable { - $factory = new BuilderFactory(); - $stmt = $factory->namespace(Utils::dirname($namespace . $chunkCount->className)); + $namespace = $package->namespace->source . '\\'; + $stmt = $this->builderFactory->namespace(Utils::dirname($namespace . $chunkCount->className)); - $class = $factory->class(Utils::basename($namespace . $chunkCount->className))->makeFinal()->addStmt( - $factory->method('__construct')->makePublic()->addParam( - (new PrivatePromotedPropertyAsParam('routers'))->setType('\\' . $namespace . 'Internal\\Routers'), + $class = $this->builderFactory->class(Utils::basename($namespace . $chunkCount->className))->makeFinal()->addStmt( + $this->builderFactory->method('__construct')->makePublic()->addParam( + $this->builderFactory->param('routers')->makePrivate()->setType('\\' . $namespace . 'Internal\\Routers'), ), ); - $callMethod = $factory->method('call')->makePublic()->addParams([ - ...(static function (array $params): iterable { + $callMethod = $this->builderFactory->method('call')->makePublic()->addParams([ + ...(function (array $params): iterable { foreach ($params as $param => $type) { - yield (new Param($param))->setType($type); + yield $this->builderFactory->param($param)->setType($type); } })([ 'call' => 'string', @@ -1113,18 +1157,20 @@ private static function createRouterChunkSize(string $pathPrefix, string $namesp 'pathChunks' => 'array', ]), ])->addStmts($chunkCount->nodes)->addStmt( - new Node\Stmt\Throw_( - new Node\Expr\New_( - new Node\Name('\InvalidArgumentException'), + new Node\Stmt\Expression( + new Node\Expr\Throw_( + new Node\Expr\New_( + new Node\Name('\InvalidArgumentException'), + ), ), ), ); - if (strlen($chunkCount->returnType) > 0) { + if ($chunkCount->returnType !== '') { $callMethod->setReturnType($chunkCount->returnType); } - if (strlen($chunkCount->docBlockReturnType) > 0) { + if ($chunkCount->docBlockReturnType !== '') { $callMethod->setDocComment( new Doc( implode( @@ -1141,6 +1187,6 @@ private static function createRouterChunkSize(string $pathPrefix, string $namesp $class->addStmt($callMethod); - yield new File($pathPrefix, $chunkCount->className, $stmt->addStmt($class)->getNode()); + yield new File($package->destination->source, $chunkCount->className, $stmt->addStmt($class)->getNode(), File::DO_LOAD_ON_WRITE); } } diff --git a/src/Generator/Client/Methods/ChunkCount.php b/src/Generator/Client/Methods/ChunkCount.php index 8af65ff..45b6e04 100644 --- a/src/Generator/Client/Methods/ChunkCount.php +++ b/src/Generator/Client/Methods/ChunkCount.php @@ -8,7 +8,7 @@ final readonly class ChunkCount { - /** @param array $nodes */ + /** @param list $nodes */ public function __construct( public string $className, public string $returnType, diff --git a/src/Generator/Client/PHPStan/ClientCallReturnTypes.php b/src/Generator/Client/PHPStan/ClientCallReturnTypes.php index 3c85132..23e8af9 100644 --- a/src/Generator/Client/PHPStan/ClientCallReturnTypes.php +++ b/src/Generator/Client/PHPStan/ClientCallReturnTypes.php @@ -4,10 +4,11 @@ namespace ApiClients\Tools\OpenApiClientGenerator\Generator\Client\PHPStan; -use ApiClients\Tools\OpenApiClientGenerator\Configuration; -use ApiClients\Tools\OpenApiClientGenerator\File; +use ApiClients\Tools\OpenApiClientGenerator\Generator\Helper\ConfigurationPackage; use ApiClients\Tools\OpenApiClientGenerator\Generator\Helper\Operation; -use ApiClients\Tools\OpenApiClientGenerator\Representation; +use OpenAPITools\Contract\Package; +use OpenAPITools\Representation\Namespaced; +use OpenAPITools\Utils\File; use PhpParser\BuilderFactory; use PhpParser\Node; use PhpParser\Node\Arg; @@ -25,9 +26,11 @@ final class ClientCallReturnTypes { /** @return iterable */ - public static function generate(Configuration $configuration, string $pathPrefix, Representation\Client $client): iterable + public static function generate(Package $package, Namespaced\Client $client): iterable { - /** @var array $operations */ + $package = ConfigurationPackage::unwrap($package); + + /** @var array $operations */ $operations = []; foreach ($client->paths as $path) { $operations = [...$operations, ...$path->operations]; @@ -38,9 +41,7 @@ public static function generate(Configuration $configuration, string $pathPrefix $stmts[] = new Node\Stmt\If_( new Expr\BinaryOp\Identical( new Expr\Variable( - new Node\Name( - 'call', - ), + 'call', ), new Node\Scalar\String_($operation->matchMethod . ' ' . $operation->path), ), @@ -50,17 +51,11 @@ public static function generate(Configuration $configuration, string $pathPrefix new Expr\MethodCall( new Expr\PropertyFetch( new Expr\Variable( - new Node\Name( - 'this', - ), - ), - new Node\Name( - 'typeResolver', + 'this', ), + 'typeResolver', ), - new Node\Name( - 'resolve', - ), + 'resolve', [ new Arg( new Node\Scalar\String_( @@ -76,7 +71,7 @@ public static function generate(Configuration $configuration, string $pathPrefix } $factory = new BuilderFactory(); - $stmt = $factory->namespace(new Node\Name(trim($configuration->namespace->source . '\PHPStan', '\\'))); + $stmt = $factory->namespace(new Node\Name(trim($package->namespace->source . '\PHPStan', '\\'))); $class = $factory->class('ClientCallReturnTypes')->makeFinal()->makeReadonly()->implement( new Node\Name('\\' . DynamicMethodReturnTypeExtension::class), )->addStmt( @@ -89,13 +84,9 @@ public static function generate(Configuration $configuration, string $pathPrefix new Expr\Assign( new Expr\PropertyFetch( new Expr\Variable( - new Node\Name( - 'this', - ), - ), - new Node\Name( - 'printer', + 'this', ), + 'printer', ), new Expr\New_( new Node\Name( @@ -109,8 +100,8 @@ public static function generate(Configuration $configuration, string $pathPrefix $factory->method('getClass')->makePublic()->setReturnType('string')->addStmt( new Node\Stmt\Return_( new Expr\ClassConstFetch( - new Node\Name('\\' . $configuration->namespace->source . '\Client'), - new Node\Name('class'), + new Node\Name('\\' . $package->namespace->source . '\Client'), + 'class', ), ), ), @@ -118,9 +109,7 @@ public static function generate(Configuration $configuration, string $pathPrefix $factory->method('isMethodSupported')->makePublic()->setReturnType('bool')->addParam( new Node\Param( new Expr\Variable( - new Node\Name( - 'methodReflection', - ), + 'methodReflection', ), null, new Node\Name( @@ -132,13 +121,9 @@ public static function generate(Configuration $configuration, string $pathPrefix new Expr\BinaryOp\Identical( new Expr\MethodCall( new Expr\Variable( - new Node\Name( - 'methodReflection', - ), - ), - new Node\Name( - 'getName', + 'methodReflection', ), + 'getName', ), new Node\Scalar\String_('call'), ), @@ -153,9 +138,7 @@ public static function generate(Configuration $configuration, string $pathPrefix )->addParam( new Node\Param( new Expr\Variable( - new Node\Name( - 'methodReflection', - ), + 'methodReflection', ), null, new Node\Name( @@ -165,9 +148,7 @@ public static function generate(Configuration $configuration, string $pathPrefix )->addParam( new Node\Param( new Expr\Variable( - new Node\Name( - 'methodCall', - ), + 'methodCall', ), null, new Node\Name( @@ -177,9 +158,7 @@ public static function generate(Configuration $configuration, string $pathPrefix )->addParam( new Node\Param( new Expr\Variable( - new Node\Name( - 'scope', - ), + 'scope', ), null, new Node\Name( @@ -190,19 +169,13 @@ public static function generate(Configuration $configuration, string $pathPrefix new Node\Stmt\Expression( new Expr\Assign( new Expr\Variable( - new Node\Name( - 'args', - ), + 'args', ), new Expr\MethodCall( new Expr\Variable( - new Node\Name( - 'methodCall', - ), - ), - new Node\Name( - 'getArgs', + 'methodCall', ), + 'getArgs', ), ), ), @@ -210,15 +183,11 @@ public static function generate(Configuration $configuration, string $pathPrefix new Node\Stmt\If_( new Expr\BinaryOp\Identical( new Expr\FuncCall( - new Node\Name( - 'count', - ), + new Node\Name('count'), [ new Arg( new Expr\Variable( - new Node\Name( - 'args', - ), + 'args', ), ), ], @@ -239,44 +208,30 @@ public static function generate(Configuration $configuration, string $pathPrefix new Node\Stmt\Expression( new Expr\Assign( new Expr\Variable( - new Node\Name( - 'call', - ), + 'call', ), new Expr\FuncCall( - new Node\Name( - 'substr', - ), + new Node\Name('substr'), [ new Arg( new MethodCall( new Expr\PropertyFetch( new Expr\Variable( - new Node\Name( - 'this', - ), - ), - new Node\Name( - 'printer', + 'this', ), + 'printer', ), - new Node\Name( - 'prettyPrintExpr', - ), + 'prettyPrintExpr', [ new Arg( new Expr\PropertyFetch( new Expr\ArrayDimFetch( new Expr\Variable( - new Node\Name( - 'args', - ), + 'args', ), new Node\Scalar\LNumber(0), ), - new Node\Name( - 'value', - ), + 'value', ), ), ], @@ -301,6 +256,6 @@ public static function generate(Configuration $configuration, string $pathPrefix ), ); - yield new File($pathPrefix, 'PHPStan\ClientCallReturnTypes', $stmt->addStmt($class)->getNode()); + yield new File($package->destination->source, 'PHPStan\\ClientCallReturnTypes', $stmt->addStmt($class)->getNode(), File::DO_NOT_LOAD_ON_WRITE); } } diff --git a/src/Generator/Client/PHPStan/ClientCallReturnTypesTest.php b/src/Generator/Client/PHPStan/ClientCallReturnTypesTest.php index c283f30..402ceda 100644 --- a/src/Generator/Client/PHPStan/ClientCallReturnTypesTest.php +++ b/src/Generator/Client/PHPStan/ClientCallReturnTypesTest.php @@ -5,10 +5,11 @@ namespace ApiClients\Tools\OpenApiClientGenerator\Generator\Client\PHPStan; use ApiClients\Contracts\HTTP\Headers\AuthenticationInterface; -use ApiClients\Tools\OpenApiClientGenerator\Configuration; -use ApiClients\Tools\OpenApiClientGenerator\File; +use ApiClients\Tools\OpenApiClientGenerator\Generator\Helper\ConfigurationPackage; use ApiClients\Tools\OpenApiClientGenerator\Generator\Helper\Operation; -use ApiClients\Tools\OpenApiClientGenerator\Representation; +use OpenAPITools\Contract\Package; +use OpenAPITools\Representation\Namespaced; +use OpenAPITools\Utils\File; use PhpParser\BuilderFactory; use PhpParser\Node; use PhpParser\Node\Arg; @@ -21,27 +22,27 @@ final class ClientCallReturnTypesTest { /** @return iterable */ - public static function generate(Configuration $configuration, string $pathPrefix, Representation\Client $client): iterable + public static function generate(Package $package, Namespaced\Client $client): iterable { + $package = ConfigurationPackage::unwrap($package); + $operations = []; foreach ($client->paths as $path) { $operations = [...$operations, ...$path->operations]; } $factory = new BuilderFactory(); - $stmt = $factory->namespace(new Node\Name(trim($configuration->namespace->test . '\\Types', '\\'))); + $stmt = $factory->namespace(new Node\Name(trim($package->namespace->test . '\\Types', '\\'))); $stmt->addStmt( new Node\Stmt\Expression( new Expr\Assign( new Expr\Variable( - new Node\Name( - 'client', - ), + 'client', ), new Expr\New_( new Node\Name( - '\\' . $configuration->namespace->source . '\\Client', + '\\' . $package->namespace->source . '\\Client', ), [ new Arg( @@ -82,9 +83,7 @@ public static function generate(Configuration $configuration, string $pathPrefix $stmt->addStmt( new Node\Stmt\Expression( new Expr\FuncCall( - new Node\Name( - '\PHPStan\Testing\assertType', - ), + new Node\Name('\PHPStan\Testing\assertType'), [ new Arg( new Node\Scalar\String_( @@ -94,13 +93,9 @@ public static function generate(Configuration $configuration, string $pathPrefix new Arg( new Expr\MethodCall( new Expr\Variable( - new Node\Name( - 'client', - ), - ), - new Node\Name( - 'call', + 'client', ), + 'call', [ new Arg( new Node\Scalar\String_($operation->matchMethod . ' ' . $operation->path), @@ -114,6 +109,6 @@ public static function generate(Configuration $configuration, string $pathPrefix ); } - yield new File($pathPrefix, 'Types\ClientCallReturnTypes', $stmt->getNode()); + yield new File($package->destination->test, 'Types\\ClientCallReturnTypes', $stmt->getNode(), File::DO_NOT_LOAD_ON_WRITE); } } diff --git a/src/Generator/Client/Routers.php b/src/Generator/Client/Routers.php index 9670860..505ae88 100644 --- a/src/Generator/Client/Routers.php +++ b/src/Generator/Client/Routers.php @@ -8,33 +8,35 @@ use ApiClients\Tools\OpenApiClientGenerator\Generator\Client\Routers\RouterClass; use ApiClients\Tools\OpenApiClientGenerator\Generator\Client\Routers\RouterClassMethod; use Jawira\CaseConverter\Convert; +use OpenAPITools\Configuration\Package; +use OpenAPITools\Utils\ClassString; use PhpParser\Node; use function lcfirst; -use function rtrim; use function str_replace; final class Routers { - /** @var array, returnType: string, docBlockReturnType: string}>>> $operations */ + /** @var array, returnType: string, docBlockReturnType: string}>>> $operations */ private array $operations = []; - /** @param array $nodes */ + /** @param list $nodes */ public function add( + Package $package, string $method, - string|null $group, + string $group, string $name, string $returnType, string $docBlockReturnType, array $nodes, ): Router { - $this->operations[$method][$group ?? ''][$name] = [ + $this->operations[$method][$group][$name] = [ 'nodes' => $nodes, 'returnType' => $returnType, 'docBlockReturnType' => $docBlockReturnType, ]; - return $this->createClassName($method, $group, $name); + return $this->createClassName($package, $method, $group, $name); } /** @return iterable */ @@ -57,20 +59,21 @@ public function get(): iterable } public function createClassName( + Package $package, string $method, - string|null $group, + string $group, string $name, ): Router { - $className = rtrim('Internal\\Router\\' . (new Convert($method))->toPascal() . ($group === null ? '' : '\\' . (new Convert($group))->toPascal()), '\\'); + $className = ClassString::factory($package->namespace, 'Internal\\Router\\' . new Convert($method)->toPascal() . ($group === '' ? '' : '\\' . new Convert($group)->toPascal())); return new Router( $className, - (new Convert($name))->toCamel(), + new Convert($name)->toCamel(), str_replace( '\\', '🔀', lcfirst( - $className, + $className->relative, ), ), ); diff --git a/src/Generator/Client/Routers/Router.php b/src/Generator/Client/Routers/Router.php index 5c2f189..db3d6d0 100644 --- a/src/Generator/Client/Routers/Router.php +++ b/src/Generator/Client/Routers/Router.php @@ -4,10 +4,12 @@ namespace ApiClients\Tools\OpenApiClientGenerator\Generator\Client\Routers; +use OpenAPITools\Utils\ClassString; + final readonly class Router { public function __construct( - public string $class, + public ClassString $class, public string $method, public string $loopUpMethod, ) { diff --git a/src/Generator/Client/Routers/RouterClassMethod.php b/src/Generator/Client/Routers/RouterClassMethod.php index 1987feb..aee316d 100644 --- a/src/Generator/Client/Routers/RouterClassMethod.php +++ b/src/Generator/Client/Routers/RouterClassMethod.php @@ -8,7 +8,7 @@ final readonly class RouterClassMethod { - /** @param array $nodes */ + /** @param list $nodes */ public function __construct( public string $name, public string $returnType, diff --git a/src/Generator/ClientInterface.php b/src/Generator/ClientInterface.php index 4b7db9d..a9c58fc 100644 --- a/src/Generator/ClientInterface.php +++ b/src/Generator/ClientInterface.php @@ -5,11 +5,14 @@ namespace ApiClients\Tools\OpenApiClientGenerator\Generator; use ApiClients\Contracts\OpenAPI\WebHooksInterface; -use ApiClients\Tools\OpenApiClientGenerator\Configuration; -use ApiClients\Tools\OpenApiClientGenerator\File; +use ApiClients\Tools\OpenApiClientGenerator\Generator\Helper\ConfigurationPackage; +use ApiClients\Tools\OpenApiClientGenerator\Generator\Helper\Operation; use ApiClients\Tools\OpenApiClientGenerator\Generator\Helper\Types; -use ApiClients\Tools\OpenApiClientGenerator\Representation\Operation; -use PhpParser\Builder\Param; +use OpenAPITools\Configuration\Package\QA\Tool; +use OpenAPITools\Contract\FileGenerator; +use OpenAPITools\Contract\Package; +use OpenAPITools\Representation\Namespaced; +use OpenAPITools\Utils\File; use PhpParser\BuilderFactory; use PhpParser\Comment\Doc; use PhpParser\Node\Name; @@ -23,25 +26,29 @@ use const PHP_EOL; -final class ClientInterface +final readonly class ClientInterface implements FileGenerator { - /** - * @param array $operations - * - * @return iterable - */ - public static function generate(Configuration $configuration, string $pathPrefix, array $operations): iterable + public function __construct( + private BuilderFactory $builderFactory, + private bool $call, + private bool $operations, + ) { + } + + /** @return iterable */ + public function generate(Package $package, Namespaced\Representation $representation): iterable { - $factory = new BuilderFactory(); - $stmt = $factory->namespace(trim($configuration->namespace->source, '\\')); + $package = ConfigurationPackage::unwrap($package); + + $stmt = $this->builderFactory->namespace(trim($package->namespace->source, '\\')); - $class = $factory->interface('ClientInterface'); + $class = $this->builderFactory->interface('ClientInterface'); - if ($configuration->entryPoints->call) { + if ($this->call) { $class->addStmt( - $factory->method('call')->makePublic()->setDocComment( + $this->builderFactory->method('call')->makePublic()->setDocComment( new Doc(implode(PHP_EOL, [ - ...($configuration->qa?->phpcs ? ['// phpcs:disable'] : []), + ...($package->qa->phpcs instanceof Tool && $package->qa->phpcs->enabled ? ['// phpcs:disable'] : []), '/**', // ' * @return ' . (static function (array $operations): string { // $count = count($operations); @@ -62,19 +69,21 @@ public static function generate(Configuration $configuration, string $pathPrefix // return $left . $right; // })($operations), ' */', - ...($configuration->qa?->phpcs ? ['// phpcs:enabled'] : []), + ...($package->qa->phpcs instanceof Tool && $package->qa->phpcs->enabled ? ['// phpcs:enabled'] : []), ])), - )->addParam((new Param('call'))->setType('string'))->addParam((new Param('params'))->setType('array')->setDefault([]))->setReturnType( + )->addParam($this->builderFactory->param('call')->setType('string'))->addParam($this->builderFactory->param('params')->setType('array')->setDefault([]))->setReturnType( new UnionType( array_map( static fn (string $type): Name => new Name($type), array_unique( [ - ...Types::filterDuplicatesAndIncompatibleRawTypes(...(static function (array $operations): iterable { - foreach ($operations as $operation) { - yield from explode('|', \ApiClients\Tools\OpenApiClientGenerator\Generator\Helper\Operation::getResultTypeFromOperation($operation)); + ...Types::filterDuplicatesAndIncompatibleRawTypes(...(static function (Namespaced\Path ...$paths): iterable { + foreach ($paths as $path) { + foreach ($path->operations as $operation) { + yield from explode('|', Operation::getResultTypeFromOperation($operation)); + } } - })($operations)), + })(...$representation->client->paths)), ], ), ), @@ -83,18 +92,18 @@ public static function generate(Configuration $configuration, string $pathPrefix ); } - if ($configuration->entryPoints->operations) { + if ($this->operations) { $class->addStmt( - $factory->method('operations')->setReturnType('OperationsInterface')->makePublic(), + $this->builderFactory->method('operations')->setReturnType('OperationsInterface')->makePublic(), ); } - if ($configuration->entryPoints->webHooks) { + if ($representation->webHooks !== []) { $class->addStmt( - $factory->method('webHooks')->setReturnType('\\' . WebHooksInterface::class)->makePublic(), + $this->builderFactory->method('webHooks')->setReturnType('\\' . WebHooksInterface::class)->makePublic(), ); } - yield new File($pathPrefix, 'ClientInterface', $stmt->addStmt($class)->getNode()); + yield new File($package->destination->source, 'ClientInterface', $stmt->addStmt($class)->getNode(), File::DO_LOAD_ON_WRITE); } } diff --git a/src/Generator/Contract.php b/src/Generator/Contract.php deleted file mode 100644 index 4bad613..0000000 --- a/src/Generator/Contract.php +++ /dev/null @@ -1,162 +0,0 @@ - $aliases - * - * @return iterable - */ - public static function generate(string $pathPrefix, Representation\Contract $contract): iterable - { - $factory = new BuilderFactory(); - - $interface = $factory->interface($contract->className->className); - $contractProperties = []; - foreach ($contract->properties as $property) { - $types = []; - if ($property->type->type === 'union' && is_array($property->type->payload)) { - $types[] = self::buildUnionType($property->type); - } - - if ($property->type->type === 'array' && ! is_string($property->type->payload)) { - if ($property->type->payload instanceof Representation\PropertyType) { - if (! $property->type->payload->payload instanceof Representation\PropertyType) { - $iterableType = $property->type->payload; - if ($iterableType->payload instanceof Representation\Schema) { - $iterableType = $iterableType->payload->className->fullyQualified->source; - } - - if ($iterableType instanceof Representation\PropertyType && (($iterableType->payload instanceof Representation\PropertyType && $iterableType->payload->type === 'union') || is_array($iterableType->payload))) { - $iterableType = self::buildUnionType($iterableType); - } - - if ($iterableType instanceof Representation\PropertyType) { - $iterableType = $iterableType->payload; - } - - $compiledTYpe = ($property->nullable ? '?' : '') . 'array<' . $iterableType . '>'; - $contractProperties[$property->name] = '@property ' . $compiledTYpe . ' $' . $property->name; - } - } elseif (is_array($property->type->payload)) { - $schemaClasses = []; - foreach ($property->type->payload as $payloadType) { - $schemaClasses = [...$schemaClasses, ...self::getUnionTypeSchemas($payloadType)]; - } - - if (count($schemaClasses) > 0) { - $compiledTYpe = ($property->nullable ? '?' : '') . 'array<' . implode('|', array_unique([ - ...(static function (Representation\Schema ...$schemas): iterable { - foreach ($schemas as $schema) { - yield $schema->className->fullyQualified->source; - } - })(...$schemaClasses), - ])) . '>'; - $contractProperties[$property->name] = '@property ' . $compiledTYpe . ' $' . $property->name; - } - } - - $types[] = 'array'; - } elseif ($property->type->payload instanceof Representation\Schema) { - $types[] = $property->type->payload->className->relative; - } elseif (is_string($property->type->payload)) { - $types[] = $property->type->payload; - } - - $types = array_unique($types); - - $nullable = ''; - if ($property->nullable) { - $nullable = count($types) > 1 || count(explode('|', implode('|', $types))) > 1 ? 'null|' : '?'; - } - - if (count($types) > 0) { - if (! array_key_exists($property->name, $contractProperties)) { - $contractProperties[$property->name] = '@property ' . $nullable . implode('|', $types) . ' $' . $property->name; - } - } else { - if (! array_key_exists($property->name, $contractProperties)) { - $contractProperties[$property->name] = '@property $' . $property->name; - } - } - } - - if (count($contractProperties) > 0) { - $interface->setDocComment('/**' . PHP_EOL . ' * ' . implode(PHP_EOL . ' * ', $contractProperties) . PHP_EOL . ' */'); - } - - yield new File($pathPrefix, $contract->className->relative, $factory->namespace($contract->className->namespace->source)->addStmt($interface)->getNode()); - } - - private static function buildUnionType(Representation\PropertyType $type): string - { - $typeList = []; - if (is_array($type->payload)) { - foreach ($type->payload as $typeInUnion) { - $typeList[] = match (gettype($typeInUnion->payload)) { - 'string' => $typeInUnion->payload, - 'array' => 'array', - 'object' => match ($typeInUnion->payload::class) { - Representation\Schema::class => $typeInUnion->payload->className->relative, - Representation\PropertyType::class => self::buildUnionType($typeInUnion->payload), - }, - }; - } - } else { - $typeList[] = $type->payload; - } - - return implode( - '|', - array_unique( - array_filter( - $typeList, - static fn (string $item): bool => strlen(trim($item)) > 0, - ), - ), - ); - } - - /** @return iterable */ - private static function getUnionTypeSchemas(Representation\PropertyType $type): iterable - { - if (! is_array($type->payload)) { - return; - } - - foreach ($type->payload as $typeInUnion) { - if ($typeInUnion->payload instanceof Representation\Schema) { - yield $typeInUnion->payload; - } - - if (! ($typeInUnion->payload instanceof Representation\PropertyType)) { - continue; - } - - yield from self::getUnionTypeSchemas($typeInUnion->payload); - } - } -} diff --git a/src/Generator/Error.php b/src/Generator/Error.php deleted file mode 100644 index f63ab1a..0000000 --- a/src/Generator/Error.php +++ /dev/null @@ -1,30 +0,0 @@ - */ - public static function generate(string $pathPrefix, Schema $schema): iterable - { - $factory = new BuilderFactory(); - $stmt = $factory->namespace($schema->errorClassName->namespace->source); - - $class = $factory->class($schema->errorClassName->className)->extend('\\' . \Error::class)->makeFinal(); - - $class->addStmt((new BuilderFactory())->method('__construct')->makePublic()->addParam( - (new PromotedPropertyAsParam('status'))->setType('int'), - )->addParam( - (new PromotedPropertyAsParam('error'))->setType($schema->className->relative), - )); - - yield new File($pathPrefix, $schema->errorClassName->relative, $stmt->addStmt($class)->getNode()); - } -} diff --git a/src/Generator/Helper/ConfigurationPackage.php b/src/Generator/Helper/ConfigurationPackage.php new file mode 100644 index 0000000..6a9bb54 --- /dev/null +++ b/src/Generator/Helper/ConfigurationPackage.php @@ -0,0 +1,27 @@ +addParams([ ...(static function (array $params): iterable { foreach ($params as $param) { - yield (new Builder\Param($param->name))->setType($param->type === '' ? 'mixed' : $param->type); + yield new Builder\Param($param->name)->setType($param->type === '' ? 'mixed' : $param->type); } })($operation->parameters), ...(count($operation->requestBody) > 0 ? [ - (new Builder\Param('params'))->setType('array'), + new Builder\Param('params')->setType('array'), ] : []), ]); } - public static function methodReturnType(Builder\Method $method, Representation\Operation $operation): Builder\Method + public static function methodReturnType(Builder\Method $method, Representation\Namespaced\Operation $operation): Builder\Method { - $docComment = ReflectionTypes::copyDocBlock($operation->operatorClassName->fullyQualified->source, 'call'); + /** @var class-string $operatorClassName */ + $operatorClassName = $operation->operatorClassName->fullyQualified->source; + $docComment = ReflectionTypes::copyDocBlock($operatorClassName, 'call'); - if ($docComment !== null) { + if ($docComment instanceof Doc) { $method = $method->setDocComment($docComment); } return $method->setReturnType( - ReflectionTypes::copyReturnType($operation->operatorClassName->fullyQualified->source, 'call'), + ReflectionTypes::copyReturnType($operatorClassName, 'call'), ); } - public static function methodCallOperation(Representation\Operation $operation): Node\Stmt\Return_ + public static function methodCallOperation(Representation\Namespaced\Operation $operation): Node\Stmt\Return_ { return new Node\Stmt\Return_( new Expr\MethodCall( @@ -87,57 +90,71 @@ public static function methodCallOperation(Representation\Operation $operation): ); } - public static function getResultTypeFromOperation(Representation\Operation $operation): string + public static function getResultTypeFromOperation(Representation\Namespaced\Operation $operation): string { - /** @phpstan-ignore-next-line */ - $returnType = (new ReflectionClass($operation->className->fullyQualified->source))->getMethod('createResponse')->getReturnType(); + /** @var class-string $className */ + $className = $operation->className->fullyQualified->source; + $returnType = new ReflectionClass($className)->getMethod('createResponse')->getReturnType(); if ($returnType === null) { return 'void'; } - if ((string) $returnType === 'void') { - return (string) $returnType; + if ($returnType instanceof ReflectionNamedType && $returnType->getName() === 'void') { + return 'void'; } - return self::convertObservableIntoIterable( - implode( - '|', - array_map( - static fn (string $object): Node\Name => new Node\Name((strpos($object, '\\') > 0 ? '\\' : '') . $object), - explode('|', (string) $returnType), - ), - ), - ); + $types = $returnType instanceof ReflectionUnionType + ? array_map( + ReflectionTypes::name(...), + $returnType->getTypes(), + ) + : [ReflectionTypes::name($returnType)]; + + return self::convertObservableIntoIterable(implode('|', $types)); } - public static function getDocBlockFromOperation(Representation\Operation $operation): Doc + public static function getDocBlockFromOperation(Representation\Namespaced\Operation $operation): Doc|null { + $resultType = self::getDocBlockResultTypeFromOperation($operation); + + /** + * An operation only carries an @return on createResponse() when the native + * return type cannot express the full type, such as the item type behind an + * Observable. Reflecting on the rest yields no type, and writing the tag + * anyway leaves an empty `@return` behind. + */ + if ($resultType === '') { + return null; + } + return new Doc( implode( PHP_EOL, [ '/**', - ' * @return ' . self::getDocBlockResultTypeFromOperation($operation), + ' * @return ' . $resultType, ' */', ], ), ); } - public static function getDocBlockResultTypeFromOperation(Representation\Operation $operation): string + public static function getDocBlockResultTypeFromOperation(Representation\Namespaced\Operation $operation): string { - /** @phpstan-ignore-next-line */ - $docComment = (new ReflectionClass($operation->className->fullyQualified->source))->getMethod('createResponse')->getDocComment(); + /** @var class-string $className */ + $className = $operation->className->fullyQualified->source; + $docComment = new ReflectionClass($className)->getMethod('createResponse')->getDocComment(); if (! is_string($docComment)) { return ''; } // basic setup - $lexer = new Lexer(); - $constExprParser = new ConstExprParser(); - $typeParser = new TypeParser($constExprParser); - $phpDocParser = new PhpDocParser($typeParser, $constExprParser); + $config = new ParserConfig([]); + $lexer = new Lexer($config); + $constExprParser = new ConstExprParser($config); + $typeParser = new TypeParser($config, $constExprParser); + $phpDocParser = new PhpDocParser($config, $typeParser, $constExprParser); // parsing and reading a PHPDoc string $tokens = new TokenIterator($lexer->tokenize($docComment)); diff --git a/src/Generator/Helper/OperationArray.php b/src/Generator/Helper/OperationArray.php index 77c8ddb..ff3b19a 100644 --- a/src/Generator/Helper/OperationArray.php +++ b/src/Generator/Helper/OperationArray.php @@ -4,9 +4,9 @@ namespace ApiClients\Tools\OpenApiClientGenerator\Generator\Helper; -use ApiClients\Tools\OpenApiClientGenerator\Representation\PropertyType; -use ApiClients\Tools\OpenApiClientGenerator\Representation\Schema; use cebe\openapi\spec\Schema as cebeSchema; +use OpenAPITools\Representation\Namespaced\Property\Type; +use OpenAPITools\Representation\Namespaced\Schema; use PhpParser\Node; use PhpParser\Node\Arg; @@ -57,8 +57,8 @@ public static function validate(string $className, bool $isArray): Node\Stmt\Exp )); } - /** @return iterable */ - public static function uniqueSchemas(string|Schema|PropertyType ...$propertyTypes): iterable + /** @return iterable */ + public static function uniqueSchemas(string|Schema|Type ...$propertyTypes): iterable { $schemas = []; @@ -74,7 +74,7 @@ public static function uniqueSchemas(string|Schema|PropertyType ...$propertyType } foreach ( - static::uniqueSchemas(...is_array($propertyType->payload) ? $propertyType->payload : [$propertyType->payload]) as $nestedPropertyType + self::uniqueSchemas(...is_array($propertyType->payload) ? $propertyType->payload : [$propertyType->payload]) as $nestedPropertyType ) { $schemas[$nestedPropertyType instanceof Schema ? $nestedPropertyType->className->fullyQualified->source : $nestedPropertyType] = $nestedPropertyType; } diff --git a/src/Generator/Helper/ReflectionTypes.php b/src/Generator/Helper/ReflectionTypes.php index 045a372..bc18ec7 100644 --- a/src/Generator/Helper/ReflectionTypes.php +++ b/src/Generator/Helper/ReflectionTypes.php @@ -13,61 +13,80 @@ use ReflectionUnionType; use function array_map; +use function implode; +use function str_contains; use function str_replace; -use function strpos; final class ReflectionTypes { + public static function name(ReflectionType $type): string + { + if ($type instanceof ReflectionNamedType) { + return $type->getName(); + } + + if ($type instanceof ReflectionUnionType) { + return implode('|', array_map( + self::name(...), + $type->getTypes(), + )); + } + + return 'mixed'; + } + + /** @param class-string $class */ public static function copyReturnType(string $class, string $method): Node\ComplexType|Name|string { - $reflection = (new ReflectionClass($class))->getMethod($method)->getReturnType(); - switch ($reflection::class) { - //ReflectionNamedType|ReflectionUnionType|ReflectionIntersectionType - case ReflectionNamedType::class: - return new Name(str_replace( - 'Traversable', - 'iterable', - (strpos((string) $reflection, '\\') !== false ? '\\' : '') . $reflection, - )); + $reflection = new ReflectionClass($class)->getMethod($method)->getReturnType(); + if ($reflection === null) { + return ''; + } - break; - case ReflectionUnionType::class: - return new Node\UnionType( - [ - ...(static function (string ...$types): iterable { - foreach ($types as $type) { - if ($type === 'array') { - continue; - } + if ($reflection instanceof ReflectionNamedType) { + return new Name(str_replace( + 'Traversable', + 'iterable', + (str_contains($reflection->getName(), '\\') ? '\\' : '') . $reflection->getName(), + )); + } - yield new Name(str_replace( - 'Traversable', - 'iterable', - (strpos($type, '\\') !== false ? '\\' : '') . $type, - )); + if ($reflection instanceof ReflectionUnionType) { + return new Node\UnionType( + [ + ...(static function (string ...$types): iterable { + foreach ($types as $type) { + if ($type === 'array') { + continue; } - })(...[ - ...Types::filterDuplicatesAndIncompatibleRawTypes(...array_map( - static fn (ReflectionType $type): string => (string) $type, - $reflection->getTypes(), - )), - ]), - ], - ); - break; - default: - return ''; + yield new Name(str_replace( + 'Traversable', + 'iterable', + (str_contains($type, '\\') ? '\\' : '') . $type, + )); + } + })(...[ + ...Types::filterDuplicatesAndIncompatibleRawTypes(...array_map( + self::name(...), + $reflection->getTypes(), + )), + ]), + ], + ); } + + return ''; } + /** @param class-string $class */ public static function copyDocBlock(string $class, string $method): Doc|null { - $comment = (new ReflectionClass($class))->getMethod($method)->getDocComment(); - if ($comment !== null) { - return new Doc($comment); + $comment = new ReflectionClass($class)->getMethod($method)->getDocComment(); + if ($comment === false) { + return null; } - return null; + return new Doc($comment); } } diff --git a/src/Generator/Helper/Representation.php b/src/Generator/Helper/Representation.php new file mode 100644 index 0000000..b9c63bd --- /dev/null +++ b/src/Generator/Helper/Representation.php @@ -0,0 +1,88 @@ +type, + $type->format, + $type->pattern, + self::typePayload($type->payload), + $type->nullable, + ); + } + + /** + * @param string|Namespaced\Schema|Namespaced\Property\Type|array $payload + * + * @return string|Schema|Property\Type|array + */ + private static function typePayload(string|Namespaced\Schema|Namespaced\Property\Type|array $payload): string|Schema|Property\Type|array + { + if (is_string($payload)) { + return $payload; + } + + if ($payload instanceof Namespaced\Schema) { + return self::schema($payload); + } + + if ($payload instanceof Namespaced\Property\Type) { + return self::propertyType($payload); + } + + return array_map(self::propertyType(...), $payload); + } + + public static function schema(Namespaced\Schema $schema): Schema + { + return new Schema( + $schema->className->relative, + array_map(self::contract(...), $schema->contracts), + $schema->errorClassName->relative, + $schema->errorClassNameAliased->relative, + $schema->title, + $schema->description, + $schema->example, + array_map(self::property(...), $schema->properties), + $schema->schema, + $schema->isArray, + $schema->type, + $schema->alias, + ); + } + + private static function contract(Namespaced\Contract $contract): Contract + { + return new Contract( + $contract->className->relative, + array_map(self::property(...), $contract->properties), + ); + } + + private static function property(Namespaced\Property $property): Property + { + return new Property( + $property->name, + $property->sourceName, + $property->description, + $property->example, + self::propertyType($property->type), + $property->nullable, + $property->enum, + ); + } +} diff --git a/src/Generator/Helper/ResultConverter.php b/src/Generator/Helper/ResultConverter.php index 7aac231..7569290 100644 --- a/src/Generator/Helper/ResultConverter.php +++ b/src/Generator/Helper/ResultConverter.php @@ -10,7 +10,7 @@ final class ResultConverter { - /** @return iterable */ + /** @return iterable */ public static function convert(Node\Expr $expr): iterable { yield new Node\Stmt\Expression( diff --git a/src/Generator/Helper/Types.php b/src/Generator/Helper/Types.php index 4fc58ea..4e05a08 100644 --- a/src/Generator/Helper/Types.php +++ b/src/Generator/Helper/Types.php @@ -9,11 +9,11 @@ use function array_key_exists; use function array_map; use function in_array; -use function substr; +use function str_starts_with; final class Types { - private const SCALARS = [ + private const array SCALARS = [ 'string', 'int', 'float', @@ -24,7 +24,7 @@ final class Types public static function normalizeDocBlock(string ...$types): array { return array_map( - static fn (string $type): string => in_array($type, self::SCALARS) || substr($type, 0, 1) === '\\' || substr($type, 0, 5) === 'array' ? $type : 'Schema\\' . $type, + static fn (string $type): string => in_array($type, self::SCALARS, true) || str_starts_with($type, '\\') || str_starts_with($type, 'array') ? $type : 'Schema\\' . $type, $types, ); } @@ -34,7 +34,7 @@ public static function normalizeRaw(string ...$types): array { return array_map( static function (string $type): string { - if (in_array($type, self::SCALARS) || substr($type, 0, 1) === '\\') { + if (in_array($type, self::SCALARS, true) || str_starts_with($type, '\\')) { return $type; } diff --git a/src/Generator/Hydrator.php b/src/Generator/Hydrator.php deleted file mode 100644 index 2df9883..0000000 --- a/src/Generator/Hydrator.php +++ /dev/null @@ -1,45 +0,0 @@ - */ - public static function generate(string $pathPrefix, \ApiClients\Tools\OpenApiClientGenerator\Representation\Hydrator $hydrator): iterable - { - $schemaClasses = []; - - foreach ($hydrator->schemas as $schema) { - $schemaClasses[] = trim($schema->className->fullyQualified->source, '\\'); - } - - if (count($schemaClasses) <= 0) { - return; - } - - yield new File( - $pathPrefix, - $hydrator->className->relative, - (new ObjectMapperCodeGenerator())->dump( - array_unique( - array_filter( - $schemaClasses, - static fn (string $className): bool => count((new ReflectionMethod($className, '__construct'))->getParameters()) > 0, - ), - ), - trim($hydrator->className->fullyQualified->source, '\\'), - ), - ); - } -} diff --git a/src/Generator/Hydrators.php b/src/Generator/Hydrators.php deleted file mode 100644 index f3423e9..0000000 --- a/src/Generator/Hydrators.php +++ /dev/null @@ -1,301 +0,0 @@ - */ - public static function generate(string $pathPrefix, string $namespace, Hydrator ...$hydrators): iterable - { - $knownScehmas = []; - $factory = new BuilderFactory(); - $stmt = $factory->namespace(trim($namespace, '\\') . '\\Internal'); - - $class = $factory->class('Hydrators')->makeFinal()->implement('\\' . ObjectMapper::class); - - $usefullHydrators = []; - foreach ($hydrators as $hydrator) { - $usefullHydrators[$hydrator->className->relative] = array_filter($hydrator->schemas, static function (Schema $schema) use (&$knownScehmas): bool { - if (array_key_exists($schema->className->relative, $knownScehmas)) { - return false; - } - - $knownScehmas[$schema->className->relative] = $schema->className; - - return true; - }); - } - - $matchHydrators = array_filter($hydrators, static fn (Hydrator $hydrator): bool => count($usefullHydrators[$hydrator->className->relative]) > 0); - - foreach ($hydrators as $hydrator) { - $class->addStmt($factory->property($hydrator->methodName)->setType('?' . $hydrator->className->relative)->setDefault(null)->makePrivate()); - } - - $class->addStmt( - $factory->method('hydrateObject')->makePublic()->setReturnType('object')->addParams([ - (new Param('className'))->setType('string'), - (new Param('payload'))->setType('array'), - ])->addStmt( - new Node\Stmt\Return_( - new Node\Expr\Match_( - new Node\Expr\Variable('className'), - array_map(static fn (Hydrator $hydrator): Node\MatchArm => new Node\MatchArm( - array_map(static fn (Schema $schema): Node\Scalar\String_ => new Node\Scalar\String_( - $schema->className->fullyQualified->source, - ), $usefullHydrators[$hydrator->className->relative]), - new Node\Expr\MethodCall( - new Node\Expr\MethodCall( - new Node\Expr\Variable('this'), - 'getObjectMapper' . ucfirst($hydrator->methodName), - ), - 'hydrateObject', - [ - new Node\Arg( - new Node\Expr\Variable('className'), - ), - new Node\Arg( - new Node\Expr\Variable('payload'), - ), - ], - ), - ), $matchHydrators), - ), - ), - ), - ); - - $class->addStmt( - $factory->method('hydrateObjects')->makePublic()->setReturnType('\\' . IterableList::class)->addParams([ - (new Param('className'))->setType('string'), - (new Param('payloads'))->setType('iterable'), - ])->addStmt( - new Node\Stmt\Return_( - new Node\Expr\New_( - new Node\Name('\\' . IterableList::class), - [ - new Node\Arg( - new Node\Expr\MethodCall( - new Node\Expr\Variable('this'), - 'doHydrateObjects', - [ - new Node\Arg( - new Node\Expr\Variable('className'), - ), - new Node\Arg( - new Node\Expr\Variable('payloads'), - ), - ], - ), - ), - ], - ), - ), - ), - ); - - $class->addStmt( - $factory->method('doHydrateObjects')->makePrivate()->setReturnType('\\' . Generator::class)->addParams([ - (new Param('className'))->setType('string'), - (new Param('payloads'))->setType('iterable'), - ])->addStmt( - new Node\Stmt\Foreach_( - new Node\Expr\Variable('payloads'), - new Node\Expr\Variable('payload'), - [ - 'keyVar' => new Node\Expr\Variable('index'), - 'stmts' => [ - new Node\Stmt\Expression( - new Node\Expr\Yield_( - new Node\Expr\MethodCall( - new Node\Expr\Variable('this'), - 'hydrateObject', - [ - new Node\Arg( - new Node\Expr\Variable('className'), - ), - new Node\Arg( - new Node\Expr\Variable('payload'), - ), - ], - ), - new Node\Expr\Variable('index'), - ), - ), - ], - ], - ), - ), - ); - - $class->addStmt( - $factory->method('serializeObject')->makePublic()->setReturnType('mixed')->addParams([ - (new Param('object'))->setType('object'), - ])->addStmt( - new Node\Stmt\Return_( - new Node\Expr\MethodCall( - new Node\Expr\Variable('this'), - 'serializeObjectOfType', - [ - new Node\Arg( - new Node\Expr\Variable('object'), - ), - new Node\Arg( - new Node\Expr\ClassConstFetch( - new Node\Expr\Variable('object'), - 'class', - ), - ), - ], - ), - ), - ), - ); - - $class->addStmt( - $factory->method('serializeObjectOfType')->makePublic()->setReturnType('mixed')->addParams([ - (new Param('object'))->setType('object'), - (new Param('className'))->setType('string'), - ])->addStmt( - new Node\Stmt\Return_( - new Node\Expr\Match_( - new Node\Expr\Variable('className'), - array_map(static fn (Hydrator $hydrator): Node\MatchArm => new Node\MatchArm( - array_map(static fn (Schema $schema): Node\Scalar\String_ => new Node\Scalar\String_( - $schema->className->fullyQualified->source, - ), $usefullHydrators[$hydrator->className->relative]), - new Node\Expr\MethodCall( - new Node\Expr\MethodCall( - new Node\Expr\Variable('this'), - 'getObjectMapper' . ucfirst($hydrator->methodName), - ), - 'serializeObject', - [ - new Node\Arg( - new Node\Expr\Variable('object'), - ), - ], - ), - ), $matchHydrators), - ), - ), - ), - ); - - $class->addStmt( - $factory->method('serializeObjects')->makePublic()->setReturnType('\\' . IterableList::class)->addParams([ - (new Param('payloads'))->setType('iterable'), - ])->addStmt( - new Node\Stmt\Return_( - new Node\Expr\New_( - new Node\Name('\\' . IterableList::class), - [ - new Node\Arg( - new Node\Expr\MethodCall( - new Node\Expr\Variable('this'), - 'doSerializeObjects', - [ - new Node\Arg( - new Node\Expr\Variable('payloads'), - ), - ], - ), - ), - ], - ), - ), - ), - ); - - $class->addStmt( - $factory->method('doSerializeObjects')->makePrivate()->setReturnType('\\' . Generator::class)->addParams([ - (new Param('objects'))->setType('iterable'), - ])->addStmt( - new Node\Stmt\Foreach_( - new Node\Expr\Variable('objects'), - new Node\Expr\Variable('object'), - [ - 'keyVar' => new Node\Expr\Variable('index'), - 'stmts' => [ - new Node\Stmt\Expression( - new Node\Expr\Yield_( - new Node\Expr\MethodCall( - new Node\Expr\Variable('this'), - 'serializeObject', - [ - new Node\Arg( - new Node\Expr\Variable('object'), - ), - ], - ), - new Node\Expr\Variable('index'), - ), - ), - ], - ], - ), - ), - ); - - foreach ($hydrators as $hydrator) { - $class->addStmt( - $factory->method('getObjectMapper' . ucfirst($hydrator->methodName))->makePublic()->setReturnType($hydrator->className->relative)->addStmts([ - new Node\Stmt\If_( - new Node\Expr\BinaryOp\Identical( - new Node\Expr\Instanceof_( - new Node\Expr\PropertyFetch( - new Node\Expr\Variable('this'), - $hydrator->methodName, - ), - new Node\Name($hydrator->className->relative), - ), - new Node\Expr\ConstFetch(new Node\Name('false')), - ), - [ - 'stmts' => [ - new Node\Stmt\Expression( - new Node\Expr\Assign( - new Node\Expr\PropertyFetch( - new Node\Expr\Variable('this'), - $hydrator->methodName, - ), - new Node\Expr\New_( - new Node\Name($hydrator->className->relative), - ), - ), - ), - ], - ], - ), - new Node\Stmt\Return_( - new Node\Expr\PropertyFetch( - new Node\Expr\Variable('this'), - $hydrator->methodName, - ), - ), - ]), - ); - } - - yield new File($pathPrefix, 'Internal\\Hydrators', $stmt->addStmt($class)->getNode()); - } -} diff --git a/src/Generator/Operations.php b/src/Generator/Operations.php deleted file mode 100644 index b2e1550..0000000 --- a/src/Generator/Operations.php +++ /dev/null @@ -1,132 +0,0 @@ - $paths - * @param array $operations - * - * @return iterable - */ - public static function generate(Configuration $configuration, string $pathPrefix, array $paths, array $operations): iterable - { - $operationHydratorMap = []; - foreach ($paths as $path) { - foreach ($path->operations as $pathOperation) { - $operationHydratorMap[$pathOperation->operationId] = $path->hydrator; - } - } - - $groups = []; - foreach ($operations as $operation) { - $groups[$operation->group][] = $operation; - } - - $factory = new BuilderFactory(); - $stmt = $factory->namespace($configuration->namespace->source); - - $class = $factory->class('Operations')->makeFinal()->implement(new Name('OperationsInterface'))->makeReadonly(); - - $class->addStmt( - $factory->method('__construct')->makePublic()->addParam( - (new PrivatePromotedPropertyAsParam('operators'))->setType('Internal\\Operators'), - ), - ); - - foreach ($groups as $group => $groupsOperations) { - if ($group === '') { - foreach ($groupsOperations as $groupsOperation) { - $class->addStmt( - Helper\Operation::methodSignature( - $factory->method((new Convert($groupsOperation->name))->toCamel())->makePublic(), - $groupsOperation, - )->addStmt(Helper\Operation::methodCallOperation($groupsOperation)), - ); - } - - continue; - } - - $class->addStmt( - $factory->method((new Convert($group))->toCamel())->makePublic()->setReturnType('Operation\\' . $group)->addStmts([ - new Node\Stmt\Return_( - new Expr\New_( - new Name( - 'Operation\\' . $group, - ), - [ - new Arg( - new Expr\PropertyFetch( - new Expr\Variable('this'), - 'operators', - ), - ), - ], - ), - ), - ]), - ); - - yield from self::generateOperationsGroup( - $pathPrefix, - $configuration->namespace, - 'Operation\\' . $group, - $groupsOperations, - $group, - ); - } - - yield from Operators::generate($configuration, $pathPrefix, $operations, $operationHydratorMap); - yield new File($pathPrefix, 'Operations', $stmt->addStmt($class)->getNode()); - } - - /** - * @param array $operations - * @param array $operationHydratorMap - * - * @return iterable - */ - private static function generateOperationsGroup(string $pathPrefix, Configuration\Namespace_ $namespace, string $className, array $operations, string $group): iterable - { - $factory = new BuilderFactory(); - $stmt = $factory->namespace(Utils::dirname($namespace->source . '\\' . $className)); - - $class = $factory->class(Utils::basename($className))->makeFinal()->addStmt( - $factory->method('__construct')->makePublic()->addParam( - (new PrivatePromotedPropertyAsParam('operators'))->setType('Internal\Operators'), - ), - ); - - foreach ($operations as $operation) { - if ($operation->group !== $group) { - continue; - } - - $class->addStmt( - Helper\Operation::methodSignature( - $factory->method((new Convert($operation->name))->toCamel())->makePublic(), - $operation, - )->addStmt(Helper\Operation::methodCallOperation($operation)), - ); - } - - yield new File($pathPrefix, $className, $stmt->addStmt($class)->getNode()); - } -} diff --git a/src/Generator/OperationsInterface.php b/src/Generator/OperationsInterface.php deleted file mode 100644 index 9b6b773..0000000 --- a/src/Generator/OperationsInterface.php +++ /dev/null @@ -1,54 +0,0 @@ - $operations - * - * @return iterable - */ - public static function generate(Configuration $configuration, string $pathPrefix, array $operations): iterable - { - $factory = new BuilderFactory(); - $stmt = $factory->namespace($configuration->namespace->source); - $class = $factory->interface('OperationsInterface'); - - /** @var array> $groups */ - $groups = []; - foreach ($operations as $operation) { - $groups[$operation->group][] = $operation; - } - - foreach ($groups as $group => $groupOperations) { - if (strlen($group) > 0) { - $class->addStmt( - $factory->method((new Convert($group))->toCamel())->makePublic()->setReturnType('Operation\\' . $group), - ); - continue; - } - - foreach ($groupOperations as $groupOperation) { - $class->addStmt( - Helper\Operation::methodSignature( - $factory->method($groupOperation->nameCamel)->makePublic(), - $groupOperation, - ), - ); - } - } - - yield new File($pathPrefix, 'OperationsInterface', $stmt->addStmt($class)->getNode()); - } -} diff --git a/src/Generator/Operators.php b/src/Generator/Operators.php deleted file mode 100644 index dbf3361..0000000 --- a/src/Generator/Operators.php +++ /dev/null @@ -1,116 +0,0 @@ - $operations - * @param array $operationHydratorMap - * - * @return iterable - */ - public static function generate(Configuration $configuration, string $pathPrefix, array $operations, array $operationHydratorMap): iterable - { - $factory = new BuilderFactory(); - $stmt = $factory->namespace(trim($configuration->namespace->source, '\\') . '\\Internal'); - - $class = $factory->class('Operators')->makeFinal()->addStmt( - $factory->method('__construct')->makePublic()->addParam( - (new PrivatePromotedPropertyAsParam('authentication'))->setType('\\' . AuthenticationInterface::class)->makeReadonly(), - )->addParam( - (new PrivatePromotedPropertyAsParam('browser'))->setType('\\' . Browser::class)->makeReadonly(), - )->addParam( - (new PrivatePromotedPropertyAsParam('requestSchemaValidator'))->setType('\League\OpenAPIValidation\Schema\SchemaValidator')->makeReadonly(), - )->addParam( - (new PrivatePromotedPropertyAsParam('responseSchemaValidator'))->setType('\League\OpenAPIValidation\Schema\SchemaValidator')->makeReadonly(), - )->addParam( - (new PrivatePromotedPropertyAsParam('hydrators'))->setType('Internal\\Hydrators')->makeReadonly(), - ), - ); - - foreach ($operations as $operation) { - $class->addStmts([ - $factory->property($operation->operatorLookUpMethod)->setType('?' . $operation->operatorClassName->relative)->setDefault(null)->makePrivate(), - $factory->method($operation->operatorLookUpMethod)->setReturnType($operation->operatorClassName->relative)->makePublic()->addStmts([ - new Node\Stmt\If_( - new Node\Expr\BinaryOp\Identical( - new Node\Expr\Instanceof_( - new Node\Expr\PropertyFetch( - new Node\Expr\Variable('this'), - $operation->operatorLookUpMethod, - ), - new Node\Name($operation->operatorClassName->relative), - ), - new Node\Expr\ConstFetch(new Node\Name('false')), - ), - [ - 'stmts' => [ - new Node\Stmt\Expression( - new Node\Expr\Assign( - new Node\Expr\PropertyFetch( - new Node\Expr\Variable('this'), - $operation->operatorLookUpMethod, - ), - new Node\Expr\New_( - new Node\Name($operation->operatorClassName->relative), - [ - ...(static function (Operation $operation, array $operationHydratorMap): iterable { - foreach ((new ReflectionClass($operation->operatorClassName->fullyQualified->source))->getConstructor()->getParameters() as $parameter) { - if ($parameter->name === 'hydrator') { - yield new Arg( - new Node\Expr\MethodCall( - new Node\Expr\PropertyFetch( - new Node\Expr\Variable('this'), - 'hydrators', - ), - 'getObjectMapper' . ucfirst($operationHydratorMap[$operation->operationId]->methodName), - ), - ); - continue; - } - - yield new Arg( - new Node\Expr\PropertyFetch( - new Node\Expr\Variable('this'), - $parameter->name, - ), - ); - } - })($operation, $operationHydratorMap), - ], - ), - ), - ), - ], - ], - ), - new Node\Stmt\Return_( - new Node\Expr\PropertyFetch( - new Node\Expr\Variable('this'), - $operation->operatorLookUpMethod, - ), - ), - ]), - ]); - } - - yield new File($pathPrefix, 'Internal\\Operators', $stmt->addStmt($class)->getNode()); - } -} diff --git a/src/Generator/Paths.php b/src/Generator/Paths.php new file mode 100644 index 0000000..24168ec --- /dev/null +++ b/src/Generator/Paths.php @@ -0,0 +1,61 @@ +operators = new Operators($builderFactory); + $this->operator = new Operator($builderFactory); + $this->operationsInterface = new OperationsInterface($builderFactory); + $this->operations = new Operations($builderFactory); + $this->operation = new Operation($builderFactory, new Json(), new Raw()); + $this->operationTest = new OperationTest($builderFactory, $call, $operations); + } + + /** @return iterable */ + public function generate(Package $package, Representation $representation): iterable + { + $package = ConfigurationPackage::unwrap($package); + + foreach ($representation->client->paths as $path) { + foreach ($path->operations as $operation) { + yield from $this->operation->generate($package, $operation, $path->hydrator); + yield from $this->operator->generate($package, $operation, $path->hydrator); + yield from $this->operationTest->generate($package, $operation); + } + } + + yield from $this->operationsInterface->generate($package, $representation); + yield from $this->operations->generate($package, $representation); + yield from $this->operators->generate($package, $representation); + } +} diff --git a/src/Generator/Operation.php b/src/Generator/Paths/Operation.php similarity index 82% rename from src/Generator/Operation.php rename to src/Generator/Paths/Operation.php index 97c13cd..e7d5548 100644 --- a/src/Generator/Operation.php +++ b/src/Generator/Paths/Operation.php @@ -2,39 +2,41 @@ declare(strict_types=1); -namespace ApiClients\Tools\OpenApiClientGenerator\Generator; +namespace ApiClients\Tools\OpenApiClientGenerator\Generator\Paths; use ApiClients\Tools\OpenApiClient\Utils\Response\Header; use ApiClients\Tools\OpenApiClient\Utils\Response\WithoutBody; -use ApiClients\Tools\OpenApiClientGenerator\Configuration; -use ApiClients\Tools\OpenApiClientGenerator\File; +use ApiClients\Tools\OpenApiClientGenerator\Contract\ContentType; +use ApiClients\Tools\OpenApiClientGenerator\Generator\Helper\ConfigurationPackage; use ApiClients\Tools\OpenApiClientGenerator\Generator\Helper\OperationArray; -use ApiClients\Tools\OpenApiClientGenerator\Registry\ThrowableSchema; -use ApiClients\Tools\OpenApiClientGenerator\Representation\Hydrator; -use ApiClients\Tools\OpenApiClientGenerator\Utils; use cebe\openapi\Reader; use cebe\openapi\spec\Schema; use Jawira\CaseConverter\Convert; +use League\OpenAPIValidation\Schema\SchemaValidator; use League\Uri\UriTemplate; use NumberToWords\NumberToWords; +use OpenAPITools\Contract\Package; +use OpenAPITools\Representation\Namespaced; +use OpenAPITools\Utils\File; +use OpenAPITools\Utils\Utils; use PhpParser\Builder\Param; use PhpParser\BuilderFactory; use PhpParser\Comment\Doc; use PhpParser\Node; use PhpParser\Node\Arg; -use PhpParser\Node\Stmt\Class_; use Psr\Http\Message\RequestInterface; use Psr\Http\Message\ResponseInterface; use Psr\Http\Message\StreamInterface; use React\Http\Browser; +use React\Http\Message\Request; use React\Stream\ReadableStreamInterface; -use RingCentral\Psr7\Request; use RuntimeException; use Rx\Observable; use Rx\Scheduler\ImmediateScheduler; use Rx\Subject\Subject; use Throwable; +use function array_filter; use function array_map; use function array_unique; use function array_values; @@ -44,23 +46,33 @@ use function is_int; use function is_string; use function ksort; -use function strlen; use function strpos; use function strtolower; use function substr; use const PHP_EOL; -final class Operation +final readonly class Operation { + /** @var array */ + private array $contentTypes; + + public function __construct( + private BuilderFactory $builderFactory, + ContentType ...$contentTypes, + ) { + $this->contentTypes = $contentTypes; + } + /** @return iterable */ - public static function generate(string $pathPrefix, \ApiClients\Tools\OpenApiClientGenerator\Representation\Operation $operation, Hydrator $hydrator, ThrowableSchema $throwableSchemaRegistry, Configuration $configuration): iterable + public function generate(Package $package, Namespaced\Operation $operation, Namespaced\Hydrator $hydrator): iterable { + $package = ConfigurationPackage::unwrap($package); + $noHydrator = true; - $factory = new BuilderFactory(); - $stmt = $factory->namespace($operation->className->namespace->source); + $stmt = $this->builderFactory->namespace($operation->className->namespace->source); - $class = $factory->class($operation->className->className)->makeFinal()->addStmt( + $class = $this->builderFactory->class($operation->className->className)->makeFinal()->addStmt( new Node\Stmt\ClassConst( [ new Node\Const_( @@ -70,7 +82,7 @@ public static function generate(string $pathPrefix, \ApiClients\Tools\OpenApiCli ), ), ], - Class_::MODIFIER_PUBLIC, + 1, ), )->addStmt( new Node\Stmt\ClassConst( @@ -82,20 +94,14 @@ public static function generate(string $pathPrefix, \ApiClients\Tools\OpenApiCli ), ), ], - Class_::MODIFIER_PUBLIC, + 1, ), ); - if (count($operation->requestBody) > 0) { - $class->addStmt( - $factory->property('requestSchemaValidator')->setType('\League\OpenAPIValidation\Schema\SchemaValidator')->makeReadonly()->makePrivate(), - ); - } - - $constructor = $factory->method('__construct')->makePublic(); + $constructor = $this->builderFactory->method('__construct')->makePublic(); if (count($operation->requestBody) > 0) { $constructor->addParam( - (new Param('requestSchemaValidator'))->setType('\League\OpenAPIValidation\Schema\SchemaValidator'), + $this->builderFactory->param('requestSchemaValidator')->makePrivate()->setType('\\' . SchemaValidator::class), )->addStmt( new Node\Expr\Assign( new Node\Expr\PropertyFetch( @@ -111,9 +117,9 @@ public static function generate(string $pathPrefix, \ApiClients\Tools\OpenApiCli $query = []; $constructorParams = []; foreach ($operation->parameters as $parameter) { - $paramterStmt = $factory->property($parameter->name); + $paramterStmt = $this->builderFactory->property($parameter->name); $param = new Param($parameter->name); - if (strlen($parameter->description) > 0) { + if ($parameter->description !== '') { $paramterStmt->setDocComment('/**' . $parameter->description . ' **/'); } @@ -178,9 +184,7 @@ public static function generate(string $pathPrefix, \ApiClients\Tools\OpenApiCli ), ], ), - new Node\Name( - 'expand', - ), + 'expand', [ new Arg( new Node\Expr\Array_( @@ -202,10 +206,10 @@ public static function generate(string $pathPrefix, \ApiClients\Tools\OpenApiCli ), ]; - $createRequestMethod = $factory->method('createRequest')->setReturnType('\\' . RequestInterface::class)->makePublic(); + $createRequestMethod = $this->builderFactory->method('createRequest')->setReturnType('\\' . RequestInterface::class)->makePublic(); if (count($operation->requestBody) > 0) { $createRequestMethod->addParam( - $factory->param('data')->setType('array'), + $this->builderFactory->param('data')->setType('array'), ); } @@ -223,7 +227,7 @@ public static function generate(string $pathPrefix, \ApiClients\Tools\OpenApiCli new Node\Arg(new Node\Expr\Variable('data')), new Node\Arg(new Node\Expr\StaticCall(new Node\Name('\\' . Reader::class), 'readFromJson', [ new Arg(new Node\Expr\ClassConstFetch( - new Node\Name($requestBody->schema->className->relative), + new Node\Name($requestBody->schema->className->fullyQualified->source), 'SCHEMA_JSON', )), new Arg(new Node\Expr\ClassConstFetch( @@ -252,24 +256,28 @@ public static function generate(string $pathPrefix, \ApiClients\Tools\OpenApiCli $returnTypeRaw = []; $cases = []; - foreach ($configuration->contentType ?? [] as $contentType) { + foreach ($this->contentTypes as $contentType) { foreach ($contentType::contentType() as $supportedContentType) { $caseCases = []; foreach ($operation->response as $contentTypeSchema) { + $content = $contentTypeSchema->content; $scPosition = strpos($contentTypeSchema->contentType, ';'); - if ( - (! is_int($scPosition) && $supportedContentType !== $contentTypeSchema->contentType) || - (is_int($scPosition) && $scPosition >= 0 && $supportedContentType !== substr($contentTypeSchema->contentType, 0, $scPosition)) - ) { + if (is_int($scPosition)) { + if ($supportedContentType !== substr($contentTypeSchema->contentType, 0, $scPosition)) { + continue; + } + } elseif ($supportedContentType !== $contentTypeSchema->contentType) { continue; } - if (! $contentTypeSchema->content->payload instanceof \ApiClients\Tools\OpenApiClientGenerator\Representation\Schema) { - if ($contentTypeSchema->content->type === 'scalar') { - $returnType[] = $returnTypeRaw[] = $contentTypeSchema->content->payload; + $responseCode = is_int($contentTypeSchema->code) ? $contentTypeSchema->code : (int) $contentTypeSchema->code; + + if ($content instanceof Namespaced\Property\Type && ! $content->payload instanceof Namespaced\Schema) { + if ($content->type === 'scalar') { + $returnType[] = $returnTypeRaw[] = $content->payload; $caseCases[] = new Node\Stmt\Case_( - new Node\Scalar\LNumber($contentTypeSchema->code), + new Node\Scalar\LNumber($responseCode), [ new Node\Stmt\Return_( new Node\Expr\Variable( @@ -282,14 +290,23 @@ public static function generate(string $pathPrefix, \ApiClients\Tools\OpenApiCli } } - $isArray = $contentTypeSchema->content->type === 'array' || ($contentTypeSchema->content->type !== 'union' && $contentTypeSchema->content->payload->isArray); + $isArray = ($content instanceof Namespaced\Property\Type && ($content->type === 'array' || ($content->type !== 'union' && $content->payload instanceof Namespaced\Schema && $content->payload->isArray))) + || ($content instanceof Namespaced\Schema && $content->isArray); - $isError = $contentTypeSchema->code >= 400; + $isError = $responseCode >= 400; - if ($contentTypeSchema->content->type === 'union' || $contentTypeSchema->content->type === 'array') { - $gotoLabels = (new Convert(Utils::cleanUpString('items_' . $supportedContentType . '_' . NumberToWords::transformNumber('en', $contentTypeSchema->code) . '_aaaaa')))->toSnake(); - $sTmts = []; - $types = []; + if ($content instanceof Namespaced\Property\Type && ($content->type === 'union' || $content->type === 'array')) { + /** + * Only the suffix is incremented. The label as a whole + * contains underscores, and incrementing a string that + * is not alphanumeric is deprecated. + */ + $gotoLabelsPrefix = new Convert(Utils::cleanUpString('items_' . $supportedContentType . '_' . NumberToWords::transformNumber('en', $responseCode)))->toSnake(); + $gotoLabelsSuffix = 0; + $gotoLabels = $gotoLabelsPrefix . '_' . $gotoLabelsSuffix; + $sTmts = []; + /** @var list $types */ + $types = []; $sTmts[] = new Node\Stmt\Expression( new Node\Expr\Assign( @@ -302,10 +319,10 @@ public static function generate(string $pathPrefix, \ApiClients\Tools\OpenApiCli foreach ( OperationArray::uniqueSchemas(...( - is_array($contentTypeSchema->content->payload) ? $contentTypeSchema->content->payload : [$contentTypeSchema->content->payload] + is_array($content->payload) ? $content->payload : [$content->payload] )) as $item ) { - if ($item instanceof \ApiClients\Tools\OpenApiClientGenerator\Representation\Schema) { + if ($item instanceof Namespaced\Schema) { $sTmts[] = new Node\Stmt\TryCatch([ new Node\Stmt\Expression(new Node\Expr\MethodCall( new Node\Expr\PropertyFetch( @@ -317,7 +334,7 @@ public static function generate(string $pathPrefix, \ApiClients\Tools\OpenApiCli new Node\Arg(new Node\Expr\Variable('body')), new Node\Arg(new Node\Expr\StaticCall(new Node\Name('\cebe\openapi\Reader'), 'readFromJson', [ new Arg(new Node\Expr\ClassConstFetch( - new Node\Name($item->className->relative), + new Node\Name($item->className->fullyQualified->source), 'SCHEMA_JSON', )), new Arg(new Node\Scalar\String_('\cebe\openapi\spec\Schema')), @@ -332,7 +349,7 @@ public static function generate(string $pathPrefix, \ApiClients\Tools\OpenApiCli 'hydrateObject', [ new Node\Arg(new Node\Expr\ClassConstFetch( - new Node\Name($item->className->relative), + new Node\Name($item->className->fullyQualified->source), 'class', )), new Node\Arg(new Node\Expr\Variable('body')), @@ -348,9 +365,10 @@ public static function generate(string $pathPrefix, \ApiClients\Tools\OpenApiCli ), ]); $sTmts[] = new Node\Stmt\Label($gotoLabels); - $gotoLabels++; - $types[] = $item->className->relative; - } else { + ++$gotoLabelsSuffix; + $gotoLabels = $gotoLabelsPrefix . '_' . $gotoLabelsSuffix; + $types[] = $item->className->fullyQualified->source; + } elseif (is_string($item)) { $sTmts[] = new Node\Stmt\If_( new Node\Expr\FuncCall( new Node\Name('\is_' . $item), @@ -370,7 +388,7 @@ public static function generate(string $pathPrefix, \ApiClients\Tools\OpenApiCli } } - $sTmts[] = new Node\Stmt\Throw_(new Node\Expr\Variable('error')); + $sTmts[] = new Node\Stmt\Expression(new Node\Expr\Throw_(new Node\Expr\Variable('error'))); if (! $isError) { if ($contentTypeSchema->content->type === 'array') { @@ -381,7 +399,7 @@ public static function generate(string $pathPrefix, \ApiClients\Tools\OpenApiCli } } - $tmts = $contentTypeSchema->content->type === 'array' ? [ + $tmts = $content->type === 'array' ? [ new Node\Stmt\Return_( new Node\Expr\MethodCall( new Node\Expr\StaticCall( @@ -402,42 +420,42 @@ public static function generate(string $pathPrefix, \ApiClients\Tools\OpenApiCli 'stmts' => $sTmts, 'params' => [new Node\Param(new Node\Expr\Variable('body'), null, new Node\Name('array'))], 'returnType' => new Node\UnionType( - array_map(static fn (string $name): Node\name => new Node\Name($name), $types), + array_map(static fn (string $name): Node\Name => new Node\Name($name), $types), ), ])), ], ), ), ] : $sTmts; - } else { - $returnOrThrow = Node\Stmt\Return_::class; - if ($isError) { - $returnOrThrow = Node\Stmt\Throw_::class; - $throwableSchemaRegistry->add($contentTypeSchema->content->payload->className->relative); - } + } elseif ($content instanceof Namespaced\Schema || $content->payload instanceof Namespaced\Schema) { + $schema = $content instanceof Namespaced\Schema ? $content : $content->payload; + + $buildReturnOrThrow = static fn (Node\Expr $expr, bool $error): Node\Stmt => $error + ? new Node\Stmt\Expression(new Node\Expr\Throw_($expr)) + : new Node\Stmt\Return_($expr); + $returnOrThrow = static fn (Node\Expr $expr): Node\Stmt => $buildReturnOrThrow($expr, $isError); - $object = $isError ? $contentTypeSchema->content->payload->errorClassNameAliased->relative : $contentTypeSchema->content->payload->className->relative; + $object = $isError ? $schema->errorClassNameAliased->fullyQualified->source : $schema->className->fullyQualified->source; if (! $isError) { - $returnType[] = ($isArray ? '\\' . Observable::class . '<' : '') . $object . ($isArray ? '>' : ''); + $returnType[] = ($isArray ? '\\' . Observable::class . '<\\' : '') . $object . ($isArray ? '>' : ''); $returnTypeRaw[] = $isArray ? '\\' . Observable::class : $object; } - $validate = OperationArray::validate($contentTypeSchema->content->payload->className->relative, $isArray); - $hydrate = OperationArray::hydrate($contentTypeSchema->content->payload->className->relative); - - if ($isError) { - $hydrate = new Node\Expr\New_( - new Node\Name($contentTypeSchema->content->payload->errorClassNameAliased->relative), + $validate = OperationArray::validate($schema->className->fullyQualified->source, $isArray); + $hydrateMethodCall = OperationArray::hydrate($schema->className->fullyQualified->source); + $responseValue = $isError + ? new Node\Expr\New_( + new Node\Name($schema->errorClassName->fullyQualified->source), [ new Arg( - is_string($contentTypeSchema->code) ? new Node\Expr\Variable('code') : new Node\Scalar\LNumber($contentTypeSchema->code), + is_string($contentTypeSchema->code) ? new Node\Expr\Variable('code') : new Node\Scalar\LNumber($responseCode), ), new Arg( - $hydrate, + $hydrateMethodCall, ), ], - ); - } + ) + : $hydrateMethodCall; $tmts = [ $isArray ? new Node\Stmt\Foreach_( @@ -447,7 +465,7 @@ public static function generate(string $pathPrefix, \ApiClients\Tools\OpenApiCli 'stmts' => [$validate], ], ) : $validate, - new $returnOrThrow( + $returnOrThrow( $isArray ? new Node\Expr\MethodCall( new Node\Expr\StaticCall( new Node\Name('\\' . Observable::class), @@ -466,16 +484,18 @@ public static function generate(string $pathPrefix, \ApiClients\Tools\OpenApiCli new Arg(new Node\Expr\Closure([ 'stmts' => [ new Node\Stmt\Return_( - $hydrate, + $responseValue, ), ], 'params' => [new Node\Param(new Node\Expr\Variable('body'), null, new Node\Name('array'))], - 'returnType' => $object, + 'returnType' => new Node\Name('\\' . $object), ])), ], - ) : $hydrate, + ) : $responseValue, ), ]; + } else { + continue; } $case = new Node\Stmt\Case_( @@ -483,7 +503,7 @@ public static function generate(string $pathPrefix, \ApiClients\Tools\OpenApiCli $tmts, ); - if (strlen($contentTypeSchema->description) > 0) { + if ($contentTypeSchema->description !== '') { $case->setDocComment(new Doc('/**' . PHP_EOL . ' * ' . $contentTypeSchema->description . PHP_EOL . ' **/')); } @@ -623,7 +643,7 @@ public static function generate(string $pathPrefix, \ApiClients\Tools\OpenApiCli ), ], 'params' => [ - $factory->param('data')->setType('string')->getNode(), + $this->builderFactory->param('data')->setType('string')->getNode(), ], 'uses' => [ new Node\Expr\ClosureUse( @@ -685,7 +705,7 @@ public static function generate(string $pathPrefix, \ApiClients\Tools\OpenApiCli ), ], 'params' => [ - $factory->param('error')->setType('\\' . Throwable::class)->getNode(), + $this->builderFactory->param('error')->setType('\\' . Throwable::class)->getNode(), ], 'uses' => [ new Node\Expr\ClosureUse( @@ -701,7 +721,7 @@ public static function generate(string $pathPrefix, \ApiClients\Tools\OpenApiCli ), ], 'params' => [ - $factory->param('response')->setType('\\' . ResponseInterface::class)->getNode(), + $this->builderFactory->param('response')->setType('\\' . ResponseInterface::class)->getNode(), ], 'uses' => [ new Node\Expr\ClosureUse( @@ -764,14 +784,14 @@ public static function generate(string $pathPrefix, \ApiClients\Tools\OpenApiCli new Node\Scalar\LNumber($empty->code), $empties, ); - if (strlen($empty->description) > 0) { + if ($empty->description !== '') { $emptyCase->setDocComment(new Doc('/**' . PHP_EOL . ' * ' . $empty->description . PHP_EOL . ' **/')); } $casesWithoutContent[] = $emptyCase; } - $createResponseMethod = $factory->method('createResponse')->makePublic(); + $createResponseMethod = $this->builderFactory->method('createResponse')->makePublic(); if (count($cases) > 0 || count($casesWithoutContent) > 0) { $createResponseMethod->addStmt( @@ -836,10 +856,12 @@ public static function generate(string $pathPrefix, \ApiClients\Tools\OpenApiCli if (count($cases) > 0 || count($casesWithoutContent) > 0) { $createResponseMethod->addStmt( - new Node\Stmt\Throw_( - new Node\Expr\New_( - new Node\Name('\\' . RuntimeException::class), - [new Arg(new Node\Scalar\String_('Unable to find matching response code and content type'))], + new Node\Stmt\Expression( + new Node\Expr\Throw_( + new Node\Expr\New_( + new Node\Name('\\' . RuntimeException::class), + [new Arg(new Node\Scalar\String_('Unable to find matching response code and content type'))], + ), ), ), ); @@ -848,7 +870,7 @@ public static function generate(string $pathPrefix, \ApiClients\Tools\OpenApiCli $returnType[] = $returnTypeRaw[] = '\\' . ResponseInterface::class; } - $returnTypeRaw = array_unique($returnTypeRaw); + $returnTypeRaw = array_unique(array_filter($returnTypeRaw, is_string(...))); if (count($returnTypeRaw) === 0) { $returnTypeRaw[] = 'void'; } @@ -861,25 +883,19 @@ public static function generate(string $pathPrefix, \ApiClients\Tools\OpenApiCli $createResponseMethod->setDocComment( new Doc(implode(PHP_EOL, [ '/**', - ' * @return ' . implode('|', array_unique($returnType)), + ' * @return ' . implode('|', array_unique(array_filter($returnType, is_string(...)))), ' */', ])), ); } $createResponseMethod->addParam( - $factory->param('response')->setType('\\' . ResponseInterface::class), + $this->builderFactory->param('response')->setType('\\' . ResponseInterface::class), ); if ($noHydrator === false) { - $class->addStmt( - $factory->property('responseSchemaValidator')->setType('\League\OpenAPIValidation\Schema\SchemaValidator')->makeReadonly()->makePrivate(), - )->addStmt( - $factory->property('hydrator')->setType($hydrator->className->relative)->makeReadonly()->makePrivate(), - ); - $constructor->addParam( - (new Param('responseSchemaValidator'))->setType('\League\OpenAPIValidation\Schema\SchemaValidator'), + $this->builderFactory->param('responseSchemaValidator')->makePrivate()->setType('\\' . SchemaValidator::class), )->addStmt( new Node\Expr\Assign( new Node\Expr\PropertyFetch( @@ -889,7 +905,7 @@ public static function generate(string $pathPrefix, \ApiClients\Tools\OpenApiCli new Node\Expr\Variable('responseSchemaValidator'), ), )->addParam( - (new Param('hydrator'))->setType($hydrator->className->relative), + $this->builderFactory->param('hydrator')->makePrivate()->setType($hydrator->className->fullyQualified->source), )->addStmt( new Node\Expr\Assign( new Node\Expr\PropertyFetch( @@ -903,10 +919,10 @@ public static function generate(string $pathPrefix, \ApiClients\Tools\OpenApiCli if ($operation->matchMethod === 'STREAM') { $class->addStmt( - $factory->property('browser')->setType('\\' . Browser::class)->makeReadonly()->makePrivate(), + $this->builderFactory->property('browser')->setType('\\' . Browser::class)->makeReadonly()->makePrivate(), ); $constructor->addParam( - (new Param('browser'))->setType('\\' . Browser::class), + $this->builderFactory->param('browser')->makePrivate()->setType('\\' . Browser::class), )->addStmt( new Node\Expr\Assign( new Node\Expr\PropertyFetch( @@ -924,6 +940,6 @@ public static function generate(string $pathPrefix, \ApiClients\Tools\OpenApiCli $class->addStmt($createRequestMethod); $class->addStmt($createResponseMethod); - yield new File($pathPrefix, $operation->className->relative, $stmt->addStmt($class)->getNode()); + yield new File($package->destination->source, $operation->className->relative, $stmt->addStmt($class)->getNode(), File::DO_LOAD_ON_WRITE); } } diff --git a/src/Generator/OperationTest.php b/src/Generator/Paths/OperationTest.php similarity index 70% rename from src/Generator/OperationTest.php rename to src/Generator/Paths/OperationTest.php index 9393c52..2c1a656 100644 --- a/src/Generator/OperationTest.php +++ b/src/Generator/Paths/OperationTest.php @@ -2,17 +2,20 @@ declare(strict_types=1); -namespace ApiClients\Tools\OpenApiClientGenerator\Generator; +namespace ApiClients\Tools\OpenApiClientGenerator\Generator\Paths; use ApiClients\Contracts\HTTP\Headers\AuthenticationInterface; -use ApiClients\Tools\OpenApiClientGenerator\Configuration; -use ApiClients\Tools\OpenApiClientGenerator\File; -use ApiClients\Tools\OpenApiClientGenerator\Gatherer\ExampleData; -use ApiClients\Tools\OpenApiClientGenerator\Registry\ThrowableSchema; -use ApiClients\Tools\OpenApiClientGenerator\Representation; -use ApiClients\Tools\OpenApiClientGenerator\Representation\Schema; +use ApiClients\Tools\OpenApiClientGenerator\Generator\Helper\ConfigurationPackage; +use ApiClients\Tools\OpenApiClientGenerator\Generator\Helper\Representation as RepresentationHelper; +use InvalidArgumentException; use Jawira\CaseConverter\Convert; use NumberToWords\NumberToWords; +use OpenAPITools\Configuration\Package as ConfigurationPackageType; +use OpenAPITools\Contract\Package; +use OpenAPITools\Gatherer\ExampleData; +use OpenAPITools\Representation\Namespaced; +use OpenAPITools\Representation\Namespaced\Operation\RequestBody; +use OpenAPITools\Utils\File; use PhpParser\Builder\Method; use PhpParser\Builder\Param; use PhpParser\BuilderFactory; @@ -29,28 +32,38 @@ use function implode; use function is_array; use function is_bool; +use function is_float; +use function is_int; use function is_string; use function ksort; -use function Safe\preg_replace; +use function preg_replace; use function str_replace; use function strtolower; use function urlencode; use const PHP_EOL; -final class OperationTest +final readonly class OperationTest { + public function __construct( + private BuilderFactory $builderFactory, + private bool $call, + private bool $operations, + ) { + } + /** @return iterable */ - public static function generate(string $pathPrefix, Representation\Operation $operation, Representation\Hydrator $hydrator, ThrowableSchema $throwableSchemaRegistry, Configuration $configuration): iterable + public function generate(Package $package, Namespaced\Operation $operation): iterable { + $package = ConfigurationPackage::unwrap($package); + if (count($operation->response) === 0) { return; } - $factory = new BuilderFactory(); - $stmt = $factory->namespace($operation->className->namespace->test); + $stmt = $this->builderFactory->namespace($operation->className->namespace->test); - $class = $factory->class($operation->className->className . 'Test')->extend( + $class = $this->builderFactory->class($operation->className->className . 'Test')->extend( new Node\Name( '\\' . AsyncTestCase::class, ), @@ -62,77 +75,70 @@ public static function generate(string $pathPrefix, Representation\Operation $op ])), ); + $testsStmts = []; + foreach ($operation->response as $contentTypeSchema) { - $contentTypePayloads = $contentTypeSchema->content->payload; - if (! is_array($contentTypePayloads)) { - $contentTypePayloads = [$contentTypePayloads]; + if (! $contentTypeSchema->content instanceof Namespaced\Property\Type) { + continue; } - foreach ($contentTypePayloads as $index => $contentTypePayload) { - if (! $contentTypePayload instanceof Representation\Schema) { - continue; - } + $payload = $contentTypeSchema->content->payload; + /** @var list $payloadItems */ + $payloadItems = is_array($payload) ? $payload : [$payload]; + foreach ($payloadItems as $index => $contentTypePayload) { $testSuffix = NumberToWords::transformNumber('en', $index); if (count($operation->requestBody) === 0) { - if ($configuration->entryPoints->call) { - $class->addStmt( - self::createCallMethod( - $factory, + if ($this->call) { + $testsStmts[] = + $this->createCallMethod( $operation, null, $contentTypeSchema, - $configuration, + $package, $contentTypePayload, $testSuffix, - ), - ); + ); } - if ($configuration->entryPoints->operations) { - $class->addStmt( - self::createOperationsMethod( - $factory, + if ($this->operations) { + $testsStmts[] = + $this->createOperationsMethod( $operation, null, $contentTypeSchema, - $configuration, + $package, $contentTypePayload, $testSuffix, - ), - ); + ); } } else { foreach ($operation->requestBody as $request) { - if ($configuration->entryPoints->call) { - $class->addStmt( - self::createCallMethod( - $factory, + if ($this->call) { + $testsStmts[] = + $this->createCallMethod( $operation, $request, $contentTypeSchema, - $configuration, + $package, $contentTypePayload, $testSuffix, - ), - ); + ); } - if (! $configuration->entryPoints->operations) { + if (! $this->operations) { continue; } - $class->addStmt( - self::createOperationsMethod( - $factory, + $testsStmts[] = + $this->createOperationsMethod( $operation, $request, $contentTypeSchema, - $configuration, + $package, $contentTypePayload, $testSuffix, - ), - ); + ); } } } @@ -140,75 +146,87 @@ public static function generate(string $pathPrefix, Representation\Operation $op foreach ($operation->empty as $emptyResponse) { if (count($operation->requestBody) === 0) { - if ($configuration->entryPoints->call) { - $class->addStmt( - self::createCallMethod( - $factory, + if ($this->call) { + $testsStmts[] = + $this->createCallMethod( $operation, null, $emptyResponse, - $configuration, + $package, null, 'empty', - ), - ); + ); } - if ($configuration->entryPoints->operations) { - $class->addStmt( - self::createOperationsMethod( - $factory, + if ($this->operations) { + $testsStmts[] = + $this->createOperationsMethod( $operation, null, $emptyResponse, - $configuration, + $package, null, 'empty', - ), - ); + ); } } else { foreach ($operation->requestBody as $request) { - if ($configuration->entryPoints->call) { - $class->addStmt( - self::createCallMethod( - $factory, + if ($this->call) { + $testsStmts[] = + $this->createCallMethod( $operation, $request, $emptyResponse, - $configuration, + $package, null, 'empty', - ), - ); + ); } - if (! $configuration->entryPoints->operations) { + if (! $this->operations) { continue; } - $class->addStmt( - self::createOperationsMethod( - $factory, + $testsStmts[] = + $this->createOperationsMethod( $operation, $request, $emptyResponse, - $configuration, + $package, null, 'empty', - ), - ); + ); } } } - yield new File($pathPrefix, $operation->className->relative . 'Test', $stmt->addStmt($class)->getNode()); + if (count($testsStmts) <= 0) { + return; + } + + $class->addStmts($testsStmts); + + yield new File($package->destination->test, $operation->className->relative . 'Test', $stmt->addStmt($class)->getNode(), File::DO_LOAD_ON_WRITE); } - private static function createCallMethod(BuilderFactory $factory, Representation\Operation $operation, Representation\OperationRequestBody|null $request, Representation\OperationResponse|Representation\OperationEmptyResponse $response, Configuration $configuration, Representation\Schema|Representation\PropertyType|string|null $contentTypePayload, string $testSuffix): Method - { - $methodName = 'call_httpCode_' . $response->code . ($request === null ? '' : '_requestContentType_' . preg_replace('/[^a-zA-Z0-9]+/', '_', $request->contentType)) . ($response instanceof Representation\OperationResponse ? '_responseContentType_' . preg_replace('/[^a-zA-Z0-9]+/', '_', $response->contentType) : '') . ($testSuffix !== '' ? '_' . $testSuffix : ''); - if ($response instanceof Representation\OperationResponse && $response->content->payload instanceof Representation\Schema) { + private function createCallMethod( + Namespaced\Operation $operation, + mixed $request, + Namespaced\Operation\Response|Namespaced\Operation\EmptyResponse $response, + ConfigurationPackageType $package, + mixed $contentTypePayload, + string $testSuffix, + ): Method { + if ($request !== null && ! $request instanceof RequestBody) { + throw new InvalidArgumentException('Request must be a RequestBody instance or null.'); + } + + if ($contentTypePayload !== null && ! is_string($contentTypePayload) && ! $contentTypePayload instanceof Namespaced\Schema && ! $contentTypePayload instanceof Namespaced\Property\Type) { + throw new InvalidArgumentException('Unsupported content type payload.'); + } + + $methodName = 'call_httpCode_' . $response->code . ($request instanceof RequestBody ? '_requestContentType_' . (preg_replace('/[^a-zA-Z0-9]+/', '_', $request->contentType) ?? '') : '') . ($response instanceof Namespaced\Operation\Response ? '_responseContentType_' . (preg_replace('/[^a-zA-Z0-9]+/', '_', $response->contentType) ?? '') : '') . ($testSuffix !== '' ? '_' . $testSuffix : ''); + if ($response instanceof Namespaced\Operation\Response && $response->content instanceof Namespaced\Property\Type && $response->content->payload instanceof Namespaced\Schema) { $responseSchemaFetch = new Node\Expr\FuncCall( new Node\Name( 'json_encode', @@ -223,7 +241,7 @@ private static function createCallMethod(BuilderFactory $factory, Representation new Arg( new Node\Expr\ClassConstFetch( new Node\Name( - $response->content->payload->className->relative, + $response->content->payload->className->fullyQualified->source, ), 'SCHEMA_EXAMPLE_DATA', ), @@ -240,20 +258,20 @@ private static function createCallMethod(BuilderFactory $factory, Representation ), ], ); - } elseif ($response instanceof Representation\OperationResponse) { - $responseSchemaFetch = ExampleData::gather(null, $response->content, $methodName)->node; + } elseif ($response instanceof Namespaced\Operation\Response && $response->content instanceof Namespaced\Property\Type) { + $responseSchemaFetch = $this->gatherExampleDataNode($response->content, $methodName); } else { $responseSchemaFetch = new Node\Scalar\String_(''); } - return $factory->method($methodName)->makePublic()->setDocComment( + return $this->builderFactory->method($methodName)->makePublic()->setDocComment( new Doc(implode(PHP_EOL, [ '/**', ' * @test', ' */', ])), )->addStmts([ - ...self::testSetUp($responseSchemaFetch, $operation, $request, $response, $configuration, $contentTypePayload), + ...$this->testSetUp($responseSchemaFetch, $operation, $request, $response, $package, $contentTypePayload), new Node\Stmt\Expression( new Node\Expr\Assign( new Node\Expr\Variable( @@ -268,7 +286,7 @@ private static function createCallMethod(BuilderFactory $factory, Representation new Arg( new Node\Expr\ClassConstFetch( new Node\Name( - $operation->className->relative, + $operation->className->fullyQualified->source, ), 'OPERATION_MATCH', ), @@ -282,9 +300,9 @@ private static function createCallMethod(BuilderFactory $factory, Representation 'array', ), 'params' => [ - (new Param( + new Param( 'data', - ))->setType( + )->setType( new Node\Name( 'array', ), @@ -316,7 +334,7 @@ private static function createCallMethod(BuilderFactory $factory, Representation ), [ new Arg( - ($request === null ? new Node\Expr\Array_() : new Node\Expr\FuncCall( + ($request instanceof RequestBody ? new Node\Expr\FuncCall( new Node\Name( 'json_decode', ), @@ -324,7 +342,7 @@ private static function createCallMethod(BuilderFactory $factory, Representation new Arg( new Node\Expr\ClassConstFetch( new Node\Name( - $request->schema->className->relative, + $request->schema->className->fullyQualified->source, ), 'SCHEMA_EXAMPLE_DATA', ), @@ -337,7 +355,7 @@ private static function createCallMethod(BuilderFactory $factory, Representation ), ), ], - )), + ) : new Node\Expr\Array_()), ), ], ), @@ -357,10 +375,24 @@ private static function createCallMethod(BuilderFactory $factory, Representation ]); } - private static function createOperationsMethod(BuilderFactory $factory, Representation\Operation $operation, Representation\OperationRequestBody|null $request, Representation\OperationResponse|Representation\OperationEmptyResponse $response, Configuration $configuration, Representation\Schema|Representation\PropertyType|string|null $contentTypePayload, string $testSuffix): Method - { - $methodName = 'operations_httpCode_' . $response->code . ($request === null ? '' : '_requestContentType_' . preg_replace('/[^a-zA-Z0-9]+/', '_', $request->contentType)) . ($response instanceof Representation\OperationResponse ? '_responseContentType_' . preg_replace('/[^a-zA-Z0-9]+/', '_', $response->contentType) : '') . ($testSuffix !== '' ? '_' . $testSuffix : ''); - if ($response instanceof Representation\OperationResponse && $response->content->payload instanceof Representation\Schema) { + private function createOperationsMethod( + Namespaced\Operation $operation, + mixed $request, + Namespaced\Operation\Response|Namespaced\Operation\EmptyResponse $response, + ConfigurationPackageType $package, + mixed $contentTypePayload, + string $testSuffix, + ): Method { + if ($request !== null && ! $request instanceof RequestBody) { + throw new InvalidArgumentException('Request must be a RequestBody instance or null.'); + } + + if ($contentTypePayload !== null && ! is_string($contentTypePayload) && ! $contentTypePayload instanceof Namespaced\Schema && ! $contentTypePayload instanceof Namespaced\Property\Type) { + throw new InvalidArgumentException('Unsupported content type payload.'); + } + + $methodName = 'operations_httpCode_' . $response->code . ($request instanceof RequestBody ? '_requestContentType_' . (preg_replace('/[^a-zA-Z0-9]+/', '_', $request->contentType) ?? '') : '') . ($response instanceof Namespaced\Operation\Response ? '_responseContentType_' . (preg_replace('/[^a-zA-Z0-9]+/', '_', $response->contentType) ?? '') : '') . ($testSuffix !== '' ? '_' . $testSuffix : ''); + if ($response instanceof Namespaced\Operation\Response && $response->content instanceof Namespaced\Property\Type && $response->content->payload instanceof Namespaced\Schema) { $responseSchemaFetch = new Node\Expr\FuncCall( new Node\Name( 'json_encode', @@ -375,7 +407,7 @@ private static function createOperationsMethod(BuilderFactory $factory, Represen new Arg( new Node\Expr\ClassConstFetch( new Node\Name( - $response->content->payload->className->relative, + $response->content->payload->className->fullyQualified->source, ), 'SCHEMA_EXAMPLE_DATA', ), @@ -392,20 +424,20 @@ private static function createOperationsMethod(BuilderFactory $factory, Represen ), ], ); - } elseif ($response instanceof Representation\OperationResponse) { - $responseSchemaFetch = ExampleData::gather(null, $response->content, $methodName)->node; + } elseif ($response instanceof Namespaced\Operation\Response && $response->content instanceof Namespaced\Property\Type) { + $responseSchemaFetch = $this->gatherExampleDataNode($response->content, $methodName); } else { $responseSchemaFetch = new Node\Scalar\String_(''); } - return $factory->method($methodName)->makePublic()->setDocComment( + return $this->builderFactory->method($methodName)->makePublic()->setDocComment( new Doc(implode(PHP_EOL, [ '/**', ' * @test', ' */', ])), )->addStmts([ - ...self::testSetUp($responseSchemaFetch, $operation, $request, $response, $configuration, $contentTypePayload), + ...$this->testSetUp($responseSchemaFetch, $operation, $request, $response, $package, $contentTypePayload), new Node\Stmt\Expression( new Node\Expr\Assign( new Node\Expr\Variable( @@ -424,16 +456,16 @@ private static function createOperationsMethod(BuilderFactory $factory, Represen ), 'operations', ), - (new Convert($operation->group))->toCamel(), + new Convert($operation->group)->toCamel(), ), - (new Convert($operation->name))->toCamel(), + new Convert($operation->name)->toCamel(), [ ...((static function (array $parameters): iterable { foreach ($parameters as $parameter) { yield new Arg($parameter->example->node); } })($operation->parameters)), - ...($request === null ? [] : [ + ...($request instanceof RequestBody ? [ new Arg(new Node\Expr\FuncCall( new Node\Name( 'json_decode', @@ -442,7 +474,7 @@ private static function createOperationsMethod(BuilderFactory $factory, Represen new Arg( new Node\Expr\ClassConstFetch( new Node\Name( - $request->schema->className->relative, + $request->schema->className->fullyQualified->source, ), 'SCHEMA_EXAMPLE_DATA', ), @@ -456,13 +488,13 @@ private static function createOperationsMethod(BuilderFactory $factory, Represen ), ], )), - ]), + ] : []), ], ), ), ), - ...($operation->matchMethod !== 'STREAM' && $response instanceof Representation\OperationEmptyResponse ? [ - new Node\Expr\StaticCall( + ...($operation->matchMethod !== 'STREAM' && $response instanceof Namespaced\Operation\EmptyResponse ? [ + $this->assertion(new Node\Expr\StaticCall( new Node\Name('self'), 'assertArrayHasKey', [ @@ -475,8 +507,8 @@ private static function createOperationsMethod(BuilderFactory $factory, Represen ), ), ], - ), - new Node\Expr\StaticCall( + )), + $this->assertion(new Node\Expr\StaticCall( new Node\Name('self'), 'assertSame', [ @@ -494,10 +526,10 @@ private static function createOperationsMethod(BuilderFactory $factory, Represen ), ), ], - ), - ...(static function (Representation\Header ...$headers): iterable { + )), + ...(static function (Namespaced\Header ...$headers): iterable { foreach ($headers as $header) { - yield new Node\Expr\StaticCall( + yield new Node\Stmt\Expression(new Node\Expr\StaticCall( new Node\Name('self'), 'assertArrayHasKey', [ @@ -510,8 +542,8 @@ private static function createOperationsMethod(BuilderFactory $factory, Represen ), ), ], - ); - yield new Node\Expr\StaticCall( + )); + yield new Node\Stmt\Expression(new Node\Expr\StaticCall( new Node\Name('self'), 'assertSame', [ @@ -527,7 +559,7 @@ private static function createOperationsMethod(BuilderFactory $factory, Represen ), ), ], - ); + )); } })(...$response->headers), ] : []), @@ -542,19 +574,45 @@ private static function createOperationsMethod(BuilderFactory $factory, Represen ]); } - private static function wrapShouldBeCalled(Node\Expr\MethodCall $methodCall): Node\Expr\MethodCall + private function assertion(Node\Expr\StaticCall $call): Node\Stmt\Expression + { + return new Node\Stmt\Expression($call); + } + + private function wrapShouldBeCalled(Node\Expr\MethodCall $methodCall): Node\Stmt\Expression { - return new Node\Expr\MethodCall( - $methodCall, - 'shouldBeCalled', + return new Node\Stmt\Expression( + new Node\Expr\MethodCall( + $methodCall, + 'shouldBeCalled', + ), ); } - /** @return array */ - private static function testSetUp(Node\Expr $responseSchemaFetch, Representation\Operation $operation, Representation\OperationRequestBody|null $request, Representation\OperationResponse|Representation\OperationEmptyResponse $response, Configuration $configuration, Representation\Schema|Representation\PropertyType|string|null $contentTypePayload): array + private function gatherExampleDataNode(Namespaced\Property\Type $type, string $methodName): Node\Expr { + return ExampleData::gather(null, RepresentationHelper::propertyType($type), $methodName)->node; + } + + /** @return list */ + private function testSetUp( + Node\Expr $responseSchemaFetch, + Namespaced\Operation $operation, + mixed $request, + Namespaced\Operation\Response|Namespaced\Operation\EmptyResponse $response, + ConfigurationPackageType $package, + mixed $contentTypePayload, + ): array { + if ($request !== null && ! $request instanceof RequestBody) { + throw new InvalidArgumentException('Request must be a RequestBody instance or null.'); + } + + if ($contentTypePayload !== null && ! is_string($contentTypePayload) && ! $contentTypePayload instanceof Namespaced\Schema && ! $contentTypePayload instanceof Namespaced\Property\Type) { + throw new InvalidArgumentException('Unsupported content type payload.'); + } + return [ - ...(is_string($response->code) || $response->code < 400 || $contentTypePayload === null ? [] : [ + ...(is_string($response->code) || $response->code < 400 || ! $contentTypePayload instanceof Namespaced\Schema ? [] : [ new Node\Stmt\Expression( new Node\Expr\StaticCall( new Node\Name( @@ -565,7 +623,7 @@ private static function testSetUp(Node\Expr $responseSchemaFetch, Representation new Arg( new Node\Expr\ClassConstFetch( new Node\Name( - $contentTypePayload->errorClassNameAliased->relative, + $contentTypePayload->errorClassName->fullyQualified->source, ), 'class', ), @@ -587,7 +645,7 @@ private static function testSetUp(Node\Expr $responseSchemaFetch, Representation new Arg( new Node\Scalar\LNumber(is_string($response->code) ? 999 : $response->code), ), - ...($response instanceof Representation\OperationResponse ? [ + ...($response instanceof Namespaced\Operation\Response ? [ new Arg( new Node\Expr\Array_([ new Node\Expr\ArrayItem( @@ -597,7 +655,7 @@ private static function testSetUp(Node\Expr $responseSchemaFetch, Representation ]), ), new Arg( - $contentTypePayload instanceof Schema && $contentTypePayload->isArray ? new Node\Expr\BinaryOp\Concat( + $contentTypePayload instanceof Namespaced\Schema && $contentTypePayload->isArray ? new Node\Expr\BinaryOp\Concat( new Node\Scalar\String_('['), new Node\Expr\BinaryOp\Concat( $responseSchemaFetch, @@ -608,7 +666,7 @@ private static function testSetUp(Node\Expr $responseSchemaFetch, Representation ] : [ new Arg( new Node\Expr\Array_([ - ...(static function (Representation\Header ...$headers): iterable { + ...(static function (Namespaced\Header ...$headers): iterable { foreach ($headers as $header) { yield new Node\Expr\ArrayItem( $header->example->node, @@ -646,7 +704,7 @@ private static function testSetUp(Node\Expr $responseSchemaFetch, Representation ), ), ), - self::wrapShouldBeCalled( + $this->wrapShouldBeCalled( new Node\Expr\MethodCall( new Node\Expr\MethodCall( new Node\Expr\Variable( @@ -695,65 +753,69 @@ private static function testSetUp(Node\Expr $responseSchemaFetch, Representation ), ), ), - new Node\Expr\MethodCall( + new Node\Stmt\Expression( new Node\Expr\MethodCall( - new Node\Expr\Variable( - 'browser', + new Node\Expr\MethodCall( + new Node\Expr\Variable( + 'browser', + ), + 'withBase', + [ + new Arg( + new Node\Expr\StaticCall( + new Node\Name( + '\\' . Argument::class, + ), + 'any', + ), + ), + ], ), - 'withBase', + 'willReturn', [ new Arg( - new Node\Expr\StaticCall( - new Node\Name( - '\\' . Argument::class, + new Node\Expr\MethodCall( + new Node\Expr\Variable( + 'browser', ), - 'any', + 'reveal', ), ), ], ), - 'willReturn', - [ - new Arg( - new Node\Expr\MethodCall( - new Node\Expr\Variable( - 'browser', - ), - 'reveal', - ), - ), - ], ), - new Node\Expr\MethodCall( + new Node\Stmt\Expression( new Node\Expr\MethodCall( - new Node\Expr\Variable( - 'browser', + new Node\Expr\MethodCall( + new Node\Expr\Variable( + 'browser', + ), + 'withFollowRedirects', + [ + new Arg( + new Node\Expr\StaticCall( + new Node\Name( + '\\' . Argument::class, + ), + 'any', + ), + ), + ], ), - 'withFollowRedirects', + 'willReturn', [ new Arg( - new Node\Expr\StaticCall( - new Node\Name( - '\\' . Argument::class, + new Node\Expr\MethodCall( + new Node\Expr\Variable( + 'browser', ), - 'any', + 'reveal', ), ), ], ), - 'willReturn', - [ - new Arg( - new Node\Expr\MethodCall( - new Node\Expr\Variable( - 'browser', - ), - 'reveal', - ), - ), - ], ), - self::wrapShouldBeCalled( + $this->wrapShouldBeCalled( new Node\Expr\MethodCall( new Node\Expr\MethodCall( new Node\Expr\Variable( @@ -788,7 +850,22 @@ private static function testSetUp(Node\Expr $responseSchemaFetch, Representation continue; } - $items[] = is_bool($parameter->example->raw) ? (int) $parameter->example->raw : $parameter->example->raw; + $raw = $parameter->example->raw; + if (is_bool($raw)) { + $items[] = (string) (int) $raw; + continue; + } + + if (is_string($raw)) { + $items[] = $raw; + continue; + } + + if (! is_int($raw) && ! is_float($raw)) { + continue; + } + + $items[] = (string) $raw; } return $items; @@ -806,8 +883,10 @@ private static function testSetUp(Node\Expr $responseSchemaFetch, Representation continue; } - if ($parameter->type === 'array') { - $items[$parameter->targetName] = $parameter->targetName . '=' . urlencode(current($parameter->example->raw)); + if ($parameter->type === 'array' && is_array($parameter->example->raw)) { + $firstExample = current($parameter->example->raw); + $encodedValue = is_string($firstExample) ? $firstExample : (is_int($firstExample) || is_float($firstExample) ? (string) $firstExample : ''); + $items[$parameter->targetName] = $parameter->targetName . '=' . urlencode($encodedValue); continue; } @@ -816,7 +895,7 @@ private static function testSetUp(Node\Expr $responseSchemaFetch, Representation continue; } - $items[$parameter->targetName] = $parameter->targetName . '=' . $parameter->example->raw; + $items[$parameter->targetName] = $parameter->targetName . '=' . (is_int($parameter->example->raw) || is_float($parameter->example->raw) ? (string) $parameter->example->raw : ''); } ksort($items); @@ -841,12 +920,7 @@ private static function testSetUp(Node\Expr $responseSchemaFetch, Representation ), ), new Arg( - $request === null ? new Node\Expr\StaticCall( - new Node\Name( - '\\' . Argument::class, - ), - 'any', - ) : new Node\Expr\FuncCall( + $request instanceof RequestBody ? new Node\Expr\FuncCall( new Node\Name( 'json_encode', ), @@ -860,7 +934,7 @@ private static function testSetUp(Node\Expr $responseSchemaFetch, Representation new Arg( new Node\Expr\ClassConstFetch( new Node\Name( - $request->schema->className->relative, + $request->schema->className->fullyQualified->source, ), 'SCHEMA_EXAMPLE_DATA', ), @@ -876,6 +950,11 @@ private static function testSetUp(Node\Expr $responseSchemaFetch, Representation ), ), ], + ) : new Node\Expr\StaticCall( + new Node\Name( + '\\' . Argument::class, + ), + 'any', ), ), ], @@ -906,7 +985,7 @@ private static function testSetUp(Node\Expr $responseSchemaFetch, Representation ), new Node\Expr\New_( new Node\Name( - '\\' . $configuration->namespace->source . '\Client', + '\\' . $package->namespace->source . '\Client', ), [ new Arg( diff --git a/src/Generator/Paths/Operations.php b/src/Generator/Paths/Operations.php new file mode 100644 index 0000000..b24e0db --- /dev/null +++ b/src/Generator/Paths/Operations.php @@ -0,0 +1,126 @@ + */ + public function generate(Package $package, Namespaced\Representation $representation): iterable + { + $package = ConfigurationPackage::unwrap($package); + + $groups = []; + $operationHydratorMap = []; + foreach ($representation->client->paths as $path) { + foreach ($path->operations as $operation) { + $operationHydratorMap[$operation->operationId] = $path->hydrator; + $groups[$operation->group ?? ''][] = $operation; + } + } + + $stmt = $this->builderFactory->namespace($package->namespace->source); + + $class = $this->builderFactory->class('Operations')->makeFinal()->implement(new Name('OperationsInterface'))->makeReadonly(); + + $class->addStmt( + $this->builderFactory->method('__construct')->makePublic()->addParam( + $this->builderFactory->param('operators')->makePublic()->setType('\\' . $package->namespace->source . '\\Internal\\Operators'), + ), + ); + + foreach ($groups as $group => $groupsOperations) { + if ($group === '') { + foreach ($groupsOperations as $groupsOperation) { + $class->addStmt( + Helper\Operation::methodSignature( + $this->builderFactory->method(new Convert($groupsOperation->name)->toCamel())->makePublic(), + $groupsOperation, + )->addStmt(Helper\Operation::methodCallOperation($groupsOperation)), + ); + } + + continue; + } + + $class->addStmt( + $this->builderFactory->method(new Convert($group)->toCamel())->makePublic()->setReturnType('Operation\\' . $group)->addStmts([ + new Node\Stmt\Return_( + new Expr\New_( + new Name( + 'Operation\\' . $group, + ), + [ + new Arg( + new Expr\PropertyFetch( + new Expr\Variable('this'), + 'operators', + ), + ), + ], + ), + ), + ]), + ); + + yield from $this->generateOperationsGroup( + $package, + 'Operation\\' . $group, + $groupsOperations, + $group, + ); + } + + yield new File($package->destination->source, 'Operations', $stmt->addStmt($class)->getNode(), File::DO_LOAD_ON_WRITE); + } + + /** + * @param array $operations + * + * @return iterable + */ + private function generateOperationsGroup(\OpenAPITools\Configuration\Package $package, string $className, array $operations, string $group): iterable + { + $stmt = $this->builderFactory->namespace(Utils::dirname($package->namespace->source . '\\' . $className)); + + $class = $this->builderFactory->class(Utils::basename($className))->makeFinal()->addStmt( + $this->builderFactory->method('__construct')->makePublic()->addParam( + $this->builderFactory->param('operators')->makePublic()->setType('\\' . $package->namespace->source . '\\Internal\\Operators'), + ), + ); + + foreach ($operations as $operation) { + if ($operation->group !== $group) { + continue; + } + + $class->addStmt( + Helper\Operation::methodSignature( + $this->builderFactory->method(new Convert($operation->name)->toCamel())->makePublic(), + $operation, + )->addStmt(Helper\Operation::methodCallOperation($operation)), + ); + } + + yield new File($package->destination->source, $className, $stmt->addStmt($class)->getNode(), File::DO_LOAD_ON_WRITE); + } +} diff --git a/src/Generator/Paths/OperationsInterface.php b/src/Generator/Paths/OperationsInterface.php new file mode 100644 index 0000000..b9c75b3 --- /dev/null +++ b/src/Generator/Paths/OperationsInterface.php @@ -0,0 +1,59 @@ + */ + public function generate(Package $package, Representation $representation): iterable + { + $package = ConfigurationPackage::unwrap($package); + + $stmt = $this->builderFactory->namespace($package->namespace->source); + $class = $this->builderFactory->interface('OperationsInterface'); + + /** @var array> $groups */ + $groups = []; + foreach ($representation->client->paths as $path) { + foreach ($path->operations as $operation) { + $groups[$operation->group ?? ''][] = $operation; + } + } + + foreach ($groups as $group => $groupOperations) { + if ($group !== '') { + $class->addStmt( + $this->builderFactory->method(new Convert($group)->toCamel())->makePublic()->setReturnType('Operation\\' . $group), + ); + continue; + } + + foreach ($groupOperations as $groupOperation) { + $class->addStmt( + Helper\Operation::methodSignature( + $this->builderFactory->method($groupOperation->nameCamel)->makePublic(), + $groupOperation, + ), + ); + } + } + + yield new File($package->destination->source, 'OperationsInterface', $stmt->addStmt($class)->getNode(), File::DO_LOAD_ON_WRITE); + } +} diff --git a/src/Generator/Operator.php b/src/Generator/Paths/Operator.php similarity index 59% rename from src/Generator/Operator.php rename to src/Generator/Paths/Operator.php index 47f5630..90a41fd 100644 --- a/src/Generator/Operator.php +++ b/src/Generator/Paths/Operator.php @@ -2,48 +2,61 @@ declare(strict_types=1); -namespace ApiClients\Tools\OpenApiClientGenerator\Generator; +namespace ApiClients\Tools\OpenApiClientGenerator\Generator\Paths; use ApiClients\Contracts\HTTP\Headers\AuthenticationInterface; -use ApiClients\Tools\OpenApiClientGenerator\Configuration; -use ApiClients\Tools\OpenApiClientGenerator\File; +use ApiClients\Tools\OpenApiClientGenerator\Generator\Helper\ConfigurationPackage; +use ApiClients\Tools\OpenApiClientGenerator\Generator\Helper\Operation as OperationHelper; +use ApiClients\Tools\OpenApiClientGenerator\Generator\Helper\ReflectionTypes; use ApiClients\Tools\OpenApiClientGenerator\Generator\Helper\ResultConverter; use ApiClients\Tools\OpenApiClientGenerator\Generator\Helper\Types; -use ApiClients\Tools\OpenApiClientGenerator\PrivatePromotedPropertyAsParam; -use ApiClients\Tools\OpenApiClientGenerator\Registry\ThrowableSchema; -use ApiClients\Tools\OpenApiClientGenerator\Representation; -use ApiClients\Tools\OpenApiClientGenerator\Representation\Operation; +use League\OpenAPIValidation\Schema\SchemaValidator; +use OpenAPITools\Contract\Package; +use OpenAPITools\Representation\Namespaced; +use OpenAPITools\Utils\File; use PhpParser\Builder\Param; use PhpParser\BuilderFactory; +use PhpParser\Comment\Doc; use PhpParser\Node; use PhpParser\Node\Arg; use PhpParser\Node\Expr; -use PhpParser\Node\Stmt\Class_; use Psr\Http\Message\ResponseInterface; use React\Http\Browser; use ReflectionClass; +use ReflectionNamedType; use ReflectionParameter; +use ReflectionUnionType; use function array_filter; use function array_map; use function count; use function explode; -use function strpos; +use function str_contains; +use function str_starts_with; -final class Operator +final readonly class Operator { + public function __construct( + private BuilderFactory $builderFactory, + ) { + } + /** @return iterable */ - public static function generate(string $pathPrefix, Operation $operation, Representation\Hydrator $hydrator, ThrowableSchema $throwableSchemaRegistry, Configuration $configuration): iterable + public function generate(Package $package, Namespaced\Operation $operation, Namespaced\Hydrator $hydrator): iterable { - $bringHydratorAndResponseValidator = count( + $package = ConfigurationPackage::unwrap($package); + + /** @var class-string $className */ + $className = $operation->className->fullyQualified->source; + $operationConstructor = new ReflectionClass($className)->getConstructor(); + $bringHydratorAndResponseValidator = $operationConstructor !== null && count( array_filter( - /** @phpstan-ignore-next-line */ - (new ReflectionClass($operation->className->fullyQualified->source))->getConstructor()->getParameters(), + $operationConstructor->getParameters(), static fn (ReflectionParameter $parameter): bool => $parameter->name === 'responseSchemaValidator' || $parameter->name === 'hydrator', ), ) > 0; - $factory = new BuilderFactory(); - $stmt = $factory->namespace($operation->operatorClassName->namespace->source); + $factory = new BuilderFactory(); + $stmt = $factory->namespace($operation->operatorClassName->namespace->source); $class = $factory->class($operation->operatorClassName->className)->makeFinal()->makeReadonly()->addStmt( new Node\Stmt\ClassConst( @@ -55,7 +68,7 @@ public static function generate(string $pathPrefix, Operation $operation, Repres ), ), ], - Class_::MODIFIER_PUBLIC, + 1, ), )->addStmt( new Node\Stmt\ClassConst( @@ -67,29 +80,29 @@ public static function generate(string $pathPrefix, Operation $operation, Repres ), ), ], - Class_::MODIFIER_PUBLIC, + 1, ), ); $constructor = $factory->method('__construct')->makePublic(); $constructor->addParam( - (new PrivatePromotedPropertyAsParam('browser'))->setType('\\' . Browser::class), + $this->builderFactory->param('browser')->makePrivate()->setType('\\' . Browser::class), ); $constructor->addParam( - (new PrivatePromotedPropertyAsParam('authentication'))->setType('\\' . AuthenticationInterface::class), + $this->builderFactory->param('authentication')->makePrivate()->setType('\\' . AuthenticationInterface::class), ); if (count($operation->requestBody) > 0) { $constructor->addParam( - (new PrivatePromotedPropertyAsParam('requestSchemaValidator'))->setType('\League\OpenAPIValidation\Schema\SchemaValidator'), + $this->builderFactory->param('requestSchemaValidator')->makePrivate()->setType('\\' . SchemaValidator::class), ); } if ($bringHydratorAndResponseValidator) { $constructor->addParam( - (new PrivatePromotedPropertyAsParam('responseSchemaValidator'))->setType('\League\OpenAPIValidation\Schema\SchemaValidator'), + $this->builderFactory->param('responseSchemaValidator')->makePrivate()->setType('\\' . SchemaValidator::class), )->addParam( - (new PrivatePromotedPropertyAsParam('hydrator'))->setType($hydrator->className->relative), + $this->builderFactory->param('hydrator')->makePrivate()->setType($hydrator->className->fullyQualified->source), ); } @@ -114,19 +127,28 @@ public static function generate(string $pathPrefix, Operation $operation, Repres $callParams[] = $factory->param('params')->setType('array'); } - $returnType = \ApiClients\Tools\OpenApiClientGenerator\Generator\Helper\Operation::getResultTypeFromOperation($operation); + $returnType = OperationHelper::getResultTypeFromOperation($operation); - $class->addStmt( - $factory->method('call')->makePublic()->setReturnType( - new Node\UnionType( - array_map( - static fn (string $object): Node\Name => new Node\Name((strpos($object, '\\') > 0 ? '\\' : '') . $object), - [...Types::filterDuplicatesAndIncompatibleRawTypes(...explode('|', (string) $returnType))], + $callMethod = $factory->method('call')->makePublic()->setReturnType( + new Node\UnionType( + array_map( + static fn (string $object): Node\Name => new Node\Name( + str_contains($object, '\\') + ? (str_starts_with($object, '\\') ? $object : '\\' . $object) + : $object, ), + [...Types::filterDuplicatesAndIncompatibleRawTypes(...explode('|', $returnType))], ), - )->setDocComment( - \ApiClients\Tools\OpenApiClientGenerator\Generator\Helper\Operation::getDocBlockFromOperation($operation), - )->addParams($callParams)->addStmts([ + ), + ); + + $docBlock = OperationHelper::getDocBlockFromOperation($operation); + if ($docBlock instanceof Doc) { + $callMethod->setDocComment($docBlock); + } + + $class->addStmt( + $callMethod->addParams($callParams)->addStmts([ new Node\Stmt\Expression(new Node\Expr\Assign( new Node\Expr\Variable('operation'), new Node\Expr\New_( @@ -163,16 +185,16 @@ public static function generate(string $pathPrefix, Operation $operation, Repres ), )), new Node\Stmt\Expression(new Node\Expr\Assign(new Node\Expr\Variable('request'), new Node\Expr\MethodCall(new Node\Expr\Variable('operation'), 'createRequest', count($operation->requestBody) > 0 ? [new Arg(new Node\Expr\Variable('params'))] : []))), - ...($returnType === 'void' ? [self::callOperation($returnType, $operation)] : ResultConverter::convert( - self::callOperation($returnType, $operation), + ...($returnType === 'void' ? [new Node\Stmt\Expression($this->callOperation($returnType, $operation))] : ResultConverter::convert( + $this->callOperation($returnType, $operation), )), ]), ); - yield new File($pathPrefix, $operation->operatorClassName->relative, $stmt->addStmt($class)->getNode()); + yield new File($package->destination->source, $operation->operatorClassName->relative, $stmt->addStmt($class)->getNode(), File::DO_LOAD_ON_WRITE); } - private static function callOperation(string $returnType, Operation $operation): Node\Expr\MethodCall + private function callOperation(string $returnType, Namespaced\Operation $operation): Node\Expr\MethodCall { return new Node\Expr\MethodCall( new Node\Expr\MethodCall( @@ -212,27 +234,41 @@ private static function callOperation(string $returnType, Operation $operation): [ new Arg(new Node\Expr\Closure([ 'stmts' => [ - $returnType === 'void' ? new Node\Stmt\Expression(new Node\Expr\MethodCall(new Node\Expr\Variable('operation'), 'createResponse', [ - new Arg(new Node\Expr\Variable('response')), - ])) : new Node\Stmt\Return_(new Node\Expr\MethodCall(new Node\Expr\Variable('operation'), 'createResponse', [ - new Arg(new Node\Expr\Variable('response')), - ])), + $returnType === 'void' + ? new Node\Stmt\Expression(new Node\Expr\MethodCall(new Node\Expr\Variable('operation'), 'createResponse', [ + new Arg(new Node\Expr\Variable('response')), + ])) + : new Node\Stmt\Return_(new Node\Expr\MethodCall(new Node\Expr\Variable('operation'), 'createResponse', [ + new Arg(new Node\Expr\Variable('response')), + ])), ], 'params' => [new Node\Param(new Node\Expr\Variable('response'), null, new Node\Name('\\' . ResponseInterface::class))], 'uses' => [ - new Node\Expr\Variable('operation'), + new Node\ClosureUse(new Node\Expr\Variable('operation')), ], - 'returnType' => (static function (Representation\Operation $operation): Node\UnionType|Node\Name { - /** @phpstan-ignore-next-line */ - $returnType = (new ReflectionClass($operation->className->fullyQualified->source))->getMethod('createResponse')->getReturnType(); - if ($returnType === null || (string) $returnType === 'void') { + 'returnType' => (static function (Namespaced\Operation $operation): Node\UnionType|Node\Name { + /** @var class-string $className */ + $className = $operation->className->fullyQualified->source; + $returnType = new ReflectionClass($className)->getMethod('createResponse')->getReturnType(); + if ($returnType === null || ($returnType instanceof ReflectionNamedType && $returnType->getName() === 'void')) { return new Node\Name('void'); } + $types = $returnType instanceof ReflectionUnionType + ? array_map( + ReflectionTypes::name(...), + $returnType->getTypes(), + ) + : [ReflectionTypes::name($returnType)]; + return new Node\UnionType( array_map( - static fn (string $object): Node\Name => new Node\Name((strpos($object, '\\') > 0 ? '\\' : '') . $object), - [...Types::filterDuplicatesAndIncompatibleRawTypes(...explode('|', (string) $returnType))], + static fn (string $object): Node\Name => new Node\Name( + str_contains($object, '\\') + ? (str_starts_with($object, '\\') ? $object : '\\' . $object) + : $object, + ), + [...Types::filterDuplicatesAndIncompatibleRawTypes(...$types)], ), ); })($operation), diff --git a/src/Generator/Paths/Operators.php b/src/Generator/Paths/Operators.php new file mode 100644 index 0000000..04261e0 --- /dev/null +++ b/src/Generator/Paths/Operators.php @@ -0,0 +1,134 @@ + */ + public function generate(Package $package, Namespaced\Representation $representation): iterable + { + $package = ConfigurationPackage::unwrap($package); + + $operationHydratorMap = []; + foreach ($representation->client->paths as $path) { + foreach ($path->operations as $operation) { + $operationHydratorMap[$operation->operationId] = $path->hydrator; + } + } + + $stmt = $this->builderFactory->namespace(trim($package->namespace->source, '\\') . '\\Internal'); + + $class = $this->builderFactory->class('Operators')->makeFinal()->addStmt( + $this->builderFactory->method('__construct')->makePublic()->addParam( + $this->builderFactory->param('authentication')->makePrivate()->setType('\\' . AuthenticationInterface::class)->makeReadonly(), + )->addParam( + $this->builderFactory->param('browser')->makePrivate()->setType('\\' . Browser::class)->makeReadonly(), + )->addParam( + $this->builderFactory->param('requestSchemaValidator')->makePrivate()->setType('\\' . SchemaValidator::class)->makeReadonly(), + )->addParam( + $this->builderFactory->param('responseSchemaValidator')->makePrivate()->setType('\\' . SchemaValidator::class)->makeReadonly(), + )->addParam( + $this->builderFactory->param('hydrators')->makePrivate()->setType('Hydrators')->makeReadonly(), + ), + ); + + foreach ($representation->client->paths as $path) { + foreach ($path->operations as $operation) { + $class->addStmts([ + $this->builderFactory->property($operation->operatorLookUpMethod)->setType('?' . $operation->operatorClassName->fullyQualified->source)->setDefault(null)->makePrivate(), + $this->builderFactory->method($operation->operatorLookUpMethod)->setReturnType($operation->operatorClassName->fullyQualified->source)->makePublic()->addStmts([ + new Node\Stmt\If_( + new Node\Expr\BinaryOp\Identical( + new Node\Expr\Instanceof_( + new Node\Expr\PropertyFetch( + new Node\Expr\Variable('this'), + $operation->operatorLookUpMethod, + ), + new Node\Name($operation->operatorClassName->fullyQualified->source), + ), + new Node\Expr\ConstFetch(new Node\Name('false')), + ), + [ + 'stmts' => [ + new Node\Stmt\Expression( + new Node\Expr\Assign( + new Node\Expr\PropertyFetch( + new Node\Expr\Variable('this'), + $operation->operatorLookUpMethod, + ), + new Node\Expr\New_( + new Node\Name($operation->operatorClassName->fullyQualified->source), + [ + ...(static function (Namespaced\Operation $operation, array $operationHydratorMap): iterable { + /** @var class-string $operatorClassName */ + $operatorClassName = $operation->operatorClassName->fullyQualified->source; + $constructor = new ReflectionClass($operatorClassName)->getConstructor(); + if ($constructor === null) { + return; + } + + foreach ($constructor->getParameters() as $parameter) { + if ($parameter->name === 'hydrator') { + yield new Arg( + new Node\Expr\MethodCall( + new Node\Expr\PropertyFetch( + new Node\Expr\Variable('this'), + 'hydrators', + ), + 'getObjectMapper' . ucfirst($operationHydratorMap[$operation->operationId]->methodName), + ), + ); + continue; + } + + yield new Arg( + new Node\Expr\PropertyFetch( + new Node\Expr\Variable('this'), + $parameter->name, + ), + ); + } + })($operation, $operationHydratorMap), + ], + ), + ), + ), + ], + ], + ), + new Node\Stmt\Return_( + new Node\Expr\PropertyFetch( + new Node\Expr\Variable('this'), + $operation->operatorLookUpMethod, + ), + ), + ]), + ]); + } + } + + yield new File($package->destination->source, 'Internal\\Operators', $stmt->addStmt($class)->getNode(), File::DO_LOAD_ON_WRITE); + } +} diff --git a/src/Generator/Routers.php b/src/Generator/Routers.php index efcd055..290ce66 100644 --- a/src/Generator/Routers.php +++ b/src/Generator/Routers.php @@ -5,10 +5,11 @@ namespace ApiClients\Tools\OpenApiClientGenerator\Generator; use ApiClients\Contracts\HTTP\Headers\AuthenticationInterface; -use ApiClients\Tools\OpenApiClientGenerator\Configuration; -use ApiClients\Tools\OpenApiClientGenerator\File; use ApiClients\Tools\OpenApiClientGenerator\Generator\Client\Routers as ClientRouters; -use ApiClients\Tools\OpenApiClientGenerator\PrivatePromotedPropertyAsParam; +use ApiClients\Tools\OpenApiClientGenerator\Generator\Helper\ConfigurationPackage; +use League\OpenAPIValidation\Schema\SchemaValidator; +use OpenAPITools\Contract\Package; +use OpenAPITools\Utils\File; use PhpParser\BuilderFactory; use PhpParser\Node; use PhpParser\Node\Arg; @@ -19,30 +20,32 @@ final class Routers { /** @return iterable */ - public static function generate(Configuration $configuration, string $pathPrefix, ClientRouters $routers): iterable + public static function generate(Package $package, ClientRouters $routers): iterable { + $package = ConfigurationPackage::unwrap($package); + $factory = new BuilderFactory(); - $stmt = $factory->namespace(trim($configuration->namespace->source, '\\') . '\\Internal'); + $stmt = $factory->namespace(trim($package->namespace->source, '\\') . '\\Internal'); $class = $factory->class('Routers')->makeFinal()->addStmt( $factory->method('__construct')->makePublic()->addParam( - (new PrivatePromotedPropertyAsParam('authentication'))->setType('\\' . AuthenticationInterface::class)->makeReadonly(), + $factory->param('authentication')->makePrivate()->setType('\\' . AuthenticationInterface::class)->makeReadonly(), )->addParam( - (new PrivatePromotedPropertyAsParam('browser'))->setType('\\' . Browser::class)->makeReadonly(), + $factory->param('browser')->makePrivate()->setType('\\' . Browser::class)->makeReadonly(), )->addParam( - (new PrivatePromotedPropertyAsParam('requestSchemaValidator'))->setType('\League\OpenAPIValidation\Schema\SchemaValidator')->makeReadonly(), + $factory->param('requestSchemaValidator')->makePrivate()->setType('\\' . SchemaValidator::class)->makeReadonly(), )->addParam( - (new PrivatePromotedPropertyAsParam('responseSchemaValidator'))->setType('\League\OpenAPIValidation\Schema\SchemaValidator')->makeReadonly(), + $factory->param('responseSchemaValidator')->makePrivate()->setType('\\' . SchemaValidator::class)->makeReadonly(), )->addParam( - (new PrivatePromotedPropertyAsParam('hydrators'))->setType('Internal\\Hydrators')->makeReadonly(), + $factory->param('hydrators')->makePrivate()->setType('Hydrators')->makeReadonly(), ), ); foreach ($routers->get() as $group) { - $router = $routers->createClassName($group->method, $group->group, ''); + $router = $routers->createClassName($package, $group->method, $group->group, ''); $class->addStmts([ - $factory->property($router->loopUpMethod)->setType('?' . $router->class)->setDefault(null)->makePrivate(), - $factory->method($router->loopUpMethod)->setReturnType($router->class)->makePublic()->addStmts([ + $factory->property($router->loopUpMethod)->setType('?' . $router->class->fullyQualified->source)->setDefault(null)->makePrivate(), + $factory->method($router->loopUpMethod)->setReturnType($router->class->fullyQualified->source)->makePublic()->addStmts([ new Node\Stmt\If_( new Node\Expr\BinaryOp\Identical( new Node\Expr\Instanceof_( @@ -50,7 +53,7 @@ public static function generate(Configuration $configuration, string $pathPrefix new Node\Expr\Variable('this'), $router->loopUpMethod, ), - new Node\Name($router->class), + new Node\Name($router->class->fullyQualified->source), ), new Node\Expr\ConstFetch(new Node\Name('false')), ), @@ -63,7 +66,7 @@ public static function generate(Configuration $configuration, string $pathPrefix $router->loopUpMethod, ), new Node\Expr\New_( - new Node\Name($router->class), + new Node\Name($router->class->fullyQualified->source), [ new Arg( new Node\Expr\PropertyFetch( @@ -132,6 +135,6 @@ public static function generate(Configuration $configuration, string $pathPrefix ]); } - yield new File($pathPrefix, 'Internal\\Routers', $stmt->addStmt($class)->getNode()); + yield new File($package->destination->source, 'Internal\\Routers', $stmt->addStmt($class)->getNode(), File::DO_LOAD_ON_WRITE); } } diff --git a/src/Generator/Schema.php b/src/Generator/Schema.php deleted file mode 100644 index f6ca81a..0000000 --- a/src/Generator/Schema.php +++ /dev/null @@ -1,319 +0,0 @@ - $aliases - * - * @return iterable - */ - public static function generate(string $pathPrefix, Representation\Schema $schema, array $aliases): iterable - { - $factory = new BuilderFactory(); - - $className = $schema->className; - if (count($aliases) > 0) { - $className = ClassString::factory( - $className->baseNamespaces, - 'Schema\\AliasAbstract\\Tiet' . implode('\\Tiet', str_split(strtoupper(md5(json_encode($schema->schema->getSerializableData()))), 8)), - ); - $aliases[] = $schema->className; - } - - $schemaJson = new Node\Stmt\ClassConst( - [ - new Node\Const_( - 'SCHEMA_JSON', - new Node\Scalar\String_( - json_encode($schema->schema->getSerializableData(), JSON_PRETTY_PRINT), - ), - ), - ], - Class_::MODIFIER_PUBLIC, - ); - - $class = $factory->class($className->className)->makeReadonly()->implement(...(static function (Representation\Contract ...$contracts): iterable { - foreach ($contracts as $contract) { - yield $contract->className->relative; - } - })(...$schema->contracts)); - - if (count($aliases) === 0) { - $class = $class->makeFinal(); - } else { - $class = $class->makeAbstract(); - } - - $class->addStmt( - $schemaJson, - )->addStmt( - new Node\Stmt\ClassConst( - [ - new Node\Const_( - 'SCHEMA_TITLE', - new Node\Scalar\String_( - $schema->title, - ), - ), - ], - Class_::MODIFIER_PUBLIC, - ), - )->addStmt( - new Node\Stmt\ClassConst( - [ - new Node\Const_( - 'SCHEMA_DESCRIPTION', - new Node\Scalar\String_( - $schema->description, - ), - ), - ], - Class_::MODIFIER_PUBLIC, - ), - )->addStmt( - new Node\Stmt\ClassConst( - [ - new Node\Const_( - 'SCHEMA_EXAMPLE_DATA', - $factory->val(json_encode($schema->example, JSON_PRETTY_PRINT)), - ), - ], - Class_::MODIFIER_PUBLIC, - ), - ); - - $constructor = (new BuilderFactory())->method('__construct')->makePublic(); - $constructDocBlock = []; - foreach ($schema->properties as $property) { - if (strlen($property->description) > 0) { - $constructDocBlock[] = $property->name . ': ' . $property->description; - } - - $constructorParam = new PromotedPropertyAsParam($property->name); - if ($property->name !== $property->sourceName) { - $constructorParam->addAttribute( - new Node\Attribute( - new Node\Name('\\' . MapFrom::class), - [ - new Node\Arg(new Node\Scalar\String_($property->sourceName)), - ], - ), - ); - } - - $types = []; - if ($property->type->type === 'union' && is_array($property->type->payload)) { - $types[] = self::buildUnionType($property->type); - $schemaClasses = [...self::getUnionTypeSchemas($property->type)]; - - if (count($schemaClasses) > 0) { - $castToUnionToType = ClassString::factory($schema->className->baseNamespaces, Utils::className('Internal\\Attribute\\CastUnionToType\\Single\\' . $schema->className->relative . '\\' . $property->name)); - - yield from SingleCastUnionToType::generate($pathPrefix, $castToUnionToType, ...$schemaClasses); - - $constructorParam->addAttribute( - new Node\Attribute( - new Node\Name($castToUnionToType->fullyQualified->source), - ), - ); - } - } - - if ($property->type->type === 'array' && ! is_string($property->type->payload)) { - if ($property->type->payload instanceof Representation\PropertyType) { - if (! $property->type->payload->payload instanceof Representation\PropertyType) { - $iterableType = $property->type->payload; - if ($iterableType->payload instanceof Representation\Schema) { - $iterableType = $iterableType->payload->className->fullyQualified->source; - } - - if ($iterableType instanceof Representation\PropertyType && (($iterableType->payload instanceof Representation\PropertyType && $iterableType->payload->type === 'union') || is_array($iterableType->payload))) { - $schemaClasses = [...self::getUnionTypeSchemas($iterableType)]; - $iterableType = self::buildUnionType($iterableType); - - if (count($schemaClasses) > 0) { - $castToUnionToType = ClassString::factory($schema->className->baseNamespaces, Utils::className('Internal\\Attribute\\CastUnionToType\\Single\\' . $schema->className->relative . '\\' . $property->name)); - - yield from SingleCastUnionToType::generate($pathPrefix, $castToUnionToType, ...$schemaClasses); - - $constructorParam->addAttribute( - new Node\Attribute( - new Node\Name($castToUnionToType->fullyQualified->source), - ), - ); - } - } - - if ($iterableType instanceof Representation\PropertyType) { - $iterableType = $iterableType->payload; - } - - $compiledTYpe = ($property->nullable ? '?' : '') . 'array<' . $iterableType . '>'; - $constructDocBlock[] = '@param ' . $compiledTYpe . ' $' . $property->name; - } - - if ($property->type->payload->payload instanceof Representation\Schema) { - $constructorParam->addAttribute( - new Node\Attribute( - new Node\Name('\\' . CastListToType::class), - [ - new Node\Arg(new Node\Expr\ClassConstFetch( - new Node\Name($property->type->payload->payload->className->relative), - 'class', - )), - ], - ), - ); - } - } elseif (is_array($property->type->payload)) { - $schemaClasses = []; - foreach ($property->type->payload as $payloadType) { - $schemaClasses = [...$schemaClasses, ...self::getUnionTypeSchemas($payloadType)]; - } - - if (count($schemaClasses) > 0) { - $castToUnionToType = ClassString::factory($schema->className->baseNamespaces, Utils::className('Internal\\Attribute\\CastUnionToType\\Single\\' . $schema->className->relative . '\\' . $property->name)); - $arrayCastToUnionToType = ClassString::factory($schema->className->baseNamespaces, Utils::className('Internal\\Attribute\\CastUnionToType\\Multiple\\' . $schema->className->relative . '\\' . $property->name)); - - yield from SingleCastUnionToType::generate($pathPrefix, $castToUnionToType, ...$schemaClasses); - yield from MultipleCastUnionToType::generate($pathPrefix, $arrayCastToUnionToType, $castToUnionToType, ...$schemaClasses); - - $constructorParam->addAttribute( - new Node\Attribute( - new Node\Name($arrayCastToUnionToType->fullyQualified->source), - ), - ); - - $compiledTYpe = ($property->nullable ? '?' : '') . 'array<' . implode('|', array_unique([ - ...(static function (Representation\Schema ...$schemas): iterable { - foreach ($schemas as $schema) { - yield $schema->className->fullyQualified->source; - } - })(...$schemaClasses), - ])) . '>'; - $constructDocBlock[] = '@param ' . $compiledTYpe . ' $' . $property->name; - } - } - - $types[] = 'array'; - } elseif ($property->type->payload instanceof Representation\Schema) { - $types[] = $property->type->payload->className->relative; - } elseif (is_string($property->type->payload)) { - $types[] = $property->type->payload; - } - - $types = array_unique($types); - - $nullable = ''; - if ($property->nullable) { - $nullable = count($types) > 1 || count(explode('|', implode('|', $types))) > 1 ? 'null|' : '?'; - } - - if (count($types) > 0) { - $constructorParam->setType($nullable . implode('|', $types)); - } - - $constructor->addParam($constructorParam); - } - - if (count($constructDocBlock) > 0) { - $constructor->setDocComment('/**' . PHP_EOL . ' * ' . implode(PHP_EOL . ' * ', str_replace(['/**', '*/'], '', $constructDocBlock)) . PHP_EOL . ' */'); - } - - $class->addStmt($constructor); - - yield new File($pathPrefix, $className->relative, $factory->namespace($className->namespace->source)->addStmt($class)->getNode()); - - foreach ($aliases as $alias) { - $aliasTms = $factory->namespace($alias->namespace->source); - $aliasClass = $factory->class($alias->className)->makeFinal()->makeReadonly()->extend($className->relative); - - yield new File($pathPrefix, $alias->relative, $aliasTms->addStmt($aliasClass)->getNode()); - } - } - - private static function buildUnionType(Representation\PropertyType $type): string - { - $typeList = []; - if (is_array($type->payload)) { - foreach ($type->payload as $typeInUnion) { - $typeList[] = match (gettype($typeInUnion->payload)) { - 'string' => $typeInUnion->payload, - 'array' => 'array', - 'object' => match ($typeInUnion->payload::class) { - Representation\Schema::class => $typeInUnion->payload->className->relative, - Representation\PropertyType::class => self::buildUnionType($typeInUnion->payload), - }, - }; - } - } else { - $typeList[] = $type->payload; - } - - return implode( - '|', - array_unique( - array_filter( - $typeList, - static fn (string $item): bool => strlen(trim($item)) > 0, - ), - ), - ); - } - - /** @return iterable */ - private static function getUnionTypeSchemas(Representation\PropertyType $type): iterable - { - if (! is_array($type->payload)) { - return; - } - - foreach ($type->payload as $typeInUnion) { - if ($typeInUnion->payload instanceof Representation\Schema) { - yield $typeInUnion->payload; - } - - if (! ($typeInUnion->payload instanceof Representation\PropertyType)) { - continue; - } - - yield from self::getUnionTypeSchemas($typeInUnion->payload); - } - } -} diff --git a/src/Generator/Schema/MultipleCastUnionToType.php b/src/Generator/Schema/MultipleCastUnionToType.php deleted file mode 100644 index 866730e..0000000 --- a/src/Generator/Schema/MultipleCastUnionToType.php +++ /dev/null @@ -1,140 +0,0 @@ - */ - public static function generate(string $pathPrefix, ClassString $classString, ClassString $wrappingClassString, Schema ...$schemas): iterable - { - $factory = new BuilderFactory(); - $stmt = $factory->namespace($classString->namespace->source); - - $class = $factory->class($classString->className)->makeFinal()->makeReadonly()->addAttribute( - new Node\Attribute( - new Node\Name('\\' . Attribute::class), - [ - new Node\Arg( - new Node\Expr\ClassConstFetch( - new Node\Name('\\' . Attribute::class), - 'TARGET_PARAMETER', - ), - ), - ], - ), - )->implement('\\' . PropertyCaster::class)->addStmt( - $factory->property('wrappedCaster')->makePrivate()->setType($wrappingClassString->fullyQualified->source), - )->addStmt( - $factory->method('__construct')->makePublic()->addStmts([ - new Node\Stmt\Expression( - new Node\Expr\Assign( - new Node\Expr\PropertyFetch( - new Node\Expr\Variable( - new Node\Name('this'), - ), - new Node\Name('wrappedCaster'), - ), - new Node\Expr\New_( - new Node\Name( - $wrappingClassString->fullyQualified->source, - ), - ), - ), - ), - ]), - )->addStmt( - $factory->method('cast')->makePublic()->addParams([ - (new Param('value'))->setType('mixed'), - (new Param('hydrator'))->setType('\\' . ObjectMapper::class), - ])->setReturnType('mixed')->addStmts([ - new Node\Stmt\Expression( - new Node\Expr\Assign( - new Node\Expr\Variable( - new Node\Name('data'), - ), - new Node\Expr\Array_(), - ), - ), - new Node\Stmt\Expression( - new Node\Expr\Assign( - new Node\Expr\Variable( - new Node\Name('values'), - ), - new Node\Expr\Variable( - new Node\Name('value'), - ), - ), - ), - new Node\Expr\FuncCall( - new Node\Name('unset'), - [ - new Node\Arg( - new Node\Expr\Variable( - new Node\Name('value'), - ), - ), - ], - ), - new Node\Stmt\Foreach_( - new Node\Expr\Variable( - new Node\Name('values'), - ), - new Node\Expr\Variable( - new Node\Name('value'), - ), - [ - 'stmts' => [ - new Node\Stmt\Expression( - new Node\Expr\Assign( - new Node\Expr\ArrayDimFetch( - new Node\Expr\Variable( - new Node\Name('values'), - ), - ), - new Node\Expr\MethodCall( - new Node\Expr\PropertyFetch( - new Node\Expr\Variable( - new Node\Name('this'), - ), - new Node\Name('wrappedCaster'), - ), - new Node\Name('cast'), - [ - new Node\Arg( - new Node\Expr\Variable( - new Node\Name('value'), - ), - ), - new Node\Arg( - new Node\Expr\Variable( - new Node\Name('hydrator'), - ), - ), - ], - ), - ), - ), - ], - ], - ), - new Node\Stmt\Return_( - new Node\Expr\Variable('data'), - ), - ]), - ); - - yield new File($pathPrefix, $classString->relative, $stmt->addStmt($class)->getNode()); - } -} diff --git a/src/Generator/Schema/SingleCastUnionToType.php b/src/Generator/Schema/SingleCastUnionToType.php deleted file mode 100644 index e840e97..0000000 --- a/src/Generator/Schema/SingleCastUnionToType.php +++ /dev/null @@ -1,201 +0,0 @@ - */ - public static function generate(string $pathPrefix, ClassString $classString, Schema ...$schemas): iterable - { - $factory = new BuilderFactory(); - $stmt = $factory->namespace($classString->namespace->source); - - $class = $factory->class($classString->className)->makeFinal()->addAttribute( - new Node\Attribute( - new Node\Name('\\' . Attribute::class), - [ - new Node\Arg( - new Node\Expr\ClassConstFetch( - new Node\Name('\\' . Attribute::class), - 'TARGET_PARAMETER', - ), - ), - ], - ), - )->implement('\\' . PropertyCaster::class)->addStmt( - (new BuilderFactory())->method('cast')->makePublic()->addParams([ - (new Param('value'))->setType('mixed'), - (new Param('hydrator'))->setType('\\' . ObjectMapper::class), - ])->setReturnType('mixed')->addStmts([ - new Node\Stmt\If_( - new Node\Expr\FuncCall( - new Node\Name('\is_array'), - [ - new Node\Arg( - new Node\Expr\Variable('value'), - ), - ], - ), - [ - 'stmts' => [ - new Node\Stmt\Expression( - new Node\Expr\Assign( - new Node\Expr\Variable('signatureChunks'), - new Node\Expr\FuncCall( - new Node\Name('\array_unique'), - [ - new Node\Arg( - new Node\Expr\FuncCall( - new Node\Name('\array_keys'), - [ - new Node\Arg( - new Node\Expr\Variable('value'), - ), - ], - ), - ), - ], - ), - ), - ), - new Node\Stmt\Expression( - new Node\Expr\FuncCall( - new Node\Name('\sort'), - [ - new Node\Arg( - new Node\Expr\Variable('signatureChunks'), - ), - ], - ), - ), - new Node\Stmt\Expression( - new Node\Expr\Assign( - new Node\Expr\Variable('signature'), - new Node\Expr\FuncCall( - new Node\Name('\implode'), - [ - new Node\Arg( - new Node\Scalar\String_('|'), - ), - new Node\Arg( - new Node\Expr\Variable('signatureChunks'), - ), - ], - ), - ), - ), - ...(static function (Schema ...$schemas): iterable { - foreach ($schemas as $schema) { - $condition = new Node\Expr\BinaryOp\Identical( - new Node\Expr\Variable('signature'), - new Node\Scalar\String_( - implode( - '|', - [ - ...(static function (Property ...$properties): iterable { - $names = []; - foreach ($properties as $property) { - $names[] = $property->sourceName; - } - - sort($names); - - return $names; - })(...$schema->properties), - ], - ), - ), - ); - foreach ($schema->properties as $property) { - $enumConditionals = []; - foreach ($property->enum as $enumPossibility) { - $enumConditionals[] = new Node\Expr\BinaryOp\Identical( - new Node\Expr\ArrayDimFetch( - new Node\Expr\Variable('value'), - new Node\Scalar\String_($property->sourceName), - ), - new Node\Scalar\String_($enumPossibility), - ); - } - - if (count($enumConditionals) <= 0) { - continue; - } - - $enumCondition = array_shift($enumConditionals); - foreach ($enumConditionals as $enumConditional) { - $enumCondition = new Node\Expr\BinaryOp\BooleanOr( - $enumCondition, - $enumConditional, - ); - } - - $condition = new Node\Expr\BinaryOp\BooleanAnd( - $condition, - $enumCondition, - ); - } - - yield new Node\Stmt\If_( - $condition, - [ - 'stmts' => [ - new Node\Stmt\TryCatch([ - new Node\Stmt\Return_( - new Node\Expr\MethodCall( - new Node\Expr\Variable('hydrator'), - 'hydrateObject', - [ - new Node\Arg( - new Node\Expr\ClassConstFetch( - new Node\Name($schema->className->relative), - 'class', - ), - ), - new Node\Arg( - new Node\Expr\Variable('value'), - ), - ], - ), - ), - ], [ - new Node\Stmt\Catch_( - [new Node\Name('\\' . Throwable::class)], - ), - ]), - ], - ], - ); - } - })(...$schemas), - ], - ], - ), - new Node\Stmt\Return_( - new Node\Expr\Variable('value'), - ), - ]), - ); - - yield new File($pathPrefix, $classString->relative, $stmt->addStmt($class)->getNode()); - } -} diff --git a/src/Generator/WebHook.php b/src/Generator/WebHook.php index d86f0c8..fe0c245 100644 --- a/src/Generator/WebHook.php +++ b/src/Generator/WebHook.php @@ -5,188 +5,165 @@ namespace ApiClients\Tools\OpenApiClientGenerator\Generator; use ApiClients\Contracts\OpenAPI\WebHookInterface; -use ApiClients\Tools\OpenApiClientGenerator\File; -use ApiClients\Tools\OpenApiClientGenerator\Registry\Schema as SchemaRegistry; -use ApiClients\Tools\OpenApiClientGenerator\Utils; +use ApiClients\Tools\OpenApiClientGenerator\Generator\Helper\ConfigurationPackage; +use cebe\openapi\Reader; +use cebe\openapi\spec\Schema as BaseSchema; use League\OpenAPIValidation\Schema\SchemaValidator; -use PhpParser\Builder\Param; +use OpenAPITools\Contract\FileGenerator; +use OpenAPITools\Contract\Package; +use OpenAPITools\Representation\Namespaced; +use OpenAPITools\Utils\ClassString; +use OpenAPITools\Utils\File; use PhpParser\BuilderFactory; -use PhpParser\Comment\Doc; use PhpParser\Node; use PhpParser\Node\Arg; use RuntimeException; use Throwable; -use function array_unique; -use function count; -use function implode; -use function ltrim; -use function strtolower; +use function array_map; +use function array_values; + +/** + * Emits one class per webhook event, resolving a delivery to its payload object. + * + * A spec declares a webhook per event variant, so an event covers several + * payload schemas. Each is tried in turn: validate the delivery against that + * variant's schema, and on success hand it to the event's hydrator. Hydration + * is delegated rather than inlined, so the payload schemas and their hydrators + * stay the ones already generated for every other schema in the package. + */ +final readonly class WebHook implements FileGenerator +{ + public function __construct(private BuilderFactory $builderFactory) + { + } -use const PHP_EOL; + /** @return iterable */ + public function generate(Package $package, Namespaced\Representation $representation): iterable + { + $package = ConfigurationPackage::unwrap($package); -final class WebHook -{ - /** - * @param class-string $event - * - * @return iterable - */ - public static function generate( - string $pathPrefix, - string $namespace, - string $event, - SchemaRegistry $schemaRegistry, - \ApiClients\Tools\OpenApiClientGenerator\Representation\WebHook ...$webHooks, - ): iterable { - $className = Utils::className($event); - - $factory = new BuilderFactory(); - $stmt = $factory->namespace(ltrim($namespace . 'Internal\WebHook', '\\')); - - $class = $factory->class(ltrim($className, '\\'))->makeFinal()->implement('\\' . WebHookInterface::class)->setDocComment(new Doc(implode(PHP_EOL, [ - '/**', - ' * @internal', - ' */', - ]))); - $class->addStmt($factory->property('requestSchemaValidator')->setType('\\' . SchemaValidator::class)->makeReadonly()->makePrivate()); - $class->addStmt($factory->property('hydrator')->setType('Internal\\Hydrator\\WebHook\\' . $className)->makeReadonly()->makePrivate()); - - $constructor = $factory->method('__construct')->makePublic()->addParam( - (new Param('requestSchemaValidator'))->setType('\\' . SchemaValidator::class), - )->addParam( - (new Param('hydrator'))->setType('Internal\\Hydrator\\WebHook\\' . $className), - )->addStmt( - new Node\Expr\Assign( - new Node\Expr\PropertyFetch( - new Node\Expr\Variable('this'), - 'requestSchemaValidator', - ), - new Node\Expr\Variable('requestSchemaValidator'), - ), - )->addStmt( - new Node\Expr\Assign( - new Node\Expr\PropertyFetch( - new Node\Expr\Variable('this'), - 'hydrator', + foreach ($representation->webHooks as $webHookEvent) { + yield $this->generateEvent($package, $webHookEvent); + } + } + + private function generateEvent(\OpenAPITools\Configuration\Package $package, Namespaced\WebHookEvent $webHookEvent): File + { + $className = ClassString::factory($package->namespace, 'Internal\\WebHook\\' . $webHookEvent->event); + + /** @var array $payloads */ + $payloads = []; + foreach ($webHookEvent->webHooks as $webHook) { + foreach ($webHook->schema as $schema) { + $payloads[$schema->className->fullyQualified->source] = $schema; + } + } + + $payloads = array_values($payloads); + + $resolve = $this->builderFactory->method('resolve')->makePublic()->addParams([ + $this->builderFactory->param('headers')->setType('array'), + $this->builderFactory->param('data')->setType('array'), + ])->setReturnType( + new Node\UnionType( + array_map( + static fn (Namespaced\Schema $schema): Node\Name => new Node\Name($schema->className->fullyQualified->source), + $payloads, ), - new Node\Expr\Variable('hydrator'), ), ); - $class->addStmt($constructor); - $resolveReturnTypes = []; - $method = $factory->method('resolve')->makePublic()->setReturnType('object')->addParam( - (new Param('headers'))->setType('array'), - )->addParam( - (new Param('data'))->setType('array'), - ); - $gotoLabels = 'actions_aaaaa'; - $tmts = []; - $tmts[] = new Node\Expr\Assign( - new Node\Expr\Variable('error'), - new Node\Expr\New_( - new Node\Name('\\' . RuntimeException::class), - [ - new Arg(new Node\Scalar\String_('No action matching given headers and data')), - ], + /** + * Seeded so the method still throws something meaningful when the event + * has no variants at all; every attempt below replaces it with the + * reason that attempt was rejected. + */ + $resolve->addStmt( + new Node\Stmt\Expression( + new Node\Expr\Assign( + new Node\Expr\Variable('error'), + new Node\Expr\New_(new Node\Name('\\' . RuntimeException::class), [ + new Arg(new Node\Scalar\String_('No webhook matching given headers and data')), + ]), + ), ), ); - foreach ($webHooks as $webHook) { - $headers = []; - foreach ($webHook->headers as $header) { - $headers[] = new Node\Stmt\Expression(new Node\Expr\MethodCall( - new Node\Expr\PropertyFetch( - new Node\Expr\Variable('this'), - 'requestSchemaValidator', - ), - 'validate', + foreach ($payloads as $payload) { + $resolve->addStmt( + new Node\Stmt\TryCatch( [ - new Node\Arg(new Node\Expr\ArrayDimFetch( - new Node\Expr\Variable('headers'), - new Node\Scalar\String_(strtolower($header->name)), - )), - new Node\Arg(new Node\Expr\StaticCall(new Node\Name('\cebe\openapi\Reader'), 'readFromJson', [ - new Node\Arg(new Node\Expr\ClassConstFetch( - new Node\Name($header->schema->className->relative), - 'SCHEMA_JSON', - )), - new Node\Arg(new Node\Scalar\String_('\cebe\openapi\spec\Schema')), - ])), + new Node\Stmt\Expression( + new Node\Expr\MethodCall( + new Node\Expr\PropertyFetch(new Node\Expr\Variable('this'), 'requestSchemaValidator'), + 'validate', + [ + new Arg(new Node\Expr\Variable('data')), + new Arg(new Node\Expr\StaticCall(new Node\Name('\\' . Reader::class), 'readFromJson', [ + new Arg(new Node\Expr\ClassConstFetch( + new Node\Name($payload->className->fullyQualified->source), + 'SCHEMA_JSON', + )), + new Arg(new Node\Expr\ClassConstFetch( + new Node\Name('\\' . BaseSchema::class), + 'class', + )), + ])), + ], + ), + ), + new Node\Stmt\Return_( + new Node\Expr\MethodCall( + new Node\Expr\PropertyFetch(new Node\Expr\Variable('this'), 'hydrator'), + 'hydrateObject', + [ + new Arg(new Node\Expr\ClassConstFetch( + new Node\Name($payload->className->fullyQualified->source), + 'class', + )), + new Arg(new Node\Expr\Variable('data')), + ], + ), + ), ], - )); - } - - foreach ($webHook->schema as $contentTYpe => $schema) { - $resolveReturnTypes[] = $schema->className->relative; - $tmts[] = new Node\Stmt\If_( - new Node\Expr\BinaryOp\Equal( - new Node\Expr\ArrayDimFetch(new Node\Expr\Variable('headers'), new Node\Scalar\String_('content-type')), - new Node\Scalar\String_($contentTYpe), - ), [ - 'stmts' => [ - new Node\Stmt\TryCatch([ - ...$headers, - new Node\Stmt\Expression(new Node\Expr\MethodCall( - new Node\Expr\PropertyFetch( - new Node\Expr\Variable('this'), - 'requestSchemaValidator', + new Node\Stmt\Catch_( + [new Node\Name('\\' . Throwable::class)], + new Node\Expr\Variable('throwable'), + [ + new Node\Stmt\Expression( + new Node\Expr\Assign( + new Node\Expr\Variable('error'), + new Node\Expr\Variable('throwable'), ), - 'validate', - [ - new Node\Arg(new Node\Expr\Variable('data')), - new Node\Arg(new Node\Expr\StaticCall(new Node\Name('\cebe\openapi\Reader'), 'readFromJson', [ - new Arg(new Node\Expr\ClassConstFetch( - new Node\Name($schema->className->relative), - 'SCHEMA_JSON', - )), - new Arg(new Node\Scalar\String_('\cebe\openapi\spec\Schema')), - ])), - ], - )), - new Node\Stmt\Return_(new Node\Expr\MethodCall( - new Node\Expr\PropertyFetch( - new Node\Expr\Variable('this'), - 'hydrator', - ), - 'hydrateObject', - [ - new Node\Arg(new Node\Expr\ClassConstFetch( - new Node\Name($schema->className->relative), - 'class', - )), - new Node\Arg(new Node\Expr\Variable('data')), - ], - )), - ], [ - new Node\Stmt\Catch_( - [new Node\Name('\\' . Throwable::class)], - new Node\Expr\Variable('error'), - [ - new Node\Stmt\Goto_($gotoLabels), - ], ), - ]), - ], + ], + ), ], - ); - } - - $tmts[] = new Node\Stmt\Label($gotoLabels); - $gotoLabels++; - } - - $tmts[] = new Node\Stmt\Throw_(new Node\Expr\Variable('error')); - - if (count($resolveReturnTypes) > 0) { - $method->setReturnType(implode('|', array_unique($resolveReturnTypes))); + ), + ); } - $method->addStmts($tmts); - $class->addStmt($method); + $resolve->addStmt(new Node\Stmt\Expression(new Node\Expr\Throw_(new Node\Expr\Variable('error')))); - yield new File($pathPrefix, 'Internal\\WebHook\\' . $className, $stmt->addStmt($class)->getNode()); + $class = $this->builderFactory->class($className->className) + ->makeFinal() + ->implement('\\' . WebHookInterface::class) + ->addStmt( + $this->builderFactory->method('__construct')->makePublic()->addParam( + $this->builderFactory->param('requestSchemaValidator')->makePrivate()->makeReadonly()->setType('\\' . SchemaValidator::class), + )->addParam( + $this->builderFactory->param('hydrator')->makePrivate()->makeReadonly()->setType($webHookEvent->hydrator->className->fullyQualified->source), + ), + ) + ->addStmt($resolve); + + return new File( + $package->destination->source, + $className->relative, + $this->builderFactory->namespace($className->namespace->source)->addStmt($class)->getNode(), + File::DO_LOAD_ON_WRITE, + ); } } diff --git a/src/Generator/WebHooks.php b/src/Generator/WebHooks.php index 8b4dd41..8fbaefa 100644 --- a/src/Generator/WebHooks.php +++ b/src/Generator/WebHooks.php @@ -5,301 +5,250 @@ namespace ApiClients\Tools\OpenApiClientGenerator\Generator; use ApiClients\Contracts\OpenAPI\WebHooksInterface; -use ApiClients\Tools\OpenApiClientGenerator\File; -use ApiClients\Tools\OpenApiClientGenerator\Representation\Hydrator; -use ApiClients\Tools\OpenApiClientGenerator\Representation\WebHook; -use ApiClients\Tools\OpenApiClientGenerator\Utils; -use Jawira\CaseConverter\Convert; +use ApiClients\Tools\OpenApiClientGenerator\Generator\Helper\ConfigurationPackage; use League\OpenAPIValidation\Schema\SchemaValidator; -use PhpParser\Builder\Param; +use OpenAPITools\Contract\FileGenerator; +use OpenAPITools\Contract\Package; +use OpenAPITools\Representation\Namespaced; +use OpenAPITools\Utils\ClassString; +use OpenAPITools\Utils\File; use PhpParser\BuilderFactory; -use PhpParser\Comment\Doc; use PhpParser\Node; use PhpParser\Node\Arg; use RuntimeException; use Throwable; -use function array_unique; -use function implode; use function lcfirst; -use function trim; use function ucfirst; -use const PHP_EOL; - -final class WebHooks +/** + * Emits the package's public webhook entry point. + * + * Which event a delivery belongs to is not known up front, so resolving walks + * the event classes and returns the first that accepts the payload. Event + * classes are built on demand: a package can carry dozens of them, and a given + * delivery only ever needs one. + */ +final readonly class WebHooks implements FileGenerator { - /** - * @param array $webHooksHydrators - * @param array> $webHooks - * - * @return iterable - */ - public static function generate(string $pathPrefix, string $namespace, array $webHooksHydrators, array $webHooks): iterable + public function __construct(private BuilderFactory $builderFactory) { - $factory = new BuilderFactory(); - $stmt = $factory->namespace(trim($namespace, '\\')); + } - $class = $factory->class('WebHooks')->makeFinal()->implement('\\' . WebHooksInterface::class); - $class->addStmt($factory->property('requestSchemaValidator')->setType('\\' . SchemaValidator::class)->makeReadonly()->makePrivate()); - $class->addStmt($factory->property('hydrator')->setType('Internal\\Hydrators')->makeReadonly()->makePrivate()); + /** @return iterable */ + public function generate(Package $package, Namespaced\Representation $representation): iterable + { + $package = ConfigurationPackage::unwrap($package); - $constructor = $factory->method('__construct')->makePublic()->addParams([ - (new Param('requestSchemaValidator'))->setType('\\' . SchemaValidator::class), - (new Param('hydrator'))->setType('Internal\\Hydrators'), - ])->addStmts([ - new Node\Expr\Assign( - new Node\Expr\PropertyFetch( - new Node\Expr\Variable('this'), - 'requestSchemaValidator', - ), - new Node\Expr\Variable('requestSchemaValidator'), - ), - new Node\Expr\Assign( - new Node\Expr\PropertyFetch( - new Node\Expr\Variable('this'), - 'hydrator', - ), - new Node\Expr\Variable('hydrator'), - ), - ]); - $class->addStmt($constructor); + if ($representation->webHooks === []) { + return; + } - $class->addStmt( - $factory->method('hydrateWebHook')->makePublic()->setDocComment( - new Doc(implode(PHP_EOL, [ - '/**', - ' * @template H', - ' * @param class-string $className', - ' * @return H', - ' */', - ])), - )->setReturnType('object')->addParam( - (new Param('className'))->setType('string'), - )->addParam( - (new Param('data'))->setType('array'), - )->addStmt(new Node\Stmt\Return_( - new Node\Expr\MethodCall( - new Node\Expr\PropertyFetch( - new Node\Expr\Variable('this'), - 'hydrator', - ), - 'hydrateObject', - [ - new Node\Arg(new Node\Expr\Variable('className')), - new Node\Arg(new Node\Expr\Variable('data')), - ], + $className = ClassString::factory($package->namespace, 'WebHooks'); + $hydratorsClassName = ClassString::factory($package->namespace, 'Internal\\Hydrators'); + + $class = $this->builderFactory->class($className->className) + ->makeFinal() + ->implement('\\' . WebHooksInterface::class) + ->addStmt( + $this->builderFactory->method('__construct')->makePublic()->addParam( + $this->builderFactory->param('requestSchemaValidator')->makePrivate()->makeReadonly()->setType('\\' . SchemaValidator::class), + )->addParam( + $this->builderFactory->param('hydrator')->makePrivate()->makeReadonly()->setType($hydratorsClassName->fullyQualified->source), ), - )), - ); + ); - $class->addStmt( - $factory->method('serializeWebHook')->makePublic()->setDocComment( - new Doc(implode(PHP_EOL, [ - '/**', - ' * @return array{className: class-string, data: mixed}', - ' */', - ])), - )->setReturnType('array')->addParam( - (new Param('object'))->setType('object'), - )->addStmt(new Node\Stmt\Return_( - new Node\Expr\Array_([ - new Node\Expr\ArrayItem( - new Node\Expr\ClassConstFetch( - new Node\Expr\Variable('object'), - 'class', - ), - new Node\Scalar\String_('className'), - ), - new Node\Expr\ArrayItem( - new Node\Expr\MethodCall( - new Node\Expr\PropertyFetch( - new Node\Expr\Variable('this'), - 'hydrator', - ), - 'serializeObject', - [ - new Node\Arg(new Node\Expr\Variable('object')), - ], - ), - new Node\Scalar\String_('data'), - ), - ]), - )), - ); - - $method = $factory->method('resolve')->makePublic()->setReturnType('object')->setDocComment(new Doc(implode(PHP_EOL, [ - '/**', - ' * @return ' . implode('|', array_unique( - (static function (WebHook ...$webHooks): array { - $schemas = []; - foreach ($webHooks as $webHook) { - foreach ($webHook->schema as $schema) { - $schemas[] = $schema->className->relative; - } - } - - return $schemas; - })(...(static function (array $webHooks) { - $hooks = []; - foreach ($webHooks as $hook) { - $hooks = [...$hooks, ...$hook]; - } + $resolve = $this->builderFactory->method('resolve')->makePublic()->setReturnType('object')->addParams([ + $this->builderFactory->param('headers')->setType('array'), + $this->builderFactory->param('data')->setType('array'), + ]); - return $hooks; - })($webHooks)), - )), - ' */', - ])))->addParam( - (new Param('headers'))->setType('array'), - )->addParam( - (new Param('data'))->setType('array'), - ); - $gotoLabels = 'webhooks_aaaaa'; - $tmts = []; - $tmts[] = new Node\Expr\Assign( - new Node\Expr\Variable('headers'), - new Node\Expr\FuncCall( - new Node\Expr\Closure( - [ - 'stmts' => [ - new Node\Stmt\Expression( - new Node\Expr\Assign( - new Node\Expr\Variable('flatHeaders'), - new Node\Expr\Array_(), + /** + * Header names are case insensitive over the wire, so they are lowered + * once here rather than at each comparison further down the chain. + */ + $resolve->addStmt( + new Node\Stmt\Expression( + new Node\Expr\Assign( + new Node\Expr\Variable('headers'), + new Node\Expr\FuncCall( + new Node\Expr\Closure([ + 'static' => true, + 'params' => [$this->builderFactory->param('headers')->setType('array')->getNode()], + 'returnType' => new Node\Identifier('array'), + 'stmts' => [ + new Node\Stmt\Expression( + new Node\Expr\Assign(new Node\Expr\Variable('loweredHeaders'), new Node\Expr\Array_([])), ), - ), - new Node\Stmt\Foreach_( - new Node\Expr\Variable('headers'), - new Node\Expr\Variable('value'), - [ - 'keyVar' => new Node\Expr\Variable('key'), - 'stmts' => [ - new Node\Stmt\Expression( - new Node\Expr\Assign( - new Node\Expr\ArrayDimFetch( - new Node\Expr\Variable('flatHeaders'), - new Node\Expr\FuncCall( - new Node\Name('strtolower'), - [ - new Arg( - new Node\Expr\Variable('key'), - ), - ], + new Node\Stmt\Foreach_( + new Node\Expr\Variable('headers'), + new Node\Expr\Variable('value'), + [ + 'keyVar' => new Node\Expr\Variable('key'), + 'stmts' => [ + new Node\Stmt\Expression( + new Node\Expr\Assign( + new Node\Expr\ArrayDimFetch( + new Node\Expr\Variable('loweredHeaders'), + new Node\Expr\FuncCall(new Node\Name('strtolower'), [ + new Arg(new Node\Expr\Variable('key')), + ]), ), + new Node\Expr\Variable('value'), ), - new Node\Expr\Variable('value'), ), - ), + ], ], - ], - ), - new Node\Stmt\Return_( - new Node\Expr\Variable('flatHeaders'), - ), - ], - 'params' => [ - new Node\Param( - new Node\Expr\Variable('headers'), - ), - ], - 'returnType' => new Node\Name('array'), - 'static' => true, - ], - ), - [ - new Arg( - new Node\Expr\Variable('headers'), + ), + new Node\Stmt\Return_(new Node\Expr\Variable('loweredHeaders')), + ], + ]), + [new Arg(new Node\Expr\Variable('headers'))], ), - ], + ), ), ); - $tmts[] = new Node\Expr\Assign( - new Node\Expr\Variable('error'), - new Node\Expr\New_( - new Node\Name('\\' . RuntimeException::class), - [ - new Arg(new Node\Scalar\String_('No event matching given headers and data')), - ], + + $resolve->addStmt( + new Node\Stmt\Expression( + new Node\Expr\Assign( + new Node\Expr\Variable('error'), + new Node\Expr\New_(new Node\Name('\\' . RuntimeException::class), [ + new Arg(new Node\Scalar\String_('No webhook matching given headers and data')), + ]), + ), ), ); - foreach ($webHooks as $event => $hooks) { - $eventClassname = 'Internal\WebHook\\' . Utils::className($event); - $eventSanitized = lcfirst((new Convert($event))->toPascal()); + foreach ($representation->webHooks as $webHookEvent) { + $eventClassName = ClassString::factory($package->namespace, 'Internal\\WebHook\\' . $webHookEvent->event); + $propertyName = lcfirst($eventClassName->className); - $class->addStmt($factory->property($eventSanitized)->setType('?' . $eventClassname)->setDefault(null)->makePrivate()); + $class->addStmt( + $this->builderFactory->property($propertyName) + ->setType('?' . $eventClassName->fullyQualified->source) + ->setDefault(null) + ->makePrivate(), + ); - $tmts[] = new Node\Stmt\TryCatch([ - new Node\Stmt\If_( - new Node\Expr\BinaryOp\Identical( - new Node\Expr\Instanceof_( - new Node\Expr\PropertyFetch( - new Node\Expr\Variable('this'), - $eventSanitized, + $resolve->addStmt( + new Node\Stmt\TryCatch( + [ + new Node\Stmt\If_( + new Node\Expr\BinaryOp\Identical( + new Node\Expr\Instanceof_( + new Node\Expr\PropertyFetch(new Node\Expr\Variable('this'), $propertyName), + new Node\Name($eventClassName->fullyQualified->source), + ), + new Node\Expr\ConstFetch(new Node\Name('false')), ), - new Node\Name($eventClassname), + [ + 'stmts' => [ + new Node\Stmt\Expression( + new Node\Expr\Assign( + new Node\Expr\PropertyFetch(new Node\Expr\Variable('this'), $propertyName), + new Node\Expr\New_( + new Node\Name($eventClassName->fullyQualified->source), + [ + new Arg(new Node\Expr\PropertyFetch(new Node\Expr\Variable('this'), 'requestSchemaValidator')), + new Arg(new Node\Expr\MethodCall( + new Node\Expr\PropertyFetch(new Node\Expr\Variable('this'), 'hydrator'), + 'getObjectMapper' . ucfirst($webHookEvent->hydrator->methodName), + )), + ], + ), + ), + ), + ], + ], ), - new Node\Expr\ConstFetch(new Node\Name('false')), - ), + new Node\Stmt\Return_( + new Node\Expr\MethodCall( + new Node\Expr\PropertyFetch(new Node\Expr\Variable('this'), $propertyName), + 'resolve', + [ + new Arg(new Node\Expr\Variable('headers')), + new Arg(new Node\Expr\Variable('data')), + ], + ), + ), + ], [ - 'stmts' => [ - new Node\Stmt\Expression( - new Node\Expr\Assign( - new Node\Expr\PropertyFetch( - new Node\Expr\Variable('this'), - $eventSanitized, - ), - new Node\Expr\New_( - new Node\Name($eventClassname), - [ - new Node\Arg(new Node\Expr\PropertyFetch( - new Node\Expr\Variable('this'), - 'requestSchemaValidator', - )), - new Node\Arg(new Node\Expr\MethodCall( - new Node\Expr\PropertyFetch( - new Node\Expr\Variable('this'), - 'hydrator', - ), - 'getObjectMapper' . ucfirst($webHooksHydrators[$event]->methodName), - )), - ], + new Node\Stmt\Catch_( + [new Node\Name('\\' . Throwable::class)], + new Node\Expr\Variable('throwable'), + [ + new Node\Stmt\Expression( + new Node\Expr\Assign( + new Node\Expr\Variable('error'), + new Node\Expr\Variable('throwable'), ), ), - ), - ], + ], + ), ], ), - new Node\Stmt\Return_(new Node\Expr\MethodCall( - new Node\Expr\PropertyFetch( - new Node\Expr\Variable('this'), - $eventSanitized, + ); + } + + $resolve->addStmt(new Node\Stmt\Expression(new Node\Expr\Throw_(new Node\Expr\Variable('error')))); + + $class->addStmt( + $this->builderFactory->method('hydrateWebHook')->makePublic()->setReturnType('object')->addParams([ + $this->builderFactory->param('className')->setType('string'), + $this->builderFactory->param('data')->setType('array'), + ])->setDocComment( + '/**' . "\n" . + ' * @param class-string $className' . "\n" . + ' *' . "\n" . + ' * @return H' . "\n" . + ' *' . "\n" . + ' * @template H' . "\n" . + ' */', + )->addStmt( + new Node\Stmt\Return_( + new Node\Expr\MethodCall( + new Node\Expr\PropertyFetch(new Node\Expr\Variable('this'), 'hydrator'), + 'hydrateObject', + [ + new Arg(new Node\Expr\Variable('className')), + new Arg(new Node\Expr\Variable('data')), + ], ), - 'resolve', - [ - new Node\Arg(new Node\Expr\Variable('headers')), - new Node\Arg(new Node\Expr\Variable('data')), - ], - )), - ], [ - new Node\Stmt\Catch_( - [new Node\Name('\\' . Throwable::class)], - new Node\Expr\Variable('error'), - [ - new Node\Stmt\Goto_($gotoLabels), - ], ), - ]); - $tmts[] = new Node\Stmt\Label($gotoLabels); - $gotoLabels++; - } + ), + ); - $tmts[] = new Node\Stmt\Throw_(new Node\Expr\Variable('error')); + $class->addStmt( + $this->builderFactory->method('serializeWebHook')->makePublic()->setReturnType('array')->addParam( + $this->builderFactory->param('object')->setType('object'), + )->setDocComment('/** @return array{className: class-string, data: mixed} */')->addStmt( + new Node\Stmt\Return_( + new Node\Expr\Array_([ + new Node\Expr\ArrayItem( + new Node\Expr\ClassConstFetch(new Node\Expr\Variable('object'), 'class'), + new Node\Scalar\String_('className'), + ), + new Node\Expr\ArrayItem( + new Node\Expr\MethodCall( + new Node\Expr\PropertyFetch(new Node\Expr\Variable('this'), 'hydrator'), + 'serializeObject', + [new Arg(new Node\Expr\Variable('object'))], + ), + new Node\Scalar\String_('data'), + ), + ]), + ), + ), + ); - $method->addStmts($tmts); - $class->addStmt($method); + $class->addStmt($resolve); - yield new File($pathPrefix, 'WebHooks', $stmt->addStmt($class)->getNode()); + yield new File( + $package->destination->source, + $className->relative, + $this->builderFactory->namespace($className->namespace->source)->addStmt($class)->getNode(), + File::DO_LOAD_ON_WRITE, + ); } } diff --git a/src/Output/Error.php b/src/Output/Error.php index 9133300..9dd28a0 100644 --- a/src/Output/Error.php +++ b/src/Output/Error.php @@ -9,6 +9,7 @@ use function file_put_contents; use function getenv; +use function is_string; use function Termwind\render; use const FILE_APPEND; @@ -24,10 +25,15 @@ public static function display(Throwable $throwable): void '); - if ((new CiDetector())->detect()->getCiName() !== CiDetector::CI_GITHUB_ACTIONS) { + if (new CiDetector()->detect()->getCiName() !== CiDetector::CI_GITHUB_ACTIONS) { return; } - file_put_contents(getenv('GITHUB_STEP_SUMMARY'), "### ⚠️ Error ⚠️\n```" . $throwable->getMessage() . "```\n", FILE_APPEND); + $summaryPath = getenv('GITHUB_STEP_SUMMARY'); + if (! is_string($summaryPath) || $summaryPath === '') { + return; + } + + file_put_contents($summaryPath, "### ⚠️ Error ⚠️\n```" . $throwable->getMessage() . "```\n", FILE_APPEND); } } diff --git a/src/Output/Status/ANSI.php b/src/Output/Status/ANSI.php index 9f3a632..5db3026 100644 --- a/src/Output/Status/ANSI.php +++ b/src/Output/Status/ANSI.php @@ -114,34 +114,17 @@ public function itemForStep(string $key, int $count): void public function advanceStep(string $key): void { $this->stepProgress[$key]++; - $percentage = 100 / $this->itemsCountForStep[$key] * $this->stepProgress[$key]; - /** @phpstan-ignore-next-line */ - switch (true) { - case $percentage <= 12.5: - $this->stepsStatus[$key] = '🌑'; - break; - case $percentage > 12.5 && $percentage <= 25: - $this->stepsStatus[$key] = '🌒'; - break; - case $percentage > 25 && $percentage <= 37.5: - $this->stepsStatus[$key] = '🌓'; - break; - case $percentage > 37.5 && $percentage <= 50: - $this->stepsStatus[$key] = '🌔'; - break; - case $percentage > 50 && $percentage <= 62.5: - $this->stepsStatus[$key] = '🌕'; - break; - case $percentage > 62.5 && $percentage <= 75: - $this->stepsStatus[$key] = '🌖'; - break; - case $percentage > 75 && $percentage <= 87.5: - $this->stepsStatus[$key] = '🌗'; - break; - case $percentage > 87.5: - $this->stepsStatus[$key] = '🌘'; - break; - } + $percentage = 100 / $this->itemsCountForStep[$key] * $this->stepProgress[$key]; + $this->stepsStatus[$key] = match (true) { + $percentage <= 12.5 => '🌑', + $percentage <= 25 => '🌒', + $percentage <= 37.5 => '🌓', + $percentage <= 50 => '🌔', + $percentage <= 62.5 => '🌕', + $percentage <= 75 => '🌖', + $percentage <= 87.5 => '🌗', + default => '🌘', + }; $this->maybeRender(); } diff --git a/src/Output/Status/OverWritingOutPut.php b/src/Output/Status/OverWritingOutPut.php index 4e4bdb1..9e00be2 100644 --- a/src/Output/Status/OverWritingOutPut.php +++ b/src/Output/Status/OverWritingOutPut.php @@ -10,6 +10,7 @@ use function count; use function explode; use function implode; +use function is_scalar; use function is_string; use function sprintf; @@ -24,25 +25,22 @@ public function __construct( ) { } - /** - * @param iterable|string $messages - * - * @phpstan-ignore-next-line - */ public function write(iterable|string $messages, bool $newline = false, int $options = 0): void { $this->output->write($messages, $newline, $options); } - /** - * @param iterable|string $messages - * - * @phpstan-ignore-next-line - */ public function writeln(iterable|string $messages, int $options = 0): void { - if (! is_string($messages)) { - $messages = implode(PHP_EOL, [...$messages]); + if (is_string($messages)) { + $messageString = $messages; + } else { + $parts = []; + foreach ($messages as $message) { + $parts[] = is_string($message) ? $message : (is_scalar($message) ? (string) $message : ''); + } + + $messageString = implode(PHP_EOL, $parts); } if ($this->previousLinecount > 0) { @@ -50,9 +48,9 @@ public function writeln(iterable|string $messages, int $options = 0): void $this->output->write("\x1b[0J"); } - $this->previousLinecount = count(explode(PHP_EOL, $messages)); + $this->previousLinecount = count(explode(PHP_EOL, $messageString)); - $this->output->writeln($messages, $options); + $this->output->writeln($messageString, $options); } public function setVerbosity(int $level): void diff --git a/src/Output/Status/Simple.php b/src/Output/Status/Simple.php index e36216d..a740c37 100644 --- a/src/Output/Status/Simple.php +++ b/src/Output/Status/Simple.php @@ -9,10 +9,10 @@ use const PHP_EOL; -final class Simple +final readonly class Simple { /** @var array */ - private readonly array $steps; + private array $steps; public function __construct(Step ...$steps) { diff --git a/src/PrivatePromotedPropertyAsParam.php b/src/PrivatePromotedPropertyAsParam.php deleted file mode 100644 index faadfea..0000000 --- a/src/PrivatePromotedPropertyAsParam.php +++ /dev/null @@ -1,30 +0,0 @@ -name), - $this->default, - $this->type, - $this->byRef, - $this->variadic, - [], - Node\Stmt\Class_::MODIFIER_PRIVATE, - $this->attributeGroups, - ); - } -} diff --git a/src/PromotedPropertyAsParam.php b/src/PromotedPropertyAsParam.php deleted file mode 100644 index 7ae1d9b..0000000 --- a/src/PromotedPropertyAsParam.php +++ /dev/null @@ -1,30 +0,0 @@ -name), - $this->default, - $this->type, - $this->byRef, - $this->variadic, - [], - Node\Stmt\Class_::MODIFIER_PUBLIC, - $this->attributeGroups, - ); - } -} diff --git a/src/Registry/CompositSchema.php b/src/Registry/CompositSchema.php deleted file mode 100644 index 0100212..0000000 --- a/src/Registry/CompositSchema.php +++ /dev/null @@ -1,32 +0,0 @@ - */ - private array $splHash = []; - - public function __construct( - private readonly Namespace_ $baseNamespaces, - ) { - } - - public function get(PropertyType $propertyType): void - { - } - - /** @return iterable */ - public function list(): iterable - { - $unknownSchemas = $this->unknownSchemas; - $this->unknownSchemas = []; - - yield from $unknownSchemas; - } -} diff --git a/src/Registry/Contract.php b/src/Registry/Contract.php deleted file mode 100644 index fbcc9b8..0000000 --- a/src/Registry/Contract.php +++ /dev/null @@ -1,67 +0,0 @@ - */ - private array $splHash = []; - - /** @var array */ - private array $unknownSchemas = []; - - /** @throws JsonException */ - public function get(openAPISchema $schema, string $fallbackName): string - { - if ($schema->type === 'array') { - $schema = $schema->items; - } - - if (! $schema instanceof openAPISchema) { - throw new RuntimeException('Schemas has to be instance of: ' . openAPISchema::class); - } - - $hash = spl_object_hash($schema); - if (array_key_exists($hash, $this->splHash)) { - return $this->splHash[$hash]; - } - - $className = Utils::fixKeyword($fallbackName); - - $suffix = 'a'; - while (array_key_exists($className, $this->unknownSchemas)) { - $className = Utils::fixKeyword($fallbackName . strtoupper($suffix++)); - } - - $this->splHash[spl_object_hash($schema)] = $className; - $this->unknownSchemas[$className] = new UnknownSchema($fallbackName, $className, $schema); - - return $className; - } - - public function hasContracts(): bool - { - return count($this->unknownSchemas) > 0; - } - - /** @return iterable */ - public function contracts(): iterable - { - $unknownSchemas = $this->unknownSchemas; - $this->unknownSchemas = []; - - yield from $unknownSchemas; - } -} diff --git a/src/Registry/Schema.php b/src/Registry/Schema.php deleted file mode 100644 index 58b016e..0000000 --- a/src/Registry/Schema.php +++ /dev/null @@ -1,131 +0,0 @@ - */ - private array $splHash = []; - /** @var array */ - private array $json = []; - - /** @var array */ - private array $unknownSchemas = []; - - /** @var array */ - private array $unknownSchemasJson = []; - /** @var array> */ - private array $aliasses = []; - - public function __construct( - private readonly Namespace_ $baseNamespaces, - private readonly bool $allowDuplicatedSchemas, - private readonly bool $useAliasesForDuplication, - ) { - } - - public function addClassName(string $className, openAPISchema $schema): void - { - if ($schema->type === 'array') { - $schema = $schema->items; - } - - if (! $schema instanceof openAPISchema) { - throw new RuntimeException('Schemas has to be instance of: ' . openAPISchema::class); - } - - $className = Utils::className($className); - $this->splHash[spl_object_hash($schema)] = $className; - $this->json[json_encode($schema->getSerializableData())] = $className; - } - - /** @throws JsonException */ - public function get(openAPISchema $schema, string $fallbackName): string - { - if ($schema->type === 'array') { - $schema = $schema->items; - } - - if (! $schema instanceof openAPISchema) { - throw new RuntimeException('Schemas has to be instance of: ' . openAPISchema::class); - } - - $hash = spl_object_hash($schema); - if (array_key_exists($hash, $this->splHash)) { - return $this->splHash[$hash]; - } - - $json = json_encode($schema->getSerializableData()); - if (! $this->allowDuplicatedSchemas && array_key_exists($json, $this->json)) { - return $this->json[$json]; - } - - if (! $this->allowDuplicatedSchemas && array_key_exists($json, $this->unknownSchemasJson)) { - return $this->unknownSchemasJson[$json]; - } - - $className = Utils::fixKeyword($fallbackName); - - if ($this->allowDuplicatedSchemas && $this->useAliasesForDuplication && array_key_exists($json, $this->json)) { - $this->aliasses['Schema\\' . $this->json[$json]][] = ClassString::factory($this->baseNamespaces, 'Schema\\' . $className); - - return $className; - } - - if ($this->allowDuplicatedSchemas && $this->useAliasesForDuplication && array_key_exists($json, $this->unknownSchemasJson)) { - $this->aliasses['Schema\\' . $this->unknownSchemasJson[$json]][] = ClassString::factory($this->baseNamespaces, 'Schema\\' . $className); - - return $className; - } - - $suffix = 'a'; - while (array_key_exists($className, $this->unknownSchemas)) { - $className = Utils::fixKeyword($fallbackName . strtoupper($suffix++)); - } - - $this->splHash[spl_object_hash($schema)] = $className; - $this->unknownSchemasJson[$json] = $className; - $this->unknownSchemas[$className] = new UnknownSchema($fallbackName, $className, $schema); - - return $className; - } - - public function hasUnknownSchemas(): bool - { - return count($this->unknownSchemas) > 0; - } - - /** @return iterable */ - public function unknownSchemas(): iterable - { - $unknownSchemas = $this->unknownSchemas; - $this->unknownSchemas = []; - - yield from $unknownSchemas; - } - - /** @return iterable */ - public function aliasesForClassName(string $classname): iterable - { - if (! array_key_exists($classname, $this->aliasses)) { - return; - } - - yield from $this->aliasses[$classname]; - } -} diff --git a/src/Registry/ThrowableSchema.php b/src/Registry/ThrowableSchema.php deleted file mode 100644 index e6aa402..0000000 --- a/src/Registry/ThrowableSchema.php +++ /dev/null @@ -1,23 +0,0 @@ - */ - private array $throwables = []; - - public function add(string $class): void - { - $this->throwables[] = $class; - } - - public function has(string $class): bool - { - return in_array($class, $this->throwables, true); - } -} diff --git a/src/Registry/UnknownSchema.php b/src/Registry/UnknownSchema.php deleted file mode 100644 index 2fe4cf4..0000000 --- a/src/Registry/UnknownSchema.php +++ /dev/null @@ -1,17 +0,0 @@ - $paths */ - public function __construct( - public readonly string|null $baseUrl, - /** @var array $paths */ - public readonly array $paths, - ) { - } -} diff --git a/src/Representation/Contract.php b/src/Representation/Contract.php deleted file mode 100644 index f49e46a..0000000 --- a/src/Representation/Contract.php +++ /dev/null @@ -1,18 +0,0 @@ - $properties */ - public function __construct( - public readonly ClassString $className, - /** @var array $properties */ - public readonly array $properties, - ) { - } -} diff --git a/src/Representation/ExampleData.php b/src/Representation/ExampleData.php deleted file mode 100644 index 71508a5..0000000 --- a/src/Representation/ExampleData.php +++ /dev/null @@ -1,16 +0,0 @@ - $schemas */ - public function __construct( - public readonly ClassString $className, - public readonly string $methodName, - /** @var array $schemas */ - public readonly array $schemas, - ) { - } -} diff --git a/src/Representation/Operation.php b/src/Representation/Operation.php deleted file mode 100644 index 0e90c95..0000000 --- a/src/Representation/Operation.php +++ /dev/null @@ -1,49 +0,0 @@ - $metaData - * @param array $returnType - * @param array $parameters - * @param array $requestBody - * @param array $response - * @param array $empty - */ - public function __construct( - public ClassString $className, - public ClassString $classNameSanitized, - public ClassString $operatorClassName, - public string $operatorLookUpMethod, - public string $name, - public string $nameCamel, - public string|null $group, - public string|null $groupCamel, - public string $operationId, - public string $matchMethod, - public string $method, - public string $summary, - public ExternalDocumentation|null $externalDocs, - public string $path, - /** @var array $metaData */ - public array $metaData, - /** @var array $returnType */ - public array $returnType, - /** @var array $parameters */ - public array $parameters, - /** @var array $requestBody */ - public array $requestBody, - /** @var array $response */ - public array $response, - /** @var array $empty */ - public array $empty, - ) { - } -} diff --git a/src/Representation/OperationEmptyResponse.php b/src/Representation/OperationEmptyResponse.php deleted file mode 100644 index 3eb3995..0000000 --- a/src/Representation/OperationEmptyResponse.php +++ /dev/null @@ -1,17 +0,0 @@ - $headers */ - public function __construct( - public int $code, - public string $description, - /** @var array
$headers */ - public array $headers, - ) { - } -} diff --git a/src/Representation/OperationRequestBody.php b/src/Representation/OperationRequestBody.php deleted file mode 100644 index 406820d..0000000 --- a/src/Representation/OperationRequestBody.php +++ /dev/null @@ -1,14 +0,0 @@ - $operations */ - public function __construct( - public readonly ClassString $className, - public readonly Hydrator $hydrator, - /** @var array $operations */ - public readonly array $operations, - ) { - } -} diff --git a/src/Representation/Property.php b/src/Representation/Property.php deleted file mode 100644 index 87bc870..0000000 --- a/src/Representation/Property.php +++ /dev/null @@ -1,20 +0,0 @@ - $enum */ - public function __construct( - public readonly string $name, - public readonly string $sourceName, - public readonly string $description, - public readonly ExampleData $example, - public readonly PropertyType $type, - public readonly bool $nullable, - public readonly array $enum, - ) { - } -} diff --git a/src/Representation/PropertyType.php b/src/Representation/PropertyType.php deleted file mode 100644 index 4442b31..0000000 --- a/src/Representation/PropertyType.php +++ /dev/null @@ -1,18 +0,0 @@ - $payload */ - public function __construct( - public readonly string $type, - public readonly string|null $format, - public readonly string|null $pattern, - public readonly string|Schema|PropertyType|array $payload, - public readonly bool $nullable, - ) { - } -} diff --git a/src/Representation/Schema.php b/src/Representation/Schema.php deleted file mode 100644 index cd39a42..0000000 --- a/src/Representation/Schema.php +++ /dev/null @@ -1,35 +0,0 @@ - $contracts - * @param array $example - * @param array $properties - * @param array $type - */ - public function __construct( - public readonly ClassString $className, - /** @var array $contracts */ - public readonly array $contracts, - public readonly ClassString $errorClassName, - public readonly ClassString $errorClassNameAliased, - public readonly string $title, - public readonly string $description, - /** @var array $example */ - public readonly array $example, - /** @var array $properties */ - public readonly array $properties, - public readonly baseSchema $schema, - public readonly bool $isArray, - public readonly array $type, - ) { - } -} diff --git a/src/Representation/WebHook.php b/src/Representation/WebHook.php deleted file mode 100644 index eb34d2a..0000000 --- a/src/Representation/WebHook.php +++ /dev/null @@ -1,25 +0,0 @@ - $headers - * @param array $schema - */ - public function __construct( - public readonly string $event, - public readonly string $summary, - public readonly string $description, - public readonly string $operationId, - public readonly string $documentationUrl, - /** @var array
*/ - public readonly array $headers, - /** @var array */ - public readonly array $schema, - ) { - } -} diff --git a/src/SectionGenerator/OperationIdSlash.php b/src/SectionGenerator/OperationIdSlash.php index 423f1e3..8a5e38e 100644 --- a/src/SectionGenerator/OperationIdSlash.php +++ b/src/SectionGenerator/OperationIdSlash.php @@ -5,8 +5,7 @@ namespace ApiClients\Tools\OpenApiClientGenerator\SectionGenerator; use ApiClients\Tools\OpenApiClientGenerator\Contract\SectionGenerator; -use ApiClients\Tools\OpenApiClientGenerator\Representation\Path; -use ApiClients\Tools\OpenApiClientGenerator\Representation\WebHook; +use OpenAPITools\Representation; use function array_pop; use function explode; @@ -14,7 +13,7 @@ final class OperationIdSlash implements SectionGenerator { - public static function path(Path $path): string|false + public static function path(Representation\Namespaced\Path $path): string { $chunks = explode('/', $path->operations[0]->operationId); array_pop($chunks); @@ -22,7 +21,7 @@ public static function path(Path $path): string|false return implode('-', $chunks); } - public static function webHook(WebHook ...$webHooks): string|false + public static function webHook(Representation\WebHook ...$webHooks): string|false { return false; } diff --git a/src/SectionGenerator/WebHooks.php b/src/SectionGenerator/WebHooks.php index 5cf9cb7..ae2ffd3 100644 --- a/src/SectionGenerator/WebHooks.php +++ b/src/SectionGenerator/WebHooks.php @@ -5,17 +5,16 @@ namespace ApiClients\Tools\OpenApiClientGenerator\SectionGenerator; use ApiClients\Tools\OpenApiClientGenerator\Contract\SectionGenerator; -use ApiClients\Tools\OpenApiClientGenerator\Representation\Path; -use ApiClients\Tools\OpenApiClientGenerator\Representation\WebHook; +use OpenAPITools\Representation; final class WebHooks implements SectionGenerator { - public static function path(Path $path): string|false + public static function path(Representation\Namespaced\Path $path): string|false { return false; } - public static function webHook(WebHook ...$webHooks): string|false + public static function webHook(Representation\WebHook ...$webHooks): string { return 'webhook'; } diff --git a/src/State.php b/src/State.php deleted file mode 100644 index 5440af9..0000000 --- a/src/State.php +++ /dev/null @@ -1,21 +0,0 @@ -files[$fileName]); } - /** @return array */ + /** @return list */ public function files(): array { return array_values($this->files); diff --git a/src/Utils.php b/src/Utils.php deleted file mode 100644 index 90a62ca..0000000 --- a/src/Utils.php +++ /dev/null @@ -1,101 +0,0 @@ - self::fixKeyword( - (new Convert($chunk))->toPascal(), - ), - explode( - '\\', - $className, - ), - ), - ); - - return trim(self::cleanUpNamespace(self::fixKeyword($className)), '\\'); - } - - public static function cleanUpNamespace(string $namespace): string - { - do { - $previousNamespace = $namespace; - $namespace = str_replace('/', '\\', $namespace); - $namespace = str_replace('\\\\', '\\', $namespace); - } while ($previousNamespace !== $namespace); - - $namespace = trim($namespace, '\\'); - - return '\\' . $namespace; - } - - public static function fqcn(string $fqcn): string - { - return str_replace('/', '\\', $fqcn); - } - - public static function dirname(string $fqcn): string - { - $fqcn = str_replace('\\', '/', $fqcn); - - return trim(self::cleanUpNamespace(dirname($fqcn)), '\\'); - } - - public static function basename(string $fqcn): string - { - $fqcn = str_replace('\\', '/', $fqcn); - - return trim(self::cleanUpNamespace(basename($fqcn)), '\\'); - } - - public static function fixKeyword(string $name): string - { - $name = self::fqcn($name); - $nameBoom = explode('\\', $name); - - /** @phpstan-ignore-next-line */ - return $name . (in_array( - strtolower($nameBoom[count($nameBoom) - 1]), - ['__halt_compiler', 'abstract', 'and', 'array', 'as', 'break', 'callable', 'case', 'catch', 'class', 'clone', 'const', 'continue', 'declare', 'default', 'die', 'do', 'echo', 'else', 'elseif', 'empty', 'enddeclare', 'endfor', 'endforeach', 'endif', 'endswitch', 'endwhile', 'eval', 'exit', 'extends', 'final', 'for', 'foreach', 'function', 'global', 'goto', 'if', 'implements', 'include', 'include_once', 'instanceof', 'insteadof', 'interface', 'isset', 'list', 'namespace', 'new', 'or', 'print', 'private', 'protected', 'public', 'require', 'require_once', 'return', 'static', 'switch', 'throw', 'trait', 'try', 'unset', 'use', 'var', 'while', 'xor', 'self', 'parent', 'object'], - false, - ) ? '_' : ''); - } -} diff --git a/src/Voter/ListOperation/PageAndPerPageInQuery.php b/src/Voter/ListOperation/PageAndPerPageInQuery.php index 55299be..5d111d2 100644 --- a/src/Voter/ListOperation/PageAndPerPageInQuery.php +++ b/src/Voter/ListOperation/PageAndPerPageInQuery.php @@ -19,7 +19,7 @@ final public static function incrementorInitialValue(): int return 1; } - /** @return array */ + /** @return list */ final public static function keys(): array { return ['perPage', 'page']; diff --git a/src/Voter/StreamOperation/DownloadInOperationId.php b/src/Voter/StreamOperation/DownloadInOperationId.php index 3e66460..cb19e19 100644 --- a/src/Voter/StreamOperation/DownloadInOperationId.php +++ b/src/Voter/StreamOperation/DownloadInOperationId.php @@ -5,14 +5,14 @@ namespace ApiClients\Tools\OpenApiClientGenerator\Voter\StreamOperation; use ApiClients\Tools\OpenApiClientGenerator\Contract\Voter\StreamOperation; -use ApiClients\Tools\OpenApiClientGenerator\Representation\Operation; +use OpenAPITools\Representation\Namespaced\Operation; -use function strpos; +use function str_contains; final class DownloadInOperationId implements StreamOperation { public static function stream(Operation $operation): bool { - return strpos($operation->operationId, 'download') !== false; + return str_contains($operation->operationId, 'download'); } } diff --git a/src/Voter/StreamOperation/DownloadInPath.php b/src/Voter/StreamOperation/DownloadInPath.php index 175499a..519d7ee 100644 --- a/src/Voter/StreamOperation/DownloadInPath.php +++ b/src/Voter/StreamOperation/DownloadInPath.php @@ -5,14 +5,14 @@ namespace ApiClients\Tools\OpenApiClientGenerator\Voter\StreamOperation; use ApiClients\Tools\OpenApiClientGenerator\Contract\Voter\StreamOperation; -use ApiClients\Tools\OpenApiClientGenerator\Representation\Operation; +use OpenAPITools\Representation\Namespaced\Operation; -use function strpos; +use function str_contains; final class DownloadInPath implements StreamOperation { public static function stream(Operation $operation): bool { - return strpos($operation->path, 'download') !== false; + return str_contains($operation->path, 'download'); } } diff --git a/src/phpstan-assertType-mock.php b/src/phpstan-assertType-mock.php index 2cb4e49..3332408 100644 --- a/src/phpstan-assertType-mock.php +++ b/src/phpstan-assertType-mock.php @@ -4,6 +4,7 @@ namespace PHPStan\Testing; -function assertType($a, $b): void +// phpcs:disable +function assertType(mixed $expectedType, mixed $actualType): void { } diff --git a/tests/app-templates/composer.json b/tests/app-templates/composer.json index 5e32df4..54fac9a 100644 --- a/tests/app-templates/composer.json +++ b/tests/app-templates/composer.json @@ -1,77 +1,91 @@ { - "name": "api-clients/{{ packageName }}", - "description": "Non-Blocking first {{ fullName }} client", - "license": "MIT", - "authors": [ - { - "name": "Cees-Jan Kiewiet", - "email": "ceesjank@gmail.com" - } - ], - "require": { - "php": "^8.2", + "name": "api-clients/{{ packageName }}", + "description": "Non-Blocking first {{ fullName }} client", + "license": "MIT", + "authors": [ + { + "name": "Cees-Jan Kiewiet", + "email": "ceesjank@gmail.com" + } + ], + "require": { + "php": "^8.4", {% if requires is iterable %} {% for require in requires %} - "{{ require.name }}": "{{ require.version }}", + "{{ require.name }}": "{{ require.version }}", {% endfor %} {% endif %} - "api-clients/contracts": "^0.1", - "api-clients/openapi-client-utils": "dev-main", - "devizzent/cebe-php-openapi": "^1", - "eventsauce/object-hydrator": "^1.1", - "league/openapi-psr7-validator": "^0.21", - "league/uri": "^7.3", - "psr/http-message": "^1.0", - "react/http": "^1.8", - "react/async": "^4.0", - "wyrihaximus/react-awaitable-observable": "^1.0" - }, - "require-dev": { -{% if require-dev is iterable %} + "api-clients/contracts": "^0.1", + "api-clients/openapi-client-utils": "dev-main", + "devizzent/cebe-php-openapi": "^1", + "eventsauce/object-hydrator": "^1.1", + "league/openapi-psr7-validator": "^0.21", + "league/uri": "^7.3", + "psr/http-message": "^1.0", + "react/http": "^1.8", + "react/async": "^4.0", + "wyrihaximus/react-awaitable-observable": "^1.0" + }, + "require-dev": { +{% if requires-dev is iterable %} {% for require in requires-dev %} - "{{ require.name }}": "{{ require.version }}", + "{{ require.name }}": "{{ require.version }}", {% endfor %} {% endif %} - "wyrihaximus/async-test-utilities": "^7" - }, - "autoload": { - "psr-4": { - "{{ namespace|trim('\\', 'left')|replace({'\\': '\\\\'}) }}": "src/" - } - }, - "autoload-dev": { - "psr-4": { - "{{ namespace|trim('\\', 'left')|replace({'\\': '\\\\'}) }}": "src/" - } - }, + "wyrihaximus/async-test-utilities": "^13.4.1", + "wyrihaximus/makefiles": "^0.13.2" + }, + "autoload": { + "psr-4": { + "{{ package.namespace.source|trim('\\', 'left')|replace({'\\': '\\\\'}) }}\\": "src/" + } + }, + "autoload-dev": { + "psr-4": { + "{{ package.namespace.source|trim('\\', 'left')|replace({'\\': '\\\\'}) }}\\": "src/" + } + }, {% if suggests is iterable and suggests|length > 0 %} -"suggest": { + "suggest": { {% for suggest in suggests %} -"api-clients/{{ suggest.name }}": "{{ suggest.reason }}"{% if not loop.last %},{% endif %} + "api-clients/{{ suggest.name }}": "{{ suggest.reason }}"{% if not loop.last %},{% endif %} {% endfor %} -}, + }, {% endif %} -{% if qa.phpstan.enabled is constant('true') and qa.phpstan.configFilePath is not constant('null') %} - "extra": { - "phpstan": { - "includes": [ - "{{ qa.phpstan.configFilePath }}" - ] - } - }, +{% if package.qa.phpstan.enabled and package.qa.phpstan.configFilePath is not null %} + "extra": { + "phpstan": { + "includes": [ + "{{ package.qa.phpstan.configFilePath }}" + ] + } + }, {% endif %} - "config": { - "sort-packages": true, - "platform": { - "php": "8.2.13" + "config": { + "sort-packages": true, + "platform": { + "php": "8.4.13" + }, + "allow-plugins": { + "composer/package-versions-deprecated": true, + "dealerdirect/phpcodesniffer-composer-installer": true, + "drupol/composer-packages": true, + "ergebnis/composer-normalize": true, + "icanhazstring/composer-unused": true, + "infection/extension-installer": true, + "mindplay/composer-locator": true, + "phpstan/extension-installer": true, + "wyrihaximus/composer-update-bin-autoload-path": true, + "wyrihaximus/makefiles": true, + "wyrihaximus/test-utilities": true + } }, - "allow-plugins": { - "dealerdirect/phpcodesniffer-composer-installer": true, - "composer/package-versions-deprecated": true, - "ergebnis/composer-normalize": true, - "icanhazstring/composer-unused": true, - "wyrihaximus/composer-update-bin-autoload-path": true, - "infection/extension-installer": true + "scripts": { + "post-install-cmd": [ + "make on-install-or-update || true" + ], + "post-update-cmd": [ + "make on-install-or-update || true" + ] } - } } diff --git a/tests/app/Makefile b/tests/app/Makefile index 9d7ac0f..ca34ce0 100644 --- a/tests/app/Makefile +++ b/tests/app/Makefile @@ -62,3 +62,4 @@ task-list-ci: ## CI: Generate a JSON array of jobs to run, matches the commands help: ## Show this help ### @printf "\033[33mUsage:\033[0m\n make [target]\n\n\033[33mTargets:\033[0m\n" @grep -E '^[a-zA-Z0-9_-]+:.*?## .*$$' $(MAKEFILE_LIST) | sort | awk 'BEGIN {FS = ":.*?## "}; {printf " \033[32m%-32s\033[0m %s\n", $$1, $$2}' | tr -d '#' + diff --git a/tests/app/app-templates/Makefile b/tests/app/app-templates/Makefile new file mode 100644 index 0000000..ca34ce0 --- /dev/null +++ b/tests/app/app-templates/Makefile @@ -0,0 +1,65 @@ +# set all to phony +SHELL=bash + +.PHONY: * + +DOCKER_CGROUP:=$(shell cat /proc/1/cgroup | grep docker | wc -l) +COMPOSER_CACHE_DIR:=$(shell composer config --global cache-dir -q || echo ${HOME}/.composer/cache) + +ifneq ("$(wildcard /.dockerenv)","") + IN_DOCKER:=TRUE +else ifneq ("$(DOCKER_CGROUP)","0") + IN_DOCKER:=TRUE +else + IN_DOCKER:=FALSE +endif + +ifeq ("$(IN_DOCKER)","TRUE") + DOCKER_RUN:= +else + 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]);") + DOCKER_RUN:=docker run --rm -it \ + -v "`pwd`:`pwd`" \ + -v "${COMPOSER_CACHE_DIR}:/home/app/.composer/cache" \ + -w "`pwd`" \ + "ghcr.io/wyrihaximusnet/php:${PHP_VERSION}-nts-alpine-slim-dev" +endif + +all: ## Runs everything ### + @grep -E '^[a-zA-Z0-9_-]+:.*?## .*$$' $(MAKEFILE_LIST) | grep -v "###" | awk 'BEGIN {FS = ":.*?## "}; {printf "%s\n", $$1}' | xargs --open-tty $(MAKE) + +syntax-php: ## Lint PHP syntax + $(DOCKER_RUN) vendor/bin/parallel-lint --exclude vendor . + +cs-fix: ## Fix any automatically fixable code style issues + $(DOCKER_RUN) vendor/bin/phpcbf --parallel=$(shell nproc) --standard=./etc/qa/phpcs.xml || $(DOCKER_RUN) vendor/bin/phpcbf --parallel=$(shell nproc) --standard=./etc/qa/phpcs.xml + +cs: ## Check the code for code style issues + $(DOCKER_RUN) vendor/bin/phpcs --parallel=$(shell nproc) --standard=./etc/qa/phpcs.xml + +stan: ## Run static analysis (PHPStan) + $(DOCKER_RUN) vendor/bin/phpstan analyse src tests --level max --ansi -c ./etc/qa/phpstan.neon + +psalm: ## Run static analysis (Psalm) + $(DOCKER_RUN) vendor/bin/psalm --threads=$(shell nproc) --shepherd --stats --config=./etc/qa/psalm.xml + +unit-testing: ## Run tests + $(DOCKER_RUN) vendor/bin/phpunit --colors=always -c ./etc/qa/phpunit.xml + $(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 + +mutation-testing: ## Run mutation testing + $(DOCKER_RUN) vendor/bin/infection --ansi --min-msi=100 --min-covered-msi=100 --threads=$(shell nproc) --ignore-msi-with-no-mutations || (cat ./var/infection.log && false) + +backward-compatibility-check: ## Check code for backwards incompatible changes + $(DOCKER_RUN) vendor/bin/roave-backward-compatibility-check || true + +shell: ## Provides Shell access in the expected environment ### + $(DOCKER_RUN) ash + +task-list-ci: ## CI: Generate a JSON array of jobs to run, matches the commands run when running `make (|all)` ### + @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]' + +help: ## Show this help ### + @printf "\033[33mUsage:\033[0m\n make [target]\n\n\033[33mTargets:\033[0m\n" + @grep -E '^[a-zA-Z0-9_-]+:.*?## .*$$' $(MAKEFILE_LIST) | sort | awk 'BEGIN {FS = ":.*?## "}; {printf " \033[32m%-32s\033[0m %s\n", $$1, $$2}' | tr -d '#' + diff --git a/tests/app/app-templates/composer.json b/tests/app/app-templates/composer.json new file mode 100644 index 0000000..8e744e3 --- /dev/null +++ b/tests/app/app-templates/composer.json @@ -0,0 +1,73 @@ +{ + "name": "api-clients/petsore", + "description": "Non-Blocking first PetStore client", + "license": "MIT", + "authors": [ + { + "name": "Cees-Jan Kiewiet", + "email": "ceesjank@gmail.com" + } + ], + "require": { + "php": "^8.4", + "api-clients/contracts": "^0.1", + "api-clients/openapi-client-utils": "dev-main", + "devizzent/cebe-php-openapi": "^1", + "eventsauce/object-hydrator": "^1.1", + "league/openapi-psr7-validator": "^0.21", + "league/uri": "^7.3", + "psr/http-message": "^1.0", + "react/http": "^1.8", + "react/async": "^4.0", + "wyrihaximus/react-awaitable-observable": "^1.0" + }, + "require-dev": { + "wyrihaximus/async-test-utilities": "^13.4.1", + "wyrihaximus/makefiles": "^0.13.2" + }, + "autoload": { + "psr-4": { + "ApiClients\\Client\\PetStore\\": "src/" + } + }, + "autoload-dev": { + "psr-4": { + "ApiClients\\Client\\PetStore\\": "src/" + } + }, + "extra": { + "phpstan": { + "includes": [ + "etc/phpstan-extension.neon" + ] + } + }, + "config": { + "sort-packages": true, + "platform": { + "php": "8.4.13" + }, + "allow-plugins": { + "composer/package-versions-deprecated": true, + "dealerdirect/phpcodesniffer-composer-installer": true, + "drupol/composer-packages": true, + "ergebnis/composer-normalize": true, + "icanhazstring/composer-unused": true, + "infection/extension-installer": true, + "mindplay/composer-locator": true, + "phpstan/extension-installer": true, + "wyrihaximus/composer-update-bin-autoload-path": true, + "wyrihaximus/makefiles": true, + "wyrihaximus/test-utilities": true + } + }, + "scripts": { + "post-install-cmd": [ + "make on-install-or-update || true" + ], + "post-update-cmd": [ + "make on-install-or-update || true" + ] + } +} + diff --git a/tests/app/app/Makefile b/tests/app/app/Makefile new file mode 100644 index 0000000..a99dce3 --- /dev/null +++ b/tests/app/app/Makefile @@ -0,0 +1,66 @@ +# set all to phony +SHELL=bash + +.PHONY: * + +DOCKER_CGROUP:=$(shell cat /proc/1/cgroup | grep docker | wc -l) +COMPOSER_CACHE_DIR:=$(shell composer config --global cache-dir -q || echo ${HOME}/.composer/cache) + +ifneq ("$(wildcard /.dockerenv)","") + IN_DOCKER:=TRUE +else ifneq ("$(DOCKER_CGROUP)","0") + IN_DOCKER:=TRUE +else + IN_DOCKER:=FALSE +endif + +ifeq ("$(IN_DOCKER)","TRUE") + DOCKER_RUN:= +else + 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]);") + DOCKER_RUN:=docker run --rm -it \ + -v "`pwd`:`pwd`" \ + -v "${COMPOSER_CACHE_DIR}:/home/app/.composer/cache" \ + -w "`pwd`" \ + "ghcr.io/wyrihaximusnet/php:${PHP_VERSION}-nts-alpine-slim-dev" +endif + +all: ## Runs everything ### + @grep -E '^[a-zA-Z0-9_-]+:.*?## .*$$' $(MAKEFILE_LIST) | grep -v "###" | awk 'BEGIN {FS = ":.*?## "}; {printf "%s\n", $$1}' | xargs --open-tty $(MAKE) + +syntax-php: ## Lint PHP syntax + $(DOCKER_RUN) vendor/bin/parallel-lint --exclude vendor . + +cs-fix: ## Fix any automatically fixable code style issues + $(DOCKER_RUN) vendor/bin/phpcbf --parallel=$(shell nproc) --standard=./etc/qa/phpcs.xml || $(DOCKER_RUN) vendor/bin/phpcbf --parallel=$(shell nproc) --standard=./etc/qa/phpcs.xml + +cs: ## Check the code for code style issues + $(DOCKER_RUN) vendor/bin/phpcs --parallel=$(shell nproc) --standard=./etc/qa/phpcs.xml + +stan: ## Run static analysis (PHPStan) + $(DOCKER_RUN) vendor/bin/phpstan analyse src tests --level max --ansi -c ./etc/qa/phpstan.neon + +psalm: ## Run static analysis (Psalm) + $(DOCKER_RUN) vendor/bin/psalm --threads=$(shell nproc) --shepherd --stats --config=./etc/qa/psalm.xml + +unit-testing: ## Run tests + $(DOCKER_RUN) vendor/bin/phpunit --colors=always -c ./etc/qa/phpunit.xml + $(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 + +mutation-testing: ## Run mutation testing + $(DOCKER_RUN) vendor/bin/infection --ansi --min-msi=100 --min-covered-msi=100 --threads=$(shell nproc) --ignore-msi-with-no-mutations || (cat ./var/infection.log && false) + +backward-compatibility-check: ## Check code for backwards incompatible changes + $(DOCKER_RUN) vendor/bin/roave-backward-compatibility-check || true + +shell: ## Provides Shell access in the expected environment ### + $(DOCKER_RUN) ash + +task-list-ci: ## CI: Generate a JSON array of jobs to run, matches the commands run when running `make (|all)` ### + @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]' + +help: ## Show this help ### + @printf "\033[33mUsage:\033[0m\n make [target]\n\n\033[33mTargets:\033[0m\n" + @grep -E '^[a-zA-Z0-9_-]+:.*?## .*$$' $(MAKEFILE_LIST) | sort | awk 'BEGIN {FS = ":.*?## "}; {printf " \033[32m%-32s\033[0m %s\n", $$1, $$2}' | tr -d '#' + + diff --git a/tests/app/app/composer.json b/tests/app/app/composer.json new file mode 100644 index 0000000..3f9f827 --- /dev/null +++ b/tests/app/app/composer.json @@ -0,0 +1,74 @@ +{ + "name": "api-clients/petsore", + "description": "Non-Blocking first PetStore client", + "license": "MIT", + "authors": [ + { + "name": "Cees-Jan Kiewiet", + "email": "ceesjank@gmail.com" + } + ], + "require": { + "php": "^8.4", + "api-clients/contracts": "^0.1", + "api-clients/openapi-client-utils": "dev-main", + "devizzent/cebe-php-openapi": "^1", + "eventsauce/object-hydrator": "^1.1", + "league/openapi-psr7-validator": "^0.21", + "league/uri": "^7.3", + "psr/http-message": "^1.0", + "react/http": "^1.8", + "react/async": "^4.0", + "wyrihaximus/react-awaitable-observable": "^1.0" + }, + "require-dev": { + "wyrihaximus/async-test-utilities": "^13.4.1", + "wyrihaximus/makefiles": "^0.13.2" + }, + "autoload": { + "psr-4": { + "ApiClients\\Client\\PetStore\\": "src/" + } + }, + "autoload-dev": { + "psr-4": { + "ApiClients\\Client\\PetStore\\": "src/" + } + }, + "extra": { + "phpstan": { + "includes": [ + "etc/phpstan-extension.neon" + ] + } + }, + "config": { + "sort-packages": true, + "platform": { + "php": "8.4.13" + }, + "allow-plugins": { + "composer/package-versions-deprecated": true, + "dealerdirect/phpcodesniffer-composer-installer": true, + "drupol/composer-packages": true, + "ergebnis/composer-normalize": true, + "icanhazstring/composer-unused": true, + "infection/extension-installer": true, + "mindplay/composer-locator": true, + "phpstan/extension-installer": true, + "wyrihaximus/composer-update-bin-autoload-path": true, + "wyrihaximus/makefiles": true, + "wyrihaximus/test-utilities": true + } + }, + "scripts": { + "post-install-cmd": [ + "make on-install-or-update || true" + ], + "post-update-cmd": [ + "make on-install-or-update || true" + ] + } +} + + diff --git a/tests/app/app/etc/openapi-client-generator.state b/tests/app/app/etc/openapi-client-generator.state new file mode 100644 index 0000000..eb0c3b8 --- /dev/null +++ b/tests/app/app/etc/openapi-client-generator.state @@ -0,0 +1,571 @@ +{ + "specHash": "c6791da54b0f6e6204158b7168cbc566bec5e29d1ebff077d31e364b603c5a16bb70e7629cddc278aabcf722e873376b2145d9a4dc5ab186c5d6241984164c66", + "generatedFiles": { + "files": [ + { + "name": "\/home\/wyrihaximus\/Projects\/PHPAPIClients\/openapi-client-generator\/tests\/test-app\/src\/Contract\/Cat.php", + "hash": "448d864ace1636478138143765a57968" + }, + { + "name": "\/home\/wyrihaximus\/Projects\/PHPAPIClients\/openapi-client-generator\/tests\/test-app\/src\/Contract\/Dog.php", + "hash": "f6a52e18f1d2ca8eeb7ea1bf4c02abb8" + }, + { + "name": "\/home\/wyrihaximus\/Projects\/PHPAPIClients\/openapi-client-generator\/tests\/test-app\/src\/Contract\/HellHound.php", + "hash": "bfbd7ed802b43161879bf7eb1e79f5bd" + }, + { + "name": "\/home\/wyrihaximus\/Projects\/PHPAPIClients\/openapi-client-generator\/tests\/test-app\/src\/Contract\/Spider.php", + "hash": "b170388bf11a738d4969461ac0d79843" + }, + { + "name": "\/home\/wyrihaximus\/Projects\/PHPAPIClients\/openapi-client-generator\/tests\/test-app\/src\/Contract\/Bird.php", + "hash": "e5917cf90e52125d3d640f4e2c79c758" + }, + { + "name": "\/home\/wyrihaximus\/Projects\/PHPAPIClients\/openapi-client-generator\/tests\/test-app\/src\/Contract\/Fish.php", + "hash": "7b51a9dec094b0e5f47d5007f9f4bb1e" + }, + { + "name": "\/home\/wyrihaximus\/Projects\/PHPAPIClients\/openapi-client-generator\/tests\/test-app\/src\/Contract\/Error.php", + "hash": "1980cc1d5d64f67aa5616311326c4f51" + }, + { + "name": "\/home\/wyrihaximus\/Projects\/PHPAPIClients\/openapi-client-generator\/tests\/test-app\/src\/Contract\/Legs.php", + "hash": "67918de3289586abaf3ac0d375834f97" + }, + { + "name": "\/home\/wyrihaximus\/Projects\/PHPAPIClients\/openapi-client-generator\/tests\/test-app\/src\/Contract\/Tails.php", + "hash": "b54eff28cb688dee46648fb0bf47844c" + }, + { + "name": "\/home\/wyrihaximus\/Projects\/PHPAPIClients\/openapi-client-generator\/tests\/test-app\/src\/Contract\/Fins.php", + "hash": "1b81c6d9442e138d8e899cb7fc6c8733" + }, + { + "name": "\/home\/wyrihaximus\/Projects\/PHPAPIClients\/openapi-client-generator\/tests\/test-app\/src\/Contract\/Wings.php", + "hash": "fd1b755030c5d993fab90d38b2c4122e" + }, + { + "name": "\/home\/wyrihaximus\/Projects\/PHPAPIClients\/openapi-client-generator\/tests\/test-app\/src\/Contract\/RedEyes.php", + "hash": "90fe6198c7bc310c24fa730b759660ca" + }, + { + "name": "\/home\/wyrihaximus\/Projects\/PHPAPIClients\/openapi-client-generator\/tests\/test-app\/src\/Contract\/RedEyes\/B.php", + "hash": "9f9944d627c578e26baf62191a7ba9dd" + }, + { + "name": "\/home\/wyrihaximus\/Projects\/PHPAPIClients\/openapi-client-generator\/tests\/test-app\/src\/Contract\/GreenEyes.php", + "hash": "41b9ab94c4eb748358973bc68b2ea28a" + }, + { + "name": "\/home\/wyrihaximus\/Projects\/PHPAPIClients\/openapi-client-generator\/tests\/test-app\/src\/Contract\/YellowEyes.php", + "hash": "16ee568e0f80ec2d66e8ae5f7e369cbc" + }, + { + "name": "\/home\/wyrihaximus\/Projects\/PHPAPIClients\/openapi-client-generator\/tests\/test-app\/src\/Contract\/BlackEyes.php", + "hash": "080123f2e4e051027f080491ea3a25ef" + }, + { + "name": "\/home\/wyrihaximus\/Projects\/PHPAPIClients\/openapi-client-generator\/tests\/test-app\/src\/Contract\/BlueEyes.php", + "hash": "f31e6a04abbf849e6f809925f28c50b3" + }, + { + "name": "\/home\/wyrihaximus\/Projects\/PHPAPIClients\/openapi-client-generator\/tests\/test-app\/src\/Contract\/Cat\/Features.php", + "hash": "5a5b68c5c62bcbb3b1f0b52d259f7c52" + }, + { + "name": "\/home\/wyrihaximus\/Projects\/PHPAPIClients\/openapi-client-generator\/tests\/test-app\/src\/Contract\/HellHound\/Eyes.php", + "hash": "8182fb556c99f3779160b30d74c982ac" + }, + { + "name": "\/home\/wyrihaximus\/Projects\/PHPAPIClients\/openapi-client-generator\/tests\/test-app\/src\/Contract\/Operations\/Pets\/List_\/Response\/ApplicationJson\/Ok.php", + "hash": "16391800ebbef88c9c6efa05338ceab3" + }, + { + "name": "\/home\/wyrihaximus\/Projects\/PHPAPIClients\/openapi-client-generator\/tests\/test-app\/src\/Contract\/Pets\/Create\/Request\/ApplicationJson.php", + "hash": "4d748f407979e87e41072b10f79f0e9d" + }, + { + "name": "\/home\/wyrihaximus\/Projects\/PHPAPIClients\/openapi-client-generator\/tests\/test-app\/src\/Contract\/Operations\/Pets\/Kinds\/Walking\/Response\/ApplicationJson\/Ok.php", + "hash": "32b479ba8abe4f689743b65f2cfb26be" + }, + { + "name": "\/home\/wyrihaximus\/Projects\/PHPAPIClients\/openapi-client-generator\/tests\/test-app\/src\/Contract\/Operations\/Pets\/Grouped\/By\/Type\/Response\/ApplicationJson\/Ok.php", + "hash": "ab4e3651adf4c8456948358c9044f47c" + }, + { + "name": "\/home\/wyrihaximus\/Projects\/PHPAPIClients\/openapi-client-generator\/tests\/test-app\/src\/Contract\/Operations\/Pets\/Names\/Response\/ApplicationJson\/Ok.php", + "hash": "874238abf0455b447536750719a305d8" + }, + { + "name": "\/home\/wyrihaximus\/Projects\/PHPAPIClients\/openapi-client-generator\/tests\/test-app\/src\/Contract\/Operations\/ShowPetById\/Response\/ApplicationJson\/Ok.php", + "hash": "f5a98bb240ee242b91ca736cbf427e8a" + }, + { + "name": "\/home\/wyrihaximus\/Projects\/PHPAPIClients\/openapi-client-generator\/tests\/test-app\/src\/Error\/Cat.php", + "hash": "5382733efa00de96527b758e572e8169" + }, + { + "name": "\/home\/wyrihaximus\/Projects\/PHPAPIClients\/openapi-client-generator\/tests\/test-app\/src\/Error\/Dog.php", + "hash": "925a1193ac0febdc4134b21466ec721e" + }, + { + "name": "\/home\/wyrihaximus\/Projects\/PHPAPIClients\/openapi-client-generator\/tests\/test-app\/src\/Error\/HellHound.php", + "hash": "f5ef1783a48db62a196e6bdeaf89c211" + }, + { + "name": "\/home\/wyrihaximus\/Projects\/PHPAPIClients\/openapi-client-generator\/tests\/test-app\/src\/Error\/Spider.php", + "hash": "d78cab1dbb8b3546993eb611dfd7be8b" + }, + { + "name": "\/home\/wyrihaximus\/Projects\/PHPAPIClients\/openapi-client-generator\/tests\/test-app\/src\/Error\/Bird.php", + "hash": "bb1b5a0deb945ed731c5a98abf517783" + }, + { + "name": "\/home\/wyrihaximus\/Projects\/PHPAPIClients\/openapi-client-generator\/tests\/test-app\/src\/Error\/Fish.php", + "hash": "3463524c263bfeecf9eea004a7f8fd9b" + }, + { + "name": "\/home\/wyrihaximus\/Projects\/PHPAPIClients\/openapi-client-generator\/tests\/test-app\/src\/Error\/Error.php", + "hash": "f21ae525ddc01d1774a42795978ba7e5" + }, + { + "name": "\/home\/wyrihaximus\/Projects\/PHPAPIClients\/openapi-client-generator\/tests\/test-app\/src\/Error\/Legs.php", + "hash": "1569ae1c419451d491079acc15157302" + }, + { + "name": "\/home\/wyrihaximus\/Projects\/PHPAPIClients\/openapi-client-generator\/tests\/test-app\/src\/Error\/Tails.php", + "hash": "8028144a8297c4410c1e33420544168f" + }, + { + "name": "\/home\/wyrihaximus\/Projects\/PHPAPIClients\/openapi-client-generator\/tests\/test-app\/src\/Error\/Fins.php", + "hash": "0aaf0dc0a1b4c5bb8ceee2e1d520b950" + }, + { + "name": "\/home\/wyrihaximus\/Projects\/PHPAPIClients\/openapi-client-generator\/tests\/test-app\/src\/Error\/Wings.php", + "hash": "5f2d34c62206c705df2399df69443ff6" + }, + { + "name": "\/home\/wyrihaximus\/Projects\/PHPAPIClients\/openapi-client-generator\/tests\/test-app\/src\/Error\/RedEyes.php", + "hash": "df9bc6a1aec4416767ca0cad9379057a" + }, + { + "name": "\/home\/wyrihaximus\/Projects\/PHPAPIClients\/openapi-client-generator\/tests\/test-app\/src\/Error\/GreenEyes.php", + "hash": "3bd000e905607d0c7ff2b3cf937dcb27" + }, + { + "name": "\/home\/wyrihaximus\/Projects\/PHPAPIClients\/openapi-client-generator\/tests\/test-app\/src\/Error\/YellowEyes.php", + "hash": "3acd885859fc50e438f8393db8fbd970" + }, + { + "name": "\/home\/wyrihaximus\/Projects\/PHPAPIClients\/openapi-client-generator\/tests\/test-app\/src\/Error\/BlackEyes.php", + "hash": "97d7ab2e137220b7970ce9e9a60412e4" + }, + { + "name": "\/home\/wyrihaximus\/Projects\/PHPAPIClients\/openapi-client-generator\/tests\/test-app\/src\/Error\/BlueEyes.php", + "hash": "9246bb96fd82e7a2903f8249cf61eb18" + }, + { + "name": "\/home\/wyrihaximus\/Projects\/PHPAPIClients\/openapi-client-generator\/tests\/test-app\/src\/Error\/EyeCount.php", + "hash": "d6c8745ae1cc35d05a2a1d871ca3359d" + }, + { + "name": "\/home\/wyrihaximus\/Projects\/PHPAPIClients\/openapi-client-generator\/tests\/test-app\/src\/Error\/Cat\/Features.php", + "hash": "6fd427b51bdf244d4b8677296d18d20c" + }, + { + "name": "\/home\/wyrihaximus\/Projects\/PHPAPIClients\/openapi-client-generator\/tests\/test-app\/src\/Error\/HellHound\/Eyes.php", + "hash": "5307680026308db56b5f0e918e649b9f" + }, + { + "name": "\/home\/wyrihaximus\/Projects\/PHPAPIClients\/openapi-client-generator\/tests\/test-app\/src\/Error\/Operations\/Pets\/List_\/Response\/ApplicationJson\/Ok.php", + "hash": "edce95dfb79ffa9d77d4da9fce25a941" + }, + { + "name": "\/home\/wyrihaximus\/Projects\/PHPAPIClients\/openapi-client-generator\/tests\/test-app\/src\/Error\/Pets\/Create\/Request\/ApplicationJson.php", + "hash": "884165042a3110f84faf480aeae881cd" + }, + { + "name": "\/home\/wyrihaximus\/Projects\/PHPAPIClients\/openapi-client-generator\/tests\/test-app\/src\/Error\/Operations\/Pets\/Kinds\/Walking\/Response\/ApplicationJson\/Ok.php", + "hash": "3c2d388b1a189b49b53c08e1c349ca95" + }, + { + "name": "\/home\/wyrihaximus\/Projects\/PHPAPIClients\/openapi-client-generator\/tests\/test-app\/src\/Error\/Operations\/Pets\/Grouped\/By\/Type\/Response\/ApplicationJson\/Ok.php", + "hash": "54d4f2601f6646ed15431c750ddd3810" + }, + { + "name": "\/home\/wyrihaximus\/Projects\/PHPAPIClients\/openapi-client-generator\/tests\/test-app\/src\/Error\/Operations\/Pets\/Names\/Response\/ApplicationJson\/Ok.php", + "hash": "fe5cd0b2bd77189deb351b36878550d6" + }, + { + "name": "\/home\/wyrihaximus\/Projects\/PHPAPIClients\/openapi-client-generator\/tests\/test-app\/src\/Error\/Operations\/ShowPetById\/Response\/ApplicationJson\/Ok.php", + "hash": "e58a677bee8b8fb9a5cf84b3980c8164" + }, + { + "name": "\/home\/wyrihaximus\/Projects\/PHPAPIClients\/openapi-client-generator\/tests\/test-app\/src\/Internal\/Attribute\/CastUnionToType\/Single\/Schema\/Cat\/Eyes.php", + "hash": "fe27d84b3777e11d6d5933c001b8ccdc" + }, + { + "name": "\/home\/wyrihaximus\/Projects\/PHPAPIClients\/openapi-client-generator\/tests\/test-app\/src\/Internal\/Attribute\/CastUnionToType\/Multiple\/Schema\/Cat\/Eyes.php", + "hash": "eb3c137aff06bde7fd2eaaa1b280bbe6" + }, + { + "name": "\/home\/wyrihaximus\/Projects\/PHPAPIClients\/openapi-client-generator\/tests\/test-app\/src\/Schema\/Cat.php", + "hash": "9594a3951f6128f203e8abd89e4a7009" + }, + { + "name": "\/home\/wyrihaximus\/Projects\/PHPAPIClients\/openapi-client-generator\/tests\/test-app\/src\/Internal\/Attribute\/CastUnionToType\/Single\/Schema\/Dog\/Eyes.php", + "hash": "9d98a4a16ad397f4ae8610b76053af2f" + }, + { + "name": "\/home\/wyrihaximus\/Projects\/PHPAPIClients\/openapi-client-generator\/tests\/test-app\/src\/Internal\/Attribute\/CastUnionToType\/Multiple\/Schema\/Dog\/Eyes.php", + "hash": "9e22f26b5cb0cbf97fd1cf88926a7154" + }, + { + "name": "\/home\/wyrihaximus\/Projects\/PHPAPIClients\/openapi-client-generator\/tests\/test-app\/src\/Schema\/Dog.php", + "hash": "edfb5e1fe67bae5944733a562ecb7ec3" + }, + { + "name": "\/home\/wyrihaximus\/Projects\/PHPAPIClients\/openapi-client-generator\/tests\/test-app\/src\/Schema\/HellHound.php", + "hash": "09e8390153c8c16e5e72c9fd17c95484" + }, + { + "name": "\/home\/wyrihaximus\/Projects\/PHPAPIClients\/openapi-client-generator\/tests\/test-app\/src\/Internal\/Attribute\/CastUnionToType\/Single\/Schema\/Spider\/Eyes.php", + "hash": "44c3e6d6afb5389f55ae82bf88e6342e" + }, + { + "name": "\/home\/wyrihaximus\/Projects\/PHPAPIClients\/openapi-client-generator\/tests\/test-app\/src\/Internal\/Attribute\/CastUnionToType\/Multiple\/Schema\/Spider\/Eyes.php", + "hash": "006aa38da422f09ced50e2e785dd074d" + }, + { + "name": "\/home\/wyrihaximus\/Projects\/PHPAPIClients\/openapi-client-generator\/tests\/test-app\/src\/Schema\/Spider.php", + "hash": "aea109a98901ff0d9a9284c4f39c0c26" + }, + { + "name": "\/home\/wyrihaximus\/Projects\/PHPAPIClients\/openapi-client-generator\/tests\/test-app\/src\/Internal\/Attribute\/CastUnionToType\/Single\/Schema\/Bird\/Eyes.php", + "hash": "49d89300aa522c4e659d02ad8ad2a204" + }, + { + "name": "\/home\/wyrihaximus\/Projects\/PHPAPIClients\/openapi-client-generator\/tests\/test-app\/src\/Schema\/Bird.php", + "hash": "c82e87b5e823f81c8d2d07fbe617f0c0" + }, + { + "name": "\/home\/wyrihaximus\/Projects\/PHPAPIClients\/openapi-client-generator\/tests\/test-app\/src\/Internal\/Attribute\/CastUnionToType\/Single\/Schema\/Fish\/Eyes.php", + "hash": "5c53e4cac5816017a0192ce8735956b1" + }, + { + "name": "\/home\/wyrihaximus\/Projects\/PHPAPIClients\/openapi-client-generator\/tests\/test-app\/src\/Schema\/Fish.php", + "hash": "090fb832f71e889596e459c52c4355cd" + }, + { + "name": "\/home\/wyrihaximus\/Projects\/PHPAPIClients\/openapi-client-generator\/tests\/test-app\/src\/Schema\/Error.php", + "hash": "7f2560163c07df1768f14a85cf68acc8" + }, + { + "name": "\/home\/wyrihaximus\/Projects\/PHPAPIClients\/openapi-client-generator\/tests\/test-app\/src\/Schema\/Legs.php", + "hash": "ef629db4c2a0f9e9dfa7710483219ca2" + }, + { + "name": "\/home\/wyrihaximus\/Projects\/PHPAPIClients\/openapi-client-generator\/tests\/test-app\/src\/Schema\/Tails.php", + "hash": "df8762fe4462a174c114e99bdb7a6562" + }, + { + "name": "\/home\/wyrihaximus\/Projects\/PHPAPIClients\/openapi-client-generator\/tests\/test-app\/src\/Schema\/Fins.php", + "hash": "2bab7ce5e8e5c3c8b73f249e0a84b346" + }, + { + "name": "\/home\/wyrihaximus\/Projects\/PHPAPIClients\/openapi-client-generator\/tests\/test-app\/src\/Schema\/Wings.php", + "hash": "cd1bcfcfe0243eda2002bad1ef771348" + }, + { + "name": "\/home\/wyrihaximus\/Projects\/PHPAPIClients\/openapi-client-generator\/tests\/test-app\/src\/Schema\/RedEyes.php", + "hash": "db973fbd06f9b6e8086e6ceac140eadb" + }, + { + "name": "\/home\/wyrihaximus\/Projects\/PHPAPIClients\/openapi-client-generator\/tests\/test-app\/src\/Schema\/GreenEyes.php", + "hash": "95e056110c122f75a4bc6c8e008ac71d" + }, + { + "name": "\/home\/wyrihaximus\/Projects\/PHPAPIClients\/openapi-client-generator\/tests\/test-app\/src\/Schema\/YellowEyes.php", + "hash": "23ebc1dd5c498b5a236f558efd78acdd" + }, + { + "name": "\/home\/wyrihaximus\/Projects\/PHPAPIClients\/openapi-client-generator\/tests\/test-app\/src\/Schema\/BlackEyes.php", + "hash": "d991253fe3bfce4aae265c7ecfea046f" + }, + { + "name": "\/home\/wyrihaximus\/Projects\/PHPAPIClients\/openapi-client-generator\/tests\/test-app\/src\/Schema\/BlueEyes.php", + "hash": "ff8359a892151497f3aed1eb093244c4" + }, + { + "name": "\/home\/wyrihaximus\/Projects\/PHPAPIClients\/openapi-client-generator\/tests\/test-app\/src\/Schema\/EyeCount.php", + "hash": "bbb6759380942cb7864ed15a5428b70d" + }, + { + "name": "\/home\/wyrihaximus\/Projects\/PHPAPIClients\/openapi-client-generator\/tests\/test-app\/src\/Schema\/Cat\/Features.php", + "hash": "4f0f948efe9531e85f9768f97af61b11" + }, + { + "name": "\/home\/wyrihaximus\/Projects\/PHPAPIClients\/openapi-client-generator\/tests\/test-app\/src\/Schema\/HellHound\/Eyes.php", + "hash": "65c6ab721e49cfd75317e7ca749de438" + }, + { + "name": "\/home\/wyrihaximus\/Projects\/PHPAPIClients\/openapi-client-generator\/tests\/test-app\/src\/Schema\/Operations\/Pets\/List_\/Response\/ApplicationJson\/Ok.php", + "hash": "335c24bf15fb42bdb9d6c0b74f93d559" + }, + { + "name": "\/home\/wyrihaximus\/Projects\/PHPAPIClients\/openapi-client-generator\/tests\/test-app\/src\/Schema\/Pets\/Create\/Request\/ApplicationJson.php", + "hash": "e09d7fb5e9e6c8994eaba0f4d21eb2bf" + }, + { + "name": "\/home\/wyrihaximus\/Projects\/PHPAPIClients\/openapi-client-generator\/tests\/test-app\/src\/Schema\/Operations\/Pets\/Kinds\/Walking\/Response\/ApplicationJson\/Ok.php", + "hash": "6262fad11d86d5ff14674dc00ac8ff8c" + }, + { + "name": "\/home\/wyrihaximus\/Projects\/PHPAPIClients\/openapi-client-generator\/tests\/test-app\/src\/Internal\/Attribute\/CastUnionToType\/Single\/Schema\/Operations\/Pets\/Grouped\/By\/Type\/Response\/ApplicationJson\/Ok\/Pets.php", + "hash": "b2ec410e4550f8cb2f5ddf04876f1982" + }, + { + "name": "\/home\/wyrihaximus\/Projects\/PHPAPIClients\/openapi-client-generator\/tests\/test-app\/src\/Internal\/Attribute\/CastUnionToType\/Multiple\/Schema\/Operations\/Pets\/Grouped\/By\/Type\/Response\/ApplicationJson\/Ok\/Pets.php", + "hash": "9d52606e91c9b96fdb8d9ac55c02c890" + }, + { + "name": "\/home\/wyrihaximus\/Projects\/PHPAPIClients\/openapi-client-generator\/tests\/test-app\/src\/Schema\/Operations\/Pets\/Grouped\/By\/Type\/Response\/ApplicationJson\/Ok.php", + "hash": "a190c957c8c004683db38ddc4086ddc4" + }, + { + "name": "\/home\/wyrihaximus\/Projects\/PHPAPIClients\/openapi-client-generator\/tests\/test-app\/src\/Schema\/Operations\/Pets\/Names\/Response\/ApplicationJson\/Ok.php", + "hash": "5d609d8a79fdf1c6d4d82aa18345d625" + }, + { + "name": "\/home\/wyrihaximus\/Projects\/PHPAPIClients\/openapi-client-generator\/tests\/test-app\/src\/Schema\/Operations\/ShowPetById\/Response\/ApplicationJson\/Ok.php", + "hash": "fd49dfbcd2ccbefe53bd6a0ebecd3555" + }, + { + "name": "\/home\/wyrihaximus\/Projects\/PHPAPIClients\/openapi-client-generator\/tests\/test-app\/src\/Internal\/Hydrator\/Operation\/Pets.php", + "hash": "0c061ecf1e1ceeab3ffddf43e4a5a0f4" + }, + { + "name": "\/home\/wyrihaximus\/Projects\/PHPAPIClients\/openapi-client-generator\/tests\/test-app\/src\/Internal\/Hydrator\/Operation\/Pets\/Gatos.php", + "hash": "2f7648546e0d243741265728476ba08e" + }, + { + "name": "\/home\/wyrihaximus\/Projects\/PHPAPIClients\/openapi-client-generator\/tests\/test-app\/src\/Internal\/Hydrator\/Operation\/Pets\/Kinds\/Walking.php", + "hash": "a67a1a58da00a984049c01c2672faa57" + }, + { + "name": "\/home\/wyrihaximus\/Projects\/PHPAPIClients\/openapi-client-generator\/tests\/test-app\/src\/Internal\/Hydrator\/Operation\/Pets\/GroupedByType.php", + "hash": "362558281211bab266ee7c7e93d5bc1b" + }, + { + "name": "\/home\/wyrihaximus\/Projects\/PHPAPIClients\/openapi-client-generator\/tests\/test-app\/src\/Internal\/Hydrator\/Operation\/Pets\/Names.php", + "hash": "5f59670b97735964a834b39416a9d3e9" + }, + { + "name": "\/home\/wyrihaximus\/Projects\/PHPAPIClients\/openapi-client-generator\/tests\/test-app\/src\/Internal\/Hydrator\/Operation\/Pets\/Petid.php", + "hash": "5c6f2b3757a2c419ffe41fd4b1f02adb" + }, + { + "name": "\/home\/wyrihaximus\/Projects\/PHPAPIClients\/openapi-client-generator\/tests\/test-app\/src\/Internal\/Hydrators.php", + "hash": "a7614b77b839bd181a29d5dd0b50ffbb" + }, + { + "name": "\/home\/wyrihaximus\/Projects\/PHPAPIClients\/openapi-client-generator\/tests\/test-app\/Makefile", + "hash": "9f5392c2286b0d7c55613dc69f23f2c8" + }, + { + "name": "\/home\/wyrihaximus\/Projects\/PHPAPIClients\/openapi-client-generator\/tests\/test-app\/composer.json", + "hash": "231d105287cd1ef41859e6f4ebac4c58" + }, + { + "name": "\/home\/wyrihaximus\/Projects\/PHPAPIClients\/openapi-client-generator\/tests\/test-app\/src\/Internal\/Operation\/Pets\/List_.php", + "hash": "1c30c9ae8854565ab7ba5b89f07ac444" + }, + { + "name": "\/home\/wyrihaximus\/Projects\/PHPAPIClients\/openapi-client-generator\/tests\/test-app\/src\/Internal\/Operator\/Pets\/List_.php", + "hash": "dbf505c1eaabd2e241ce7290b360223a" + }, + { + "name": "\/home\/wyrihaximus\/Projects\/PHPAPIClients\/openapi-client-generator\/tests\/test-app\/tests\/Internal\/Operation\/Pets\/List_Test.php", + "hash": "5e36e4d396b54d93ac00313bb0866286" + }, + { + "name": "\/home\/wyrihaximus\/Projects\/PHPAPIClients\/openapi-client-generator\/tests\/test-app\/src\/Internal\/Operation\/Pets\/Create.php", + "hash": "6001575535e2c88fbcf73f32de5115c1" + }, + { + "name": "\/home\/wyrihaximus\/Projects\/PHPAPIClients\/openapi-client-generator\/tests\/test-app\/src\/Internal\/Operator\/Pets\/Create.php", + "hash": "b769bac719b96acc2a0775ea08a9f9f1" + }, + { + "name": "\/home\/wyrihaximus\/Projects\/PHPAPIClients\/openapi-client-generator\/tests\/test-app\/tests\/Internal\/Operation\/Pets\/CreateTest.php", + "hash": "3f742285a589a4f5de66d4c8a394dea9" + }, + { + "name": "\/home\/wyrihaximus\/Projects\/PHPAPIClients\/openapi-client-generator\/tests\/test-app\/src\/Internal\/Operation\/Pets\/List_\/Gatos.php", + "hash": "84c387e907b1f4c660d4f54bde9dafc3" + }, + { + "name": "\/home\/wyrihaximus\/Projects\/PHPAPIClients\/openapi-client-generator\/tests\/test-app\/src\/Internal\/Operator\/Pets\/List_\/Gatos.php", + "hash": "5d2649e350abb377d050db620ecd8aeb" + }, + { + "name": "\/home\/wyrihaximus\/Projects\/PHPAPIClients\/openapi-client-generator\/tests\/test-app\/tests\/Internal\/Operation\/Pets\/List_\/GatosTest.php", + "hash": "e9cbf0d85c9f6a79712454f55b82b66c" + }, + { + "name": "\/home\/wyrihaximus\/Projects\/PHPAPIClients\/openapi-client-generator\/tests\/test-app\/src\/Internal\/Operation\/Pets\/Kinds\/Walking.php", + "hash": "0b39dde8f1367c94fea361827c12bdaf" + }, + { + "name": "\/home\/wyrihaximus\/Projects\/PHPAPIClients\/openapi-client-generator\/tests\/test-app\/src\/Internal\/Operator\/Pets\/Kinds\/Walking.php", + "hash": "2f57ee66e76b3b944b91155bc7fcc012" + }, + { + "name": "\/home\/wyrihaximus\/Projects\/PHPAPIClients\/openapi-client-generator\/tests\/test-app\/tests\/Internal\/Operation\/Pets\/Kinds\/WalkingTest.php", + "hash": "51eb03044c96c457edae31e2202caadd" + }, + { + "name": "\/home\/wyrihaximus\/Projects\/PHPAPIClients\/openapi-client-generator\/tests\/test-app\/src\/Internal\/Operation\/Pets\/Grouped\/By\/Type.php", + "hash": "3811899268f0669485bd8e6ddedc1983" + }, + { + "name": "\/home\/wyrihaximus\/Projects\/PHPAPIClients\/openapi-client-generator\/tests\/test-app\/src\/Internal\/Operator\/Pets\/Grouped\/By\/Type.php", + "hash": "b37b6416aa52872a6ea521d4791470b9" + }, + { + "name": "\/home\/wyrihaximus\/Projects\/PHPAPIClients\/openapi-client-generator\/tests\/test-app\/tests\/Internal\/Operation\/Pets\/Grouped\/By\/TypeTest.php", + "hash": "a42bd4a4fa73ddb4a7784bdeb67a696c" + }, + { + "name": "\/home\/wyrihaximus\/Projects\/PHPAPIClients\/openapi-client-generator\/tests\/test-app\/src\/Internal\/Operation\/Pets\/Names.php", + "hash": "b94e1cc3bcf16f2a70ef42780302670c" + }, + { + "name": "\/home\/wyrihaximus\/Projects\/PHPAPIClients\/openapi-client-generator\/tests\/test-app\/src\/Internal\/Operator\/Pets\/Names.php", + "hash": "a9f78a5fc7c20ce480ba542731cbfdb0" + }, + { + "name": "\/home\/wyrihaximus\/Projects\/PHPAPIClients\/openapi-client-generator\/tests\/test-app\/tests\/Internal\/Operation\/Pets\/NamesTest.php", + "hash": "34f5268220b35eaab233a5f2f3755045" + }, + { + "name": "\/home\/wyrihaximus\/Projects\/PHPAPIClients\/openapi-client-generator\/tests\/test-app\/src\/Internal\/Operation\/ShowPetById.php", + "hash": "9c350323e58f8f61e747d72daf75a9b5" + }, + { + "name": "\/home\/wyrihaximus\/Projects\/PHPAPIClients\/openapi-client-generator\/tests\/test-app\/src\/Internal\/Operator\/ShowPetById.php", + "hash": "d78be43280b54855921366149e52717c" + }, + { + "name": "\/home\/wyrihaximus\/Projects\/PHPAPIClients\/openapi-client-generator\/tests\/test-app\/tests\/Internal\/Operation\/ShowPetByIdTest.php", + "hash": "794794a6da6b8588f75da876f1df6c5c" + }, + { + "name": "\/home\/wyrihaximus\/Projects\/PHPAPIClients\/openapi-client-generator\/tests\/test-app\/src\/OperationsInterface.php", + "hash": "8d90aa322d2d1589f1303476ad5f65c7" + }, + { + "name": "\/home\/wyrihaximus\/Projects\/PHPAPIClients\/openapi-client-generator\/tests\/test-app\/src\/Operation\/Pets.php", + "hash": "1e8e5d799e5983a9a8085500f61baba6" + }, + { + "name": "\/home\/wyrihaximus\/Projects\/PHPAPIClients\/openapi-client-generator\/tests\/test-app\/src\/Operation\/PetsList.php", + "hash": "f6b8e2828be552d8f7e76f4beb5bcbaf" + }, + { + "name": "\/home\/wyrihaximus\/Projects\/PHPAPIClients\/openapi-client-generator\/tests\/test-app\/src\/Operation\/PetsKinds.php", + "hash": "601ed564f2cc8b9b71544b2c2faf9d5d" + }, + { + "name": "\/home\/wyrihaximus\/Projects\/PHPAPIClients\/openapi-client-generator\/tests\/test-app\/src\/Operation\/PetsGroupedBy.php", + "hash": "90536e5fa6d172ffebdc5c5a0a4b6cd2" + }, + { + "name": "\/home\/wyrihaximus\/Projects\/PHPAPIClients\/openapi-client-generator\/tests\/test-app\/src\/Operations.php", + "hash": "5580ac87a9b3832776d2647c86d0afab" + }, + { + "name": "\/home\/wyrihaximus\/Projects\/PHPAPIClients\/openapi-client-generator\/tests\/test-app\/src\/Internal\/Operators.php", + "hash": "874c6c460e103c55a5161a53be69c485" + }, + { + "name": "\/home\/wyrihaximus\/Projects\/PHPAPIClients\/openapi-client-generator\/tests\/test-app\/src\/ClientInterface.php", + "hash": "f581126e4e40e163c7b24a4e45100448" + }, + { + "name": "\/home\/wyrihaximus\/Projects\/PHPAPIClients\/openapi-client-generator\/tests\/test-app\/src\/Client.php", + "hash": "0e9efd908fb734e46451b87c3e99678a" + }, + { + "name": "\/home\/wyrihaximus\/Projects\/PHPAPIClients\/openapi-client-generator\/tests\/test-app\/src\/Internal\/Router\/Get\/Pets.php", + "hash": "704e5dc2ea685f9b283aef505c9ddc92" + }, + { + "name": "\/home\/wyrihaximus\/Projects\/PHPAPIClients\/openapi-client-generator\/tests\/test-app\/src\/Internal\/Router\/Get\/PetsList.php", + "hash": "388b6a8044c2e4a473329221a4063e56" + }, + { + "name": "\/home\/wyrihaximus\/Projects\/PHPAPIClients\/openapi-client-generator\/tests\/test-app\/src\/Internal\/Router\/Get\/PetsGroupedBy.php", + "hash": "bdbf4227af05e7b96e1092fb080985aa" + }, + { + "name": "\/home\/wyrihaximus\/Projects\/PHPAPIClients\/openapi-client-generator\/tests\/test-app\/src\/Internal\/Router\/Get.php", + "hash": "7deddea8e053abdd2c5a5fd235af9486" + }, + { + "name": "\/home\/wyrihaximus\/Projects\/PHPAPIClients\/openapi-client-generator\/tests\/test-app\/src\/Internal\/Router\/Get\/PetsKinds.php", + "hash": "86250409c86136e771cb8896090f5f75" + }, + { + "name": "\/home\/wyrihaximus\/Projects\/PHPAPIClients\/openapi-client-generator\/tests\/test-app\/src\/Internal\/Router\/Post\/Pets.php", + "hash": "c1d6e82be1200cba60db36906053652e" + }, + { + "name": "\/home\/wyrihaximus\/Projects\/PHPAPIClients\/openapi-client-generator\/tests\/test-app\/src\/Internal\/Routers.php", + "hash": "8a4cae9b959bc19107261cee4b659d26" + }, + { + "name": "\/home\/wyrihaximus\/Projects\/PHPAPIClients\/openapi-client-generator\/tests\/test-app\/src\/Internal\/Router\/Get\/Two.php", + "hash": "ff80b7f61d59fc0a035d708c19ac9afb" + }, + { + "name": "\/home\/wyrihaximus\/Projects\/PHPAPIClients\/openapi-client-generator\/tests\/test-app\/src\/Internal\/Router\/Get\/Three.php", + "hash": "79bb09a47361b547ad8a8dc5e7c2f3f1" + }, + { + "name": "\/home\/wyrihaximus\/Projects\/PHPAPIClients\/openapi-client-generator\/tests\/test-app\/src\/Internal\/Router\/Get\/Four.php", + "hash": "692172076dfa2654286429fa45260256" + }, + { + "name": "\/home\/wyrihaximus\/Projects\/PHPAPIClients\/openapi-client-generator\/tests\/test-app\/src\/Internal\/Router\/Post\/Two.php", + "hash": "abf5c85dd48a567ee4d2a1ae4098b5bb" + }, + { + "name": "\/home\/wyrihaximus\/Projects\/PHPAPIClients\/openapi-client-generator\/tests\/test-app\/src\/PHPStan\/ClientCallReturnTypes.php", + "hash": "47b7f421a53030bfb30e014202736b8f" + }, + { + "name": "\/home\/wyrihaximus\/Projects\/PHPAPIClients\/openapi-client-generator\/tests\/test-app\/tests\/Types\/ClientCallReturnTypes.php", + "hash": "6fb44a0ad7181025fce078feea6c8776" + }, + { + "name": "\/home\/wyrihaximus\/Projects\/PHPAPIClients\/openapi-client-generator\/tests\/test-app\/etc\/phpstan-extension.neon", + "hash": "3d7b9f10231d14a80329ca810f476b3d" + } + ] + }, + "additionalFiles": { + "files": [ + { + "name": "composer.json", + "hash": "ec142d9420b7440bf47fe93541ef0155899fc599323ca506a96617b0d66acf0ae4640d7cf4f9dac1bb7860b884913fbba7776bcc75304bdcf2c603671c6fde64" + }, + { + "name": "composer.lock", + "hash": "" + } + ] + } +} diff --git a/tests/app/etc/phpstan-extension.neon b/tests/app/app/etc/phpstan-extension.neon similarity index 99% rename from tests/app/etc/phpstan-extension.neon rename to tests/app/app/etc/phpstan-extension.neon index 2045a81..424d1ea 100644 --- a/tests/app/etc/phpstan-extension.neon +++ b/tests/app/app/etc/phpstan-extension.neon @@ -3,3 +3,4 @@ services: tags: - phpstan.broker.dynamicMethodReturnTypeExtension + diff --git a/tests/app/app/src/Schema/Bird.php.php b/tests/app/app/src/Schema/Bird.php.php new file mode 100644 index 0000000..205abd9 --- /dev/null +++ b/tests/app/app/src/Schema/Bird.php.php @@ -0,0 +1,163 @@ + $pets + */ + public function __construct( + #[\ApiClients\Client\PetStore\Internal\Attribute\CastUnionToType\Multiple\Schema\Operations\Pets\Grouped\By\Type\Response\ApplicationJson\Ok\Pets] + public array $pets + ) + { + } +} + diff --git a/tests/app/app/src/Schema/Operations/Pets/Kinds/Walking/Response/ApplicationJson/Ok.php.php b/tests/app/app/src/Schema/Operations/Pets/Kinds/Walking/Response/ApplicationJson/Ok.php.php new file mode 100644 index 0000000..7afe34f --- /dev/null +++ b/tests/app/app/src/Schema/Operations/Pets/Kinds/Walking/Response/ApplicationJson/Ok.php.php @@ -0,0 +1,360 @@ + $eyes + */ + public function __construct( + public string $id, + public string $name, + public array $legs, + #[\ApiClients\Client\PetStore\Internal\Attribute\CastUnionToType\Multiple\Schema\Spider\Eyes] + public array $eyes + ) + { + } +} + diff --git a/tests/app/app/src/Schema/Tails.php.php b/tests/app/app/src/Schema/Tails.php.php new file mode 100644 index 0000000..18f104e --- /dev/null +++ b/tests/app/app/src/Schema/Tails.php.php @@ -0,0 +1,28 @@ + 'application/json'], json_encode(json_decode(\ApiClients\Client\PetStore\Schema\Error::SCHEMA_EXAMPLE_DATA, true))); + $auth = $this->prophesize(\ApiClients\Contracts\HTTP\Headers\AuthenticationInterface::class); + $auth->authHeader(Prophecy\Argument::any())->willReturn('Bearer beer')->shouldBeCalled(); + $browser = $this->prophesize(\React\Http\Browser::class); + $browser->withBase(Prophecy\Argument::any())->willReturn($browser->reveal()); + $browser->withFollowRedirects(Prophecy\Argument::any())->willReturn($browser->reveal()); + $browser->request('POST', '/pets', Prophecy\Argument::type('array'), json_encode(json_decode(\ApiClients\Client\PetStore\Schema\Pets\Create\Request\ApplicationJson::SCHEMA_EXAMPLE_DATA, true)))->willReturn(\React\Promise\resolve($response))->shouldBeCalled(); + $client = new \ApiClients\Client\PetStore\Client($auth->reveal(), $browser->reveal()); + $result = $client->call(\ApiClients\Client\PetStore\Internal\Operation\Pets\Create::OPERATION_MATCH, (static fn(array $data): array => $data)(json_decode(\ApiClients\Client\PetStore\Schema\Pets\Create\Request\ApplicationJson::SCHEMA_EXAMPLE_DATA, true))); + } + #[\PHPUnit\Framework\Attributes\Test] + public function operations_httpCode_default_requestContentType_application_json_responseContentType_application_json_zero(): void + { + $response = new \React\Http\Message\Response(999, ['Content-Type' => 'application/json'], json_encode(json_decode(\ApiClients\Client\PetStore\Schema\Error::SCHEMA_EXAMPLE_DATA, true))); + $auth = $this->prophesize(\ApiClients\Contracts\HTTP\Headers\AuthenticationInterface::class); + $auth->authHeader(Prophecy\Argument::any())->willReturn('Bearer beer')->shouldBeCalled(); + $browser = $this->prophesize(\React\Http\Browser::class); + $browser->withBase(Prophecy\Argument::any())->willReturn($browser->reveal()); + $browser->withFollowRedirects(Prophecy\Argument::any())->willReturn($browser->reveal()); + $browser->request('POST', '/pets', Prophecy\Argument::type('array'), json_encode(json_decode(\ApiClients\Client\PetStore\Schema\Pets\Create\Request\ApplicationJson::SCHEMA_EXAMPLE_DATA, true)))->willReturn(\React\Promise\resolve($response))->shouldBeCalled(); + $client = new \ApiClients\Client\PetStore\Client($auth->reveal(), $browser->reveal()); + $result = $client->operations()->pets()->create(json_decode(\ApiClients\Client\PetStore\Schema\Pets\Create\Request\ApplicationJson::SCHEMA_EXAMPLE_DATA, true)); + } + #[\PHPUnit\Framework\Attributes\Test] + public function call_httpCode_201_requestContentType_application_json_empty(): void + { + $response = new \React\Http\Message\Response(201, []); + $auth = $this->prophesize(\ApiClients\Contracts\HTTP\Headers\AuthenticationInterface::class); + $auth->authHeader(Prophecy\Argument::any())->willReturn('Bearer beer')->shouldBeCalled(); + $browser = $this->prophesize(\React\Http\Browser::class); + $browser->withBase(Prophecy\Argument::any())->willReturn($browser->reveal()); + $browser->withFollowRedirects(Prophecy\Argument::any())->willReturn($browser->reveal()); + $browser->request('POST', '/pets', Prophecy\Argument::type('array'), json_encode(json_decode(\ApiClients\Client\PetStore\Schema\Pets\Create\Request\ApplicationJson::SCHEMA_EXAMPLE_DATA, true)))->willReturn(\React\Promise\resolve($response))->shouldBeCalled(); + $client = new \ApiClients\Client\PetStore\Client($auth->reveal(), $browser->reveal()); + $result = $client->call(\ApiClients\Client\PetStore\Internal\Operation\Pets\Create::OPERATION_MATCH, (static fn(array $data): array => $data)(json_decode(\ApiClients\Client\PetStore\Schema\Pets\Create\Request\ApplicationJson::SCHEMA_EXAMPLE_DATA, true))); + } + #[\PHPUnit\Framework\Attributes\Test] + public function operations_httpCode_201_requestContentType_application_json_empty(): void + { + $response = new \React\Http\Message\Response(201, []); + $auth = $this->prophesize(\ApiClients\Contracts\HTTP\Headers\AuthenticationInterface::class); + $auth->authHeader(Prophecy\Argument::any())->willReturn('Bearer beer')->shouldBeCalled(); + $browser = $this->prophesize(\React\Http\Browser::class); + $browser->withBase(Prophecy\Argument::any())->willReturn($browser->reveal()); + $browser->withFollowRedirects(Prophecy\Argument::any())->willReturn($browser->reveal()); + $browser->request('POST', '/pets', Prophecy\Argument::type('array'), json_encode(json_decode(\ApiClients\Client\PetStore\Schema\Pets\Create\Request\ApplicationJson::SCHEMA_EXAMPLE_DATA, true)))->willReturn(\React\Promise\resolve($response))->shouldBeCalled(); + $client = new \ApiClients\Client\PetStore\Client($auth->reveal(), $browser->reveal()); + $result = $client->operations()->pets()->create(json_decode(\ApiClients\Client\PetStore\Schema\Pets\Create\Request\ApplicationJson::SCHEMA_EXAMPLE_DATA, true)); + self::assertArrayHasKey('code', $result); + self::assertSame(201, $result['code']); + } +} + diff --git a/tests/app/app/tests/Internal/Operation/Pets/Grouped/By/TypeTest.php.php b/tests/app/app/tests/Internal/Operation/Pets/Grouped/By/TypeTest.php.php new file mode 100644 index 0000000..a4d8523 --- /dev/null +++ b/tests/app/app/tests/Internal/Operation/Pets/Grouped/By/TypeTest.php.php @@ -0,0 +1,70 @@ + 'application/json'], json_encode(json_decode(\ApiClients\Client\PetStore\Schema\Operations\Pets\Grouped\By\Type\Response\ApplicationJson\Ok::SCHEMA_EXAMPLE_DATA, true))); + $auth = $this->prophesize(\ApiClients\Contracts\HTTP\Headers\AuthenticationInterface::class); + $auth->authHeader(Prophecy\Argument::any())->willReturn('Bearer beer')->shouldBeCalled(); + $browser = $this->prophesize(\React\Http\Browser::class); + $browser->withBase(Prophecy\Argument::any())->willReturn($browser->reveal()); + $browser->withFollowRedirects(Prophecy\Argument::any())->willReturn($browser->reveal()); + $browser->request('GET', '/pets/groupedByType?page=1&per_page=8', Prophecy\Argument::type('array'), Prophecy\Argument::any())->willReturn(\React\Promise\resolve($response))->shouldBeCalled(); + $client = new \ApiClients\Client\PetStore\Client($auth->reveal(), $browser->reveal()); + $result = $client->call(\ApiClients\Client\PetStore\Internal\Operation\Pets\Grouped\By\Type::OPERATION_MATCH, (static function (array $data): array { + $data['per_page'] = 8; + $data['page'] = 1; + return $data; + })([])); + } + #[\PHPUnit\Framework\Attributes\Test] + public function operations_httpCode_200_responseContentType_application_json_zero(): void + { + $response = new \React\Http\Message\Response(200, ['Content-Type' => 'application/json'], json_encode(json_decode(\ApiClients\Client\PetStore\Schema\Operations\Pets\Grouped\By\Type\Response\ApplicationJson\Ok::SCHEMA_EXAMPLE_DATA, true))); + $auth = $this->prophesize(\ApiClients\Contracts\HTTP\Headers\AuthenticationInterface::class); + $auth->authHeader(Prophecy\Argument::any())->willReturn('Bearer beer')->shouldBeCalled(); + $browser = $this->prophesize(\React\Http\Browser::class); + $browser->withBase(Prophecy\Argument::any())->willReturn($browser->reveal()); + $browser->withFollowRedirects(Prophecy\Argument::any())->willReturn($browser->reveal()); + $browser->request('GET', '/pets/groupedByType?page=1&per_page=8', Prophecy\Argument::type('array'), Prophecy\Argument::any())->willReturn(\React\Promise\resolve($response))->shouldBeCalled(); + $client = new \ApiClients\Client\PetStore\Client($auth->reveal(), $browser->reveal()); + $result = $client->operations()->petsGroupedBy()->type(8, 1); + } + #[\PHPUnit\Framework\Attributes\Test] + public function call_httpCode_default_responseContentType_application_json_zero(): void + { + $response = new \React\Http\Message\Response(999, ['Content-Type' => 'application/json'], json_encode(json_decode(\ApiClients\Client\PetStore\Schema\Error::SCHEMA_EXAMPLE_DATA, true))); + $auth = $this->prophesize(\ApiClients\Contracts\HTTP\Headers\AuthenticationInterface::class); + $auth->authHeader(Prophecy\Argument::any())->willReturn('Bearer beer')->shouldBeCalled(); + $browser = $this->prophesize(\React\Http\Browser::class); + $browser->withBase(Prophecy\Argument::any())->willReturn($browser->reveal()); + $browser->withFollowRedirects(Prophecy\Argument::any())->willReturn($browser->reveal()); + $browser->request('GET', '/pets/groupedByType?page=1&per_page=8', Prophecy\Argument::type('array'), Prophecy\Argument::any())->willReturn(\React\Promise\resolve($response))->shouldBeCalled(); + $client = new \ApiClients\Client\PetStore\Client($auth->reveal(), $browser->reveal()); + $result = $client->call(\ApiClients\Client\PetStore\Internal\Operation\Pets\Grouped\By\Type::OPERATION_MATCH, (static function (array $data): array { + $data['per_page'] = 8; + $data['page'] = 1; + return $data; + })([])); + } + #[\PHPUnit\Framework\Attributes\Test] + public function operations_httpCode_default_responseContentType_application_json_zero(): void + { + $response = new \React\Http\Message\Response(999, ['Content-Type' => 'application/json'], json_encode(json_decode(\ApiClients\Client\PetStore\Schema\Error::SCHEMA_EXAMPLE_DATA, true))); + $auth = $this->prophesize(\ApiClients\Contracts\HTTP\Headers\AuthenticationInterface::class); + $auth->authHeader(Prophecy\Argument::any())->willReturn('Bearer beer')->shouldBeCalled(); + $browser = $this->prophesize(\React\Http\Browser::class); + $browser->withBase(Prophecy\Argument::any())->willReturn($browser->reveal()); + $browser->withFollowRedirects(Prophecy\Argument::any())->willReturn($browser->reveal()); + $browser->request('GET', '/pets/groupedByType?page=1&per_page=8', Prophecy\Argument::type('array'), Prophecy\Argument::any())->willReturn(\React\Promise\resolve($response))->shouldBeCalled(); + $client = new \ApiClients\Client\PetStore\Client($auth->reveal(), $browser->reveal()); + $result = $client->operations()->petsGroupedBy()->type(8, 1); + } +} + diff --git a/tests/app/app/tests/Internal/Operation/Pets/Kinds/WalkingTest.php.php b/tests/app/app/tests/Internal/Operation/Pets/Kinds/WalkingTest.php.php new file mode 100644 index 0000000..3b1abb0 --- /dev/null +++ b/tests/app/app/tests/Internal/Operation/Pets/Kinds/WalkingTest.php.php @@ -0,0 +1,100 @@ + 'application/json'], \json_decode('[]', false)); + $auth = $this->prophesize(\ApiClients\Contracts\HTTP\Headers\AuthenticationInterface::class); + $auth->authHeader(Prophecy\Argument::any())->willReturn('Bearer beer')->shouldBeCalled(); + $browser = $this->prophesize(\React\Http\Browser::class); + $browser->withBase(Prophecy\Argument::any())->willReturn($browser->reveal()); + $browser->withFollowRedirects(Prophecy\Argument::any())->willReturn($browser->reveal()); + $browser->request('GET', '/pets/kinds/walking?page=1&per_page=8', Prophecy\Argument::type('array'), Prophecy\Argument::any())->willReturn(\React\Promise\resolve($response))->shouldBeCalled(); + $client = new \ApiClients\Client\PetStore\Client($auth->reveal(), $browser->reveal()); + $result = $client->call(\ApiClients\Client\PetStore\Internal\Operation\Pets\Kinds\Walking::OPERATION_MATCH, (static function (array $data): array { + $data['per_page'] = 8; + $data['page'] = 1; + return $data; + })([])); + } + #[\PHPUnit\Framework\Attributes\Test] + public function operations_httpCode_200_responseContentType_application_json_zero(): void + { + $response = new \React\Http\Message\Response(200, ['Content-Type' => 'application/json'], \json_decode('[]', false)); + $auth = $this->prophesize(\ApiClients\Contracts\HTTP\Headers\AuthenticationInterface::class); + $auth->authHeader(Prophecy\Argument::any())->willReturn('Bearer beer')->shouldBeCalled(); + $browser = $this->prophesize(\React\Http\Browser::class); + $browser->withBase(Prophecy\Argument::any())->willReturn($browser->reveal()); + $browser->withFollowRedirects(Prophecy\Argument::any())->willReturn($browser->reveal()); + $browser->request('GET', '/pets/kinds/walking?page=1&per_page=8', Prophecy\Argument::type('array'), Prophecy\Argument::any())->willReturn(\React\Promise\resolve($response))->shouldBeCalled(); + $client = new \ApiClients\Client\PetStore\Client($auth->reveal(), $browser->reveal()); + $result = $client->operations()->petsKinds()->walking(8, 1); + } + #[\PHPUnit\Framework\Attributes\Test] + public function call_httpCode_200_responseContentType_application_json_one(): void + { + $response = new \React\Http\Message\Response(200, ['Content-Type' => 'application/json'], \json_decode('[]', false)); + $auth = $this->prophesize(\ApiClients\Contracts\HTTP\Headers\AuthenticationInterface::class); + $auth->authHeader(Prophecy\Argument::any())->willReturn('Bearer beer')->shouldBeCalled(); + $browser = $this->prophesize(\React\Http\Browser::class); + $browser->withBase(Prophecy\Argument::any())->willReturn($browser->reveal()); + $browser->withFollowRedirects(Prophecy\Argument::any())->willReturn($browser->reveal()); + $browser->request('GET', '/pets/kinds/walking?page=1&per_page=8', Prophecy\Argument::type('array'), Prophecy\Argument::any())->willReturn(\React\Promise\resolve($response))->shouldBeCalled(); + $client = new \ApiClients\Client\PetStore\Client($auth->reveal(), $browser->reveal()); + $result = $client->call(\ApiClients\Client\PetStore\Internal\Operation\Pets\Kinds\Walking::OPERATION_MATCH, (static function (array $data): array { + $data['per_page'] = 8; + $data['page'] = 1; + return $data; + })([])); + } + #[\PHPUnit\Framework\Attributes\Test] + public function operations_httpCode_200_responseContentType_application_json_one(): void + { + $response = new \React\Http\Message\Response(200, ['Content-Type' => 'application/json'], \json_decode('[]', false)); + $auth = $this->prophesize(\ApiClients\Contracts\HTTP\Headers\AuthenticationInterface::class); + $auth->authHeader(Prophecy\Argument::any())->willReturn('Bearer beer')->shouldBeCalled(); + $browser = $this->prophesize(\React\Http\Browser::class); + $browser->withBase(Prophecy\Argument::any())->willReturn($browser->reveal()); + $browser->withFollowRedirects(Prophecy\Argument::any())->willReturn($browser->reveal()); + $browser->request('GET', '/pets/kinds/walking?page=1&per_page=8', Prophecy\Argument::type('array'), Prophecy\Argument::any())->willReturn(\React\Promise\resolve($response))->shouldBeCalled(); + $client = new \ApiClients\Client\PetStore\Client($auth->reveal(), $browser->reveal()); + $result = $client->operations()->petsKinds()->walking(8, 1); + } + #[\PHPUnit\Framework\Attributes\Test] + public function call_httpCode_default_responseContentType_application_json_zero(): void + { + $response = new \React\Http\Message\Response(999, ['Content-Type' => 'application/json'], json_encode(json_decode(\ApiClients\Client\PetStore\Schema\Error::SCHEMA_EXAMPLE_DATA, true))); + $auth = $this->prophesize(\ApiClients\Contracts\HTTP\Headers\AuthenticationInterface::class); + $auth->authHeader(Prophecy\Argument::any())->willReturn('Bearer beer')->shouldBeCalled(); + $browser = $this->prophesize(\React\Http\Browser::class); + $browser->withBase(Prophecy\Argument::any())->willReturn($browser->reveal()); + $browser->withFollowRedirects(Prophecy\Argument::any())->willReturn($browser->reveal()); + $browser->request('GET', '/pets/kinds/walking?page=1&per_page=8', Prophecy\Argument::type('array'), Prophecy\Argument::any())->willReturn(\React\Promise\resolve($response))->shouldBeCalled(); + $client = new \ApiClients\Client\PetStore\Client($auth->reveal(), $browser->reveal()); + $result = $client->call(\ApiClients\Client\PetStore\Internal\Operation\Pets\Kinds\Walking::OPERATION_MATCH, (static function (array $data): array { + $data['per_page'] = 8; + $data['page'] = 1; + return $data; + })([])); + } + #[\PHPUnit\Framework\Attributes\Test] + public function operations_httpCode_default_responseContentType_application_json_zero(): void + { + $response = new \React\Http\Message\Response(999, ['Content-Type' => 'application/json'], json_encode(json_decode(\ApiClients\Client\PetStore\Schema\Error::SCHEMA_EXAMPLE_DATA, true))); + $auth = $this->prophesize(\ApiClients\Contracts\HTTP\Headers\AuthenticationInterface::class); + $auth->authHeader(Prophecy\Argument::any())->willReturn('Bearer beer')->shouldBeCalled(); + $browser = $this->prophesize(\React\Http\Browser::class); + $browser->withBase(Prophecy\Argument::any())->willReturn($browser->reveal()); + $browser->withFollowRedirects(Prophecy\Argument::any())->willReturn($browser->reveal()); + $browser->request('GET', '/pets/kinds/walking?page=1&per_page=8', Prophecy\Argument::type('array'), Prophecy\Argument::any())->willReturn(\React\Promise\resolve($response))->shouldBeCalled(); + $client = new \ApiClients\Client\PetStore\Client($auth->reveal(), $browser->reveal()); + $result = $client->operations()->petsKinds()->walking(8, 1); + } +} + diff --git a/tests/app/app/tests/Internal/Operation/Pets/List_/GatosTest.php.php b/tests/app/app/tests/Internal/Operation/Pets/List_/GatosTest.php.php new file mode 100644 index 0000000..9f75054 --- /dev/null +++ b/tests/app/app/tests/Internal/Operation/Pets/List_/GatosTest.php.php @@ -0,0 +1,100 @@ + 'application/json'], \json_decode('[]', false)); + $auth = $this->prophesize(\ApiClients\Contracts\HTTP\Headers\AuthenticationInterface::class); + $auth->authHeader(Prophecy\Argument::any())->willReturn('Bearer beer')->shouldBeCalled(); + $browser = $this->prophesize(\React\Http\Browser::class); + $browser->withBase(Prophecy\Argument::any())->willReturn($browser->reveal()); + $browser->withFollowRedirects(Prophecy\Argument::any())->willReturn($browser->reveal()); + $browser->request('GET', '/pets/gatos?page=1&per_page=8', Prophecy\Argument::type('array'), Prophecy\Argument::any())->willReturn(\React\Promise\resolve($response))->shouldBeCalled(); + $client = new \ApiClients\Client\PetStore\Client($auth->reveal(), $browser->reveal()); + $result = $client->call(\ApiClients\Client\PetStore\Internal\Operation\Pets\List_\Gatos::OPERATION_MATCH, (static function (array $data): array { + $data['per_page'] = 8; + $data['page'] = 1; + return $data; + })([])); + } + #[\PHPUnit\Framework\Attributes\Test] + public function operations_httpCode_200_responseContentType_application_json_zero(): void + { + $response = new \React\Http\Message\Response(200, ['Content-Type' => 'application/json'], \json_decode('[]', false)); + $auth = $this->prophesize(\ApiClients\Contracts\HTTP\Headers\AuthenticationInterface::class); + $auth->authHeader(Prophecy\Argument::any())->willReturn('Bearer beer')->shouldBeCalled(); + $browser = $this->prophesize(\React\Http\Browser::class); + $browser->withBase(Prophecy\Argument::any())->willReturn($browser->reveal()); + $browser->withFollowRedirects(Prophecy\Argument::any())->willReturn($browser->reveal()); + $browser->request('GET', '/pets/gatos?page=1&per_page=8', Prophecy\Argument::type('array'), Prophecy\Argument::any())->willReturn(\React\Promise\resolve($response))->shouldBeCalled(); + $client = new \ApiClients\Client\PetStore\Client($auth->reveal(), $browser->reveal()); + $result = $client->operations()->petsList()->gatos(8, 1); + } + #[\PHPUnit\Framework\Attributes\Test] + public function call_httpCode_200_responseContentType_application_json_one(): void + { + $response = new \React\Http\Message\Response(200, ['Content-Type' => 'application/json'], \json_decode('[]', false)); + $auth = $this->prophesize(\ApiClients\Contracts\HTTP\Headers\AuthenticationInterface::class); + $auth->authHeader(Prophecy\Argument::any())->willReturn('Bearer beer')->shouldBeCalled(); + $browser = $this->prophesize(\React\Http\Browser::class); + $browser->withBase(Prophecy\Argument::any())->willReturn($browser->reveal()); + $browser->withFollowRedirects(Prophecy\Argument::any())->willReturn($browser->reveal()); + $browser->request('GET', '/pets/gatos?page=1&per_page=8', Prophecy\Argument::type('array'), Prophecy\Argument::any())->willReturn(\React\Promise\resolve($response))->shouldBeCalled(); + $client = new \ApiClients\Client\PetStore\Client($auth->reveal(), $browser->reveal()); + $result = $client->call(\ApiClients\Client\PetStore\Internal\Operation\Pets\List_\Gatos::OPERATION_MATCH, (static function (array $data): array { + $data['per_page'] = 8; + $data['page'] = 1; + return $data; + })([])); + } + #[\PHPUnit\Framework\Attributes\Test] + public function operations_httpCode_200_responseContentType_application_json_one(): void + { + $response = new \React\Http\Message\Response(200, ['Content-Type' => 'application/json'], \json_decode('[]', false)); + $auth = $this->prophesize(\ApiClients\Contracts\HTTP\Headers\AuthenticationInterface::class); + $auth->authHeader(Prophecy\Argument::any())->willReturn('Bearer beer')->shouldBeCalled(); + $browser = $this->prophesize(\React\Http\Browser::class); + $browser->withBase(Prophecy\Argument::any())->willReturn($browser->reveal()); + $browser->withFollowRedirects(Prophecy\Argument::any())->willReturn($browser->reveal()); + $browser->request('GET', '/pets/gatos?page=1&per_page=8', Prophecy\Argument::type('array'), Prophecy\Argument::any())->willReturn(\React\Promise\resolve($response))->shouldBeCalled(); + $client = new \ApiClients\Client\PetStore\Client($auth->reveal(), $browser->reveal()); + $result = $client->operations()->petsList()->gatos(8, 1); + } + #[\PHPUnit\Framework\Attributes\Test] + public function call_httpCode_default_responseContentType_application_json_zero(): void + { + $response = new \React\Http\Message\Response(999, ['Content-Type' => 'application/json'], json_encode(json_decode(\ApiClients\Client\PetStore\Schema\Error::SCHEMA_EXAMPLE_DATA, true))); + $auth = $this->prophesize(\ApiClients\Contracts\HTTP\Headers\AuthenticationInterface::class); + $auth->authHeader(Prophecy\Argument::any())->willReturn('Bearer beer')->shouldBeCalled(); + $browser = $this->prophesize(\React\Http\Browser::class); + $browser->withBase(Prophecy\Argument::any())->willReturn($browser->reveal()); + $browser->withFollowRedirects(Prophecy\Argument::any())->willReturn($browser->reveal()); + $browser->request('GET', '/pets/gatos?page=1&per_page=8', Prophecy\Argument::type('array'), Prophecy\Argument::any())->willReturn(\React\Promise\resolve($response))->shouldBeCalled(); + $client = new \ApiClients\Client\PetStore\Client($auth->reveal(), $browser->reveal()); + $result = $client->call(\ApiClients\Client\PetStore\Internal\Operation\Pets\List_\Gatos::OPERATION_MATCH, (static function (array $data): array { + $data['per_page'] = 8; + $data['page'] = 1; + return $data; + })([])); + } + #[\PHPUnit\Framework\Attributes\Test] + public function operations_httpCode_default_responseContentType_application_json_zero(): void + { + $response = new \React\Http\Message\Response(999, ['Content-Type' => 'application/json'], json_encode(json_decode(\ApiClients\Client\PetStore\Schema\Error::SCHEMA_EXAMPLE_DATA, true))); + $auth = $this->prophesize(\ApiClients\Contracts\HTTP\Headers\AuthenticationInterface::class); + $auth->authHeader(Prophecy\Argument::any())->willReturn('Bearer beer')->shouldBeCalled(); + $browser = $this->prophesize(\React\Http\Browser::class); + $browser->withBase(Prophecy\Argument::any())->willReturn($browser->reveal()); + $browser->withFollowRedirects(Prophecy\Argument::any())->willReturn($browser->reveal()); + $browser->request('GET', '/pets/gatos?page=1&per_page=8', Prophecy\Argument::type('array'), Prophecy\Argument::any())->willReturn(\React\Promise\resolve($response))->shouldBeCalled(); + $client = new \ApiClients\Client\PetStore\Client($auth->reveal(), $browser->reveal()); + $result = $client->operations()->petsList()->gatos(8, 1); + } +} + diff --git a/tests/app/app/tests/Internal/Operation/Pets/List_Test.php.php b/tests/app/app/tests/Internal/Operation/Pets/List_Test.php.php new file mode 100644 index 0000000..c29196d --- /dev/null +++ b/tests/app/app/tests/Internal/Operation/Pets/List_Test.php.php @@ -0,0 +1,100 @@ + 'application/json'], \json_decode('[]', false)); + $auth = $this->prophesize(\ApiClients\Contracts\HTTP\Headers\AuthenticationInterface::class); + $auth->authHeader(Prophecy\Argument::any())->willReturn('Bearer beer')->shouldBeCalled(); + $browser = $this->prophesize(\React\Http\Browser::class); + $browser->withBase(Prophecy\Argument::any())->willReturn($browser->reveal()); + $browser->withFollowRedirects(Prophecy\Argument::any())->willReturn($browser->reveal()); + $browser->request('GET', '/pets?page=1&per_page=8', Prophecy\Argument::type('array'), Prophecy\Argument::any())->willReturn(\React\Promise\resolve($response))->shouldBeCalled(); + $client = new \ApiClients\Client\PetStore\Client($auth->reveal(), $browser->reveal()); + $result = $client->call(\ApiClients\Client\PetStore\Internal\Operation\Pets\List_::OPERATION_MATCH, (static function (array $data): array { + $data['per_page'] = 8; + $data['page'] = 1; + return $data; + })([])); + } + #[\PHPUnit\Framework\Attributes\Test] + public function operations_httpCode_200_responseContentType_application_json_zero(): void + { + $response = new \React\Http\Message\Response(200, ['Content-Type' => 'application/json'], \json_decode('[]', false)); + $auth = $this->prophesize(\ApiClients\Contracts\HTTP\Headers\AuthenticationInterface::class); + $auth->authHeader(Prophecy\Argument::any())->willReturn('Bearer beer')->shouldBeCalled(); + $browser = $this->prophesize(\React\Http\Browser::class); + $browser->withBase(Prophecy\Argument::any())->willReturn($browser->reveal()); + $browser->withFollowRedirects(Prophecy\Argument::any())->willReturn($browser->reveal()); + $browser->request('GET', '/pets?page=1&per_page=8', Prophecy\Argument::type('array'), Prophecy\Argument::any())->willReturn(\React\Promise\resolve($response))->shouldBeCalled(); + $client = new \ApiClients\Client\PetStore\Client($auth->reveal(), $browser->reveal()); + $result = $client->operations()->pets()->list(8, 1); + } + #[\PHPUnit\Framework\Attributes\Test] + public function call_httpCode_200_responseContentType_application_json_one(): void + { + $response = new \React\Http\Message\Response(200, ['Content-Type' => 'application/json'], \json_decode('[]', false)); + $auth = $this->prophesize(\ApiClients\Contracts\HTTP\Headers\AuthenticationInterface::class); + $auth->authHeader(Prophecy\Argument::any())->willReturn('Bearer beer')->shouldBeCalled(); + $browser = $this->prophesize(\React\Http\Browser::class); + $browser->withBase(Prophecy\Argument::any())->willReturn($browser->reveal()); + $browser->withFollowRedirects(Prophecy\Argument::any())->willReturn($browser->reveal()); + $browser->request('GET', '/pets?page=1&per_page=8', Prophecy\Argument::type('array'), Prophecy\Argument::any())->willReturn(\React\Promise\resolve($response))->shouldBeCalled(); + $client = new \ApiClients\Client\PetStore\Client($auth->reveal(), $browser->reveal()); + $result = $client->call(\ApiClients\Client\PetStore\Internal\Operation\Pets\List_::OPERATION_MATCH, (static function (array $data): array { + $data['per_page'] = 8; + $data['page'] = 1; + return $data; + })([])); + } + #[\PHPUnit\Framework\Attributes\Test] + public function operations_httpCode_200_responseContentType_application_json_one(): void + { + $response = new \React\Http\Message\Response(200, ['Content-Type' => 'application/json'], \json_decode('[]', false)); + $auth = $this->prophesize(\ApiClients\Contracts\HTTP\Headers\AuthenticationInterface::class); + $auth->authHeader(Prophecy\Argument::any())->willReturn('Bearer beer')->shouldBeCalled(); + $browser = $this->prophesize(\React\Http\Browser::class); + $browser->withBase(Prophecy\Argument::any())->willReturn($browser->reveal()); + $browser->withFollowRedirects(Prophecy\Argument::any())->willReturn($browser->reveal()); + $browser->request('GET', '/pets?page=1&per_page=8', Prophecy\Argument::type('array'), Prophecy\Argument::any())->willReturn(\React\Promise\resolve($response))->shouldBeCalled(); + $client = new \ApiClients\Client\PetStore\Client($auth->reveal(), $browser->reveal()); + $result = $client->operations()->pets()->list(8, 1); + } + #[\PHPUnit\Framework\Attributes\Test] + public function call_httpCode_default_responseContentType_application_json_zero(): void + { + $response = new \React\Http\Message\Response(999, ['Content-Type' => 'application/json'], json_encode(json_decode(\ApiClients\Client\PetStore\Schema\Error::SCHEMA_EXAMPLE_DATA, true))); + $auth = $this->prophesize(\ApiClients\Contracts\HTTP\Headers\AuthenticationInterface::class); + $auth->authHeader(Prophecy\Argument::any())->willReturn('Bearer beer')->shouldBeCalled(); + $browser = $this->prophesize(\React\Http\Browser::class); + $browser->withBase(Prophecy\Argument::any())->willReturn($browser->reveal()); + $browser->withFollowRedirects(Prophecy\Argument::any())->willReturn($browser->reveal()); + $browser->request('GET', '/pets?page=1&per_page=8', Prophecy\Argument::type('array'), Prophecy\Argument::any())->willReturn(\React\Promise\resolve($response))->shouldBeCalled(); + $client = new \ApiClients\Client\PetStore\Client($auth->reveal(), $browser->reveal()); + $result = $client->call(\ApiClients\Client\PetStore\Internal\Operation\Pets\List_::OPERATION_MATCH, (static function (array $data): array { + $data['per_page'] = 8; + $data['page'] = 1; + return $data; + })([])); + } + #[\PHPUnit\Framework\Attributes\Test] + public function operations_httpCode_default_responseContentType_application_json_zero(): void + { + $response = new \React\Http\Message\Response(999, ['Content-Type' => 'application/json'], json_encode(json_decode(\ApiClients\Client\PetStore\Schema\Error::SCHEMA_EXAMPLE_DATA, true))); + $auth = $this->prophesize(\ApiClients\Contracts\HTTP\Headers\AuthenticationInterface::class); + $auth->authHeader(Prophecy\Argument::any())->willReturn('Bearer beer')->shouldBeCalled(); + $browser = $this->prophesize(\React\Http\Browser::class); + $browser->withBase(Prophecy\Argument::any())->willReturn($browser->reveal()); + $browser->withFollowRedirects(Prophecy\Argument::any())->willReturn($browser->reveal()); + $browser->request('GET', '/pets?page=1&per_page=8', Prophecy\Argument::type('array'), Prophecy\Argument::any())->willReturn(\React\Promise\resolve($response))->shouldBeCalled(); + $client = new \ApiClients\Client\PetStore\Client($auth->reveal(), $browser->reveal()); + $result = $client->operations()->pets()->list(8, 1); + } +} + diff --git a/tests/app/app/tests/Internal/Operation/Pets/NamesTest.php.php b/tests/app/app/tests/Internal/Operation/Pets/NamesTest.php.php new file mode 100644 index 0000000..861486d --- /dev/null +++ b/tests/app/app/tests/Internal/Operation/Pets/NamesTest.php.php @@ -0,0 +1,100 @@ + 'application/json'], \json_decode('[]', false)); + $auth = $this->prophesize(\ApiClients\Contracts\HTTP\Headers\AuthenticationInterface::class); + $auth->authHeader(Prophecy\Argument::any())->willReturn('Bearer beer')->shouldBeCalled(); + $browser = $this->prophesize(\React\Http\Browser::class); + $browser->withBase(Prophecy\Argument::any())->willReturn($browser->reveal()); + $browser->withFollowRedirects(Prophecy\Argument::any())->willReturn($browser->reveal()); + $browser->request('GET', '/pets/names?page=1&per_page=8', Prophecy\Argument::type('array'), Prophecy\Argument::any())->willReturn(\React\Promise\resolve($response))->shouldBeCalled(); + $client = new \ApiClients\Client\PetStore\Client($auth->reveal(), $browser->reveal()); + $result = $client->call(\ApiClients\Client\PetStore\Internal\Operation\Pets\Names::OPERATION_MATCH, (static function (array $data): array { + $data['per_page'] = 8; + $data['page'] = 1; + return $data; + })([])); + } + #[\PHPUnit\Framework\Attributes\Test] + public function operations_httpCode_200_responseContentType_application_json_zero(): void + { + $response = new \React\Http\Message\Response(200, ['Content-Type' => 'application/json'], \json_decode('[]', false)); + $auth = $this->prophesize(\ApiClients\Contracts\HTTP\Headers\AuthenticationInterface::class); + $auth->authHeader(Prophecy\Argument::any())->willReturn('Bearer beer')->shouldBeCalled(); + $browser = $this->prophesize(\React\Http\Browser::class); + $browser->withBase(Prophecy\Argument::any())->willReturn($browser->reveal()); + $browser->withFollowRedirects(Prophecy\Argument::any())->willReturn($browser->reveal()); + $browser->request('GET', '/pets/names?page=1&per_page=8', Prophecy\Argument::type('array'), Prophecy\Argument::any())->willReturn(\React\Promise\resolve($response))->shouldBeCalled(); + $client = new \ApiClients\Client\PetStore\Client($auth->reveal(), $browser->reveal()); + $result = $client->operations()->pets()->names(8, 1); + } + #[\PHPUnit\Framework\Attributes\Test] + public function call_httpCode_200_responseContentType_application_json_one(): void + { + $response = new \React\Http\Message\Response(200, ['Content-Type' => 'application/json'], \json_decode('[]', false)); + $auth = $this->prophesize(\ApiClients\Contracts\HTTP\Headers\AuthenticationInterface::class); + $auth->authHeader(Prophecy\Argument::any())->willReturn('Bearer beer')->shouldBeCalled(); + $browser = $this->prophesize(\React\Http\Browser::class); + $browser->withBase(Prophecy\Argument::any())->willReturn($browser->reveal()); + $browser->withFollowRedirects(Prophecy\Argument::any())->willReturn($browser->reveal()); + $browser->request('GET', '/pets/names?page=1&per_page=8', Prophecy\Argument::type('array'), Prophecy\Argument::any())->willReturn(\React\Promise\resolve($response))->shouldBeCalled(); + $client = new \ApiClients\Client\PetStore\Client($auth->reveal(), $browser->reveal()); + $result = $client->call(\ApiClients\Client\PetStore\Internal\Operation\Pets\Names::OPERATION_MATCH, (static function (array $data): array { + $data['per_page'] = 8; + $data['page'] = 1; + return $data; + })([])); + } + #[\PHPUnit\Framework\Attributes\Test] + public function operations_httpCode_200_responseContentType_application_json_one(): void + { + $response = new \React\Http\Message\Response(200, ['Content-Type' => 'application/json'], \json_decode('[]', false)); + $auth = $this->prophesize(\ApiClients\Contracts\HTTP\Headers\AuthenticationInterface::class); + $auth->authHeader(Prophecy\Argument::any())->willReturn('Bearer beer')->shouldBeCalled(); + $browser = $this->prophesize(\React\Http\Browser::class); + $browser->withBase(Prophecy\Argument::any())->willReturn($browser->reveal()); + $browser->withFollowRedirects(Prophecy\Argument::any())->willReturn($browser->reveal()); + $browser->request('GET', '/pets/names?page=1&per_page=8', Prophecy\Argument::type('array'), Prophecy\Argument::any())->willReturn(\React\Promise\resolve($response))->shouldBeCalled(); + $client = new \ApiClients\Client\PetStore\Client($auth->reveal(), $browser->reveal()); + $result = $client->operations()->pets()->names(8, 1); + } + #[\PHPUnit\Framework\Attributes\Test] + public function call_httpCode_default_responseContentType_application_json_zero(): void + { + $response = new \React\Http\Message\Response(999, ['Content-Type' => 'application/json'], json_encode(json_decode(\ApiClients\Client\PetStore\Schema\Error::SCHEMA_EXAMPLE_DATA, true))); + $auth = $this->prophesize(\ApiClients\Contracts\HTTP\Headers\AuthenticationInterface::class); + $auth->authHeader(Prophecy\Argument::any())->willReturn('Bearer beer')->shouldBeCalled(); + $browser = $this->prophesize(\React\Http\Browser::class); + $browser->withBase(Prophecy\Argument::any())->willReturn($browser->reveal()); + $browser->withFollowRedirects(Prophecy\Argument::any())->willReturn($browser->reveal()); + $browser->request('GET', '/pets/names?page=1&per_page=8', Prophecy\Argument::type('array'), Prophecy\Argument::any())->willReturn(\React\Promise\resolve($response))->shouldBeCalled(); + $client = new \ApiClients\Client\PetStore\Client($auth->reveal(), $browser->reveal()); + $result = $client->call(\ApiClients\Client\PetStore\Internal\Operation\Pets\Names::OPERATION_MATCH, (static function (array $data): array { + $data['per_page'] = 8; + $data['page'] = 1; + return $data; + })([])); + } + #[\PHPUnit\Framework\Attributes\Test] + public function operations_httpCode_default_responseContentType_application_json_zero(): void + { + $response = new \React\Http\Message\Response(999, ['Content-Type' => 'application/json'], json_encode(json_decode(\ApiClients\Client\PetStore\Schema\Error::SCHEMA_EXAMPLE_DATA, true))); + $auth = $this->prophesize(\ApiClients\Contracts\HTTP\Headers\AuthenticationInterface::class); + $auth->authHeader(Prophecy\Argument::any())->willReturn('Bearer beer')->shouldBeCalled(); + $browser = $this->prophesize(\React\Http\Browser::class); + $browser->withBase(Prophecy\Argument::any())->willReturn($browser->reveal()); + $browser->withFollowRedirects(Prophecy\Argument::any())->willReturn($browser->reveal()); + $browser->request('GET', '/pets/names?page=1&per_page=8', Prophecy\Argument::type('array'), Prophecy\Argument::any())->willReturn(\React\Promise\resolve($response))->shouldBeCalled(); + $client = new \ApiClients\Client\PetStore\Client($auth->reveal(), $browser->reveal()); + $result = $client->operations()->pets()->names(8, 1); + } +} + diff --git a/tests/app/app/tests/Internal/Operation/ShowPetByIdTest.php.php b/tests/app/app/tests/Internal/Operation/ShowPetByIdTest.php.php new file mode 100644 index 0000000..3a6b8f4 --- /dev/null +++ b/tests/app/app/tests/Internal/Operation/ShowPetByIdTest.php.php @@ -0,0 +1,166 @@ + 'application/json'], \json_decode('[]', false)); + $auth = $this->prophesize(\ApiClients\Contracts\HTTP\Headers\AuthenticationInterface::class); + $auth->authHeader(Prophecy\Argument::any())->willReturn('Bearer beer')->shouldBeCalled(); + $browser = $this->prophesize(\React\Http\Browser::class); + $browser->withBase(Prophecy\Argument::any())->willReturn($browser->reveal()); + $browser->withFollowRedirects(Prophecy\Argument::any())->willReturn($browser->reveal()); + $browser->request('GET', '/pets/{petId}', Prophecy\Argument::type('array'), Prophecy\Argument::any())->willReturn(\React\Promise\resolve($response))->shouldBeCalled(); + $client = new \ApiClients\Client\PetStore\Client($auth->reveal(), $browser->reveal()); + $result = $client->call(\ApiClients\Client\PetStore\Internal\Operation\ShowPetById::OPERATION_MATCH, (static fn(array $data): array => $data)([])); + } + #[\PHPUnit\Framework\Attributes\Test] + public function operations_httpCode_200_responseContentType_application_json_zero(): void + { + $response = new \React\Http\Message\Response(200, ['Content-Type' => 'application/json'], \json_decode('[]', false)); + $auth = $this->prophesize(\ApiClients\Contracts\HTTP\Headers\AuthenticationInterface::class); + $auth->authHeader(Prophecy\Argument::any())->willReturn('Bearer beer')->shouldBeCalled(); + $browser = $this->prophesize(\React\Http\Browser::class); + $browser->withBase(Prophecy\Argument::any())->willReturn($browser->reveal()); + $browser->withFollowRedirects(Prophecy\Argument::any())->willReturn($browser->reveal()); + $browser->request('GET', '/pets/{petId}', Prophecy\Argument::type('array'), Prophecy\Argument::any())->willReturn(\React\Promise\resolve($response))->shouldBeCalled(); + $client = new \ApiClients\Client\PetStore\Client($auth->reveal(), $browser->reveal()); + $result = $client->operations()->showPetById(); + } + #[\PHPUnit\Framework\Attributes\Test] + public function call_httpCode_200_responseContentType_application_json_one(): void + { + $response = new \React\Http\Message\Response(200, ['Content-Type' => 'application/json'], \json_decode('[]', false)); + $auth = $this->prophesize(\ApiClients\Contracts\HTTP\Headers\AuthenticationInterface::class); + $auth->authHeader(Prophecy\Argument::any())->willReturn('Bearer beer')->shouldBeCalled(); + $browser = $this->prophesize(\React\Http\Browser::class); + $browser->withBase(Prophecy\Argument::any())->willReturn($browser->reveal()); + $browser->withFollowRedirects(Prophecy\Argument::any())->willReturn($browser->reveal()); + $browser->request('GET', '/pets/{petId}', Prophecy\Argument::type('array'), Prophecy\Argument::any())->willReturn(\React\Promise\resolve($response))->shouldBeCalled(); + $client = new \ApiClients\Client\PetStore\Client($auth->reveal(), $browser->reveal()); + $result = $client->call(\ApiClients\Client\PetStore\Internal\Operation\ShowPetById::OPERATION_MATCH, (static fn(array $data): array => $data)([])); + } + #[\PHPUnit\Framework\Attributes\Test] + public function operations_httpCode_200_responseContentType_application_json_one(): void + { + $response = new \React\Http\Message\Response(200, ['Content-Type' => 'application/json'], \json_decode('[]', false)); + $auth = $this->prophesize(\ApiClients\Contracts\HTTP\Headers\AuthenticationInterface::class); + $auth->authHeader(Prophecy\Argument::any())->willReturn('Bearer beer')->shouldBeCalled(); + $browser = $this->prophesize(\React\Http\Browser::class); + $browser->withBase(Prophecy\Argument::any())->willReturn($browser->reveal()); + $browser->withFollowRedirects(Prophecy\Argument::any())->willReturn($browser->reveal()); + $browser->request('GET', '/pets/{petId}', Prophecy\Argument::type('array'), Prophecy\Argument::any())->willReturn(\React\Promise\resolve($response))->shouldBeCalled(); + $client = new \ApiClients\Client\PetStore\Client($auth->reveal(), $browser->reveal()); + $result = $client->operations()->showPetById(); + } + #[\PHPUnit\Framework\Attributes\Test] + public function call_httpCode_200_responseContentType_application_json_two(): void + { + $response = new \React\Http\Message\Response(200, ['Content-Type' => 'application/json'], \json_decode('[]', false)); + $auth = $this->prophesize(\ApiClients\Contracts\HTTP\Headers\AuthenticationInterface::class); + $auth->authHeader(Prophecy\Argument::any())->willReturn('Bearer beer')->shouldBeCalled(); + $browser = $this->prophesize(\React\Http\Browser::class); + $browser->withBase(Prophecy\Argument::any())->willReturn($browser->reveal()); + $browser->withFollowRedirects(Prophecy\Argument::any())->willReturn($browser->reveal()); + $browser->request('GET', '/pets/{petId}', Prophecy\Argument::type('array'), Prophecy\Argument::any())->willReturn(\React\Promise\resolve($response))->shouldBeCalled(); + $client = new \ApiClients\Client\PetStore\Client($auth->reveal(), $browser->reveal()); + $result = $client->call(\ApiClients\Client\PetStore\Internal\Operation\ShowPetById::OPERATION_MATCH, (static fn(array $data): array => $data)([])); + } + #[\PHPUnit\Framework\Attributes\Test] + public function operations_httpCode_200_responseContentType_application_json_two(): void + { + $response = new \React\Http\Message\Response(200, ['Content-Type' => 'application/json'], \json_decode('[]', false)); + $auth = $this->prophesize(\ApiClients\Contracts\HTTP\Headers\AuthenticationInterface::class); + $auth->authHeader(Prophecy\Argument::any())->willReturn('Bearer beer')->shouldBeCalled(); + $browser = $this->prophesize(\React\Http\Browser::class); + $browser->withBase(Prophecy\Argument::any())->willReturn($browser->reveal()); + $browser->withFollowRedirects(Prophecy\Argument::any())->willReturn($browser->reveal()); + $browser->request('GET', '/pets/{petId}', Prophecy\Argument::type('array'), Prophecy\Argument::any())->willReturn(\React\Promise\resolve($response))->shouldBeCalled(); + $client = new \ApiClients\Client\PetStore\Client($auth->reveal(), $browser->reveal()); + $result = $client->operations()->showPetById(); + } + #[\PHPUnit\Framework\Attributes\Test] + public function call_httpCode_200_responseContentType_application_json_three(): void + { + $response = new \React\Http\Message\Response(200, ['Content-Type' => 'application/json'], \json_decode('[]', false)); + $auth = $this->prophesize(\ApiClients\Contracts\HTTP\Headers\AuthenticationInterface::class); + $auth->authHeader(Prophecy\Argument::any())->willReturn('Bearer beer')->shouldBeCalled(); + $browser = $this->prophesize(\React\Http\Browser::class); + $browser->withBase(Prophecy\Argument::any())->willReturn($browser->reveal()); + $browser->withFollowRedirects(Prophecy\Argument::any())->willReturn($browser->reveal()); + $browser->request('GET', '/pets/{petId}', Prophecy\Argument::type('array'), Prophecy\Argument::any())->willReturn(\React\Promise\resolve($response))->shouldBeCalled(); + $client = new \ApiClients\Client\PetStore\Client($auth->reveal(), $browser->reveal()); + $result = $client->call(\ApiClients\Client\PetStore\Internal\Operation\ShowPetById::OPERATION_MATCH, (static fn(array $data): array => $data)([])); + } + #[\PHPUnit\Framework\Attributes\Test] + public function operations_httpCode_200_responseContentType_application_json_three(): void + { + $response = new \React\Http\Message\Response(200, ['Content-Type' => 'application/json'], \json_decode('[]', false)); + $auth = $this->prophesize(\ApiClients\Contracts\HTTP\Headers\AuthenticationInterface::class); + $auth->authHeader(Prophecy\Argument::any())->willReturn('Bearer beer')->shouldBeCalled(); + $browser = $this->prophesize(\React\Http\Browser::class); + $browser->withBase(Prophecy\Argument::any())->willReturn($browser->reveal()); + $browser->withFollowRedirects(Prophecy\Argument::any())->willReturn($browser->reveal()); + $browser->request('GET', '/pets/{petId}', Prophecy\Argument::type('array'), Prophecy\Argument::any())->willReturn(\React\Promise\resolve($response))->shouldBeCalled(); + $client = new \ApiClients\Client\PetStore\Client($auth->reveal(), $browser->reveal()); + $result = $client->operations()->showPetById(); + } + #[\PHPUnit\Framework\Attributes\Test] + public function call_httpCode_200_responseContentType_application_json_four(): void + { + $response = new \React\Http\Message\Response(200, ['Content-Type' => 'application/json'], \json_decode('[]', false)); + $auth = $this->prophesize(\ApiClients\Contracts\HTTP\Headers\AuthenticationInterface::class); + $auth->authHeader(Prophecy\Argument::any())->willReturn('Bearer beer')->shouldBeCalled(); + $browser = $this->prophesize(\React\Http\Browser::class); + $browser->withBase(Prophecy\Argument::any())->willReturn($browser->reveal()); + $browser->withFollowRedirects(Prophecy\Argument::any())->willReturn($browser->reveal()); + $browser->request('GET', '/pets/{petId}', Prophecy\Argument::type('array'), Prophecy\Argument::any())->willReturn(\React\Promise\resolve($response))->shouldBeCalled(); + $client = new \ApiClients\Client\PetStore\Client($auth->reveal(), $browser->reveal()); + $result = $client->call(\ApiClients\Client\PetStore\Internal\Operation\ShowPetById::OPERATION_MATCH, (static fn(array $data): array => $data)([])); + } + #[\PHPUnit\Framework\Attributes\Test] + public function operations_httpCode_200_responseContentType_application_json_four(): void + { + $response = new \React\Http\Message\Response(200, ['Content-Type' => 'application/json'], \json_decode('[]', false)); + $auth = $this->prophesize(\ApiClients\Contracts\HTTP\Headers\AuthenticationInterface::class); + $auth->authHeader(Prophecy\Argument::any())->willReturn('Bearer beer')->shouldBeCalled(); + $browser = $this->prophesize(\React\Http\Browser::class); + $browser->withBase(Prophecy\Argument::any())->willReturn($browser->reveal()); + $browser->withFollowRedirects(Prophecy\Argument::any())->willReturn($browser->reveal()); + $browser->request('GET', '/pets/{petId}', Prophecy\Argument::type('array'), Prophecy\Argument::any())->willReturn(\React\Promise\resolve($response))->shouldBeCalled(); + $client = new \ApiClients\Client\PetStore\Client($auth->reveal(), $browser->reveal()); + $result = $client->operations()->showPetById(); + } + #[\PHPUnit\Framework\Attributes\Test] + public function call_httpCode_default_responseContentType_application_json_zero(): void + { + $response = new \React\Http\Message\Response(999, ['Content-Type' => 'application/json'], json_encode(json_decode(\ApiClients\Client\PetStore\Schema\Error::SCHEMA_EXAMPLE_DATA, true))); + $auth = $this->prophesize(\ApiClients\Contracts\HTTP\Headers\AuthenticationInterface::class); + $auth->authHeader(Prophecy\Argument::any())->willReturn('Bearer beer')->shouldBeCalled(); + $browser = $this->prophesize(\React\Http\Browser::class); + $browser->withBase(Prophecy\Argument::any())->willReturn($browser->reveal()); + $browser->withFollowRedirects(Prophecy\Argument::any())->willReturn($browser->reveal()); + $browser->request('GET', '/pets/{petId}', Prophecy\Argument::type('array'), Prophecy\Argument::any())->willReturn(\React\Promise\resolve($response))->shouldBeCalled(); + $client = new \ApiClients\Client\PetStore\Client($auth->reveal(), $browser->reveal()); + $result = $client->call(\ApiClients\Client\PetStore\Internal\Operation\ShowPetById::OPERATION_MATCH, (static fn(array $data): array => $data)([])); + } + #[\PHPUnit\Framework\Attributes\Test] + public function operations_httpCode_default_responseContentType_application_json_zero(): void + { + $response = new \React\Http\Message\Response(999, ['Content-Type' => 'application/json'], json_encode(json_decode(\ApiClients\Client\PetStore\Schema\Error::SCHEMA_EXAMPLE_DATA, true))); + $auth = $this->prophesize(\ApiClients\Contracts\HTTP\Headers\AuthenticationInterface::class); + $auth->authHeader(Prophecy\Argument::any())->willReturn('Bearer beer')->shouldBeCalled(); + $browser = $this->prophesize(\React\Http\Browser::class); + $browser->withBase(Prophecy\Argument::any())->willReturn($browser->reveal()); + $browser->withFollowRedirects(Prophecy\Argument::any())->willReturn($browser->reveal()); + $browser->request('GET', '/pets/{petId}', Prophecy\Argument::type('array'), Prophecy\Argument::any())->willReturn(\React\Promise\resolve($response))->shouldBeCalled(); + $client = new \ApiClients\Client\PetStore\Client($auth->reveal(), $browser->reveal()); + $result = $client->operations()->showPetById(); + } +} + diff --git a/tests/app/app/tests/Types/ClientCallReturnTypes.php.php b/tests/app/app/tests/Types/ClientCallReturnTypes.php.php new file mode 100644 index 0000000..f2fb6cd --- /dev/null +++ b/tests/app/app/tests/Types/ClientCallReturnTypes.php.php @@ -0,0 +1,20 @@ +|\ApiClients\Client\PetStore\Schema\Error', $client->call('GET /pets')); +\PHPStan\Testing\assertType('\ApiClients\Client\PetStore\Schema\Error|\ApiClients\Tools\OpenApiClient\Utils\Response\WithoutBody', $client->call('POST /pets')); +\PHPStan\Testing\assertType('iterable|\ApiClients\Client\PetStore\Schema\Error', $client->call('GET /pets/gatos')); +\PHPStan\Testing\assertType('iterable|\ApiClients\Client\PetStore\Schema\Error', $client->call('GET /pets/kinds/walking')); +\PHPStan\Testing\assertType('\ApiClients\Client\PetStore\Schema\Operations\Pets\Grouped\By\Type\Response\ApplicationJson\Ok|\ApiClients\Client\PetStore\Schema\Error', $client->call('GET /pets/groupedByType')); +\PHPStan\Testing\assertType('iterable|\ApiClients\Client\PetStore\Schema\Error', $client->call('GET /pets/names')); +\PHPStan\Testing\assertType('\ApiClients\Client\PetStore\Schema\Cat|\ApiClients\Client\PetStore\Schema\Dog|\ApiClients\Client\PetStore\Schema\Bird|\ApiClients\Client\PetStore\Schema\Fish|\ApiClients\Client\PetStore\Schema\Spider|\ApiClients\Client\PetStore\Schema\Error', $client->call('GET /pets/{petId}')); + diff --git a/tests/app/composer.json b/tests/app/composer.json index 5bea2c1..3111bff 100644 --- a/tests/app/composer.json +++ b/tests/app/composer.json @@ -1,58 +1,66 @@ { - "name": "api-clients/petsore", - "description": "Non-Blocking first PetStore client", - "license": "MIT", - "authors": [ - { - "name": "Cees-Jan Kiewiet", - "email": "ceesjank@gmail.com" - } - ], - "require": { - "php": "^8.2", - "api-clients/contracts": "^0.1", - "api-clients/openapi-client-utils": "dev-main", - "devizzent/cebe-php-openapi": "^1", - "eventsauce/object-hydrator": "^1.1", - "league/openapi-psr7-validator": "^0.21", - "league/uri": "^7.3", - "psr/http-message": "^1.0", - "react/http": "^1.8", - "react/async": "^4.0", - "wyrihaximus/react-awaitable-observable": "^1.0" - }, - "require-dev": { - "wyrihaximus/async-test-utilities": "^7" - }, - "autoload": { - "psr-4": { - "ApiClients\\Client\\PetStore\\": "src/" - } - }, - "autoload-dev": { - "psr-4": { - "ApiClients\\Client\\PetStore\\": "src/" - } - }, - "extra": { - "phpstan": { - "includes": [ - "etc/phpstan-extension.neon" - ] - } - }, - "config": { - "sort-packages": true, - "platform": { - "php": "8.2.13" + "name": "api-clients/petsore", + "description": "Non-Blocking first PetStore client", + "license": "MIT", + "authors": [ + { + "name": "Cees-Jan Kiewiet", + "email": "ceesjank@gmail.com" + } + ], + "require": { + "php": "^8.4", + "api-clients/contracts": "^0.1", + "api-clients/openapi-client-utils": "dev-main", + "devizzent/cebe-php-openapi": "^1", + "eventsauce/object-hydrator": "^1.1", + "league/openapi-psr7-validator": "^0.21", + "league/uri": "^7.3", + "psr/http-message": "^1.0", + "react/http": "^1.8", + "react/async": "^4.0", + "wyrihaximus/react-awaitable-observable": "^1.0" + }, + "require-dev": { + "wyrihaximus/async-test-utilities": "^13.4.1", + "wyrihaximus/makefiles": "^0.13.2" + }, + "autoload": { + "psr-4": { + "ApiClients\\Client\\PetStore\\": "src/" + } + }, + "autoload-dev": { + "psr-4": { + "ApiClients\\Client\\PetStore\\": "src/" + } + }, + "config": { + "sort-packages": true, + "platform": { + "php": "8.4.13" + }, + "allow-plugins": { + "composer/package-versions-deprecated": true, + "dealerdirect/phpcodesniffer-composer-installer": true, + "drupol/composer-packages": true, + "ergebnis/composer-normalize": true, + "icanhazstring/composer-unused": true, + "infection/extension-installer": true, + "mindplay/composer-locator": true, + "phpstan/extension-installer": true, + "wyrihaximus/composer-update-bin-autoload-path": true, + "wyrihaximus/makefiles": true, + "wyrihaximus/test-utilities": true + } }, - "allow-plugins": { - "dealerdirect/phpcodesniffer-composer-installer": true, - "composer/package-versions-deprecated": true, - "ergebnis/composer-normalize": true, - "icanhazstring/composer-unused": true, - "wyrihaximus/composer-update-bin-autoload-path": true, - "infection/extension-installer": true + "scripts": { + "post-install-cmd": [ + "make on-install-or-update || true" + ], + "post-update-cmd": [ + "make on-install-or-update || true" + ] } - } } + diff --git a/tests/app/etc/openapi-client-generator.state b/tests/app/etc/openapi-client-generator.state index 3b14062..f27ac92 100644 --- a/tests/app/etc/openapi-client-generator.state +++ b/tests/app/etc/openapi-client-generator.state @@ -1,526 +1,558 @@ { - "specHash": "49b7769c2e53c7b43fd64f2c24afecb3", + "specHash": "c6791da54b0f6e6204158b7168cbc566bec5e29d1ebff077d31e364b603c5a16bb70e7629cddc278aabcf722e873376b2145d9a4dc5ab186c5d6241984164c66", "generatedFiles": { "files": [ { - "name": ".\/tests\/app\/src\/\/Internal\/Operation\/Pets\/List_.php", - "hash": "25a82ab4cabbcd0859ae973584a2783f" + "name": "\/home\/wyrihaximus\/Projects\/PHPAPIClients\/openapi-client-generator\/tests\/test-app\/src\/Contract\/Cat.php", + "hash": "448d864ace1636478138143765a57968" }, { - "name": ".\/tests\/app\/src\/\/Internal\/Operator\/Pets\/List_.php", - "hash": "47c2a7da84b6ee54196ec3c6ac055f72" + "name": "\/home\/wyrihaximus\/Projects\/PHPAPIClients\/openapi-client-generator\/tests\/test-app\/src\/Contract\/Dog.php", + "hash": "f6a52e18f1d2ca8eeb7ea1bf4c02abb8" }, { - "name": ".\/tests\/app\/tests\/\/Internal\/Operation\/Pets\/List_Test.php", - "hash": "a55edea63c07b47db2b06f8a4552419b" + "name": "\/home\/wyrihaximus\/Projects\/PHPAPIClients\/openapi-client-generator\/tests\/test-app\/src\/Contract\/HellHound.php", + "hash": "bfbd7ed802b43161879bf7eb1e79f5bd" }, { - "name": ".\/tests\/app\/src\/\/Internal\/Operation\/Pets\/ListListing.php", - "hash": "8328e99919a32a2f6cd0cc1e5e8d7220" + "name": "\/home\/wyrihaximus\/Projects\/PHPAPIClients\/openapi-client-generator\/tests\/test-app\/src\/Contract\/Spider.php", + "hash": "b170388bf11a738d4969461ac0d79843" }, { - "name": ".\/tests\/app\/src\/\/Internal\/Operator\/Pets\/ListListing.php", - "hash": "81a050aaa65ea5a5f4968fdacb151f1d" + "name": "\/home\/wyrihaximus\/Projects\/PHPAPIClients\/openapi-client-generator\/tests\/test-app\/src\/Contract\/Bird.php", + "hash": "e5917cf90e52125d3d640f4e2c79c758" }, { - "name": ".\/tests\/app\/tests\/\/Internal\/Operation\/Pets\/ListListingTest.php", - "hash": "a565e061be5406b21e98798aa1124632" + "name": "\/home\/wyrihaximus\/Projects\/PHPAPIClients\/openapi-client-generator\/tests\/test-app\/src\/Contract\/Fish.php", + "hash": "7b51a9dec094b0e5f47d5007f9f4bb1e" }, { - "name": ".\/tests\/app\/src\/\/Internal\/Operation\/Pets\/Create.php", - "hash": "10ca455872aa8e50dc50e6ccc4be9ee8" + "name": "\/home\/wyrihaximus\/Projects\/PHPAPIClients\/openapi-client-generator\/tests\/test-app\/src\/Contract\/Error.php", + "hash": "1980cc1d5d64f67aa5616311326c4f51" }, { - "name": ".\/tests\/app\/src\/\/Internal\/Operator\/Pets\/Create.php", - "hash": "1894602e2383fc07d45f10c15a959e5f" + "name": "\/home\/wyrihaximus\/Projects\/PHPAPIClients\/openapi-client-generator\/tests\/test-app\/src\/Contract\/Legs.php", + "hash": "67918de3289586abaf3ac0d375834f97" }, { - "name": ".\/tests\/app\/tests\/\/Internal\/Operation\/Pets\/CreateTest.php", - "hash": "c7f1b5aa62146ad64081177d26e9c994" + "name": "\/home\/wyrihaximus\/Projects\/PHPAPIClients\/openapi-client-generator\/tests\/test-app\/src\/Contract\/Tails.php", + "hash": "b54eff28cb688dee46648fb0bf47844c" }, { - "name": ".\/tests\/app\/src\/\/Internal\/Operation\/Pets\/List_\/Gatos.php", - "hash": "f4b232e914937297d5a892754f63c172" + "name": "\/home\/wyrihaximus\/Projects\/PHPAPIClients\/openapi-client-generator\/tests\/test-app\/src\/Contract\/Fins.php", + "hash": "1b81c6d9442e138d8e899cb7fc6c8733" }, { - "name": ".\/tests\/app\/src\/\/Internal\/Operator\/Pets\/List_\/Gatos.php", - "hash": "3b21fa465f28a528bafd38fed238d7d5" + "name": "\/home\/wyrihaximus\/Projects\/PHPAPIClients\/openapi-client-generator\/tests\/test-app\/src\/Contract\/Wings.php", + "hash": "fd1b755030c5d993fab90d38b2c4122e" }, { - "name": ".\/tests\/app\/tests\/\/Internal\/Operation\/Pets\/List_\/GatosTest.php", - "hash": "ba271b6f0c919ad74870903c49358487" + "name": "\/home\/wyrihaximus\/Projects\/PHPAPIClients\/openapi-client-generator\/tests\/test-app\/src\/Contract\/RedEyes.php", + "hash": "90fe6198c7bc310c24fa730b759660ca" }, { - "name": ".\/tests\/app\/src\/\/Internal\/Operation\/Pets\/List_\/GatosListing.php", - "hash": "3a785d5c18a38ad282fcf7c05a533cca" + "name": "\/home\/wyrihaximus\/Projects\/PHPAPIClients\/openapi-client-generator\/tests\/test-app\/src\/Contract\/RedEyes\/B.php", + "hash": "9f9944d627c578e26baf62191a7ba9dd" }, { - "name": ".\/tests\/app\/src\/\/Internal\/Operator\/Pets\/List_\/GatosListing.php", - "hash": "464515feabb30b925ca80dec3b3200b7" + "name": "\/home\/wyrihaximus\/Projects\/PHPAPIClients\/openapi-client-generator\/tests\/test-app\/src\/Contract\/GreenEyes.php", + "hash": "41b9ab94c4eb748358973bc68b2ea28a" }, { - "name": ".\/tests\/app\/tests\/\/Internal\/Operation\/Pets\/List_\/GatosListingTest.php", - "hash": "b390b45049613024209e795a63428b17" + "name": "\/home\/wyrihaximus\/Projects\/PHPAPIClients\/openapi-client-generator\/tests\/test-app\/src\/Contract\/YellowEyes.php", + "hash": "16ee568e0f80ec2d66e8ae5f7e369cbc" }, { - "name": ".\/tests\/app\/src\/\/Internal\/Operation\/Pets\/Kinds\/Walking.php", - "hash": "5b141f5559fa05146208c8b330cb34e3" + "name": "\/home\/wyrihaximus\/Projects\/PHPAPIClients\/openapi-client-generator\/tests\/test-app\/src\/Contract\/BlackEyes.php", + "hash": "080123f2e4e051027f080491ea3a25ef" }, { - "name": ".\/tests\/app\/src\/\/Internal\/Operator\/Pets\/Kinds\/Walking.php", - "hash": "3b69defcccd48d2b751cb96bcc0fd28e" + "name": "\/home\/wyrihaximus\/Projects\/PHPAPIClients\/openapi-client-generator\/tests\/test-app\/src\/Contract\/BlueEyes.php", + "hash": "f31e6a04abbf849e6f809925f28c50b3" }, { - "name": ".\/tests\/app\/tests\/\/Internal\/Operation\/Pets\/Kinds\/WalkingTest.php", - "hash": "cdc490680bc8bc8bc01699bcd16afb7c" + "name": "\/home\/wyrihaximus\/Projects\/PHPAPIClients\/openapi-client-generator\/tests\/test-app\/src\/Contract\/Cat\/Features.php", + "hash": "5a5b68c5c62bcbb3b1f0b52d259f7c52" }, { - "name": ".\/tests\/app\/src\/\/Internal\/Operation\/Pets\/Kinds\/WalkingListing.php", - "hash": "9dd7908366a01691fbd955aa67b81d07" + "name": "\/home\/wyrihaximus\/Projects\/PHPAPIClients\/openapi-client-generator\/tests\/test-app\/src\/Contract\/HellHound\/Eyes.php", + "hash": "8182fb556c99f3779160b30d74c982ac" }, { - "name": ".\/tests\/app\/src\/\/Internal\/Operator\/Pets\/Kinds\/WalkingListing.php", - "hash": "4380b7a348e37e6df06c4c2d4829744b" + "name": "\/home\/wyrihaximus\/Projects\/PHPAPIClients\/openapi-client-generator\/tests\/test-app\/src\/Contract\/Operations\/Pets\/List_\/Response\/ApplicationJson\/Ok.php", + "hash": "16391800ebbef88c9c6efa05338ceab3" }, { - "name": ".\/tests\/app\/tests\/\/Internal\/Operation\/Pets\/Kinds\/WalkingListingTest.php", - "hash": "c44cc667c3c4a7536ed9e65c1577c236" + "name": "\/home\/wyrihaximus\/Projects\/PHPAPIClients\/openapi-client-generator\/tests\/test-app\/src\/Contract\/Pets\/Create\/Request\/ApplicationJson.php", + "hash": "4d748f407979e87e41072b10f79f0e9d" }, { - "name": ".\/tests\/app\/src\/\/Internal\/Operation\/Pets\/Grouped\/By\/Type.php", - "hash": "9d26f1af1b900ea85a2b2c60f3e2411f" + "name": "\/home\/wyrihaximus\/Projects\/PHPAPIClients\/openapi-client-generator\/tests\/test-app\/src\/Contract\/Operations\/Pets\/Kinds\/Walking\/Response\/ApplicationJson\/Ok.php", + "hash": "32b479ba8abe4f689743b65f2cfb26be" }, { - "name": ".\/tests\/app\/src\/\/Internal\/Operator\/Pets\/Grouped\/By\/Type.php", - "hash": "2514d2139048da39f8734a87a34a4787" + "name": "\/home\/wyrihaximus\/Projects\/PHPAPIClients\/openapi-client-generator\/tests\/test-app\/src\/Contract\/Operations\/Pets\/Grouped\/By\/Type\/Response\/ApplicationJson\/Ok.php", + "hash": "ab4e3651adf4c8456948358c9044f47c" }, { - "name": ".\/tests\/app\/tests\/\/Internal\/Operation\/Pets\/Grouped\/By\/TypeTest.php", - "hash": "b59cfc90a1cf6a8448bbda0227f202c8" + "name": "\/home\/wyrihaximus\/Projects\/PHPAPIClients\/openapi-client-generator\/tests\/test-app\/src\/Contract\/Operations\/Pets\/Names\/Response\/ApplicationJson\/Ok.php", + "hash": "874238abf0455b447536750719a305d8" }, { - "name": ".\/tests\/app\/src\/\/Internal\/Operation\/Pets\/Names.php", - "hash": "6597d53081735f442af07731f67048cd" + "name": "\/home\/wyrihaximus\/Projects\/PHPAPIClients\/openapi-client-generator\/tests\/test-app\/src\/Contract\/Operations\/ShowPetById\/Response\/ApplicationJson\/Ok.php", + "hash": "f5a98bb240ee242b91ca736cbf427e8a" }, { - "name": ".\/tests\/app\/src\/\/Internal\/Operator\/Pets\/Names.php", - "hash": "66b7cac30b2f07748737b97e9a0e8056" + "name": "\/home\/wyrihaximus\/Projects\/PHPAPIClients\/openapi-client-generator\/tests\/test-app\/src\/Error\/Cat.php", + "hash": "5382733efa00de96527b758e572e8169" }, { - "name": ".\/tests\/app\/tests\/\/Internal\/Operation\/Pets\/NamesTest.php", - "hash": "9c861d7eda455fdb2d97464e4f52ebe1" + "name": "\/home\/wyrihaximus\/Projects\/PHPAPIClients\/openapi-client-generator\/tests\/test-app\/src\/Error\/Dog.php", + "hash": "925a1193ac0febdc4134b21466ec721e" }, { - "name": ".\/tests\/app\/src\/\/Internal\/Operation\/Pets\/NamesListing.php", - "hash": "c108707e8fff08989852ca98bf4f1043" + "name": "\/home\/wyrihaximus\/Projects\/PHPAPIClients\/openapi-client-generator\/tests\/test-app\/src\/Error\/HellHound.php", + "hash": "f5ef1783a48db62a196e6bdeaf89c211" }, { - "name": ".\/tests\/app\/src\/\/Internal\/Operator\/Pets\/NamesListing.php", - "hash": "fa24eee87e05c9b3d7b373cde1511ddb" + "name": "\/home\/wyrihaximus\/Projects\/PHPAPIClients\/openapi-client-generator\/tests\/test-app\/src\/Error\/Spider.php", + "hash": "d78cab1dbb8b3546993eb611dfd7be8b" }, { - "name": ".\/tests\/app\/tests\/\/Internal\/Operation\/Pets\/NamesListingTest.php", - "hash": "2bd6f5a5c8d809760ade5ebb0c1ff3d9" + "name": "\/home\/wyrihaximus\/Projects\/PHPAPIClients\/openapi-client-generator\/tests\/test-app\/src\/Error\/Bird.php", + "hash": "bb1b5a0deb945ed731c5a98abf517783" }, { - "name": ".\/tests\/app\/src\/\/Internal\/Operation\/ShowPetById.php", - "hash": "c27f58ea100588a410786c5274652f59" + "name": "\/home\/wyrihaximus\/Projects\/PHPAPIClients\/openapi-client-generator\/tests\/test-app\/src\/Error\/Fish.php", + "hash": "3463524c263bfeecf9eea004a7f8fd9b" }, { - "name": ".\/tests\/app\/src\/\/Internal\/Operator\/ShowPetById.php", - "hash": "f106fffb57aa50c3916b664e55eb4b33" + "name": "\/home\/wyrihaximus\/Projects\/PHPAPIClients\/openapi-client-generator\/tests\/test-app\/src\/Error\/Error.php", + "hash": "f21ae525ddc01d1774a42795978ba7e5" }, { - "name": ".\/tests\/app\/tests\/\/Internal\/Operation\/ShowPetByIdTest.php", - "hash": "56a07d4a2fff947aa1a91312eb6d5f42" + "name": "\/home\/wyrihaximus\/Projects\/PHPAPIClients\/openapi-client-generator\/tests\/test-app\/src\/Error\/Legs.php", + "hash": "1569ae1c419451d491079acc15157302" }, { - "name": ".\/tests\/app\/src\/\/Contract\/Cat.php", - "hash": "b27e87adfdb0b253dd166baba2e722fd" + "name": "\/home\/wyrihaximus\/Projects\/PHPAPIClients\/openapi-client-generator\/tests\/test-app\/src\/Error\/Tails.php", + "hash": "8028144a8297c4410c1e33420544168f" }, { - "name": ".\/tests\/app\/src\/\/Contract\/Dog.php", - "hash": "4b8bf1158f13747f9c1e7dd683173f8b" + "name": "\/home\/wyrihaximus\/Projects\/PHPAPIClients\/openapi-client-generator\/tests\/test-app\/src\/Error\/Fins.php", + "hash": "0aaf0dc0a1b4c5bb8ceee2e1d520b950" }, { - "name": ".\/tests\/app\/src\/\/Contract\/HellHound.php", - "hash": "d2ef7b550643537c7df6d47a9975c414" + "name": "\/home\/wyrihaximus\/Projects\/PHPAPIClients\/openapi-client-generator\/tests\/test-app\/src\/Error\/Wings.php", + "hash": "5f2d34c62206c705df2399df69443ff6" }, { - "name": ".\/tests\/app\/src\/\/Contract\/Spider.php", - "hash": "67eb1aa8c944170ae93b3d9167b148a1" + "name": "\/home\/wyrihaximus\/Projects\/PHPAPIClients\/openapi-client-generator\/tests\/test-app\/src\/Error\/RedEyes.php", + "hash": "df9bc6a1aec4416767ca0cad9379057a" }, { - "name": ".\/tests\/app\/src\/\/Contract\/Bird.php", - "hash": "dcbced63bad5795cbada26277a7cda78" + "name": "\/home\/wyrihaximus\/Projects\/PHPAPIClients\/openapi-client-generator\/tests\/test-app\/src\/Error\/GreenEyes.php", + "hash": "3bd000e905607d0c7ff2b3cf937dcb27" }, { - "name": ".\/tests\/app\/src\/\/Contract\/Fish.php", - "hash": "ae2166fca603aa40e8143c44d965d073" + "name": "\/home\/wyrihaximus\/Projects\/PHPAPIClients\/openapi-client-generator\/tests\/test-app\/src\/Error\/YellowEyes.php", + "hash": "3acd885859fc50e438f8393db8fbd970" }, { - "name": ".\/tests\/app\/src\/\/Contract\/Error.php", - "hash": "888aac4e2dfd815ae61650be7c9a030c" + "name": "\/home\/wyrihaximus\/Projects\/PHPAPIClients\/openapi-client-generator\/tests\/test-app\/src\/Error\/BlackEyes.php", + "hash": "97d7ab2e137220b7970ce9e9a60412e4" }, { - "name": ".\/tests\/app\/src\/\/Contract\/Legs.php", - "hash": "a92256f12b2c73f6570dfe6c5f1c73e4" + "name": "\/home\/wyrihaximus\/Projects\/PHPAPIClients\/openapi-client-generator\/tests\/test-app\/src\/Error\/BlueEyes.php", + "hash": "9246bb96fd82e7a2903f8249cf61eb18" }, { - "name": ".\/tests\/app\/src\/\/Contract\/Tails.php", - "hash": "66fa727e0d2d200b697fa4c551690703" + "name": "\/home\/wyrihaximus\/Projects\/PHPAPIClients\/openapi-client-generator\/tests\/test-app\/src\/Error\/EyeCount.php", + "hash": "d6c8745ae1cc35d05a2a1d871ca3359d" }, { - "name": ".\/tests\/app\/src\/\/Contract\/Fins.php", - "hash": "5015c047ef897ed7158b61dccf0eecc6" + "name": "\/home\/wyrihaximus\/Projects\/PHPAPIClients\/openapi-client-generator\/tests\/test-app\/src\/Error\/Cat\/Features.php", + "hash": "6fd427b51bdf244d4b8677296d18d20c" }, { - "name": ".\/tests\/app\/src\/\/Contract\/Wings.php", - "hash": "e9570bc1c4d2f81bd585bf5460846d16" + "name": "\/home\/wyrihaximus\/Projects\/PHPAPIClients\/openapi-client-generator\/tests\/test-app\/src\/Error\/HellHound\/Eyes.php", + "hash": "5307680026308db56b5f0e918e649b9f" }, { - "name": ".\/tests\/app\/src\/\/Contract\/RedEyes.php", - "hash": "6323cdda485882f06d3ac6c8a91c1724" + "name": "\/home\/wyrihaximus\/Projects\/PHPAPIClients\/openapi-client-generator\/tests\/test-app\/src\/Error\/Operations\/Pets\/List_\/Response\/ApplicationJson\/Ok.php", + "hash": "edce95dfb79ffa9d77d4da9fce25a941" }, { - "name": ".\/tests\/app\/src\/\/Contract\/RedEyes\/A.php", - "hash": "0ded9db3063fc1d083faccbe90fced50" + "name": "\/home\/wyrihaximus\/Projects\/PHPAPIClients\/openapi-client-generator\/tests\/test-app\/src\/Error\/Pets\/Create\/Request\/ApplicationJson.php", + "hash": "884165042a3110f84faf480aeae881cd" }, { - "name": ".\/tests\/app\/src\/\/Contract\/GreenEyes.php", - "hash": "9ea4e67be717aeaa917577d09d94e951" + "name": "\/home\/wyrihaximus\/Projects\/PHPAPIClients\/openapi-client-generator\/tests\/test-app\/src\/Error\/Operations\/Pets\/Kinds\/Walking\/Response\/ApplicationJson\/Ok.php", + "hash": "3c2d388b1a189b49b53c08e1c349ca95" }, { - "name": ".\/tests\/app\/src\/\/Contract\/YellowEyes.php", - "hash": "8ba3be68dd394a4579ccd2f66fa00415" + "name": "\/home\/wyrihaximus\/Projects\/PHPAPIClients\/openapi-client-generator\/tests\/test-app\/src\/Error\/Operations\/Pets\/Grouped\/By\/Type\/Response\/ApplicationJson\/Ok.php", + "hash": "54d4f2601f6646ed15431c750ddd3810" }, { - "name": ".\/tests\/app\/src\/\/Contract\/BlackEyes.php", - "hash": "ba7dc750473a4fc8caef228933de78b7" + "name": "\/home\/wyrihaximus\/Projects\/PHPAPIClients\/openapi-client-generator\/tests\/test-app\/src\/Error\/Operations\/Pets\/Names\/Response\/ApplicationJson\/Ok.php", + "hash": "fe5cd0b2bd77189deb351b36878550d6" }, { - "name": ".\/tests\/app\/src\/\/Contract\/BlueEyes.php", - "hash": "d583ccd34c5dd526f16bee0d74ccc1fe" + "name": "\/home\/wyrihaximus\/Projects\/PHPAPIClients\/openapi-client-generator\/tests\/test-app\/src\/Error\/Operations\/ShowPetById\/Response\/ApplicationJson\/Ok.php", + "hash": "e58a677bee8b8fb9a5cf84b3980c8164" }, { - "name": ".\/tests\/app\/src\/\/Contract\/Cat\/Features.php", - "hash": "12e61b11807152ba3c71ef854c2d0ba7" + "name": "\/home\/wyrihaximus\/Projects\/PHPAPIClients\/openapi-client-generator\/tests\/test-app\/src\/Internal\/Attribute\/CastUnionToType\/Single\/Schema\/Cat\/Eyes.php", + "hash": "fe27d84b3777e11d6d5933c001b8ccdc" }, { - "name": ".\/tests\/app\/src\/\/Contract\/HellHound\/Eyes.php", - "hash": "43d9c8abf2ea3507db3499a57c730eb3" + "name": "\/home\/wyrihaximus\/Projects\/PHPAPIClients\/openapi-client-generator\/tests\/test-app\/src\/Internal\/Attribute\/CastUnionToType\/Multiple\/Schema\/Cat\/Eyes.php", + "hash": "eb3c137aff06bde7fd2eaaa1b280bbe6" }, { - "name": ".\/tests\/app\/src\/\/Contract\/Operations\/Pets\/List_\/Response\/ApplicationJson\/Ok.php", - "hash": "3af7854e4196f13457cdd01aeffeb30c" + "name": "\/home\/wyrihaximus\/Projects\/PHPAPIClients\/openapi-client-generator\/tests\/test-app\/src\/Schema\/Cat.php", + "hash": "9594a3951f6128f203e8abd89e4a7009" }, { - "name": ".\/tests\/app\/src\/\/Contract\/Pets\/Create\/Request\/ApplicationJson.php", - "hash": "23c8c398cc7e8483fd9f89fc39ed7fbd" + "name": "\/home\/wyrihaximus\/Projects\/PHPAPIClients\/openapi-client-generator\/tests\/test-app\/src\/Internal\/Attribute\/CastUnionToType\/Single\/Schema\/Dog\/Eyes.php", + "hash": "9d98a4a16ad397f4ae8610b76053af2f" }, { - "name": ".\/tests\/app\/src\/\/Contract\/Operations\/Pets\/Kinds\/Walking\/Response\/ApplicationJson\/Ok.php", - "hash": "5021e52be7c2b44ce04df206dda33b53" + "name": "\/home\/wyrihaximus\/Projects\/PHPAPIClients\/openapi-client-generator\/tests\/test-app\/src\/Internal\/Attribute\/CastUnionToType\/Multiple\/Schema\/Dog\/Eyes.php", + "hash": "9e22f26b5cb0cbf97fd1cf88926a7154" }, { - "name": ".\/tests\/app\/src\/\/Contract\/Operations\/Pets\/Grouped\/By\/Type\/Response\/ApplicationJson\/Ok.php", - "hash": "c7dba030163738f70d3d10673cb31d4e" + "name": "\/home\/wyrihaximus\/Projects\/PHPAPIClients\/openapi-client-generator\/tests\/test-app\/src\/Schema\/Dog.php", + "hash": "edfb5e1fe67bae5944733a562ecb7ec3" }, { - "name": ".\/tests\/app\/src\/\/Contract\/Operations\/Pets\/Names\/Response\/ApplicationJson\/Ok.php", - "hash": "43c07e4ce6bde480632b657eaa44558f" + "name": "\/home\/wyrihaximus\/Projects\/PHPAPIClients\/openapi-client-generator\/tests\/test-app\/src\/Schema\/HellHound.php", + "hash": "09e8390153c8c16e5e72c9fd17c95484" }, { - "name": ".\/tests\/app\/src\/\/Contract\/Operations\/ShowPetById\/Response\/ApplicationJson\/Ok.php", - "hash": "d9bfc89607641c5aa96c3f878c8bd923" + "name": "\/home\/wyrihaximus\/Projects\/PHPAPIClients\/openapi-client-generator\/tests\/test-app\/src\/Internal\/Attribute\/CastUnionToType\/Single\/Schema\/Spider\/Eyes.php", + "hash": "44c3e6d6afb5389f55ae82bf88e6342e" }, { - "name": ".\/tests\/app\/src\/\/Internal\/Attribute\/CastUnionToType\/Single\/Schema\/Cat\/Eyes.php", - "hash": "cddfbcb1e600bdd28629759fe4b9889a" + "name": "\/home\/wyrihaximus\/Projects\/PHPAPIClients\/openapi-client-generator\/tests\/test-app\/src\/Internal\/Attribute\/CastUnionToType\/Multiple\/Schema\/Spider\/Eyes.php", + "hash": "006aa38da422f09ced50e2e785dd074d" }, { - "name": ".\/tests\/app\/src\/\/Internal\/Attribute\/CastUnionToType\/Multiple\/Schema\/Cat\/Eyes.php", - "hash": "503c33760dfe73b24a02bd20bfe4998d" + "name": "\/home\/wyrihaximus\/Projects\/PHPAPIClients\/openapi-client-generator\/tests\/test-app\/src\/Schema\/Spider.php", + "hash": "aea109a98901ff0d9a9284c4f39c0c26" }, { - "name": ".\/tests\/app\/src\/\/Schema\/Cat.php", - "hash": "ef4d11cfdac8fdd48315578396dbaf10" + "name": "\/home\/wyrihaximus\/Projects\/PHPAPIClients\/openapi-client-generator\/tests\/test-app\/src\/Internal\/Attribute\/CastUnionToType\/Single\/Schema\/Bird\/Eyes.php", + "hash": "49d89300aa522c4e659d02ad8ad2a204" }, { - "name": ".\/tests\/app\/src\/\/Internal\/Attribute\/CastUnionToType\/Single\/Schema\/Dog\/Eyes.php", - "hash": "4fb880d277bb77b8ab11e2358dd40575" + "name": "\/home\/wyrihaximus\/Projects\/PHPAPIClients\/openapi-client-generator\/tests\/test-app\/src\/Schema\/Bird.php", + "hash": "c82e87b5e823f81c8d2d07fbe617f0c0" }, { - "name": ".\/tests\/app\/src\/\/Internal\/Attribute\/CastUnionToType\/Multiple\/Schema\/Dog\/Eyes.php", - "hash": "a21475e3742fbd1cc55f1f14ab21bc33" + "name": "\/home\/wyrihaximus\/Projects\/PHPAPIClients\/openapi-client-generator\/tests\/test-app\/src\/Internal\/Attribute\/CastUnionToType\/Single\/Schema\/Fish\/Eyes.php", + "hash": "5c53e4cac5816017a0192ce8735956b1" }, { - "name": ".\/tests\/app\/src\/\/Schema\/Dog.php", - "hash": "40843550ef160f86ce22d73c95a9bd2e" + "name": "\/home\/wyrihaximus\/Projects\/PHPAPIClients\/openapi-client-generator\/tests\/test-app\/src\/Schema\/Fish.php", + "hash": "090fb832f71e889596e459c52c4355cd" }, { - "name": ".\/tests\/app\/src\/\/Schema\/HellHound.php", - "hash": "6535e0dc68e97b4436096f6a4e40a61b" + "name": "\/home\/wyrihaximus\/Projects\/PHPAPIClients\/openapi-client-generator\/tests\/test-app\/src\/Schema\/Error.php", + "hash": "7f2560163c07df1768f14a85cf68acc8" }, { - "name": ".\/tests\/app\/src\/\/Internal\/Attribute\/CastUnionToType\/Single\/Schema\/Spider\/Eyes.php", - "hash": "6d7ff273e85dd03a767677eff11631ce" + "name": "\/home\/wyrihaximus\/Projects\/PHPAPIClients\/openapi-client-generator\/tests\/test-app\/src\/Schema\/Legs.php", + "hash": "ef629db4c2a0f9e9dfa7710483219ca2" }, { - "name": ".\/tests\/app\/src\/\/Internal\/Attribute\/CastUnionToType\/Multiple\/Schema\/Spider\/Eyes.php", - "hash": "7f117477922ccc957817fcc47b83177f" + "name": "\/home\/wyrihaximus\/Projects\/PHPAPIClients\/openapi-client-generator\/tests\/test-app\/src\/Schema\/Tails.php", + "hash": "df8762fe4462a174c114e99bdb7a6562" }, { - "name": ".\/tests\/app\/src\/\/Schema\/Spider.php", - "hash": "afcb2fcbc5f4af4a16acf8250f62a56f" + "name": "\/home\/wyrihaximus\/Projects\/PHPAPIClients\/openapi-client-generator\/tests\/test-app\/src\/Schema\/Fins.php", + "hash": "2bab7ce5e8e5c3c8b73f249e0a84b346" }, { - "name": ".\/tests\/app\/src\/\/Internal\/Attribute\/CastUnionToType\/Single\/Schema\/Bird\/Eyes.php", - "hash": "18bdd1915bbd9a5152e5dc5f98af70dd" + "name": "\/home\/wyrihaximus\/Projects\/PHPAPIClients\/openapi-client-generator\/tests\/test-app\/src\/Schema\/Wings.php", + "hash": "cd1bcfcfe0243eda2002bad1ef771348" }, { - "name": ".\/tests\/app\/src\/\/Schema\/Bird.php", - "hash": "7fbc410f283b5ce5f3ff6cbacb00d2f3" + "name": "\/home\/wyrihaximus\/Projects\/PHPAPIClients\/openapi-client-generator\/tests\/test-app\/src\/Schema\/RedEyes.php", + "hash": "db973fbd06f9b6e8086e6ceac140eadb" }, { - "name": ".\/tests\/app\/src\/\/Internal\/Attribute\/CastUnionToType\/Single\/Schema\/Fish\/Eyes.php", - "hash": "f9572ac57d6b2ff7cc69e64c64fdac03" + "name": "\/home\/wyrihaximus\/Projects\/PHPAPIClients\/openapi-client-generator\/tests\/test-app\/src\/Schema\/GreenEyes.php", + "hash": "95e056110c122f75a4bc6c8e008ac71d" }, { - "name": ".\/tests\/app\/src\/\/Schema\/Fish.php", - "hash": "6ec9eaa63e42a5967c467f241b3fde4c" + "name": "\/home\/wyrihaximus\/Projects\/PHPAPIClients\/openapi-client-generator\/tests\/test-app\/src\/Schema\/YellowEyes.php", + "hash": "23ebc1dd5c498b5a236f558efd78acdd" }, { - "name": ".\/tests\/app\/src\/\/Schema\/Error.php", - "hash": "f80f769c7a4c8c68aea934d6ab348753" + "name": "\/home\/wyrihaximus\/Projects\/PHPAPIClients\/openapi-client-generator\/tests\/test-app\/src\/Schema\/BlackEyes.php", + "hash": "d991253fe3bfce4aae265c7ecfea046f" }, { - "name": ".\/tests\/app\/src\/\/Error\/Error.php", - "hash": "feb248b9aaa268d799d22ce3a0d32d82" + "name": "\/home\/wyrihaximus\/Projects\/PHPAPIClients\/openapi-client-generator\/tests\/test-app\/src\/Schema\/BlueEyes.php", + "hash": "ff8359a892151497f3aed1eb093244c4" }, { - "name": ".\/tests\/app\/src\/\/Schema\/Legs.php", - "hash": "b67532b7c8ac986f616080402baac75d" + "name": "\/home\/wyrihaximus\/Projects\/PHPAPIClients\/openapi-client-generator\/tests\/test-app\/src\/Schema\/EyeCount.php", + "hash": "bbb6759380942cb7864ed15a5428b70d" }, { - "name": ".\/tests\/app\/src\/\/Schema\/Tails.php", - "hash": "b014236ffacd12123d41632522be3a0d" + "name": "\/home\/wyrihaximus\/Projects\/PHPAPIClients\/openapi-client-generator\/tests\/test-app\/src\/Schema\/Cat\/Features.php", + "hash": "4f0f948efe9531e85f9768f97af61b11" }, { - "name": ".\/tests\/app\/src\/\/Schema\/Fins.php", - "hash": "81b9d536290a1ae0be0b6044de7dcf85" + "name": "\/home\/wyrihaximus\/Projects\/PHPAPIClients\/openapi-client-generator\/tests\/test-app\/src\/Schema\/HellHound\/Eyes.php", + "hash": "65c6ab721e49cfd75317e7ca749de438" }, { - "name": ".\/tests\/app\/src\/\/Schema\/Wings.php", - "hash": "338b33430ecb97c1344c8bc9e8723bba" + "name": "\/home\/wyrihaximus\/Projects\/PHPAPIClients\/openapi-client-generator\/tests\/test-app\/src\/Schema\/Operations\/Pets\/List_\/Response\/ApplicationJson\/Ok.php", + "hash": "335c24bf15fb42bdb9d6c0b74f93d559" }, { - "name": ".\/tests\/app\/src\/\/Schema\/RedEyes.php", - "hash": "fdac8c22a648ed1ab185ec9901ab24ce" + "name": "\/home\/wyrihaximus\/Projects\/PHPAPIClients\/openapi-client-generator\/tests\/test-app\/src\/Schema\/Pets\/Create\/Request\/ApplicationJson.php", + "hash": "e09d7fb5e9e6c8994eaba0f4d21eb2bf" }, { - "name": ".\/tests\/app\/src\/\/Schema\/GreenEyes.php", - "hash": "4a74d6a7d6c2e5e6dc664ef559092127" + "name": "\/home\/wyrihaximus\/Projects\/PHPAPIClients\/openapi-client-generator\/tests\/test-app\/src\/Schema\/Operations\/Pets\/Kinds\/Walking\/Response\/ApplicationJson\/Ok.php", + "hash": "6262fad11d86d5ff14674dc00ac8ff8c" }, { - "name": ".\/tests\/app\/src\/\/Schema\/YellowEyes.php", - "hash": "906c2067a33469c829d8b7ebfce513d1" + "name": "\/home\/wyrihaximus\/Projects\/PHPAPIClients\/openapi-client-generator\/tests\/test-app\/src\/Internal\/Attribute\/CastUnionToType\/Single\/Schema\/Operations\/Pets\/Grouped\/By\/Type\/Response\/ApplicationJson\/Ok\/Pets.php", + "hash": "b2ec410e4550f8cb2f5ddf04876f1982" }, { - "name": ".\/tests\/app\/src\/\/Schema\/BlackEyes.php", - "hash": "3ceafa5ee4635806c15fd3aeff58d860" + "name": "\/home\/wyrihaximus\/Projects\/PHPAPIClients\/openapi-client-generator\/tests\/test-app\/src\/Internal\/Attribute\/CastUnionToType\/Multiple\/Schema\/Operations\/Pets\/Grouped\/By\/Type\/Response\/ApplicationJson\/Ok\/Pets.php", + "hash": "9d52606e91c9b96fdb8d9ac55c02c890" }, { - "name": ".\/tests\/app\/src\/\/Schema\/BlueEyes.php", - "hash": "17adf4d334500e864b4d0c94de3abb66" + "name": "\/home\/wyrihaximus\/Projects\/PHPAPIClients\/openapi-client-generator\/tests\/test-app\/src\/Schema\/Operations\/Pets\/Grouped\/By\/Type\/Response\/ApplicationJson\/Ok.php", + "hash": "a190c957c8c004683db38ddc4086ddc4" }, { - "name": ".\/tests\/app\/src\/\/Schema\/EyeCount.php", - "hash": "7bfe00b00b8ebe42ed6f5e2a37c385ef" + "name": "\/home\/wyrihaximus\/Projects\/PHPAPIClients\/openapi-client-generator\/tests\/test-app\/src\/Schema\/Operations\/Pets\/Names\/Response\/ApplicationJson\/Ok.php", + "hash": "5d609d8a79fdf1c6d4d82aa18345d625" }, { - "name": ".\/tests\/app\/src\/\/Schema\/Cat\/Features.php", - "hash": "42309d9c833e24d88590ae6dd14a228a" + "name": "\/home\/wyrihaximus\/Projects\/PHPAPIClients\/openapi-client-generator\/tests\/test-app\/src\/Schema\/Operations\/ShowPetById\/Response\/ApplicationJson\/Ok.php", + "hash": "fd49dfbcd2ccbefe53bd6a0ebecd3555" }, { - "name": ".\/tests\/app\/src\/\/Schema\/HellHound\/Eyes.php", - "hash": "0b6d5980da015ccf4d44d7ccf051886e" + "name": "\/home\/wyrihaximus\/Projects\/PHPAPIClients\/openapi-client-generator\/tests\/test-app\/src\/Internal\/Hydrator\/Operation\/Pets.php", + "hash": "0c061ecf1e1ceeab3ffddf43e4a5a0f4" }, { - "name": ".\/tests\/app\/src\/\/Schema\/Operations\/Pets\/List_\/Response\/ApplicationJson\/Ok.php", - "hash": "eb4bde06394e697066d745898decafe5" + "name": "\/home\/wyrihaximus\/Projects\/PHPAPIClients\/openapi-client-generator\/tests\/test-app\/src\/Internal\/Hydrator\/Operation\/Pets\/Gatos.php", + "hash": "2f7648546e0d243741265728476ba08e" }, { - "name": ".\/tests\/app\/src\/\/Schema\/Pets\/Create\/Request\/ApplicationJson.php", - "hash": "b3fe54e8ff3b295241c9b95089a60f20" + "name": "\/home\/wyrihaximus\/Projects\/PHPAPIClients\/openapi-client-generator\/tests\/test-app\/src\/Internal\/Hydrator\/Operation\/Pets\/Kinds\/Walking.php", + "hash": "a67a1a58da00a984049c01c2672faa57" }, { - "name": ".\/tests\/app\/src\/\/Schema\/Operations\/Pets\/Kinds\/Walking\/Response\/ApplicationJson\/Ok.php", - "hash": "d345051d1e2d8f2a301400efac81491c" + "name": "\/home\/wyrihaximus\/Projects\/PHPAPIClients\/openapi-client-generator\/tests\/test-app\/src\/Internal\/Hydrator\/Operation\/Pets\/GroupedByType.php", + "hash": "362558281211bab266ee7c7e93d5bc1b" }, { - "name": ".\/tests\/app\/src\/\/Internal\/Attribute\/CastUnionToType\/Single\/Schema\/Operations\/Pets\/Grouped\/By\/Type\/Response\/ApplicationJson\/Ok\/Pets.php", - "hash": "332c053b25e90067f64fcfa1805a9cfb" + "name": "\/home\/wyrihaximus\/Projects\/PHPAPIClients\/openapi-client-generator\/tests\/test-app\/src\/Internal\/Hydrator\/Operation\/Pets\/Names.php", + "hash": "5f59670b97735964a834b39416a9d3e9" }, { - "name": ".\/tests\/app\/src\/\/Internal\/Attribute\/CastUnionToType\/Multiple\/Schema\/Operations\/Pets\/Grouped\/By\/Type\/Response\/ApplicationJson\/Ok\/Pets.php", - "hash": "ce24c150645696a7ce97483ecbc9f314" + "name": "\/home\/wyrihaximus\/Projects\/PHPAPIClients\/openapi-client-generator\/tests\/test-app\/src\/Internal\/Hydrator\/Operation\/Pets\/Petid.php", + "hash": "5c6f2b3757a2c419ffe41fd4b1f02adb" }, { - "name": ".\/tests\/app\/src\/\/Schema\/Operations\/Pets\/Grouped\/By\/Type\/Response\/ApplicationJson\/Ok.php", - "hash": "7817c48c0faf01e7464f83bd9cf1b190" + "name": "\/home\/wyrihaximus\/Projects\/PHPAPIClients\/openapi-client-generator\/tests\/test-app\/src\/Internal\/Hydrators.php", + "hash": "a7614b77b839bd181a29d5dd0b50ffbb" }, { - "name": ".\/tests\/app\/src\/\/Schema\/Operations\/Pets\/Names\/Response\/ApplicationJson\/Ok.php", - "hash": "4a301cd45b2aa9e0c3bb4e27b59b145b" + "name": "\/home\/wyrihaximus\/Projects\/PHPAPIClients\/openapi-client-generator\/tests\/test-app\/Makefile", + "hash": "9f5392c2286b0d7c55613dc69f23f2c8" }, { - "name": ".\/tests\/app\/src\/\/Schema\/Operations\/ShowPetById\/Response\/ApplicationJson\/Ok.php", - "hash": "718bf83915b749a6b1967a6c5f1062f0" + "name": "\/home\/wyrihaximus\/Projects\/PHPAPIClients\/openapi-client-generator\/tests\/test-app\/composer.json", + "hash": "231d105287cd1ef41859e6f4ebac4c58" }, { - "name": ".\/tests\/app\/src\/\/ClientInterface.php", - "hash": "3c95cda80a5d5a0035ffd8d0b1978b3e" + "name": "\/home\/wyrihaximus\/Projects\/PHPAPIClients\/openapi-client-generator\/tests\/test-app\/src\/Internal\/Operation\/Pets\/List_.php", + "hash": "30e05e4eb97d8802f75c654b3c8f0165" }, { - "name": ".\/tests\/app\/src\/\/Client.php", - "hash": "50273a0e8ee86c0f309aa5a1bc78c304" + "name": "\/home\/wyrihaximus\/Projects\/PHPAPIClients\/openapi-client-generator\/tests\/test-app\/src\/Internal\/Operator\/Pets\/List_.php", + "hash": "5ed669feb3c29d8001314db2f8ecc089" }, { - "name": ".\/tests\/app\/src\/\/Internal\/Router\/Get\/Pets.php", - "hash": "26801353f33618f73545bb09d73546ee" + "name": "\/home\/wyrihaximus\/Projects\/PHPAPIClients\/openapi-client-generator\/tests\/test-app\/src\/Internal\/Operation\/Pets\/Create.php", + "hash": "5185bbde9f38a57db39033521e771172" }, { - "name": ".\/tests\/app\/src\/\/Internal\/Router\/Get\/PetsList.php", - "hash": "d28ed757714675cce217d3c3280c0573" + "name": "\/home\/wyrihaximus\/Projects\/PHPAPIClients\/openapi-client-generator\/tests\/test-app\/src\/Internal\/Operator\/Pets\/Create.php", + "hash": "d594b13effcac676daaeedeff4f91f3f" }, { - "name": ".\/tests\/app\/src\/\/Internal\/Router\/Get\/PetsGroupedBy.php", - "hash": "fd3134b03ec0d40e4dc21785efa3da75" + "name": "\/home\/wyrihaximus\/Projects\/PHPAPIClients\/openapi-client-generator\/tests\/test-app\/src\/Internal\/Operation\/Pets\/List_\/Gatos.php", + "hash": "9c6eb9f273cfe8b9c834c1344ad76b90" }, { - "name": ".\/tests\/app\/src\/\/Internal\/Router\/Get.php", - "hash": "c3cd1fe34e19e7d0c2377b4b9bce4939" + "name": "\/home\/wyrihaximus\/Projects\/PHPAPIClients\/openapi-client-generator\/tests\/test-app\/src\/Internal\/Operator\/Pets\/List_\/Gatos.php", + "hash": "896c635d1311bca05e179fb49d2993a2" }, { - "name": ".\/tests\/app\/src\/\/Internal\/Router\/Get\/PetsKinds.php", - "hash": "9749d3aa066946d3731d64224e6b033c" + "name": "\/home\/wyrihaximus\/Projects\/PHPAPIClients\/openapi-client-generator\/tests\/test-app\/src\/Internal\/Operation\/Pets\/Kinds\/Walking.php", + "hash": "375e9a57a970e05c6437361daf7dfe26" }, { - "name": ".\/tests\/app\/src\/\/Internal\/Router\/List\/Pets.php", - "hash": "34036592004d7410317c6bb615b184c1" + "name": "\/home\/wyrihaximus\/Projects\/PHPAPIClients\/openapi-client-generator\/tests\/test-app\/src\/Internal\/Operator\/Pets\/Kinds\/Walking.php", + "hash": "07f0af722689784ffabe3cd16dce4175" }, { - "name": ".\/tests\/app\/src\/\/Internal\/Router\/List\/PetsList.php", - "hash": "430159a271abdf64c6848458b8309969" + "name": "\/home\/wyrihaximus\/Projects\/PHPAPIClients\/openapi-client-generator\/tests\/test-app\/src\/Internal\/Operation\/Pets\/Grouped\/By\/Type.php", + "hash": "a842a23752d9fb46356ef6b2cd3704af" }, { - "name": ".\/tests\/app\/src\/\/Internal\/Router\/List\/PetsKinds.php", - "hash": "66365f2b04fb1ca518ce93e400481d72" + "name": "\/home\/wyrihaximus\/Projects\/PHPAPIClients\/openapi-client-generator\/tests\/test-app\/src\/Internal\/Operator\/Pets\/Grouped\/By\/Type.php", + "hash": "df0dc1a550aad45ae089f13dda43930c" }, { - "name": ".\/tests\/app\/src\/\/Internal\/Router\/Post\/Pets.php", - "hash": "6a2b6ef8dc6fe4e7f0cfcc03a14ef916" + "name": "\/home\/wyrihaximus\/Projects\/PHPAPIClients\/openapi-client-generator\/tests\/test-app\/src\/Internal\/Operation\/Pets\/Names.php", + "hash": "f7616e3288243bb12e51267df447990d" }, { - "name": ".\/tests\/app\/src\/\/Internal\/Router\/Get\/Two.php", - "hash": "1c7472aa0e0a0f1719afb3017c1f0d40" + "name": "\/home\/wyrihaximus\/Projects\/PHPAPIClients\/openapi-client-generator\/tests\/test-app\/src\/Internal\/Operator\/Pets\/Names.php", + "hash": "b6c7b543e9834a7c37340efa66aad287" }, { - "name": ".\/tests\/app\/src\/\/Internal\/Router\/Get\/Three.php", - "hash": "b87dabf60f65b189e3ad0ea673cb5b0f" + "name": "\/home\/wyrihaximus\/Projects\/PHPAPIClients\/openapi-client-generator\/tests\/test-app\/src\/Internal\/Operation\/ShowPetById.php", + "hash": "0d66a6ce8bf2a74ca3dd6e2a3fb6a35f" }, { - "name": ".\/tests\/app\/src\/\/Internal\/Router\/Get\/Four.php", - "hash": "8556a87f9c23c5f5cc3719b45c33da71" + "name": "\/home\/wyrihaximus\/Projects\/PHPAPIClients\/openapi-client-generator\/tests\/test-app\/src\/Internal\/Operator\/ShowPetById.php", + "hash": "98466c1bca05b8260023bca429a22e99" }, { - "name": ".\/tests\/app\/src\/\/Internal\/Router\/List\/Two.php", - "hash": "353e1d0a404c9aa1bb071279cc5de22c" + "name": "\/home\/wyrihaximus\/Projects\/PHPAPIClients\/openapi-client-generator\/tests\/test-app\/src\/OperationsInterface.php", + "hash": "8d90aa322d2d1589f1303476ad5f65c7" }, { - "name": ".\/tests\/app\/src\/\/Internal\/Router\/List\/Three.php", - "hash": "5c677ce26874a1d04eced0390b5b6582" + "name": "\/home\/wyrihaximus\/Projects\/PHPAPIClients\/openapi-client-generator\/tests\/test-app\/src\/Operations.php", + "hash": "5580ac87a9b3832776d2647c86d0afab" }, { - "name": ".\/tests\/app\/src\/\/Internal\/Router\/List\/Four.php", - "hash": "fa8bfd9dd72921449a8f9e7337ed1506" + "name": "\/home\/wyrihaximus\/Projects\/PHPAPIClients\/openapi-client-generator\/tests\/test-app\/src\/Internal\/Operators.php", + "hash": "b210597dba0a1d3c2bc8d4e6a7035bdc" }, { - "name": ".\/tests\/app\/src\/\/Internal\/Router\/Post\/Two.php", - "hash": "259311d4ce584913ad28482b216ccb1f" + "name": "\/home\/wyrihaximus\/Projects\/PHPAPIClients\/openapi-client-generator\/tests\/test-app\/src\/ClientInterface.php", + "hash": "f581126e4e40e163c7b24a4e45100448" }, { - "name": ".\/tests\/app\/src\/\/Internal\/Routers.php", - "hash": "8204cdc19452a95d8556cd3baf5b02a6" + "name": "\/home\/wyrihaximus\/Projects\/PHPAPIClients\/openapi-client-generator\/tests\/test-app\/src\/Client.php", + "hash": "4875d5e2c75e15f01d6ecb045139b34a" }, { - "name": ".\/tests\/app\/src\/\/PHPStan\/ClientCallReturnTypes.php", - "hash": "479c4668570871f44c72d5d2e47684d1" + "name": "\/home\/wyrihaximus\/Projects\/PHPAPIClients\/openapi-client-generator\/tests\/test-app\/src\/Internal\/Router\/Get\/Pets.php", + "hash": "3d52d294c5494c0e9a3e8d7fd9fadaa0" }, { - "name": ".\/tests\/app\/tests\/\/Types\/ClientCallReturnTypes.php", - "hash": "e3edeeec0b2b86a5d1a0448533e0729e" + "name": "\/home\/wyrihaximus\/Projects\/PHPAPIClients\/openapi-client-generator\/tests\/test-app\/src\/Internal\/Router\/Get\/PetsList.php", + "hash": "dd59ed1c2f4ec4801e0e96cdcc297e39" }, { - "name": ".\/tests\/app\/src\/\/..\/etc\/phpstan-extension.neon", - "hash": "3d7b9f10231d14a80329ca810f476b3d" + "name": "\/home\/wyrihaximus\/Projects\/PHPAPIClients\/openapi-client-generator\/tests\/test-app\/src\/Internal\/Router\/Get\/PetsGroupedBy.php", + "hash": "7cf6113a184cc73a40fe6a16565269e5" + }, + { + "name": "\/home\/wyrihaximus\/Projects\/PHPAPIClients\/openapi-client-generator\/tests\/test-app\/src\/Internal\/Router\/Get.php", + "hash": "694589c85d19091fbc3cd7465b547112" + }, + { + "name": "\/home\/wyrihaximus\/Projects\/PHPAPIClients\/openapi-client-generator\/tests\/test-app\/src\/Internal\/Router\/Get\/PetsKinds.php", + "hash": "367c6205c3663f74562ceea71341045e" + }, + { + "name": "\/home\/wyrihaximus\/Projects\/PHPAPIClients\/openapi-client-generator\/tests\/test-app\/src\/Internal\/Router\/Post\/Pets.php", + "hash": "29d4f8f4978fac96aa286ad285ea25ac" + }, + { + "name": "\/home\/wyrihaximus\/Projects\/PHPAPIClients\/openapi-client-generator\/tests\/test-app\/src\/Internal\/Routers.php", + "hash": "6e7a9ea26c05cc9ad065d03d75895e2e" }, { - "name": ".\/tests\/app\/src\/\/OperationsInterface.php", - "hash": "59dc8c9c8649087bf7c3e7ee2866bed9" + "name": "\/home\/wyrihaximus\/Projects\/PHPAPIClients\/openapi-client-generator\/tests\/test-app\/src\/Internal\/Router\/Get\/Two.php", + "hash": "ff80b7f61d59fc0a035d708c19ac9afb" }, { - "name": ".\/tests\/app\/src\/\/Operation\/Pets.php", - "hash": "e10821cae7d62b7d07f0d2653fd4aeeb" + "name": "\/home\/wyrihaximus\/Projects\/PHPAPIClients\/openapi-client-generator\/tests\/test-app\/src\/Internal\/Router\/Get\/Three.php", + "hash": "79bb09a47361b547ad8a8dc5e7c2f3f1" }, { - "name": ".\/tests\/app\/src\/\/Operation\/PetsList.php", - "hash": "5dad30f80783e68cefd11f401b170d2d" + "name": "\/home\/wyrihaximus\/Projects\/PHPAPIClients\/openapi-client-generator\/tests\/test-app\/src\/Internal\/Router\/Get\/Four.php", + "hash": "692172076dfa2654286429fa45260256" + }, + { + "name": "\/home\/wyrihaximus\/Projects\/PHPAPIClients\/openapi-client-generator\/tests\/test-app\/src\/Internal\/Router\/Post\/Two.php", + "hash": "abf5c85dd48a567ee4d2a1ae4098b5bb" + }, + { + "name": "\/home\/wyrihaximus\/Projects\/PHPAPIClients\/openapi-client-generator\/tests\/test-app\/src\/PHPStan\/ClientCallReturnTypes.php", + "hash": "47b7f421a53030bfb30e014202736b8f" + }, + { + "name": "\/home\/wyrihaximus\/Projects\/PHPAPIClients\/openapi-client-generator\/tests\/test-app\/tests\/Types\/ClientCallReturnTypes.php", + "hash": "6fb44a0ad7181025fce078feea6c8776" + }, + { + "name": "\/home\/wyrihaximus\/Projects\/PHPAPIClients\/openapi-client-generator\/tests\/test-app\/etc\/phpstan-extension.neon", + "hash": "3d7b9f10231d14a80329ca810f476b3d" }, { - "name": ".\/tests\/app\/src\/\/Operation\/PetsKinds.php", - "hash": "5639df53f59d7fdcbf5f1a0951ce6359" + "name": "\/home\/wyrihaximus\/Projects\/PHPAPIClients\/openapi-client-generator\/tests\/test-app\/tests\/Internal\/Operation\/Pets\/List_Test.php", + "hash": "816b2ef68f625cbf2d26dea6eb2db7bd" }, { - "name": ".\/tests\/app\/src\/\/Operation\/PetsGroupedBy.php", - "hash": "116f94a4bf54b3186780de4c793c589d" + "name": "\/home\/wyrihaximus\/Projects\/PHPAPIClients\/openapi-client-generator\/tests\/test-app\/tests\/Internal\/Operation\/Pets\/CreateTest.php", + "hash": "44076d0f624a2e22b09bef1dc15971b4" }, { - "name": ".\/tests\/app\/src\/\/Internal\/Operators.php", - "hash": "9a327b2c58687e0ed2261c341c4e3422" + "name": "\/home\/wyrihaximus\/Projects\/PHPAPIClients\/openapi-client-generator\/tests\/test-app\/tests\/Internal\/Operation\/Pets\/List_\/GatosTest.php", + "hash": "22729ba49dfb8be9d430d86cb28c7a8e" }, { - "name": ".\/tests\/app\/src\/\/Operations.php", - "hash": "65089bd8b715ff442449eb7d7ed9b147" + "name": "\/home\/wyrihaximus\/Projects\/PHPAPIClients\/openapi-client-generator\/tests\/test-app\/tests\/Internal\/Operation\/Pets\/Kinds\/WalkingTest.php", + "hash": "05f349581beeacb4a413f9c68dc659b3" }, { - "name": ".\/tests\/app\/src\/\/Internal\/Hydrator\/Operation\/Pets.php", - "hash": "a051e5e611a2266ed49372835768dfc2" + "name": "\/home\/wyrihaximus\/Projects\/PHPAPIClients\/openapi-client-generator\/tests\/test-app\/tests\/Internal\/Operation\/Pets\/Grouped\/By\/TypeTest.php", + "hash": "58a77bad44420c855882cb0d9689be9a" }, { - "name": ".\/tests\/app\/src\/\/Internal\/Hydrator\/Operation\/Pets\/Gatos.php", - "hash": "fc5f76f6986c1c96eb7a4f9c98fb718e" + "name": "\/home\/wyrihaximus\/Projects\/PHPAPIClients\/openapi-client-generator\/tests\/test-app\/tests\/Internal\/Operation\/Pets\/NamesTest.php", + "hash": "34c1497a2614ca5ea56bc9e3909e809a" }, { - "name": ".\/tests\/app\/src\/\/Internal\/Hydrator\/Operation\/Pets\/Kinds\/Walking.php", - "hash": "90eb300e4cb8d0abe7a5159f53c0d9c7" + "name": "\/home\/wyrihaximus\/Projects\/PHPAPIClients\/openapi-client-generator\/tests\/test-app\/tests\/Internal\/Operation\/ShowPetByIdTest.php", + "hash": "49a45ece8cd721f0e598e45fce28342d" }, { - "name": ".\/tests\/app\/src\/\/Internal\/Hydrator\/Operation\/Pets\/GroupedByType.php", - "hash": "da2f224be43cb2cc7903f47638c196e1" + "name": "\/home\/wyrihaximus\/Projects\/PHPAPIClients\/openapi-client-generator\/tests\/test-app\/src\/Operation\/Pets.php", + "hash": "1e8e5d799e5983a9a8085500f61baba6" }, { - "name": ".\/tests\/app\/src\/\/Internal\/Hydrator\/Operation\/Pets\/Names.php", - "hash": "763360da3f82b554e30cd9c53a2c4c69" + "name": "\/home\/wyrihaximus\/Projects\/PHPAPIClients\/openapi-client-generator\/tests\/test-app\/src\/Operation\/PetsList.php", + "hash": "f6b8e2828be552d8f7e76f4beb5bcbaf" }, { - "name": ".\/tests\/app\/src\/\/Internal\/Hydrator\/Operation\/Pets\/PetId.php", - "hash": "bc9eff40e9278db28d7b6f2d56990eba" + "name": "\/home\/wyrihaximus\/Projects\/PHPAPIClients\/openapi-client-generator\/tests\/test-app\/src\/Operation\/PetsKinds.php", + "hash": "601ed564f2cc8b9b71544b2c2faf9d5d" }, { - "name": ".\/tests\/app\/src\/\/Internal\/Hydrators.php", - "hash": "fbb023471a07a315d08b4a3c8a1a797c" + "name": "\/home\/wyrihaximus\/Projects\/PHPAPIClients\/openapi-client-generator\/tests\/test-app\/src\/Operation\/PetsGroupedBy.php", + "hash": "90536e5fa6d172ffebdc5c5a0a4b6cd2" } ] }, @@ -528,7 +560,7 @@ "files": [ { "name": "composer.json", - "hash": "5f3a1e7681873ef9a8226a2a404267a9" + "hash": "567d4289eda75f5583c4d1e04e2bab96214b7ce74bfef44cf494171003d63c8563fae9f475152bdb15e467f33852e56d5a871a3a7cf6f722d72d01a0d2f9d6e5" }, { "name": "composer.lock", diff --git a/tests/app/openapi-client-petstore.yaml b/tests/app/openapi-client-petstore.yaml new file mode 100644 index 0000000..8a9bb87 --- /dev/null +++ b/tests/app/openapi-client-petstore.yaml @@ -0,0 +1,40 @@ +state: + file: etc/openapi-client-generator.state + additionalFiles: + - composer.json + - composer.lock +spec: petstore.yaml +namespace: + source: ApiClients\Client\PetStore + test: ApiClients\Tests\Client\PetStore +entryPoints: + call: true + operations: true + webHooks: false +destination: + root: app + source: src + test: tests +templates: + dir: app-templates + variables: + fullName: PetStore + packageName: petsore +schemas: + allowDuplication: true + useAliasesForDuplication: true +contentType: + - ApiClients\Tools\OpenApiClientGenerator\ContentType\Json + - ApiClients\Tools\OpenApiClientGenerator\ContentType\Raw +voter: + listOperation: + - ApiClients\Tools\OpenApiClientGenerator\Voter\ListOperation\PageAndPerPageInQuery + streamOperation: + - ApiClients\Tools\OpenApiClientGenerator\Voter\StreamOperation\DownloadInOperationId +qa: + phpcs: + enabled: true + phpstan: + enabled: true + configFilePath: etc/phpstan-extension.neon + diff --git a/tests/app/petstore.yaml b/tests/app/petstore.yaml new file mode 100644 index 0000000..87df27b --- /dev/null +++ b/tests/app/petstore.yaml @@ -0,0 +1,518 @@ +openapi: "3.1.0" +info: + version: 1.0.0 + title: Swagger Petstore + license: + name: MIT +servers: + - url: http://petstore.swagger.io/v1 +paths: + /pets: + get: + summary: List all pets + operationId: pets/list + tags: + - pets + parameters: + - "$ref": "#/components/parameters/per-page" + - "$ref": "#/components/parameters/page" + responses: + 200: + description: A paged array of pets + headers: + x-next: + description: A link to the next page of responses + schema: + type: string + content: + application/json: + schema: + type: array + items: + anyOf: + - $ref: "#/components/schemas/Cat" + - $ref: "#/components/schemas/Dog" + - $ref: "#/components/schemas/HellHound" + - $ref: "#/components/schemas/Bird" + - $ref: "#/components/schemas/Fish" + - $ref: "#/components/schemas/Spider" + default: + description: unexpected error + content: + application/json: + schema: + $ref: "#/components/schemas/Error" + post: + summary: Create a pet + operationId: pets/create + tags: + - pets + requestBody: + required: true + content: + application/json: + schema: + oneOf: + - $ref: "#/components/schemas/Cat" + - $ref: "#/components/schemas/Dog" + - $ref: "#/components/schemas/HellHound" + - $ref: "#/components/schemas/Bird" + - $ref: "#/components/schemas/Fish" + - $ref: "#/components/schemas/Spider" + responses: + 201: + description: Null response + default: + description: unexpected error + content: + application/json: + schema: + $ref: "#/components/schemas/Error" + /pets/gatos: + get: + summary: List all cats + operationId: pets/list/gatos + tags: + - cats + parameters: + - "$ref": "#/components/parameters/per-page" + - "$ref": "#/components/parameters/page" + responses: + 200: + description: A paged array of cats + headers: + x-next: + description: A link to the next page of cats + schema: + type: string + content: + application/json: + schema: + type: array + items: + $ref: "#/components/schemas/Cat" + default: + description: unexpected error + content: + application/json: + schema: + $ref: "#/components/schemas/Error" + /pets/kinds/walking: + get: + summary: List all cats + operationId: pets/kinds/walking + tags: + - cats + parameters: + - "$ref": "#/components/parameters/per-page" + - "$ref": "#/components/parameters/page" + responses: + 200: + description: A paged array of cats + headers: + x-next: + description: A link to the next page of cats + schema: + type: string + content: + application/json: + schema: + type: array + items: + type: object + oneOf: + - $ref: "#/components/schemas/Cat" + - $ref: "#/components/schemas/Dog" + - $ref: "#/components/schemas/HellHound" + default: + description: unexpected error + content: + application/json: + schema: + $ref: "#/components/schemas/Error" + /pets/groupedByType: + get: + summary: List all pets + operationId: pets/grouped/by/type + tags: + - cats + - dogs + parameters: + - "$ref": "#/components/parameters/per-page" + - "$ref": "#/components/parameters/page" + responses: + 200: + description: A shitty design choice to test a specific situation in the generator + headers: + x-next: + description: A link to the next page of cats + schema: + type: string + content: + application/json: + schema: + type: object + required: + - pets + properties: + pets: + type: array + items: + type: object + oneOf: + - $ref: "#/components/schemas/Cat" + - $ref: "#/components/schemas/Dog" + - $ref: "#/components/schemas/HellHound" + default: + description: unexpected error + content: + application/json: + schema: + $ref: "#/components/schemas/Error" + /pets/names: + get: + summary: List all pet names + operationId: pets/names + tags: + - cats + parameters: + - "$ref": "#/components/parameters/per-page" + - "$ref": "#/components/parameters/page" + responses: + 200: + description: A paged array of cats + headers: + x-next: + description: A link to the next page of cats + schema: + type: string + content: + application/json: + schema: + type: array + items: + type: string + default: + description: unexpected error + content: + application/json: + schema: + $ref: "#/components/schemas/Error" + /pets/{petId}: + get: + summary: Info for a specific pet + operationId: showPetById + tags: + - pets + responses: + 200: + description: Expected response to a valid request + content: + application/json: + schema: + oneOf: + - $ref: "#/components/schemas/Cat" + - $ref: "#/components/schemas/Dog" + - $ref: "#/components/schemas/Bird" + - $ref: "#/components/schemas/Fish" + - $ref: "#/components/schemas/Spider" + default: + description: unexpected error + content: + application/json: + schema: + $ref: "#/components/schemas/Error" +components: + schemas: + Cat: + type: object + required: + - id + - name + - indoor + - features + - eyes + properties: + id: + type: string + format: uuid + name: + type: string + indoor: + type: bool + features: + type: object + eyes: + type: array + minItems: 2 + maxItems: 2 + items: + type: object + anyOf: + - $ref: "#/components/schemas/RedEyes" + - $ref: "#/components/schemas/BlueEyes" + - $ref: "#/components/schemas/GreenEyes" + - $ref: "#/components/schemas/YellowEyes" + - $ref: "#/components/schemas/BlackEyes" + Dog: + type: object + required: + - id + - name + - good-boy + - eyes + properties: + id: + type: string + format: uuid + name: + type: string + good-boy: + type: bool + eyes: + type: array + minItems: 2 + maxItems: 2 + items: + type: object + oneOf: + - $ref: "#/components/schemas/RedEyes" + - $ref: "#/components/schemas/BlueEyes" + - $ref: "#/components/schemas/GreenEyes" + - $ref: "#/components/schemas/YellowEyes" + - $ref: "#/components/schemas/BlackEyes" + HellHound: + type: object + required: + - id + - name + - bad-boy + properties: + id: + type: integer + format: int64 + name: + type: string + bad-boy: + type: bool + eyes: + type: object + allOf: + - $ref: "#/components/schemas/RedEyes" + Spider: + type: object + required: + - id + - name + - eyes + - legs + properties: + id: + type: string + format: uuid + name: + type: string + legs: + type: array + minItems: 8 + maxItems: 8 + items: + type: string + eyes: + type: array + minItems: 8 + maxItems: 8 + items: + type: object + oneOf: + - $ref: "#/components/schemas/RedEyes" + - $ref: "#/components/schemas/BlueEyes" + - $ref: "#/components/schemas/GreenEyes" + - $ref: "#/components/schemas/YellowEyes" + - $ref: "#/components/schemas/BlackEyes" + Bird: + type: object + required: + - id + - name + - flies + - eyes + properties: + id: + type: string + format: uuid + name: + type: string4 + flies: + type: bool + eyes: + type: object + oneOf: + - $ref: "#/components/schemas/RedEyes" + - $ref: "#/components/schemas/BlueEyes" + - $ref: "#/components/schemas/GreenEyes" + - $ref: "#/components/schemas/YellowEyes" + - $ref: "#/components/schemas/BlackEyes" + Fish: + type: object + required: + - id + - name + - flat + - flies + - eyes + properties: + id: + type: string + format: uuid + name: + type: string + flat: + type: bool + flies: + type: bool + eyes: + type: object + oneOf: + - $ref: "#/components/schemas/RedEyes" + - $ref: "#/components/schemas/BlueEyes" + - $ref: "#/components/schemas/GreenEyes" + - $ref: "#/components/schemas/YellowEyes" + - $ref: "#/components/schemas/BlackEyes" + Error: + type: object + required: + - code + - message + properties: + code: + type: integer + format: int32 + message: + type: string + Legs: + type: object + required: + - count + - joints + properties: + count: + type: integer + joins: + type: integer + Tails: + type: object + required: + - count + properties: + count: + type: integer + Fins: + type: object + required: + - count + - spikes + properties: + count: + type: integer + spikes: + type: integer + Wings: + type: object + required: + - count + - features + properties: + count: + type: integer + features: + type: integer + RedEyes: + type: object + required: + - count + - type + allOf: + - $ref: "#/components/schemas/EyeCount" + - type: object + properties: + type: + type: string + enum: + - blood + - wine + - stale + GreenEyes: + type: object + required: + - count + - type + properties: + count: + type: integer + type: + type: string + enum: + - hulk + - forest + - feral + YellowEyes: + type: object + required: + - count + - type + properties: + count: + type: integer + type: + type: string + enum: + - snake + BlackEyes: + type: object + required: + - count + - type + properties: + count: + type: integer + type: + type: string + enum: + - rage + BlueEyes: + type: object + required: + - count + - type + properties: + count: + type: integer + type: + type: string + enum: + - sky + - boobies + EyeCount: + type: object + required: + - count + properties: + count: + type: integer + parameters: + page: + name: page + description: Page number of the results to fetch. + in: query + schema: + type: integer + default: 1 + per-page: + name: per_page + description: The number of results per page (max 100). + in: query + schema: + type: integer + default: 30 + diff --git a/tests/app/src/Client.php b/tests/app/src/Client.php index 83783ea..727f0b9 100644 --- a/tests/app/src/Client.php +++ b/tests/app/src/Client.php @@ -3,74 +3,49 @@ declare (strict_types=1); namespace ApiClients\Client\PetStore; -use ApiClients\Client\PetStore\Contract; -use ApiClients\Client\PetStore\Error as ErrorSchemas; -use ApiClients\Client\PetStore\Internal; -use ApiClients\Client\PetStore\Operation; -use ApiClients\Client\PetStore\Schema; -use League\OpenAPIValidation; -use React\Http; -use ApiClients\Contracts; final class Client implements ClientInterface { - private array $router = array(); + private array $router = []; private readonly OperationsInterface $operations; - private readonly Internal\Routers $routers; - public function __construct(\ApiClients\Contracts\HTTP\Headers\AuthenticationInterface $authentication, \React\Http\Browser $browser) + private readonly \ApiClients\Client\PetStore\Internal\Routers $routers; + public function __construct(private readonly \ApiClients\Contracts\HTTP\Headers\AuthenticationInterface $authentication, private \React\Http\Browser $browser) { - $browser = $browser->withBase('http://petstore.swagger.io/v1')->withFollowRedirects(false); + $browser = $browser->withFollowRedirects(false); $requestSchemaValidator = new \League\OpenAPIValidation\Schema\SchemaValidator(\League\OpenAPIValidation\Schema\SchemaValidator::VALIDATE_AS_REQUEST); $responseSchemaValidator = new \League\OpenAPIValidation\Schema\SchemaValidator(\League\OpenAPIValidation\Schema\SchemaValidator::VALIDATE_AS_RESPONSE); - $hydrators = new Internal\Hydrators(); - $this->operations = new Operations(new Internal\Operators(browser: $browser, authentication: $authentication, requestSchemaValidator: $requestSchemaValidator, responseSchemaValidator: $responseSchemaValidator, hydrators: $hydrators)); - $this->routers = new Internal\Routers(browser: $browser, authentication: $authentication, requestSchemaValidator: $requestSchemaValidator, responseSchemaValidator: $responseSchemaValidator, hydrators: $hydrators); + $hydrators = new \ApiClients\Client\PetStore\Internal\Hydrators(); + $this->operations = new Operations(new \ApiClients\Client\PetStore\Internal\Operators(authentication: $authentication, browser: $browser, requestSchemaValidator: $requestSchemaValidator, responseSchemaValidator: $responseSchemaValidator, hydrators: $hydrators)); + $this->routers = new \ApiClients\Client\PetStore\Internal\Routers(authentication: $authentication, browser: $browser, requestSchemaValidator: $requestSchemaValidator, responseSchemaValidator: $responseSchemaValidator, hydrators: $hydrators); } // phpcs:disable /** */ // phpcs:enable - public function call(string $call, array $params = array()) : iterable|\ApiClients\Tools\OpenApiClient\Utils\Response\WithoutBody|\ApiClients\Client\PetStore\Schema\Operations\Pets\Grouped\By\Type\Response\ApplicationJson\Ok|\ApiClients\Client\PetStore\Schema\Cat|\ApiClients\Client\PetStore\Schema\Dog|\ApiClients\Client\PetStore\Schema\Bird|\ApiClients\Client\PetStore\Schema\Fish|\ApiClients\Client\PetStore\Schema\Spider + public function call(string $call, array $params = []): Rx\Observable|ApiClients\Client\PetStore\Schema\Error|ApiClients\Tools\OpenApiClient\Utils\Response\WithoutBody|ApiClients\Client\PetStore\Schema\Operations\Pets\Grouped\By\Type\Response\ApplicationJson\Ok|ApiClients\Client\PetStore\Schema\Cat|ApiClients\Client\PetStore\Schema\Dog|ApiClients\Client\PetStore\Schema\Bird|ApiClients\Client\PetStore\Schema\Fish|ApiClients\Client\PetStore\Schema\Spider { [$method, $path] = explode(' ', $call); $pathChunks = explode('/', $path); $pathChunksCount = count($pathChunks); if ($method === 'GET') { if ($pathChunksCount === 2) { - if (\array_key_exists(Internal\Router\Get\Two::class, $this->router) == false) { + if (\array_key_exists(Internal\Router\Get\Two::class, $this->router) === false) { $this->router[Internal\Router\Get\Two::class] = new Internal\Router\Get\Two(routers: $this->routers); } return $this->router[Internal\Router\Get\Two::class]->call($call, $params, $pathChunks); } elseif ($pathChunksCount === 3) { - if (\array_key_exists(Internal\Router\Get\Three::class, $this->router) == false) { + if (\array_key_exists(Internal\Router\Get\Three::class, $this->router) === false) { $this->router[Internal\Router\Get\Three::class] = new Internal\Router\Get\Three(routers: $this->routers); } return $this->router[Internal\Router\Get\Three::class]->call($call, $params, $pathChunks); } elseif ($pathChunksCount === 4) { - if (\array_key_exists(Internal\Router\Get\Four::class, $this->router) == false) { + if (\array_key_exists(Internal\Router\Get\Four::class, $this->router) === false) { $this->router[Internal\Router\Get\Four::class] = new Internal\Router\Get\Four(routers: $this->routers); } return $this->router[Internal\Router\Get\Four::class]->call($call, $params, $pathChunks); } - } elseif ($method === 'LIST') { - if ($pathChunksCount === 2) { - if (\array_key_exists(Internal\Router\List\Two::class, $this->router) == false) { - $this->router[Internal\Router\List\Two::class] = new Internal\Router\List\Two(routers: $this->routers); - } - return $this->router[Internal\Router\List\Two::class]->call($call, $params, $pathChunks); - } elseif ($pathChunksCount === 3) { - if (\array_key_exists(Internal\Router\List\Three::class, $this->router) == false) { - $this->router[Internal\Router\List\Three::class] = new Internal\Router\List\Three(routers: $this->routers); - } - return $this->router[Internal\Router\List\Three::class]->call($call, $params, $pathChunks); - } elseif ($pathChunksCount === 4) { - if (\array_key_exists(Internal\Router\List\Four::class, $this->router) == false) { - $this->router[Internal\Router\List\Four::class] = new Internal\Router\List\Four(routers: $this->routers); - } - return $this->router[Internal\Router\List\Four::class]->call($call, $params, $pathChunks); - } } elseif ($method === 'POST') { if ($pathChunksCount === 2) { - if (\array_key_exists(Internal\Router\Post\Two::class, $this->router) == false) { + if (\array_key_exists(Internal\Router\Post\Two::class, $this->router) === false) { $this->router[Internal\Router\Post\Two::class] = new Internal\Router\Post\Two(routers: $this->routers); } return $this->router[Internal\Router\Post\Two::class]->call($call, $params, $pathChunks); @@ -78,7 +53,7 @@ public function call(string $call, array $params = array()) : iterable|\ApiClien } throw new \InvalidArgumentException(); } - public function operations() : OperationsInterface + public function operations(): OperationsInterface { return $this->operations; } diff --git a/tests/app/src/ClientInterface.php b/tests/app/src/ClientInterface.php index 6512832..09eba4e 100644 --- a/tests/app/src/ClientInterface.php +++ b/tests/app/src/ClientInterface.php @@ -3,20 +3,12 @@ declare (strict_types=1); namespace ApiClients\Client\PetStore; -use ApiClients\Client\PetStore\Contract; -use ApiClients\Client\PetStore\Error as ErrorSchemas; -use ApiClients\Client\PetStore\Internal; -use ApiClients\Client\PetStore\Operation; -use ApiClients\Client\PetStore\Schema; -use League\OpenAPIValidation; -use React\Http; -use ApiClients\Contracts; interface ClientInterface { // phpcs:disable /** */ // phpcs:enabled - public function call(string $call, array $params = array()) : iterable|\ApiClients\Tools\OpenApiClient\Utils\Response\WithoutBody|\ApiClients\Client\PetStore\Schema\Operations\Pets\Grouped\By\Type\Response\ApplicationJson\Ok|\ApiClients\Client\PetStore\Schema\Cat|\ApiClients\Client\PetStore\Schema\Dog|\ApiClients\Client\PetStore\Schema\Bird|\ApiClients\Client\PetStore\Schema\Fish|\ApiClients\Client\PetStore\Schema\Spider; - public function operations() : OperationsInterface; + public function call(string $call, array $params = []): Rx\Observable|ApiClients\Client\PetStore\Schema\Error|ApiClients\Tools\OpenApiClient\Utils\Response\WithoutBody|ApiClients\Client\PetStore\Schema\Operations\Pets\Grouped\By\Type\Response\ApplicationJson\Ok|ApiClients\Client\PetStore\Schema\Cat|ApiClients\Client\PetStore\Schema\Dog|ApiClients\Client\PetStore\Schema\Bird|ApiClients\Client\PetStore\Schema\Fish|ApiClients\Client\PetStore\Schema\Spider; + public function operations(): OperationsInterface; } diff --git a/tests/app/src/Contract/Bird.php b/tests/app/src/Contract/Bird.php index 9f90d83..476c635 100644 --- a/tests/app/src/Contract/Bird.php +++ b/tests/app/src/Contract/Bird.php @@ -3,19 +3,11 @@ declare (strict_types=1); namespace ApiClients\Client\PetStore\Contract; -use ApiClients\Client\PetStore\Contract; -use ApiClients\Client\PetStore\Error as ErrorSchemas; -use ApiClients\Client\PetStore\Internal; -use ApiClients\Client\PetStore\Operation; -use ApiClients\Client\PetStore\Schema; -use League\OpenAPIValidation; -use React\Http; -use ApiClients\Contracts; /** * @property string $id * @property string4 $name * @property bool $flies - * @property Schema\RedEyes|Schema\BlueEyes|Schema\GreenEyes|Schema\YellowEyes|Schema\BlackEyes $eyes + * @property \ApiClients\Client\PetStore\Schema\RedEyes|\ApiClients\Client\PetStore\Schema\BlueEyes|\ApiClients\Client\PetStore\Schema\GreenEyes|\ApiClients\Client\PetStore\Schema\YellowEyes|\ApiClients\Client\PetStore\Schema\BlackEyes $eyes */ interface Bird { diff --git a/tests/app/src/Contract/BlackEyes.php b/tests/app/src/Contract/BlackEyes.php index 7371394..beab7f7 100644 --- a/tests/app/src/Contract/BlackEyes.php +++ b/tests/app/src/Contract/BlackEyes.php @@ -3,14 +3,6 @@ declare (strict_types=1); namespace ApiClients\Client\PetStore\Contract; -use ApiClients\Client\PetStore\Contract; -use ApiClients\Client\PetStore\Error as ErrorSchemas; -use ApiClients\Client\PetStore\Internal; -use ApiClients\Client\PetStore\Operation; -use ApiClients\Client\PetStore\Schema; -use League\OpenAPIValidation; -use React\Http; -use ApiClients\Contracts; /** * @property int $count * @property string $type diff --git a/tests/app/src/Contract/BlueEyes.php b/tests/app/src/Contract/BlueEyes.php index 72435d8..6c9963f 100644 --- a/tests/app/src/Contract/BlueEyes.php +++ b/tests/app/src/Contract/BlueEyes.php @@ -3,14 +3,6 @@ declare (strict_types=1); namespace ApiClients\Client\PetStore\Contract; -use ApiClients\Client\PetStore\Contract; -use ApiClients\Client\PetStore\Error as ErrorSchemas; -use ApiClients\Client\PetStore\Internal; -use ApiClients\Client\PetStore\Operation; -use ApiClients\Client\PetStore\Schema; -use League\OpenAPIValidation; -use React\Http; -use ApiClients\Contracts; /** * @property int $count * @property string $type diff --git a/tests/app/src/Contract/Cat.php b/tests/app/src/Contract/Cat.php index d373f0a..a8fec5a 100644 --- a/tests/app/src/Contract/Cat.php +++ b/tests/app/src/Contract/Cat.php @@ -3,19 +3,11 @@ declare (strict_types=1); namespace ApiClients\Client\PetStore\Contract; -use ApiClients\Client\PetStore\Contract; -use ApiClients\Client\PetStore\Error as ErrorSchemas; -use ApiClients\Client\PetStore\Internal; -use ApiClients\Client\PetStore\Operation; -use ApiClients\Client\PetStore\Schema; -use League\OpenAPIValidation; -use React\Http; -use ApiClients\Contracts; /** * @property string $id * @property string $name * @property bool $indoor - * @property Schema\Cat\Features $features + * @property \ApiClients\Client\PetStore\Schema\Cat\Features $features * @property array<\ApiClients\Client\PetStore\Schema\RedEyes|\ApiClients\Client\PetStore\Schema\BlueEyes|\ApiClients\Client\PetStore\Schema\GreenEyes|\ApiClients\Client\PetStore\Schema\YellowEyes|\ApiClients\Client\PetStore\Schema\BlackEyes> $eyes */ interface Cat diff --git a/tests/app/src/Contract/Cat/Features.php b/tests/app/src/Contract/Cat/Features.php index eb1a625..2e57c62 100644 --- a/tests/app/src/Contract/Cat/Features.php +++ b/tests/app/src/Contract/Cat/Features.php @@ -3,14 +3,6 @@ declare (strict_types=1); namespace ApiClients\Client\PetStore\Contract\Cat; -use ApiClients\Client\PetStore\Contract; -use ApiClients\Client\PetStore\Error as ErrorSchemas; -use ApiClients\Client\PetStore\Internal; -use ApiClients\Client\PetStore\Operation; -use ApiClients\Client\PetStore\Schema; -use League\OpenAPIValidation; -use React\Http; -use ApiClients\Contracts; interface Features { } diff --git a/tests/app/src/Contract/Dog.php b/tests/app/src/Contract/Dog.php index 14635d3..3902dd0 100644 --- a/tests/app/src/Contract/Dog.php +++ b/tests/app/src/Contract/Dog.php @@ -3,14 +3,6 @@ declare (strict_types=1); namespace ApiClients\Client\PetStore\Contract; -use ApiClients\Client\PetStore\Contract; -use ApiClients\Client\PetStore\Error as ErrorSchemas; -use ApiClients\Client\PetStore\Internal; -use ApiClients\Client\PetStore\Operation; -use ApiClients\Client\PetStore\Schema; -use League\OpenAPIValidation; -use React\Http; -use ApiClients\Contracts; /** * @property string $id * @property string $name diff --git a/tests/app/src/Contract/Error.php b/tests/app/src/Contract/Error.php index 97d2d7f..d3e69eb 100644 --- a/tests/app/src/Contract/Error.php +++ b/tests/app/src/Contract/Error.php @@ -3,14 +3,6 @@ declare (strict_types=1); namespace ApiClients\Client\PetStore\Contract; -use ApiClients\Client\PetStore\Contract; -use ApiClients\Client\PetStore\Error as ErrorSchemas; -use ApiClients\Client\PetStore\Internal; -use ApiClients\Client\PetStore\Operation; -use ApiClients\Client\PetStore\Schema; -use League\OpenAPIValidation; -use React\Http; -use ApiClients\Contracts; /** * @property int $code * @property string $message diff --git a/tests/app/src/Contract/Fins.php b/tests/app/src/Contract/Fins.php index ae7c9e3..10e07a7 100644 --- a/tests/app/src/Contract/Fins.php +++ b/tests/app/src/Contract/Fins.php @@ -3,14 +3,6 @@ declare (strict_types=1); namespace ApiClients\Client\PetStore\Contract; -use ApiClients\Client\PetStore\Contract; -use ApiClients\Client\PetStore\Error as ErrorSchemas; -use ApiClients\Client\PetStore\Internal; -use ApiClients\Client\PetStore\Operation; -use ApiClients\Client\PetStore\Schema; -use League\OpenAPIValidation; -use React\Http; -use ApiClients\Contracts; /** * @property int $count * @property int $spikes diff --git a/tests/app/src/Contract/Fish.php b/tests/app/src/Contract/Fish.php index 2f2f0fb..e26ac4a 100644 --- a/tests/app/src/Contract/Fish.php +++ b/tests/app/src/Contract/Fish.php @@ -3,20 +3,12 @@ declare (strict_types=1); namespace ApiClients\Client\PetStore\Contract; -use ApiClients\Client\PetStore\Contract; -use ApiClients\Client\PetStore\Error as ErrorSchemas; -use ApiClients\Client\PetStore\Internal; -use ApiClients\Client\PetStore\Operation; -use ApiClients\Client\PetStore\Schema; -use League\OpenAPIValidation; -use React\Http; -use ApiClients\Contracts; /** * @property string $id * @property string $name * @property bool $flat * @property bool $flies - * @property Schema\RedEyes|Schema\BlueEyes|Schema\GreenEyes|Schema\YellowEyes|Schema\BlackEyes $eyes + * @property \ApiClients\Client\PetStore\Schema\RedEyes|\ApiClients\Client\PetStore\Schema\BlueEyes|\ApiClients\Client\PetStore\Schema\GreenEyes|\ApiClients\Client\PetStore\Schema\YellowEyes|\ApiClients\Client\PetStore\Schema\BlackEyes $eyes */ interface Fish { diff --git a/tests/app/src/Contract/GreenEyes.php b/tests/app/src/Contract/GreenEyes.php index d19e0bb..5317d3d 100644 --- a/tests/app/src/Contract/GreenEyes.php +++ b/tests/app/src/Contract/GreenEyes.php @@ -3,14 +3,6 @@ declare (strict_types=1); namespace ApiClients\Client\PetStore\Contract; -use ApiClients\Client\PetStore\Contract; -use ApiClients\Client\PetStore\Error as ErrorSchemas; -use ApiClients\Client\PetStore\Internal; -use ApiClients\Client\PetStore\Operation; -use ApiClients\Client\PetStore\Schema; -use League\OpenAPIValidation; -use React\Http; -use ApiClients\Contracts; /** * @property int $count * @property string $type diff --git a/tests/app/src/Contract/HellHound.php b/tests/app/src/Contract/HellHound.php index 298471d..258f1d4 100644 --- a/tests/app/src/Contract/HellHound.php +++ b/tests/app/src/Contract/HellHound.php @@ -3,19 +3,11 @@ declare (strict_types=1); namespace ApiClients\Client\PetStore\Contract; -use ApiClients\Client\PetStore\Contract; -use ApiClients\Client\PetStore\Error as ErrorSchemas; -use ApiClients\Client\PetStore\Internal; -use ApiClients\Client\PetStore\Operation; -use ApiClients\Client\PetStore\Schema; -use League\OpenAPIValidation; -use React\Http; -use ApiClients\Contracts; /** * @property int $id * @property string $name * @property bool $badMinBoy - * @property ?Schema\HellHound\Eyes $eyes + * @property ?\ApiClients\Client\PetStore\Schema\HellHound\Eyes $eyes */ interface HellHound { diff --git a/tests/app/src/Contract/HellHound/Eyes.php b/tests/app/src/Contract/HellHound/Eyes.php index 5fe5909..20ac9c5 100644 --- a/tests/app/src/Contract/HellHound/Eyes.php +++ b/tests/app/src/Contract/HellHound/Eyes.php @@ -3,14 +3,6 @@ declare (strict_types=1); namespace ApiClients\Client\PetStore\Contract\HellHound; -use ApiClients\Client\PetStore\Contract; -use ApiClients\Client\PetStore\Error as ErrorSchemas; -use ApiClients\Client\PetStore\Internal; -use ApiClients\Client\PetStore\Operation; -use ApiClients\Client\PetStore\Schema; -use League\OpenAPIValidation; -use React\Http; -use ApiClients\Contracts; interface Eyes { } diff --git a/tests/app/src/Contract/Legs.php b/tests/app/src/Contract/Legs.php index 1b262c1..4af0be0 100644 --- a/tests/app/src/Contract/Legs.php +++ b/tests/app/src/Contract/Legs.php @@ -3,14 +3,6 @@ declare (strict_types=1); namespace ApiClients\Client\PetStore\Contract; -use ApiClients\Client\PetStore\Contract; -use ApiClients\Client\PetStore\Error as ErrorSchemas; -use ApiClients\Client\PetStore\Internal; -use ApiClients\Client\PetStore\Operation; -use ApiClients\Client\PetStore\Schema; -use League\OpenAPIValidation; -use React\Http; -use ApiClients\Contracts; /** * @property int $count * @property ?int $joins diff --git a/tests/app/src/Contract/Operations/Pets/Grouped/By/Type/Response/ApplicationJson/Ok.php b/tests/app/src/Contract/Operations/Pets/Grouped/By/Type/Response/ApplicationJson/Ok.php index 99d8fd6..93198a0 100644 --- a/tests/app/src/Contract/Operations/Pets/Grouped/By/Type/Response/ApplicationJson/Ok.php +++ b/tests/app/src/Contract/Operations/Pets/Grouped/By/Type/Response/ApplicationJson/Ok.php @@ -3,14 +3,6 @@ declare (strict_types=1); namespace ApiClients\Client\PetStore\Contract\Operations\Pets\Grouped\By\Type\Response\ApplicationJson; -use ApiClients\Client\PetStore\Contract; -use ApiClients\Client\PetStore\Error as ErrorSchemas; -use ApiClients\Client\PetStore\Internal; -use ApiClients\Client\PetStore\Operation; -use ApiClients\Client\PetStore\Schema; -use League\OpenAPIValidation; -use React\Http; -use ApiClients\Contracts; /** * @property array<\ApiClients\Client\PetStore\Schema\Cat|\ApiClients\Client\PetStore\Schema\Dog|\ApiClients\Client\PetStore\Schema\HellHound> $pets */ diff --git a/tests/app/src/Contract/Operations/Pets/Kinds/Walking/Response/ApplicationJson/Ok.php b/tests/app/src/Contract/Operations/Pets/Kinds/Walking/Response/ApplicationJson/Ok.php index bfa4e11..4006701 100644 --- a/tests/app/src/Contract/Operations/Pets/Kinds/Walking/Response/ApplicationJson/Ok.php +++ b/tests/app/src/Contract/Operations/Pets/Kinds/Walking/Response/ApplicationJson/Ok.php @@ -3,14 +3,6 @@ declare (strict_types=1); namespace ApiClients\Client\PetStore\Contract\Operations\Pets\Kinds\Walking\Response\ApplicationJson; -use ApiClients\Client\PetStore\Contract; -use ApiClients\Client\PetStore\Error as ErrorSchemas; -use ApiClients\Client\PetStore\Internal; -use ApiClients\Client\PetStore\Operation; -use ApiClients\Client\PetStore\Schema; -use League\OpenAPIValidation; -use React\Http; -use ApiClients\Contracts; interface Ok { } diff --git a/tests/app/src/Contract/Operations/Pets/List_/Response/ApplicationJson/Ok.php b/tests/app/src/Contract/Operations/Pets/List_/Response/ApplicationJson/Ok.php index 9e7f5b7..bd68fd8 100644 --- a/tests/app/src/Contract/Operations/Pets/List_/Response/ApplicationJson/Ok.php +++ b/tests/app/src/Contract/Operations/Pets/List_/Response/ApplicationJson/Ok.php @@ -3,14 +3,6 @@ declare (strict_types=1); namespace ApiClients\Client\PetStore\Contract\Operations\Pets\List_\Response\ApplicationJson; -use ApiClients\Client\PetStore\Contract; -use ApiClients\Client\PetStore\Error as ErrorSchemas; -use ApiClients\Client\PetStore\Internal; -use ApiClients\Client\PetStore\Operation; -use ApiClients\Client\PetStore\Schema; -use League\OpenAPIValidation; -use React\Http; -use ApiClients\Contracts; interface Ok { } diff --git a/tests/app/src/Contract/Operations/Pets/Names/Response/ApplicationJson/Ok.php b/tests/app/src/Contract/Operations/Pets/Names/Response/ApplicationJson/Ok.php index ff839d4..87756d8 100644 --- a/tests/app/src/Contract/Operations/Pets/Names/Response/ApplicationJson/Ok.php +++ b/tests/app/src/Contract/Operations/Pets/Names/Response/ApplicationJson/Ok.php @@ -3,14 +3,6 @@ declare (strict_types=1); namespace ApiClients\Client\PetStore\Contract\Operations\Pets\Names\Response\ApplicationJson; -use ApiClients\Client\PetStore\Contract; -use ApiClients\Client\PetStore\Error as ErrorSchemas; -use ApiClients\Client\PetStore\Internal; -use ApiClients\Client\PetStore\Operation; -use ApiClients\Client\PetStore\Schema; -use League\OpenAPIValidation; -use React\Http; -use ApiClients\Contracts; interface Ok { } diff --git a/tests/app/src/Contract/Operations/ShowPetById/Response/ApplicationJson/Ok.php b/tests/app/src/Contract/Operations/ShowPetById/Response/ApplicationJson/Ok.php index f5182d1..8a85be0 100644 --- a/tests/app/src/Contract/Operations/ShowPetById/Response/ApplicationJson/Ok.php +++ b/tests/app/src/Contract/Operations/ShowPetById/Response/ApplicationJson/Ok.php @@ -3,14 +3,6 @@ declare (strict_types=1); namespace ApiClients\Client\PetStore\Contract\Operations\ShowPetById\Response\ApplicationJson; -use ApiClients\Client\PetStore\Contract; -use ApiClients\Client\PetStore\Error as ErrorSchemas; -use ApiClients\Client\PetStore\Internal; -use ApiClients\Client\PetStore\Operation; -use ApiClients\Client\PetStore\Schema; -use League\OpenAPIValidation; -use React\Http; -use ApiClients\Contracts; interface Ok { } diff --git a/tests/app/src/Contract/Pets/Create/Request/ApplicationJson.php b/tests/app/src/Contract/Pets/Create/Request/ApplicationJson.php index e85bd73..7e6c44a 100644 --- a/tests/app/src/Contract/Pets/Create/Request/ApplicationJson.php +++ b/tests/app/src/Contract/Pets/Create/Request/ApplicationJson.php @@ -3,14 +3,6 @@ declare (strict_types=1); namespace ApiClients\Client\PetStore\Contract\Pets\Create\Request; -use ApiClients\Client\PetStore\Contract; -use ApiClients\Client\PetStore\Error as ErrorSchemas; -use ApiClients\Client\PetStore\Internal; -use ApiClients\Client\PetStore\Operation; -use ApiClients\Client\PetStore\Schema; -use League\OpenAPIValidation; -use React\Http; -use ApiClients\Contracts; interface ApplicationJson { } diff --git a/tests/app/src/Contract/RedEyes.php b/tests/app/src/Contract/RedEyes.php index 63d36ef..b117ce2 100644 --- a/tests/app/src/Contract/RedEyes.php +++ b/tests/app/src/Contract/RedEyes.php @@ -3,14 +3,6 @@ declare (strict_types=1); namespace ApiClients\Client\PetStore\Contract; -use ApiClients\Client\PetStore\Contract; -use ApiClients\Client\PetStore\Error as ErrorSchemas; -use ApiClients\Client\PetStore\Internal; -use ApiClients\Client\PetStore\Operation; -use ApiClients\Client\PetStore\Schema; -use League\OpenAPIValidation; -use React\Http; -use ApiClients\Contracts; /** * @property int $count */ diff --git a/tests/app/src/Contract/RedEyes/A.php b/tests/app/src/Contract/RedEyes/A.php deleted file mode 100644 index f71062e..0000000 --- a/tests/app/src/Contract/RedEyes/A.php +++ /dev/null @@ -1,19 +0,0 @@ -wrappedCaster = new \ApiClients\Client\PetStore\Internal\Attribute\CastUnionToType\Single\Schema\Cat\Eyes(); } - public function cast(mixed $value, \EventSauce\ObjectHydrator\ObjectMapper $hydrator) : mixed + public function cast(mixed $value, \EventSauce\ObjectHydrator\ObjectMapper $hydrator): mixed { - $data = array(); + $data = []; $values = $value; unset($value); foreach ($values as $value) { diff --git a/tests/app/src/Internal/Attribute/CastUnionToType/Multiple/Schema/Dog/Eyes.php b/tests/app/src/Internal/Attribute/CastUnionToType/Multiple/Schema/Dog/Eyes.php index f6ecd72..0decfcf 100644 --- a/tests/app/src/Internal/Attribute/CastUnionToType/Multiple/Schema/Dog/Eyes.php +++ b/tests/app/src/Internal/Attribute/CastUnionToType/Multiple/Schema/Dog/Eyes.php @@ -3,14 +3,6 @@ declare (strict_types=1); namespace ApiClients\Client\PetStore\Internal\Attribute\CastUnionToType\Multiple\Schema\Dog; -use ApiClients\Client\PetStore\Contract; -use ApiClients\Client\PetStore\Error as ErrorSchemas; -use ApiClients\Client\PetStore\Internal; -use ApiClients\Client\PetStore\Operation; -use ApiClients\Client\PetStore\Schema; -use League\OpenAPIValidation; -use React\Http; -use ApiClients\Contracts; #[\Attribute(\Attribute::TARGET_PARAMETER)] final readonly class Eyes implements \EventSauce\ObjectHydrator\PropertyCaster { @@ -19,9 +11,9 @@ public function __construct() { $this->wrappedCaster = new \ApiClients\Client\PetStore\Internal\Attribute\CastUnionToType\Single\Schema\Dog\Eyes(); } - public function cast(mixed $value, \EventSauce\ObjectHydrator\ObjectMapper $hydrator) : mixed + public function cast(mixed $value, \EventSauce\ObjectHydrator\ObjectMapper $hydrator): mixed { - $data = array(); + $data = []; $values = $value; unset($value); foreach ($values as $value) { diff --git a/tests/app/src/Internal/Attribute/CastUnionToType/Multiple/Schema/Operations/Pets/Grouped/By/Type/Response/ApplicationJson/Ok/Pets.php b/tests/app/src/Internal/Attribute/CastUnionToType/Multiple/Schema/Operations/Pets/Grouped/By/Type/Response/ApplicationJson/Ok/Pets.php index c02b8a4..56e82a9 100644 --- a/tests/app/src/Internal/Attribute/CastUnionToType/Multiple/Schema/Operations/Pets/Grouped/By/Type/Response/ApplicationJson/Ok/Pets.php +++ b/tests/app/src/Internal/Attribute/CastUnionToType/Multiple/Schema/Operations/Pets/Grouped/By/Type/Response/ApplicationJson/Ok/Pets.php @@ -3,14 +3,6 @@ declare (strict_types=1); namespace ApiClients\Client\PetStore\Internal\Attribute\CastUnionToType\Multiple\Schema\Operations\Pets\Grouped\By\Type\Response\ApplicationJson\Ok; -use ApiClients\Client\PetStore\Contract; -use ApiClients\Client\PetStore\Error as ErrorSchemas; -use ApiClients\Client\PetStore\Internal; -use ApiClients\Client\PetStore\Operation; -use ApiClients\Client\PetStore\Schema; -use League\OpenAPIValidation; -use React\Http; -use ApiClients\Contracts; #[\Attribute(\Attribute::TARGET_PARAMETER)] final readonly class Pets implements \EventSauce\ObjectHydrator\PropertyCaster { @@ -19,9 +11,9 @@ public function __construct() { $this->wrappedCaster = new \ApiClients\Client\PetStore\Internal\Attribute\CastUnionToType\Single\Schema\Operations\Pets\Grouped\By\Type\Response\ApplicationJson\Ok\Pets(); } - public function cast(mixed $value, \EventSauce\ObjectHydrator\ObjectMapper $hydrator) : mixed + public function cast(mixed $value, \EventSauce\ObjectHydrator\ObjectMapper $hydrator): mixed { - $data = array(); + $data = []; $values = $value; unset($value); foreach ($values as $value) { diff --git a/tests/app/src/Internal/Attribute/CastUnionToType/Multiple/Schema/Spider/Eyes.php b/tests/app/src/Internal/Attribute/CastUnionToType/Multiple/Schema/Spider/Eyes.php index 8df1c15..ba81c28 100644 --- a/tests/app/src/Internal/Attribute/CastUnionToType/Multiple/Schema/Spider/Eyes.php +++ b/tests/app/src/Internal/Attribute/CastUnionToType/Multiple/Schema/Spider/Eyes.php @@ -3,14 +3,6 @@ declare (strict_types=1); namespace ApiClients\Client\PetStore\Internal\Attribute\CastUnionToType\Multiple\Schema\Spider; -use ApiClients\Client\PetStore\Contract; -use ApiClients\Client\PetStore\Error as ErrorSchemas; -use ApiClients\Client\PetStore\Internal; -use ApiClients\Client\PetStore\Operation; -use ApiClients\Client\PetStore\Schema; -use League\OpenAPIValidation; -use React\Http; -use ApiClients\Contracts; #[\Attribute(\Attribute::TARGET_PARAMETER)] final readonly class Eyes implements \EventSauce\ObjectHydrator\PropertyCaster { @@ -19,9 +11,9 @@ public function __construct() { $this->wrappedCaster = new \ApiClients\Client\PetStore\Internal\Attribute\CastUnionToType\Single\Schema\Spider\Eyes(); } - public function cast(mixed $value, \EventSauce\ObjectHydrator\ObjectMapper $hydrator) : mixed + public function cast(mixed $value, \EventSauce\ObjectHydrator\ObjectMapper $hydrator): mixed { - $data = array(); + $data = []; $values = $value; unset($value); foreach ($values as $value) { diff --git a/tests/app/src/Internal/Attribute/CastUnionToType/Single/Schema/Bird/Eyes.php b/tests/app/src/Internal/Attribute/CastUnionToType/Single/Schema/Bird/Eyes.php index 2b1612f..6ad9b8a 100644 --- a/tests/app/src/Internal/Attribute/CastUnionToType/Single/Schema/Bird/Eyes.php +++ b/tests/app/src/Internal/Attribute/CastUnionToType/Single/Schema/Bird/Eyes.php @@ -3,50 +3,42 @@ declare (strict_types=1); namespace ApiClients\Client\PetStore\Internal\Attribute\CastUnionToType\Single\Schema\Bird; -use ApiClients\Client\PetStore\Contract; -use ApiClients\Client\PetStore\Error as ErrorSchemas; -use ApiClients\Client\PetStore\Internal; -use ApiClients\Client\PetStore\Operation; -use ApiClients\Client\PetStore\Schema; -use League\OpenAPIValidation; -use React\Http; -use ApiClients\Contracts; #[\Attribute(\Attribute::TARGET_PARAMETER)] final class Eyes implements \EventSauce\ObjectHydrator\PropertyCaster { - public function cast(mixed $value, \EventSauce\ObjectHydrator\ObjectMapper $hydrator) : mixed + public function cast(mixed $value, \EventSauce\ObjectHydrator\ObjectMapper $hydrator): mixed { if (\is_array($value)) { $signatureChunks = \array_unique(\array_keys($value)); \sort($signatureChunks); $signature = \implode('|', $signatureChunks); - if ($signature === 'count|type' && ($value['type'] === 'blood' || $value['type'] === 'wine' || $value['type'] === 'stale')) { + if ($signature === 'count|type' && (in_array($value['type'], ['blood', 'wine', 'stale'], true))) { try { - return $hydrator->hydrateObject(Schema\RedEyes::class, $value); + return $hydrator->hydrateObject(\ApiClients\Client\PetStore\Internal\Attribute\CastUnionToType\Single\Schema\Bird\Eyes::class, $value); } catch (\Throwable) { } } if ($signature === 'count|type' && ($value['type'] === 'sky' || $value['type'] === 'boobies')) { try { - return $hydrator->hydrateObject(Schema\BlueEyes::class, $value); + return $hydrator->hydrateObject(\ApiClients\Client\PetStore\Internal\Attribute\CastUnionToType\Single\Schema\Bird\Eyes::class, $value); } catch (\Throwable) { } } - if ($signature === 'count|type' && ($value['type'] === 'hulk' || $value['type'] === 'forest' || $value['type'] === 'feral')) { + if ($signature === 'count|type' && (in_array($value['type'], ['hulk', 'forest', 'feral'], true))) { try { - return $hydrator->hydrateObject(Schema\GreenEyes::class, $value); + return $hydrator->hydrateObject(\ApiClients\Client\PetStore\Internal\Attribute\CastUnionToType\Single\Schema\Bird\Eyes::class, $value); } catch (\Throwable) { } } if ($signature === 'count|type' && $value['type'] === 'snake') { try { - return $hydrator->hydrateObject(Schema\YellowEyes::class, $value); + return $hydrator->hydrateObject(\ApiClients\Client\PetStore\Internal\Attribute\CastUnionToType\Single\Schema\Bird\Eyes::class, $value); } catch (\Throwable) { } } if ($signature === 'count|type' && $value['type'] === 'rage') { try { - return $hydrator->hydrateObject(Schema\BlackEyes::class, $value); + return $hydrator->hydrateObject(\ApiClients\Client\PetStore\Internal\Attribute\CastUnionToType\Single\Schema\Bird\Eyes::class, $value); } catch (\Throwable) { } } diff --git a/tests/app/src/Internal/Attribute/CastUnionToType/Single/Schema/Cat/Eyes.php b/tests/app/src/Internal/Attribute/CastUnionToType/Single/Schema/Cat/Eyes.php index d557f8d..9485fc0 100644 --- a/tests/app/src/Internal/Attribute/CastUnionToType/Single/Schema/Cat/Eyes.php +++ b/tests/app/src/Internal/Attribute/CastUnionToType/Single/Schema/Cat/Eyes.php @@ -3,80 +3,72 @@ declare (strict_types=1); namespace ApiClients\Client\PetStore\Internal\Attribute\CastUnionToType\Single\Schema\Cat; -use ApiClients\Client\PetStore\Contract; -use ApiClients\Client\PetStore\Error as ErrorSchemas; -use ApiClients\Client\PetStore\Internal; -use ApiClients\Client\PetStore\Operation; -use ApiClients\Client\PetStore\Schema; -use League\OpenAPIValidation; -use React\Http; -use ApiClients\Contracts; #[\Attribute(\Attribute::TARGET_PARAMETER)] final class Eyes implements \EventSauce\ObjectHydrator\PropertyCaster { - public function cast(mixed $value, \EventSauce\ObjectHydrator\ObjectMapper $hydrator) : mixed + public function cast(mixed $value, \EventSauce\ObjectHydrator\ObjectMapper $hydrator): mixed { if (\is_array($value)) { $signatureChunks = \array_unique(\array_keys($value)); \sort($signatureChunks); $signature = \implode('|', $signatureChunks); - if ($signature === 'count|type' && ($value['type'] === 'blood' || $value['type'] === 'wine' || $value['type'] === 'stale')) { + if ($signature === 'count|type' && (in_array($value['type'], ['blood', 'wine', 'stale'], true))) { try { - return $hydrator->hydrateObject(Schema\RedEyes::class, $value); + return $hydrator->hydrateObject(\ApiClients\Client\PetStore\Internal\Attribute\CastUnionToType\Single\Schema\Cat\Eyes::class, $value); } catch (\Throwable) { } } if ($signature === 'count|type' && ($value['type'] === 'sky' || $value['type'] === 'boobies')) { try { - return $hydrator->hydrateObject(Schema\BlueEyes::class, $value); + return $hydrator->hydrateObject(\ApiClients\Client\PetStore\Internal\Attribute\CastUnionToType\Single\Schema\Cat\Eyes::class, $value); } catch (\Throwable) { } } - if ($signature === 'count|type' && ($value['type'] === 'hulk' || $value['type'] === 'forest' || $value['type'] === 'feral')) { + if ($signature === 'count|type' && (in_array($value['type'], ['hulk', 'forest', 'feral'], true))) { try { - return $hydrator->hydrateObject(Schema\GreenEyes::class, $value); + return $hydrator->hydrateObject(\ApiClients\Client\PetStore\Internal\Attribute\CastUnionToType\Single\Schema\Cat\Eyes::class, $value); } catch (\Throwable) { } } if ($signature === 'count|type' && $value['type'] === 'snake') { try { - return $hydrator->hydrateObject(Schema\YellowEyes::class, $value); + return $hydrator->hydrateObject(\ApiClients\Client\PetStore\Internal\Attribute\CastUnionToType\Single\Schema\Cat\Eyes::class, $value); } catch (\Throwable) { } } if ($signature === 'count|type' && $value['type'] === 'rage') { try { - return $hydrator->hydrateObject(Schema\BlackEyes::class, $value); + return $hydrator->hydrateObject(\ApiClients\Client\PetStore\Internal\Attribute\CastUnionToType\Single\Schema\Cat\Eyes::class, $value); } catch (\Throwable) { } } - if ($signature === 'count|type' && ($value['type'] === 'blood' || $value['type'] === 'wine' || $value['type'] === 'stale')) { + if ($signature === 'count|type' && (in_array($value['type'], ['blood', 'wine', 'stale'], true))) { try { - return $hydrator->hydrateObject(Schema\RedEyes::class, $value); + return $hydrator->hydrateObject(\ApiClients\Client\PetStore\Internal\Attribute\CastUnionToType\Single\Schema\Cat\Eyes::class, $value); } catch (\Throwable) { } } if ($signature === 'count|type' && ($value['type'] === 'sky' || $value['type'] === 'boobies')) { try { - return $hydrator->hydrateObject(Schema\BlueEyes::class, $value); + return $hydrator->hydrateObject(\ApiClients\Client\PetStore\Internal\Attribute\CastUnionToType\Single\Schema\Cat\Eyes::class, $value); } catch (\Throwable) { } } - if ($signature === 'count|type' && ($value['type'] === 'hulk' || $value['type'] === 'forest' || $value['type'] === 'feral')) { + if ($signature === 'count|type' && (in_array($value['type'], ['hulk', 'forest', 'feral'], true))) { try { - return $hydrator->hydrateObject(Schema\GreenEyes::class, $value); + return $hydrator->hydrateObject(\ApiClients\Client\PetStore\Internal\Attribute\CastUnionToType\Single\Schema\Cat\Eyes::class, $value); } catch (\Throwable) { } } if ($signature === 'count|type' && $value['type'] === 'snake') { try { - return $hydrator->hydrateObject(Schema\YellowEyes::class, $value); + return $hydrator->hydrateObject(\ApiClients\Client\PetStore\Internal\Attribute\CastUnionToType\Single\Schema\Cat\Eyes::class, $value); } catch (\Throwable) { } } if ($signature === 'count|type' && $value['type'] === 'rage') { try { - return $hydrator->hydrateObject(Schema\BlackEyes::class, $value); + return $hydrator->hydrateObject(\ApiClients\Client\PetStore\Internal\Attribute\CastUnionToType\Single\Schema\Cat\Eyes::class, $value); } catch (\Throwable) { } } diff --git a/tests/app/src/Internal/Attribute/CastUnionToType/Single/Schema/Dog/Eyes.php b/tests/app/src/Internal/Attribute/CastUnionToType/Single/Schema/Dog/Eyes.php index cab899d..80bda16 100644 --- a/tests/app/src/Internal/Attribute/CastUnionToType/Single/Schema/Dog/Eyes.php +++ b/tests/app/src/Internal/Attribute/CastUnionToType/Single/Schema/Dog/Eyes.php @@ -3,80 +3,72 @@ declare (strict_types=1); namespace ApiClients\Client\PetStore\Internal\Attribute\CastUnionToType\Single\Schema\Dog; -use ApiClients\Client\PetStore\Contract; -use ApiClients\Client\PetStore\Error as ErrorSchemas; -use ApiClients\Client\PetStore\Internal; -use ApiClients\Client\PetStore\Operation; -use ApiClients\Client\PetStore\Schema; -use League\OpenAPIValidation; -use React\Http; -use ApiClients\Contracts; #[\Attribute(\Attribute::TARGET_PARAMETER)] final class Eyes implements \EventSauce\ObjectHydrator\PropertyCaster { - public function cast(mixed $value, \EventSauce\ObjectHydrator\ObjectMapper $hydrator) : mixed + public function cast(mixed $value, \EventSauce\ObjectHydrator\ObjectMapper $hydrator): mixed { if (\is_array($value)) { $signatureChunks = \array_unique(\array_keys($value)); \sort($signatureChunks); $signature = \implode('|', $signatureChunks); - if ($signature === 'count|type' && ($value['type'] === 'blood' || $value['type'] === 'wine' || $value['type'] === 'stale')) { + if ($signature === 'count|type' && (in_array($value['type'], ['blood', 'wine', 'stale'], true))) { try { - return $hydrator->hydrateObject(Schema\RedEyes::class, $value); + return $hydrator->hydrateObject(\ApiClients\Client\PetStore\Internal\Attribute\CastUnionToType\Single\Schema\Dog\Eyes::class, $value); } catch (\Throwable) { } } if ($signature === 'count|type' && ($value['type'] === 'sky' || $value['type'] === 'boobies')) { try { - return $hydrator->hydrateObject(Schema\BlueEyes::class, $value); + return $hydrator->hydrateObject(\ApiClients\Client\PetStore\Internal\Attribute\CastUnionToType\Single\Schema\Dog\Eyes::class, $value); } catch (\Throwable) { } } - if ($signature === 'count|type' && ($value['type'] === 'hulk' || $value['type'] === 'forest' || $value['type'] === 'feral')) { + if ($signature === 'count|type' && (in_array($value['type'], ['hulk', 'forest', 'feral'], true))) { try { - return $hydrator->hydrateObject(Schema\GreenEyes::class, $value); + return $hydrator->hydrateObject(\ApiClients\Client\PetStore\Internal\Attribute\CastUnionToType\Single\Schema\Dog\Eyes::class, $value); } catch (\Throwable) { } } if ($signature === 'count|type' && $value['type'] === 'snake') { try { - return $hydrator->hydrateObject(Schema\YellowEyes::class, $value); + return $hydrator->hydrateObject(\ApiClients\Client\PetStore\Internal\Attribute\CastUnionToType\Single\Schema\Dog\Eyes::class, $value); } catch (\Throwable) { } } if ($signature === 'count|type' && $value['type'] === 'rage') { try { - return $hydrator->hydrateObject(Schema\BlackEyes::class, $value); + return $hydrator->hydrateObject(\ApiClients\Client\PetStore\Internal\Attribute\CastUnionToType\Single\Schema\Dog\Eyes::class, $value); } catch (\Throwable) { } } - if ($signature === 'count|type' && ($value['type'] === 'blood' || $value['type'] === 'wine' || $value['type'] === 'stale')) { + if ($signature === 'count|type' && (in_array($value['type'], ['blood', 'wine', 'stale'], true))) { try { - return $hydrator->hydrateObject(Schema\RedEyes::class, $value); + return $hydrator->hydrateObject(\ApiClients\Client\PetStore\Internal\Attribute\CastUnionToType\Single\Schema\Dog\Eyes::class, $value); } catch (\Throwable) { } } if ($signature === 'count|type' && ($value['type'] === 'sky' || $value['type'] === 'boobies')) { try { - return $hydrator->hydrateObject(Schema\BlueEyes::class, $value); + return $hydrator->hydrateObject(\ApiClients\Client\PetStore\Internal\Attribute\CastUnionToType\Single\Schema\Dog\Eyes::class, $value); } catch (\Throwable) { } } - if ($signature === 'count|type' && ($value['type'] === 'hulk' || $value['type'] === 'forest' || $value['type'] === 'feral')) { + if ($signature === 'count|type' && (in_array($value['type'], ['hulk', 'forest', 'feral'], true))) { try { - return $hydrator->hydrateObject(Schema\GreenEyes::class, $value); + return $hydrator->hydrateObject(\ApiClients\Client\PetStore\Internal\Attribute\CastUnionToType\Single\Schema\Dog\Eyes::class, $value); } catch (\Throwable) { } } if ($signature === 'count|type' && $value['type'] === 'snake') { try { - return $hydrator->hydrateObject(Schema\YellowEyes::class, $value); + return $hydrator->hydrateObject(\ApiClients\Client\PetStore\Internal\Attribute\CastUnionToType\Single\Schema\Dog\Eyes::class, $value); } catch (\Throwable) { } } if ($signature === 'count|type' && $value['type'] === 'rage') { try { - return $hydrator->hydrateObject(Schema\BlackEyes::class, $value); + return $hydrator->hydrateObject(\ApiClients\Client\PetStore\Internal\Attribute\CastUnionToType\Single\Schema\Dog\Eyes::class, $value); } catch (\Throwable) { } } diff --git a/tests/app/src/Internal/Attribute/CastUnionToType/Single/Schema/Fish/Eyes.php b/tests/app/src/Internal/Attribute/CastUnionToType/Single/Schema/Fish/Eyes.php index 8718e33..edc9101 100644 --- a/tests/app/src/Internal/Attribute/CastUnionToType/Single/Schema/Fish/Eyes.php +++ b/tests/app/src/Internal/Attribute/CastUnionToType/Single/Schema/Fish/Eyes.php @@ -3,50 +3,42 @@ declare (strict_types=1); namespace ApiClients\Client\PetStore\Internal\Attribute\CastUnionToType\Single\Schema\Fish; -use ApiClients\Client\PetStore\Contract; -use ApiClients\Client\PetStore\Error as ErrorSchemas; -use ApiClients\Client\PetStore\Internal; -use ApiClients\Client\PetStore\Operation; -use ApiClients\Client\PetStore\Schema; -use League\OpenAPIValidation; -use React\Http; -use ApiClients\Contracts; #[\Attribute(\Attribute::TARGET_PARAMETER)] final class Eyes implements \EventSauce\ObjectHydrator\PropertyCaster { - public function cast(mixed $value, \EventSauce\ObjectHydrator\ObjectMapper $hydrator) : mixed + public function cast(mixed $value, \EventSauce\ObjectHydrator\ObjectMapper $hydrator): mixed { if (\is_array($value)) { $signatureChunks = \array_unique(\array_keys($value)); \sort($signatureChunks); $signature = \implode('|', $signatureChunks); - if ($signature === 'count|type' && ($value['type'] === 'blood' || $value['type'] === 'wine' || $value['type'] === 'stale')) { + if ($signature === 'count|type' && (in_array($value['type'], ['blood', 'wine', 'stale'], true))) { try { - return $hydrator->hydrateObject(Schema\RedEyes::class, $value); + return $hydrator->hydrateObject(\ApiClients\Client\PetStore\Internal\Attribute\CastUnionToType\Single\Schema\Fish\Eyes::class, $value); } catch (\Throwable) { } } if ($signature === 'count|type' && ($value['type'] === 'sky' || $value['type'] === 'boobies')) { try { - return $hydrator->hydrateObject(Schema\BlueEyes::class, $value); + return $hydrator->hydrateObject(\ApiClients\Client\PetStore\Internal\Attribute\CastUnionToType\Single\Schema\Fish\Eyes::class, $value); } catch (\Throwable) { } } - if ($signature === 'count|type' && ($value['type'] === 'hulk' || $value['type'] === 'forest' || $value['type'] === 'feral')) { + if ($signature === 'count|type' && (in_array($value['type'], ['hulk', 'forest', 'feral'], true))) { try { - return $hydrator->hydrateObject(Schema\GreenEyes::class, $value); + return $hydrator->hydrateObject(\ApiClients\Client\PetStore\Internal\Attribute\CastUnionToType\Single\Schema\Fish\Eyes::class, $value); } catch (\Throwable) { } } if ($signature === 'count|type' && $value['type'] === 'snake') { try { - return $hydrator->hydrateObject(Schema\YellowEyes::class, $value); + return $hydrator->hydrateObject(\ApiClients\Client\PetStore\Internal\Attribute\CastUnionToType\Single\Schema\Fish\Eyes::class, $value); } catch (\Throwable) { } } if ($signature === 'count|type' && $value['type'] === 'rage') { try { - return $hydrator->hydrateObject(Schema\BlackEyes::class, $value); + return $hydrator->hydrateObject(\ApiClients\Client\PetStore\Internal\Attribute\CastUnionToType\Single\Schema\Fish\Eyes::class, $value); } catch (\Throwable) { } } diff --git a/tests/app/src/Internal/Attribute/CastUnionToType/Single/Schema/Operations/Pets/Grouped/By/Type/Response/ApplicationJson/Ok/Pets.php b/tests/app/src/Internal/Attribute/CastUnionToType/Single/Schema/Operations/Pets/Grouped/By/Type/Response/ApplicationJson/Ok/Pets.php index 4914148..bfd8591 100644 --- a/tests/app/src/Internal/Attribute/CastUnionToType/Single/Schema/Operations/Pets/Grouped/By/Type/Response/ApplicationJson/Ok/Pets.php +++ b/tests/app/src/Internal/Attribute/CastUnionToType/Single/Schema/Operations/Pets/Grouped/By/Type/Response/ApplicationJson/Ok/Pets.php @@ -3,18 +3,10 @@ declare (strict_types=1); namespace ApiClients\Client\PetStore\Internal\Attribute\CastUnionToType\Single\Schema\Operations\Pets\Grouped\By\Type\Response\ApplicationJson\Ok; -use ApiClients\Client\PetStore\Contract; -use ApiClients\Client\PetStore\Error as ErrorSchemas; -use ApiClients\Client\PetStore\Internal; -use ApiClients\Client\PetStore\Operation; -use ApiClients\Client\PetStore\Schema; -use League\OpenAPIValidation; -use React\Http; -use ApiClients\Contracts; #[\Attribute(\Attribute::TARGET_PARAMETER)] final class Pets implements \EventSauce\ObjectHydrator\PropertyCaster { - public function cast(mixed $value, \EventSauce\ObjectHydrator\ObjectMapper $hydrator) : mixed + public function cast(mixed $value, \EventSauce\ObjectHydrator\ObjectMapper $hydrator): mixed { if (\is_array($value)) { $signatureChunks = \array_unique(\array_keys($value)); @@ -22,37 +14,37 @@ public function cast(mixed $value, \EventSauce\ObjectHydrator\ObjectMapper $hydr $signature = \implode('|', $signatureChunks); if ($signature === 'eyes|features|id|indoor|name') { try { - return $hydrator->hydrateObject(Schema\Cat::class, $value); + return $hydrator->hydrateObject(\ApiClients\Client\PetStore\Internal\Attribute\CastUnionToType\Single\Schema\Operations\Pets\Grouped\By\Type\Response\ApplicationJson\Ok\Pets::class, $value); } catch (\Throwable) { } } if ($signature === 'eyes|good-boy|id|name') { try { - return $hydrator->hydrateObject(Schema\Dog::class, $value); + return $hydrator->hydrateObject(\ApiClients\Client\PetStore\Internal\Attribute\CastUnionToType\Single\Schema\Operations\Pets\Grouped\By\Type\Response\ApplicationJson\Ok\Pets::class, $value); } catch (\Throwable) { } } if ($signature === 'bad-boy|eyes|id|name') { try { - return $hydrator->hydrateObject(Schema\HellHound::class, $value); + return $hydrator->hydrateObject(\ApiClients\Client\PetStore\Internal\Attribute\CastUnionToType\Single\Schema\Operations\Pets\Grouped\By\Type\Response\ApplicationJson\Ok\Pets::class, $value); } catch (\Throwable) { } } if ($signature === 'eyes|features|id|indoor|name') { try { - return $hydrator->hydrateObject(Schema\Cat::class, $value); + return $hydrator->hydrateObject(\ApiClients\Client\PetStore\Internal\Attribute\CastUnionToType\Single\Schema\Operations\Pets\Grouped\By\Type\Response\ApplicationJson\Ok\Pets::class, $value); } catch (\Throwable) { } } if ($signature === 'eyes|good-boy|id|name') { try { - return $hydrator->hydrateObject(Schema\Dog::class, $value); + return $hydrator->hydrateObject(\ApiClients\Client\PetStore\Internal\Attribute\CastUnionToType\Single\Schema\Operations\Pets\Grouped\By\Type\Response\ApplicationJson\Ok\Pets::class, $value); } catch (\Throwable) { } } if ($signature === 'bad-boy|eyes|id|name') { try { - return $hydrator->hydrateObject(Schema\HellHound::class, $value); + return $hydrator->hydrateObject(\ApiClients\Client\PetStore\Internal\Attribute\CastUnionToType\Single\Schema\Operations\Pets\Grouped\By\Type\Response\ApplicationJson\Ok\Pets::class, $value); } catch (\Throwable) { } } diff --git a/tests/app/src/Internal/Attribute/CastUnionToType/Single/Schema/Spider/Eyes.php b/tests/app/src/Internal/Attribute/CastUnionToType/Single/Schema/Spider/Eyes.php index 4b0ec6f..8beb688 100644 --- a/tests/app/src/Internal/Attribute/CastUnionToType/Single/Schema/Spider/Eyes.php +++ b/tests/app/src/Internal/Attribute/CastUnionToType/Single/Schema/Spider/Eyes.php @@ -3,260 +3,252 @@ declare (strict_types=1); namespace ApiClients\Client\PetStore\Internal\Attribute\CastUnionToType\Single\Schema\Spider; -use ApiClients\Client\PetStore\Contract; -use ApiClients\Client\PetStore\Error as ErrorSchemas; -use ApiClients\Client\PetStore\Internal; -use ApiClients\Client\PetStore\Operation; -use ApiClients\Client\PetStore\Schema; -use League\OpenAPIValidation; -use React\Http; -use ApiClients\Contracts; #[\Attribute(\Attribute::TARGET_PARAMETER)] final class Eyes implements \EventSauce\ObjectHydrator\PropertyCaster { - public function cast(mixed $value, \EventSauce\ObjectHydrator\ObjectMapper $hydrator) : mixed + public function cast(mixed $value, \EventSauce\ObjectHydrator\ObjectMapper $hydrator): mixed { if (\is_array($value)) { $signatureChunks = \array_unique(\array_keys($value)); \sort($signatureChunks); $signature = \implode('|', $signatureChunks); - if ($signature === 'count|type' && ($value['type'] === 'blood' || $value['type'] === 'wine' || $value['type'] === 'stale')) { + if ($signature === 'count|type' && (in_array($value['type'], ['blood', 'wine', 'stale'], true))) { try { - return $hydrator->hydrateObject(Schema\RedEyes::class, $value); + return $hydrator->hydrateObject(\ApiClients\Client\PetStore\Internal\Attribute\CastUnionToType\Single\Schema\Spider\Eyes::class, $value); } catch (\Throwable) { } } if ($signature === 'count|type' && ($value['type'] === 'sky' || $value['type'] === 'boobies')) { try { - return $hydrator->hydrateObject(Schema\BlueEyes::class, $value); + return $hydrator->hydrateObject(\ApiClients\Client\PetStore\Internal\Attribute\CastUnionToType\Single\Schema\Spider\Eyes::class, $value); } catch (\Throwable) { } } - if ($signature === 'count|type' && ($value['type'] === 'hulk' || $value['type'] === 'forest' || $value['type'] === 'feral')) { + if ($signature === 'count|type' && (in_array($value['type'], ['hulk', 'forest', 'feral'], true))) { try { - return $hydrator->hydrateObject(Schema\GreenEyes::class, $value); + return $hydrator->hydrateObject(\ApiClients\Client\PetStore\Internal\Attribute\CastUnionToType\Single\Schema\Spider\Eyes::class, $value); } catch (\Throwable) { } } if ($signature === 'count|type' && $value['type'] === 'snake') { try { - return $hydrator->hydrateObject(Schema\YellowEyes::class, $value); + return $hydrator->hydrateObject(\ApiClients\Client\PetStore\Internal\Attribute\CastUnionToType\Single\Schema\Spider\Eyes::class, $value); } catch (\Throwable) { } } if ($signature === 'count|type' && $value['type'] === 'rage') { try { - return $hydrator->hydrateObject(Schema\BlackEyes::class, $value); + return $hydrator->hydrateObject(\ApiClients\Client\PetStore\Internal\Attribute\CastUnionToType\Single\Schema\Spider\Eyes::class, $value); } catch (\Throwable) { } } - if ($signature === 'count|type' && ($value['type'] === 'blood' || $value['type'] === 'wine' || $value['type'] === 'stale')) { + if ($signature === 'count|type' && (in_array($value['type'], ['blood', 'wine', 'stale'], true))) { try { - return $hydrator->hydrateObject(Schema\RedEyes::class, $value); + return $hydrator->hydrateObject(\ApiClients\Client\PetStore\Internal\Attribute\CastUnionToType\Single\Schema\Spider\Eyes::class, $value); } catch (\Throwable) { } } if ($signature === 'count|type' && ($value['type'] === 'sky' || $value['type'] === 'boobies')) { try { - return $hydrator->hydrateObject(Schema\BlueEyes::class, $value); + return $hydrator->hydrateObject(\ApiClients\Client\PetStore\Internal\Attribute\CastUnionToType\Single\Schema\Spider\Eyes::class, $value); } catch (\Throwable) { } } - if ($signature === 'count|type' && ($value['type'] === 'hulk' || $value['type'] === 'forest' || $value['type'] === 'feral')) { + if ($signature === 'count|type' && (in_array($value['type'], ['hulk', 'forest', 'feral'], true))) { try { - return $hydrator->hydrateObject(Schema\GreenEyes::class, $value); + return $hydrator->hydrateObject(\ApiClients\Client\PetStore\Internal\Attribute\CastUnionToType\Single\Schema\Spider\Eyes::class, $value); } catch (\Throwable) { } } if ($signature === 'count|type' && $value['type'] === 'snake') { try { - return $hydrator->hydrateObject(Schema\YellowEyes::class, $value); + return $hydrator->hydrateObject(\ApiClients\Client\PetStore\Internal\Attribute\CastUnionToType\Single\Schema\Spider\Eyes::class, $value); } catch (\Throwable) { } } if ($signature === 'count|type' && $value['type'] === 'rage') { try { - return $hydrator->hydrateObject(Schema\BlackEyes::class, $value); + return $hydrator->hydrateObject(\ApiClients\Client\PetStore\Internal\Attribute\CastUnionToType\Single\Schema\Spider\Eyes::class, $value); } catch (\Throwable) { } } - if ($signature === 'count|type' && ($value['type'] === 'blood' || $value['type'] === 'wine' || $value['type'] === 'stale')) { + if ($signature === 'count|type' && (in_array($value['type'], ['blood', 'wine', 'stale'], true))) { try { - return $hydrator->hydrateObject(Schema\RedEyes::class, $value); + return $hydrator->hydrateObject(\ApiClients\Client\PetStore\Internal\Attribute\CastUnionToType\Single\Schema\Spider\Eyes::class, $value); } catch (\Throwable) { } } if ($signature === 'count|type' && ($value['type'] === 'sky' || $value['type'] === 'boobies')) { try { - return $hydrator->hydrateObject(Schema\BlueEyes::class, $value); + return $hydrator->hydrateObject(\ApiClients\Client\PetStore\Internal\Attribute\CastUnionToType\Single\Schema\Spider\Eyes::class, $value); } catch (\Throwable) { } } - if ($signature === 'count|type' && ($value['type'] === 'hulk' || $value['type'] === 'forest' || $value['type'] === 'feral')) { + if ($signature === 'count|type' && (in_array($value['type'], ['hulk', 'forest', 'feral'], true))) { try { - return $hydrator->hydrateObject(Schema\GreenEyes::class, $value); + return $hydrator->hydrateObject(\ApiClients\Client\PetStore\Internal\Attribute\CastUnionToType\Single\Schema\Spider\Eyes::class, $value); } catch (\Throwable) { } } if ($signature === 'count|type' && $value['type'] === 'snake') { try { - return $hydrator->hydrateObject(Schema\YellowEyes::class, $value); + return $hydrator->hydrateObject(\ApiClients\Client\PetStore\Internal\Attribute\CastUnionToType\Single\Schema\Spider\Eyes::class, $value); } catch (\Throwable) { } } if ($signature === 'count|type' && $value['type'] === 'rage') { try { - return $hydrator->hydrateObject(Schema\BlackEyes::class, $value); + return $hydrator->hydrateObject(\ApiClients\Client\PetStore\Internal\Attribute\CastUnionToType\Single\Schema\Spider\Eyes::class, $value); } catch (\Throwable) { } } - if ($signature === 'count|type' && ($value['type'] === 'blood' || $value['type'] === 'wine' || $value['type'] === 'stale')) { + if ($signature === 'count|type' && (in_array($value['type'], ['blood', 'wine', 'stale'], true))) { try { - return $hydrator->hydrateObject(Schema\RedEyes::class, $value); + return $hydrator->hydrateObject(\ApiClients\Client\PetStore\Internal\Attribute\CastUnionToType\Single\Schema\Spider\Eyes::class, $value); } catch (\Throwable) { } } if ($signature === 'count|type' && ($value['type'] === 'sky' || $value['type'] === 'boobies')) { try { - return $hydrator->hydrateObject(Schema\BlueEyes::class, $value); + return $hydrator->hydrateObject(\ApiClients\Client\PetStore\Internal\Attribute\CastUnionToType\Single\Schema\Spider\Eyes::class, $value); } catch (\Throwable) { } } - if ($signature === 'count|type' && ($value['type'] === 'hulk' || $value['type'] === 'forest' || $value['type'] === 'feral')) { + if ($signature === 'count|type' && (in_array($value['type'], ['hulk', 'forest', 'feral'], true))) { try { - return $hydrator->hydrateObject(Schema\GreenEyes::class, $value); + return $hydrator->hydrateObject(\ApiClients\Client\PetStore\Internal\Attribute\CastUnionToType\Single\Schema\Spider\Eyes::class, $value); } catch (\Throwable) { } } if ($signature === 'count|type' && $value['type'] === 'snake') { try { - return $hydrator->hydrateObject(Schema\YellowEyes::class, $value); + return $hydrator->hydrateObject(\ApiClients\Client\PetStore\Internal\Attribute\CastUnionToType\Single\Schema\Spider\Eyes::class, $value); } catch (\Throwable) { } } if ($signature === 'count|type' && $value['type'] === 'rage') { try { - return $hydrator->hydrateObject(Schema\BlackEyes::class, $value); + return $hydrator->hydrateObject(\ApiClients\Client\PetStore\Internal\Attribute\CastUnionToType\Single\Schema\Spider\Eyes::class, $value); } catch (\Throwable) { } } - if ($signature === 'count|type' && ($value['type'] === 'blood' || $value['type'] === 'wine' || $value['type'] === 'stale')) { + if ($signature === 'count|type' && (in_array($value['type'], ['blood', 'wine', 'stale'], true))) { try { - return $hydrator->hydrateObject(Schema\RedEyes::class, $value); + return $hydrator->hydrateObject(\ApiClients\Client\PetStore\Internal\Attribute\CastUnionToType\Single\Schema\Spider\Eyes::class, $value); } catch (\Throwable) { } } if ($signature === 'count|type' && ($value['type'] === 'sky' || $value['type'] === 'boobies')) { try { - return $hydrator->hydrateObject(Schema\BlueEyes::class, $value); + return $hydrator->hydrateObject(\ApiClients\Client\PetStore\Internal\Attribute\CastUnionToType\Single\Schema\Spider\Eyes::class, $value); } catch (\Throwable) { } } - if ($signature === 'count|type' && ($value['type'] === 'hulk' || $value['type'] === 'forest' || $value['type'] === 'feral')) { + if ($signature === 'count|type' && (in_array($value['type'], ['hulk', 'forest', 'feral'], true))) { try { - return $hydrator->hydrateObject(Schema\GreenEyes::class, $value); + return $hydrator->hydrateObject(\ApiClients\Client\PetStore\Internal\Attribute\CastUnionToType\Single\Schema\Spider\Eyes::class, $value); } catch (\Throwable) { } } if ($signature === 'count|type' && $value['type'] === 'snake') { try { - return $hydrator->hydrateObject(Schema\YellowEyes::class, $value); + return $hydrator->hydrateObject(\ApiClients\Client\PetStore\Internal\Attribute\CastUnionToType\Single\Schema\Spider\Eyes::class, $value); } catch (\Throwable) { } } if ($signature === 'count|type' && $value['type'] === 'rage') { try { - return $hydrator->hydrateObject(Schema\BlackEyes::class, $value); + return $hydrator->hydrateObject(\ApiClients\Client\PetStore\Internal\Attribute\CastUnionToType\Single\Schema\Spider\Eyes::class, $value); } catch (\Throwable) { } } - if ($signature === 'count|type' && ($value['type'] === 'blood' || $value['type'] === 'wine' || $value['type'] === 'stale')) { + if ($signature === 'count|type' && (in_array($value['type'], ['blood', 'wine', 'stale'], true))) { try { - return $hydrator->hydrateObject(Schema\RedEyes::class, $value); + return $hydrator->hydrateObject(\ApiClients\Client\PetStore\Internal\Attribute\CastUnionToType\Single\Schema\Spider\Eyes::class, $value); } catch (\Throwable) { } } if ($signature === 'count|type' && ($value['type'] === 'sky' || $value['type'] === 'boobies')) { try { - return $hydrator->hydrateObject(Schema\BlueEyes::class, $value); + return $hydrator->hydrateObject(\ApiClients\Client\PetStore\Internal\Attribute\CastUnionToType\Single\Schema\Spider\Eyes::class, $value); } catch (\Throwable) { } } - if ($signature === 'count|type' && ($value['type'] === 'hulk' || $value['type'] === 'forest' || $value['type'] === 'feral')) { + if ($signature === 'count|type' && (in_array($value['type'], ['hulk', 'forest', 'feral'], true))) { try { - return $hydrator->hydrateObject(Schema\GreenEyes::class, $value); + return $hydrator->hydrateObject(\ApiClients\Client\PetStore\Internal\Attribute\CastUnionToType\Single\Schema\Spider\Eyes::class, $value); } catch (\Throwable) { } } if ($signature === 'count|type' && $value['type'] === 'snake') { try { - return $hydrator->hydrateObject(Schema\YellowEyes::class, $value); + return $hydrator->hydrateObject(\ApiClients\Client\PetStore\Internal\Attribute\CastUnionToType\Single\Schema\Spider\Eyes::class, $value); } catch (\Throwable) { } } if ($signature === 'count|type' && $value['type'] === 'rage') { try { - return $hydrator->hydrateObject(Schema\BlackEyes::class, $value); + return $hydrator->hydrateObject(\ApiClients\Client\PetStore\Internal\Attribute\CastUnionToType\Single\Schema\Spider\Eyes::class, $value); } catch (\Throwable) { } } - if ($signature === 'count|type' && ($value['type'] === 'blood' || $value['type'] === 'wine' || $value['type'] === 'stale')) { + if ($signature === 'count|type' && (in_array($value['type'], ['blood', 'wine', 'stale'], true))) { try { - return $hydrator->hydrateObject(Schema\RedEyes::class, $value); + return $hydrator->hydrateObject(\ApiClients\Client\PetStore\Internal\Attribute\CastUnionToType\Single\Schema\Spider\Eyes::class, $value); } catch (\Throwable) { } } if ($signature === 'count|type' && ($value['type'] === 'sky' || $value['type'] === 'boobies')) { try { - return $hydrator->hydrateObject(Schema\BlueEyes::class, $value); + return $hydrator->hydrateObject(\ApiClients\Client\PetStore\Internal\Attribute\CastUnionToType\Single\Schema\Spider\Eyes::class, $value); } catch (\Throwable) { } } - if ($signature === 'count|type' && ($value['type'] === 'hulk' || $value['type'] === 'forest' || $value['type'] === 'feral')) { + if ($signature === 'count|type' && (in_array($value['type'], ['hulk', 'forest', 'feral'], true))) { try { - return $hydrator->hydrateObject(Schema\GreenEyes::class, $value); + return $hydrator->hydrateObject(\ApiClients\Client\PetStore\Internal\Attribute\CastUnionToType\Single\Schema\Spider\Eyes::class, $value); } catch (\Throwable) { } } if ($signature === 'count|type' && $value['type'] === 'snake') { try { - return $hydrator->hydrateObject(Schema\YellowEyes::class, $value); + return $hydrator->hydrateObject(\ApiClients\Client\PetStore\Internal\Attribute\CastUnionToType\Single\Schema\Spider\Eyes::class, $value); } catch (\Throwable) { } } if ($signature === 'count|type' && $value['type'] === 'rage') { try { - return $hydrator->hydrateObject(Schema\BlackEyes::class, $value); + return $hydrator->hydrateObject(\ApiClients\Client\PetStore\Internal\Attribute\CastUnionToType\Single\Schema\Spider\Eyes::class, $value); } catch (\Throwable) { } } - if ($signature === 'count|type' && ($value['type'] === 'blood' || $value['type'] === 'wine' || $value['type'] === 'stale')) { + if ($signature === 'count|type' && (in_array($value['type'], ['blood', 'wine', 'stale'], true))) { try { - return $hydrator->hydrateObject(Schema\RedEyes::class, $value); + return $hydrator->hydrateObject(\ApiClients\Client\PetStore\Internal\Attribute\CastUnionToType\Single\Schema\Spider\Eyes::class, $value); } catch (\Throwable) { } } if ($signature === 'count|type' && ($value['type'] === 'sky' || $value['type'] === 'boobies')) { try { - return $hydrator->hydrateObject(Schema\BlueEyes::class, $value); + return $hydrator->hydrateObject(\ApiClients\Client\PetStore\Internal\Attribute\CastUnionToType\Single\Schema\Spider\Eyes::class, $value); } catch (\Throwable) { } } - if ($signature === 'count|type' && ($value['type'] === 'hulk' || $value['type'] === 'forest' || $value['type'] === 'feral')) { + if ($signature === 'count|type' && (in_array($value['type'], ['hulk', 'forest', 'feral'], true))) { try { - return $hydrator->hydrateObject(Schema\GreenEyes::class, $value); + return $hydrator->hydrateObject(\ApiClients\Client\PetStore\Internal\Attribute\CastUnionToType\Single\Schema\Spider\Eyes::class, $value); } catch (\Throwable) { } } if ($signature === 'count|type' && $value['type'] === 'snake') { try { - return $hydrator->hydrateObject(Schema\YellowEyes::class, $value); + return $hydrator->hydrateObject(\ApiClients\Client\PetStore\Internal\Attribute\CastUnionToType\Single\Schema\Spider\Eyes::class, $value); } catch (\Throwable) { } } if ($signature === 'count|type' && $value['type'] === 'rage') { try { - return $hydrator->hydrateObject(Schema\BlackEyes::class, $value); + return $hydrator->hydrateObject(\ApiClients\Client\PetStore\Internal\Attribute\CastUnionToType\Single\Schema\Spider\Eyes::class, $value); } catch (\Throwable) { } } diff --git a/tests/app/src/Internal/Hydrator/Operation/Pets.php b/tests/app/src/Internal/Hydrator/Operation/Pets.php index 3dd8c75..111aa11 100644 --- a/tests/app/src/Internal/Hydrator/Operation/Pets.php +++ b/tests/app/src/Internal/Hydrator/Operation/Pets.php @@ -23,7 +23,7 @@ public function __construct() {} public function hydrateObject(string $className, array $payload): object { return match($className) { - 'ApiClients\Client\PetStore\Schema\Error' => $this->hydrateApiClients⚡️Client⚡️PetStore⚡️Schema⚡️Error($payload), + \ApiClients\Client\PetStore\Schema\Error::class => $this->hydrateApiClients⚡️Client⚡️PetStore⚡️Schema⚡️Error($payload), default => throw UnableToHydrateObject::noHydrationDefined($className, $this->hydrationStack), }; } @@ -57,7 +57,7 @@ private function hydrateApiClients⚡️Client⚡️PetStore⚡️Schema⚡️Er after_message: } catch (\Throwable $exception) { - throw UnableToHydrateObject::dueToError('ApiClients\Client\PetStore\Schema\Error', $exception, stack: $this->hydrationStack); + throw UnableToHydrateObject::dueToError(\ApiClients\Client\PetStore\Schema\Error::class, $exception, stack: $this->hydrationStack); } if (count($missingFields) > 0) { @@ -67,24 +67,24 @@ private function hydrateApiClients⚡️Client⚡️PetStore⚡️Schema⚡️Er try { return new \ApiClients\Client\PetStore\Schema\Error(...$properties); } catch (\Throwable $exception) { - throw UnableToHydrateObject::dueToError('ApiClients\Client\PetStore\Schema\Error', $exception, stack: $this->hydrationStack); + throw UnableToHydrateObject::dueToError(\ApiClients\Client\PetStore\Schema\Error::class, $exception, stack: $this->hydrationStack); } } private function serializeViaTypeMap(string $accessor, object $object, array $payloadToTypeMap): array { foreach ($payloadToTypeMap as $payloadType => [$valueType, $method]) { - if (is_a($object, $valueType)) { + if ($object instanceof $valueType) { return [$accessor => $payloadType] + $this->{$method}($object); } } - throw new \LogicException('No type mapped for object of class: ' . get_class($object)); + throw new \LogicException('No type mapped for object of class: ' . $object::class); } public function serializeObject(object $object): mixed { - return $this->serializeObjectOfType($object, get_class($object)); + return $this->serializeObjectOfType($object, $object::class); } /** @@ -102,8 +102,8 @@ public function serializeObjectOfType(object $object, string $className): mixed 'DateTime' => $this->serializeValueDateTime($object), 'DateTimeImmutable' => $this->serializeValueDateTimeImmutable($object), 'DateTimeInterface' => $this->serializeValueDateTimeInterface($object), - 'ApiClients\Client\PetStore\Schema\Error' => $this->serializeObjectApiClients⚡️Client⚡️PetStore⚡️Schema⚡️Error($object), - default => throw new \LogicException('No serialization defined for $className'), + \ApiClients\Client\PetStore\Schema\Error::class => $this->serializeObjectApiClients⚡️Client⚡️PetStore⚡️Schema⚡️Error($object), + default => throw new \LogicException("No serialization defined for $className"), }; } catch (\Throwable $exception) { throw UnableToSerializeObject::dueToError($className, $exception); @@ -116,8 +116,8 @@ private function serializeValuearray(mixed $value): mixed static $serializer; if ($serializer === null) { - $serializer = new \EventSauce\ObjectHydrator\PropertySerializers\SerializeArrayItems(...array ( -)); + $serializer = new \EventSauce\ObjectHydrator\PropertySerializers\SerializeArrayItems(... [ +]); } return $serializer->serialize($value, $this); @@ -129,8 +129,8 @@ private function serializeValueRamsey⚡️Uuid⚡️UuidInterface(mixed $value) static $serializer; if ($serializer === null) { - $serializer = new \EventSauce\ObjectHydrator\PropertySerializers\SerializeUuidToString(...array ( -)); + $serializer = new \EventSauce\ObjectHydrator\PropertySerializers\SerializeUuidToString(... [ +]); } return $serializer->serialize($value, $this); @@ -142,8 +142,8 @@ private function serializeValueDateTime(mixed $value): mixed static $serializer; if ($serializer === null) { - $serializer = new \EventSauce\ObjectHydrator\PropertySerializers\SerializeDateTime(...array ( -)); + $serializer = new \EventSauce\ObjectHydrator\PropertySerializers\SerializeDateTime(... [ +]); } return $serializer->serialize($value, $this); @@ -155,8 +155,8 @@ private function serializeValueDateTimeImmutable(mixed $value): mixed static $serializer; if ($serializer === null) { - $serializer = new \EventSauce\ObjectHydrator\PropertySerializers\SerializeDateTime(...array ( -)); + $serializer = new \EventSauce\ObjectHydrator\PropertySerializers\SerializeDateTime(... [ +]); } return $serializer->serialize($value, $this); @@ -168,8 +168,8 @@ private function serializeValueDateTimeInterface(mixed $value): mixed static $serializer; if ($serializer === null) { - $serializer = new \EventSauce\ObjectHydrator\PropertySerializers\SerializeDateTime(...array ( -)); + $serializer = new \EventSauce\ObjectHydrator\PropertySerializers\SerializeDateTime(... [ +]); } return $serializer->serialize($value, $this); diff --git a/tests/app/src/Internal/Hydrator/Operation/Pets/Gatos.php b/tests/app/src/Internal/Hydrator/Operation/Pets/Gatos.php index 00368b4..e627ffa 100644 --- a/tests/app/src/Internal/Hydrator/Operation/Pets/Gatos.php +++ b/tests/app/src/Internal/Hydrator/Operation/Pets/Gatos.php @@ -23,7 +23,7 @@ public function __construct() {} public function hydrateObject(string $className, array $payload): object { return match($className) { - 'ApiClients\Client\PetStore\Schema\Error' => $this->hydrateApiClients⚡️Client⚡️PetStore⚡️Schema⚡️Error($payload), + \ApiClients\Client\PetStore\Schema\Error::class => $this->hydrateApiClients⚡️Client⚡️PetStore⚡️Schema⚡️Error($payload), default => throw UnableToHydrateObject::noHydrationDefined($className, $this->hydrationStack), }; } @@ -57,7 +57,7 @@ private function hydrateApiClients⚡️Client⚡️PetStore⚡️Schema⚡️Er after_message: } catch (\Throwable $exception) { - throw UnableToHydrateObject::dueToError('ApiClients\Client\PetStore\Schema\Error', $exception, stack: $this->hydrationStack); + throw UnableToHydrateObject::dueToError(\ApiClients\Client\PetStore\Schema\Error::class, $exception, stack: $this->hydrationStack); } if (count($missingFields) > 0) { @@ -67,24 +67,24 @@ private function hydrateApiClients⚡️Client⚡️PetStore⚡️Schema⚡️Er try { return new \ApiClients\Client\PetStore\Schema\Error(...$properties); } catch (\Throwable $exception) { - throw UnableToHydrateObject::dueToError('ApiClients\Client\PetStore\Schema\Error', $exception, stack: $this->hydrationStack); + throw UnableToHydrateObject::dueToError(\ApiClients\Client\PetStore\Schema\Error::class, $exception, stack: $this->hydrationStack); } } private function serializeViaTypeMap(string $accessor, object $object, array $payloadToTypeMap): array { foreach ($payloadToTypeMap as $payloadType => [$valueType, $method]) { - if (is_a($object, $valueType)) { + if ($object instanceof $valueType) { return [$accessor => $payloadType] + $this->{$method}($object); } } - throw new \LogicException('No type mapped for object of class: ' . get_class($object)); + throw new \LogicException('No type mapped for object of class: ' . $object::class); } public function serializeObject(object $object): mixed { - return $this->serializeObjectOfType($object, get_class($object)); + return $this->serializeObjectOfType($object, $object::class); } /** @@ -102,8 +102,8 @@ public function serializeObjectOfType(object $object, string $className): mixed 'DateTime' => $this->serializeValueDateTime($object), 'DateTimeImmutable' => $this->serializeValueDateTimeImmutable($object), 'DateTimeInterface' => $this->serializeValueDateTimeInterface($object), - 'ApiClients\Client\PetStore\Schema\Error' => $this->serializeObjectApiClients⚡️Client⚡️PetStore⚡️Schema⚡️Error($object), - default => throw new \LogicException('No serialization defined for $className'), + \ApiClients\Client\PetStore\Schema\Error::class => $this->serializeObjectApiClients⚡️Client⚡️PetStore⚡️Schema⚡️Error($object), + default => throw new \LogicException("No serialization defined for $className"), }; } catch (\Throwable $exception) { throw UnableToSerializeObject::dueToError($className, $exception); @@ -116,8 +116,8 @@ private function serializeValuearray(mixed $value): mixed static $serializer; if ($serializer === null) { - $serializer = new \EventSauce\ObjectHydrator\PropertySerializers\SerializeArrayItems(...array ( -)); + $serializer = new \EventSauce\ObjectHydrator\PropertySerializers\SerializeArrayItems(... [ +]); } return $serializer->serialize($value, $this); @@ -129,8 +129,8 @@ private function serializeValueRamsey⚡️Uuid⚡️UuidInterface(mixed $value) static $serializer; if ($serializer === null) { - $serializer = new \EventSauce\ObjectHydrator\PropertySerializers\SerializeUuidToString(...array ( -)); + $serializer = new \EventSauce\ObjectHydrator\PropertySerializers\SerializeUuidToString(... [ +]); } return $serializer->serialize($value, $this); @@ -142,8 +142,8 @@ private function serializeValueDateTime(mixed $value): mixed static $serializer; if ($serializer === null) { - $serializer = new \EventSauce\ObjectHydrator\PropertySerializers\SerializeDateTime(...array ( -)); + $serializer = new \EventSauce\ObjectHydrator\PropertySerializers\SerializeDateTime(... [ +]); } return $serializer->serialize($value, $this); @@ -155,8 +155,8 @@ private function serializeValueDateTimeImmutable(mixed $value): mixed static $serializer; if ($serializer === null) { - $serializer = new \EventSauce\ObjectHydrator\PropertySerializers\SerializeDateTime(...array ( -)); + $serializer = new \EventSauce\ObjectHydrator\PropertySerializers\SerializeDateTime(... [ +]); } return $serializer->serialize($value, $this); @@ -168,8 +168,8 @@ private function serializeValueDateTimeInterface(mixed $value): mixed static $serializer; if ($serializer === null) { - $serializer = new \EventSauce\ObjectHydrator\PropertySerializers\SerializeDateTime(...array ( -)); + $serializer = new \EventSauce\ObjectHydrator\PropertySerializers\SerializeDateTime(... [ +]); } return $serializer->serialize($value, $this); diff --git a/tests/app/src/Internal/Hydrator/Operation/Pets/GroupedByType.php b/tests/app/src/Internal/Hydrator/Operation/Pets/GroupedByType.php index b43deee..b3f9ead 100644 --- a/tests/app/src/Internal/Hydrator/Operation/Pets/GroupedByType.php +++ b/tests/app/src/Internal/Hydrator/Operation/Pets/GroupedByType.php @@ -23,8 +23,8 @@ public function __construct() {} public function hydrateObject(string $className, array $payload): object { return match($className) { - 'ApiClients\Client\PetStore\Schema\Operations\Pets\Grouped\By\Type\Response\ApplicationJson\Ok' => $this->hydrateApiClients⚡️Client⚡️PetStore⚡️Schema⚡️Operations⚡️Pets⚡️Grouped⚡️By⚡️Type⚡️Response⚡️ApplicationJson⚡️Ok($payload), - 'ApiClients\Client\PetStore\Schema\Error' => $this->hydrateApiClients⚡️Client⚡️PetStore⚡️Schema⚡️Error($payload), + \ApiClients\Client\PetStore\Schema\Operations\Pets\Grouped\By\Type\Response\ApplicationJson\Ok::class => $this->hydrateApiClients⚡️Client⚡️PetStore⚡️Schema⚡️Operations⚡️Pets⚡️Grouped⚡️By⚡️Type⚡️Response⚡️ApplicationJson⚡️Ok($payload), + \ApiClients\Client\PetStore\Schema\Error::class => $this->hydrateApiClients⚡️Client⚡️PetStore⚡️Schema⚡️Error($payload), default => throw UnableToHydrateObject::noHydrationDefined($className, $this->hydrationStack), }; } @@ -45,8 +45,8 @@ private function hydrateApiClients⚡️Client⚡️PetStore⚡️Schema⚡️Op static $petsCaster1; if ($petsCaster1 === null) { - $petsCaster1 = new \ApiClients\Client\PetStore\Internal\Attribute\CastUnionToType\Multiple\Schema\Operations\Pets\Grouped\By\Type\Response\ApplicationJson\Ok\Pets(...array ( -)); + $petsCaster1 = new \ApiClients\Client\PetStore\Internal\Attribute\CastUnionToType\Multiple\Schema\Operations\Pets\Grouped\By\Type\Response\ApplicationJson\Ok\Pets(... [ +]); } $value = $petsCaster1->cast($value, $this); @@ -61,7 +61,7 @@ private function hydrateApiClients⚡️Client⚡️PetStore⚡️Schema⚡️Op after_pets: } catch (\Throwable $exception) { - throw UnableToHydrateObject::dueToError('ApiClients\Client\PetStore\Schema\Operations\Pets\Grouped\By\Type\Response\ApplicationJson\Ok', $exception, stack: $this->hydrationStack); + throw UnableToHydrateObject::dueToError(\ApiClients\Client\PetStore\Schema\Operations\Pets\Grouped\By\Type\Response\ApplicationJson\Ok::class, $exception, stack: $this->hydrationStack); } if (count($missingFields) > 0) { @@ -71,7 +71,7 @@ private function hydrateApiClients⚡️Client⚡️PetStore⚡️Schema⚡️Op try { return new \ApiClients\Client\PetStore\Schema\Operations\Pets\Grouped\By\Type\Response\ApplicationJson\Ok(...$properties); } catch (\Throwable $exception) { - throw UnableToHydrateObject::dueToError('ApiClients\Client\PetStore\Schema\Operations\Pets\Grouped\By\Type\Response\ApplicationJson\Ok', $exception, stack: $this->hydrationStack); + throw UnableToHydrateObject::dueToError(\ApiClients\Client\PetStore\Schema\Operations\Pets\Grouped\By\Type\Response\ApplicationJson\Ok::class, $exception, stack: $this->hydrationStack); } } @@ -104,7 +104,7 @@ private function hydrateApiClients⚡️Client⚡️PetStore⚡️Schema⚡️Er after_message: } catch (\Throwable $exception) { - throw UnableToHydrateObject::dueToError('ApiClients\Client\PetStore\Schema\Error', $exception, stack: $this->hydrationStack); + throw UnableToHydrateObject::dueToError(\ApiClients\Client\PetStore\Schema\Error::class, $exception, stack: $this->hydrationStack); } if (count($missingFields) > 0) { @@ -114,24 +114,24 @@ private function hydrateApiClients⚡️Client⚡️PetStore⚡️Schema⚡️Er try { return new \ApiClients\Client\PetStore\Schema\Error(...$properties); } catch (\Throwable $exception) { - throw UnableToHydrateObject::dueToError('ApiClients\Client\PetStore\Schema\Error', $exception, stack: $this->hydrationStack); + throw UnableToHydrateObject::dueToError(\ApiClients\Client\PetStore\Schema\Error::class, $exception, stack: $this->hydrationStack); } } private function serializeViaTypeMap(string $accessor, object $object, array $payloadToTypeMap): array { foreach ($payloadToTypeMap as $payloadType => [$valueType, $method]) { - if (is_a($object, $valueType)) { + if ($object instanceof $valueType) { return [$accessor => $payloadType] + $this->{$method}($object); } } - throw new \LogicException('No type mapped for object of class: ' . get_class($object)); + throw new \LogicException('No type mapped for object of class: ' . $object::class); } public function serializeObject(object $object): mixed { - return $this->serializeObjectOfType($object, get_class($object)); + return $this->serializeObjectOfType($object, $object::class); } /** @@ -149,9 +149,9 @@ public function serializeObjectOfType(object $object, string $className): mixed 'DateTime' => $this->serializeValueDateTime($object), 'DateTimeImmutable' => $this->serializeValueDateTimeImmutable($object), 'DateTimeInterface' => $this->serializeValueDateTimeInterface($object), - 'ApiClients\Client\PetStore\Schema\Operations\Pets\Grouped\By\Type\Response\ApplicationJson\Ok' => $this->serializeObjectApiClients⚡️Client⚡️PetStore⚡️Schema⚡️Operations⚡️Pets⚡️Grouped⚡️By⚡️Type⚡️Response⚡️ApplicationJson⚡️Ok($object), - 'ApiClients\Client\PetStore\Schema\Error' => $this->serializeObjectApiClients⚡️Client⚡️PetStore⚡️Schema⚡️Error($object), - default => throw new \LogicException('No serialization defined for $className'), + \ApiClients\Client\PetStore\Schema\Operations\Pets\Grouped\By\Type\Response\ApplicationJson\Ok::class => $this->serializeObjectApiClients⚡️Client⚡️PetStore⚡️Schema⚡️Operations⚡️Pets⚡️Grouped⚡️By⚡️Type⚡️Response⚡️ApplicationJson⚡️Ok($object), + \ApiClients\Client\PetStore\Schema\Error::class => $this->serializeObjectApiClients⚡️Client⚡️PetStore⚡️Schema⚡️Error($object), + default => throw new \LogicException("No serialization defined for $className"), }; } catch (\Throwable $exception) { throw UnableToSerializeObject::dueToError($className, $exception); @@ -164,8 +164,8 @@ private function serializeValuearray(mixed $value): mixed static $serializer; if ($serializer === null) { - $serializer = new \EventSauce\ObjectHydrator\PropertySerializers\SerializeArrayItems(...array ( -)); + $serializer = new \EventSauce\ObjectHydrator\PropertySerializers\SerializeArrayItems(... [ +]); } return $serializer->serialize($value, $this); @@ -177,8 +177,8 @@ private function serializeValueRamsey⚡️Uuid⚡️UuidInterface(mixed $value) static $serializer; if ($serializer === null) { - $serializer = new \EventSauce\ObjectHydrator\PropertySerializers\SerializeUuidToString(...array ( -)); + $serializer = new \EventSauce\ObjectHydrator\PropertySerializers\SerializeUuidToString(... [ +]); } return $serializer->serialize($value, $this); @@ -190,8 +190,8 @@ private function serializeValueDateTime(mixed $value): mixed static $serializer; if ($serializer === null) { - $serializer = new \EventSauce\ObjectHydrator\PropertySerializers\SerializeDateTime(...array ( -)); + $serializer = new \EventSauce\ObjectHydrator\PropertySerializers\SerializeDateTime(... [ +]); } return $serializer->serialize($value, $this); @@ -203,8 +203,8 @@ private function serializeValueDateTimeImmutable(mixed $value): mixed static $serializer; if ($serializer === null) { - $serializer = new \EventSauce\ObjectHydrator\PropertySerializers\SerializeDateTime(...array ( -)); + $serializer = new \EventSauce\ObjectHydrator\PropertySerializers\SerializeDateTime(... [ +]); } return $serializer->serialize($value, $this); @@ -216,8 +216,8 @@ private function serializeValueDateTimeInterface(mixed $value): mixed static $serializer; if ($serializer === null) { - $serializer = new \EventSauce\ObjectHydrator\PropertySerializers\SerializeDateTime(...array ( -)); + $serializer = new \EventSauce\ObjectHydrator\PropertySerializers\SerializeDateTime(... [ +]); } return $serializer->serialize($value, $this); @@ -233,8 +233,8 @@ private function serializeObjectApiClients⚡️Client⚡️PetStore⚡️Schema static $petsSerializer0; if ($petsSerializer0 === null) { - $petsSerializer0 = new \EventSauce\ObjectHydrator\PropertySerializers\SerializeArrayItems(...array ( -)); + $petsSerializer0 = new \EventSauce\ObjectHydrator\PropertySerializers\SerializeArrayItems(... [ +]); } $pets = $petsSerializer0->serialize($pets, $this); diff --git a/tests/app/src/Internal/Hydrator/Operation/Pets/Kinds/Walking.php b/tests/app/src/Internal/Hydrator/Operation/Pets/Kinds/Walking.php index 67fde76..12f9fe6 100644 --- a/tests/app/src/Internal/Hydrator/Operation/Pets/Kinds/Walking.php +++ b/tests/app/src/Internal/Hydrator/Operation/Pets/Kinds/Walking.php @@ -23,7 +23,7 @@ public function __construct() {} public function hydrateObject(string $className, array $payload): object { return match($className) { - 'ApiClients\Client\PetStore\Schema\Error' => $this->hydrateApiClients⚡️Client⚡️PetStore⚡️Schema⚡️Error($payload), + \ApiClients\Client\PetStore\Schema\Error::class => $this->hydrateApiClients⚡️Client⚡️PetStore⚡️Schema⚡️Error($payload), default => throw UnableToHydrateObject::noHydrationDefined($className, $this->hydrationStack), }; } @@ -57,7 +57,7 @@ private function hydrateApiClients⚡️Client⚡️PetStore⚡️Schema⚡️Er after_message: } catch (\Throwable $exception) { - throw UnableToHydrateObject::dueToError('ApiClients\Client\PetStore\Schema\Error', $exception, stack: $this->hydrationStack); + throw UnableToHydrateObject::dueToError(\ApiClients\Client\PetStore\Schema\Error::class, $exception, stack: $this->hydrationStack); } if (count($missingFields) > 0) { @@ -67,24 +67,24 @@ private function hydrateApiClients⚡️Client⚡️PetStore⚡️Schema⚡️Er try { return new \ApiClients\Client\PetStore\Schema\Error(...$properties); } catch (\Throwable $exception) { - throw UnableToHydrateObject::dueToError('ApiClients\Client\PetStore\Schema\Error', $exception, stack: $this->hydrationStack); + throw UnableToHydrateObject::dueToError(\ApiClients\Client\PetStore\Schema\Error::class, $exception, stack: $this->hydrationStack); } } private function serializeViaTypeMap(string $accessor, object $object, array $payloadToTypeMap): array { foreach ($payloadToTypeMap as $payloadType => [$valueType, $method]) { - if (is_a($object, $valueType)) { + if ($object instanceof $valueType) { return [$accessor => $payloadType] + $this->{$method}($object); } } - throw new \LogicException('No type mapped for object of class: ' . get_class($object)); + throw new \LogicException('No type mapped for object of class: ' . $object::class); } public function serializeObject(object $object): mixed { - return $this->serializeObjectOfType($object, get_class($object)); + return $this->serializeObjectOfType($object, $object::class); } /** @@ -102,8 +102,8 @@ public function serializeObjectOfType(object $object, string $className): mixed 'DateTime' => $this->serializeValueDateTime($object), 'DateTimeImmutable' => $this->serializeValueDateTimeImmutable($object), 'DateTimeInterface' => $this->serializeValueDateTimeInterface($object), - 'ApiClients\Client\PetStore\Schema\Error' => $this->serializeObjectApiClients⚡️Client⚡️PetStore⚡️Schema⚡️Error($object), - default => throw new \LogicException('No serialization defined for $className'), + \ApiClients\Client\PetStore\Schema\Error::class => $this->serializeObjectApiClients⚡️Client⚡️PetStore⚡️Schema⚡️Error($object), + default => throw new \LogicException("No serialization defined for $className"), }; } catch (\Throwable $exception) { throw UnableToSerializeObject::dueToError($className, $exception); @@ -116,8 +116,8 @@ private function serializeValuearray(mixed $value): mixed static $serializer; if ($serializer === null) { - $serializer = new \EventSauce\ObjectHydrator\PropertySerializers\SerializeArrayItems(...array ( -)); + $serializer = new \EventSauce\ObjectHydrator\PropertySerializers\SerializeArrayItems(... [ +]); } return $serializer->serialize($value, $this); @@ -129,8 +129,8 @@ private function serializeValueRamsey⚡️Uuid⚡️UuidInterface(mixed $value) static $serializer; if ($serializer === null) { - $serializer = new \EventSauce\ObjectHydrator\PropertySerializers\SerializeUuidToString(...array ( -)); + $serializer = new \EventSauce\ObjectHydrator\PropertySerializers\SerializeUuidToString(... [ +]); } return $serializer->serialize($value, $this); @@ -142,8 +142,8 @@ private function serializeValueDateTime(mixed $value): mixed static $serializer; if ($serializer === null) { - $serializer = new \EventSauce\ObjectHydrator\PropertySerializers\SerializeDateTime(...array ( -)); + $serializer = new \EventSauce\ObjectHydrator\PropertySerializers\SerializeDateTime(... [ +]); } return $serializer->serialize($value, $this); @@ -155,8 +155,8 @@ private function serializeValueDateTimeImmutable(mixed $value): mixed static $serializer; if ($serializer === null) { - $serializer = new \EventSauce\ObjectHydrator\PropertySerializers\SerializeDateTime(...array ( -)); + $serializer = new \EventSauce\ObjectHydrator\PropertySerializers\SerializeDateTime(... [ +]); } return $serializer->serialize($value, $this); @@ -168,8 +168,8 @@ private function serializeValueDateTimeInterface(mixed $value): mixed static $serializer; if ($serializer === null) { - $serializer = new \EventSauce\ObjectHydrator\PropertySerializers\SerializeDateTime(...array ( -)); + $serializer = new \EventSauce\ObjectHydrator\PropertySerializers\SerializeDateTime(... [ +]); } return $serializer->serialize($value, $this); diff --git a/tests/app/src/Internal/Hydrator/Operation/Pets/Names.php b/tests/app/src/Internal/Hydrator/Operation/Pets/Names.php index a462078..2af41fc 100644 --- a/tests/app/src/Internal/Hydrator/Operation/Pets/Names.php +++ b/tests/app/src/Internal/Hydrator/Operation/Pets/Names.php @@ -23,7 +23,7 @@ public function __construct() {} public function hydrateObject(string $className, array $payload): object { return match($className) { - 'ApiClients\Client\PetStore\Schema\Error' => $this->hydrateApiClients⚡️Client⚡️PetStore⚡️Schema⚡️Error($payload), + \ApiClients\Client\PetStore\Schema\Error::class => $this->hydrateApiClients⚡️Client⚡️PetStore⚡️Schema⚡️Error($payload), default => throw UnableToHydrateObject::noHydrationDefined($className, $this->hydrationStack), }; } @@ -57,7 +57,7 @@ private function hydrateApiClients⚡️Client⚡️PetStore⚡️Schema⚡️Er after_message: } catch (\Throwable $exception) { - throw UnableToHydrateObject::dueToError('ApiClients\Client\PetStore\Schema\Error', $exception, stack: $this->hydrationStack); + throw UnableToHydrateObject::dueToError(\ApiClients\Client\PetStore\Schema\Error::class, $exception, stack: $this->hydrationStack); } if (count($missingFields) > 0) { @@ -67,24 +67,24 @@ private function hydrateApiClients⚡️Client⚡️PetStore⚡️Schema⚡️Er try { return new \ApiClients\Client\PetStore\Schema\Error(...$properties); } catch (\Throwable $exception) { - throw UnableToHydrateObject::dueToError('ApiClients\Client\PetStore\Schema\Error', $exception, stack: $this->hydrationStack); + throw UnableToHydrateObject::dueToError(\ApiClients\Client\PetStore\Schema\Error::class, $exception, stack: $this->hydrationStack); } } private function serializeViaTypeMap(string $accessor, object $object, array $payloadToTypeMap): array { foreach ($payloadToTypeMap as $payloadType => [$valueType, $method]) { - if (is_a($object, $valueType)) { + if ($object instanceof $valueType) { return [$accessor => $payloadType] + $this->{$method}($object); } } - throw new \LogicException('No type mapped for object of class: ' . get_class($object)); + throw new \LogicException('No type mapped for object of class: ' . $object::class); } public function serializeObject(object $object): mixed { - return $this->serializeObjectOfType($object, get_class($object)); + return $this->serializeObjectOfType($object, $object::class); } /** @@ -102,8 +102,8 @@ public function serializeObjectOfType(object $object, string $className): mixed 'DateTime' => $this->serializeValueDateTime($object), 'DateTimeImmutable' => $this->serializeValueDateTimeImmutable($object), 'DateTimeInterface' => $this->serializeValueDateTimeInterface($object), - 'ApiClients\Client\PetStore\Schema\Error' => $this->serializeObjectApiClients⚡️Client⚡️PetStore⚡️Schema⚡️Error($object), - default => throw new \LogicException('No serialization defined for $className'), + \ApiClients\Client\PetStore\Schema\Error::class => $this->serializeObjectApiClients⚡️Client⚡️PetStore⚡️Schema⚡️Error($object), + default => throw new \LogicException("No serialization defined for $className"), }; } catch (\Throwable $exception) { throw UnableToSerializeObject::dueToError($className, $exception); @@ -116,8 +116,8 @@ private function serializeValuearray(mixed $value): mixed static $serializer; if ($serializer === null) { - $serializer = new \EventSauce\ObjectHydrator\PropertySerializers\SerializeArrayItems(...array ( -)); + $serializer = new \EventSauce\ObjectHydrator\PropertySerializers\SerializeArrayItems(... [ +]); } return $serializer->serialize($value, $this); @@ -129,8 +129,8 @@ private function serializeValueRamsey⚡️Uuid⚡️UuidInterface(mixed $value) static $serializer; if ($serializer === null) { - $serializer = new \EventSauce\ObjectHydrator\PropertySerializers\SerializeUuidToString(...array ( -)); + $serializer = new \EventSauce\ObjectHydrator\PropertySerializers\SerializeUuidToString(... [ +]); } return $serializer->serialize($value, $this); @@ -142,8 +142,8 @@ private function serializeValueDateTime(mixed $value): mixed static $serializer; if ($serializer === null) { - $serializer = new \EventSauce\ObjectHydrator\PropertySerializers\SerializeDateTime(...array ( -)); + $serializer = new \EventSauce\ObjectHydrator\PropertySerializers\SerializeDateTime(... [ +]); } return $serializer->serialize($value, $this); @@ -155,8 +155,8 @@ private function serializeValueDateTimeImmutable(mixed $value): mixed static $serializer; if ($serializer === null) { - $serializer = new \EventSauce\ObjectHydrator\PropertySerializers\SerializeDateTime(...array ( -)); + $serializer = new \EventSauce\ObjectHydrator\PropertySerializers\SerializeDateTime(... [ +]); } return $serializer->serialize($value, $this); @@ -168,8 +168,8 @@ private function serializeValueDateTimeInterface(mixed $value): mixed static $serializer; if ($serializer === null) { - $serializer = new \EventSauce\ObjectHydrator\PropertySerializers\SerializeDateTime(...array ( -)); + $serializer = new \EventSauce\ObjectHydrator\PropertySerializers\SerializeDateTime(... [ +]); } return $serializer->serialize($value, $this); diff --git a/tests/app/src/Internal/Hydrator/Operation/Pets/PetId.php b/tests/app/src/Internal/Hydrator/Operation/Pets/Petid.php similarity index 85% rename from tests/app/src/Internal/Hydrator/Operation/Pets/PetId.php rename to tests/app/src/Internal/Hydrator/Operation/Pets/Petid.php index 76e23eb..6df7fe1 100644 --- a/tests/app/src/Internal/Hydrator/Operation/Pets/PetId.php +++ b/tests/app/src/Internal/Hydrator/Operation/Pets/Petid.php @@ -10,7 +10,7 @@ use EventSauce\ObjectHydrator\UnableToSerializeObject; use Generator; -class PetId implements ObjectMapper +class Petid implements ObjectMapper { private array $hydrationStack = []; public function __construct() {} @@ -23,7 +23,7 @@ public function __construct() {} public function hydrateObject(string $className, array $payload): object { return match($className) { - 'ApiClients\Client\PetStore\Schema\Error' => $this->hydrateApiClients⚡️Client⚡️PetStore⚡️Schema⚡️Error($payload), + \ApiClients\Client\PetStore\Schema\Error::class => $this->hydrateApiClients⚡️Client⚡️PetStore⚡️Schema⚡️Error($payload), default => throw UnableToHydrateObject::noHydrationDefined($className, $this->hydrationStack), }; } @@ -57,7 +57,7 @@ private function hydrateApiClients⚡️Client⚡️PetStore⚡️Schema⚡️Er after_message: } catch (\Throwable $exception) { - throw UnableToHydrateObject::dueToError('ApiClients\Client\PetStore\Schema\Error', $exception, stack: $this->hydrationStack); + throw UnableToHydrateObject::dueToError(\ApiClients\Client\PetStore\Schema\Error::class, $exception, stack: $this->hydrationStack); } if (count($missingFields) > 0) { @@ -67,24 +67,24 @@ private function hydrateApiClients⚡️Client⚡️PetStore⚡️Schema⚡️Er try { return new \ApiClients\Client\PetStore\Schema\Error(...$properties); } catch (\Throwable $exception) { - throw UnableToHydrateObject::dueToError('ApiClients\Client\PetStore\Schema\Error', $exception, stack: $this->hydrationStack); + throw UnableToHydrateObject::dueToError(\ApiClients\Client\PetStore\Schema\Error::class, $exception, stack: $this->hydrationStack); } } private function serializeViaTypeMap(string $accessor, object $object, array $payloadToTypeMap): array { foreach ($payloadToTypeMap as $payloadType => [$valueType, $method]) { - if (is_a($object, $valueType)) { + if ($object instanceof $valueType) { return [$accessor => $payloadType] + $this->{$method}($object); } } - throw new \LogicException('No type mapped for object of class: ' . get_class($object)); + throw new \LogicException('No type mapped for object of class: ' . $object::class); } public function serializeObject(object $object): mixed { - return $this->serializeObjectOfType($object, get_class($object)); + return $this->serializeObjectOfType($object, $object::class); } /** @@ -102,8 +102,8 @@ public function serializeObjectOfType(object $object, string $className): mixed 'DateTime' => $this->serializeValueDateTime($object), 'DateTimeImmutable' => $this->serializeValueDateTimeImmutable($object), 'DateTimeInterface' => $this->serializeValueDateTimeInterface($object), - 'ApiClients\Client\PetStore\Schema\Error' => $this->serializeObjectApiClients⚡️Client⚡️PetStore⚡️Schema⚡️Error($object), - default => throw new \LogicException('No serialization defined for $className'), + \ApiClients\Client\PetStore\Schema\Error::class => $this->serializeObjectApiClients⚡️Client⚡️PetStore⚡️Schema⚡️Error($object), + default => throw new \LogicException("No serialization defined for $className"), }; } catch (\Throwable $exception) { throw UnableToSerializeObject::dueToError($className, $exception); @@ -116,8 +116,8 @@ private function serializeValuearray(mixed $value): mixed static $serializer; if ($serializer === null) { - $serializer = new \EventSauce\ObjectHydrator\PropertySerializers\SerializeArrayItems(...array ( -)); + $serializer = new \EventSauce\ObjectHydrator\PropertySerializers\SerializeArrayItems(... [ +]); } return $serializer->serialize($value, $this); @@ -129,8 +129,8 @@ private function serializeValueRamsey⚡️Uuid⚡️UuidInterface(mixed $value) static $serializer; if ($serializer === null) { - $serializer = new \EventSauce\ObjectHydrator\PropertySerializers\SerializeUuidToString(...array ( -)); + $serializer = new \EventSauce\ObjectHydrator\PropertySerializers\SerializeUuidToString(... [ +]); } return $serializer->serialize($value, $this); @@ -142,8 +142,8 @@ private function serializeValueDateTime(mixed $value): mixed static $serializer; if ($serializer === null) { - $serializer = new \EventSauce\ObjectHydrator\PropertySerializers\SerializeDateTime(...array ( -)); + $serializer = new \EventSauce\ObjectHydrator\PropertySerializers\SerializeDateTime(... [ +]); } return $serializer->serialize($value, $this); @@ -155,8 +155,8 @@ private function serializeValueDateTimeImmutable(mixed $value): mixed static $serializer; if ($serializer === null) { - $serializer = new \EventSauce\ObjectHydrator\PropertySerializers\SerializeDateTime(...array ( -)); + $serializer = new \EventSauce\ObjectHydrator\PropertySerializers\SerializeDateTime(... [ +]); } return $serializer->serialize($value, $this); @@ -168,8 +168,8 @@ private function serializeValueDateTimeInterface(mixed $value): mixed static $serializer; if ($serializer === null) { - $serializer = new \EventSauce\ObjectHydrator\PropertySerializers\SerializeDateTime(...array ( -)); + $serializer = new \EventSauce\ObjectHydrator\PropertySerializers\SerializeDateTime(... [ +]); } return $serializer->serialize($value, $this); diff --git a/tests/app/src/Internal/Hydrators.php b/tests/app/src/Internal/Hydrators.php index aebc236..8e3ba88 100644 --- a/tests/app/src/Internal/Hydrators.php +++ b/tests/app/src/Internal/Hydrators.php @@ -3,100 +3,92 @@ declare (strict_types=1); namespace ApiClients\Client\PetStore\Internal; -use ApiClients\Client\PetStore\Contract; -use ApiClients\Client\PetStore\Error as ErrorSchemas; -use ApiClients\Client\PetStore\Internal; -use ApiClients\Client\PetStore\Operation; -use ApiClients\Client\PetStore\Schema; -use League\OpenAPIValidation; -use React\Http; -use ApiClients\Contracts; final class Hydrators implements \EventSauce\ObjectHydrator\ObjectMapper { - private ?Internal\Hydrator\Operation\Pets $operation🌀Pets = null; - private ?Internal\Hydrator\Operation\Pets\Gatos $operation🌀Pets🌀Gatos = null; - private ?Internal\Hydrator\Operation\Pets\Kinds\Walking $operation🌀Pets🌀Kinds🌀Walking = null; - private ?Internal\Hydrator\Operation\Pets\GroupedByType $operation🌀Pets🌀GroupedByType = null; - private ?Internal\Hydrator\Operation\Pets\Names $operation🌀Pets🌀Names = null; - private ?Internal\Hydrator\Operation\Pets\PetId $operation🌀Pets🌀PetId = null; - public function hydrateObject(string $className, array $payload) : object + private ?\ApiClients\Client\PetStore\Internal\Hydrator\Operation\Pets $operation🌀Pets = null; + private ?\ApiClients\Client\PetStore\Internal\Hydrator\Operation\Pets\Gatos $operation🌀Pets🌀Gatos = null; + private ?\ApiClients\Client\PetStore\Internal\Hydrator\Operation\Pets\Kinds\Walking $operation🌀Pets🌀Kinds🌀Walking = null; + private ?\ApiClients\Client\PetStore\Internal\Hydrator\Operation\Pets\GroupedByType $operation🌀Pets🌀GroupedByType = null; + private ?\ApiClients\Client\PetStore\Internal\Hydrator\Operation\Pets\Names $operation🌀Pets🌀Names = null; + private ?\ApiClients\Client\PetStore\Internal\Hydrator\Operation\Pets\Petid $operation🌀Pets🌀Petid = null; + public function hydrateObject(string $className, array $payload): object { return match ($className) { - '\\ApiClients\\Client\\PetStore\\Schema\\Error' => $this->getObjectMapperOperation🌀Pets()->hydrateObject($className, $payload), - '\\ApiClients\\Client\\PetStore\\Schema\\Operations\\Pets\\Grouped\\By\\Type\\Response\\ApplicationJson\\Ok' => $this->getObjectMapperOperation🌀Pets🌀GroupedByType()->hydrateObject($className, $payload), + \ApiClients\Client\PetStore\Schema\Error::class => $this->getObjectMapperOperation🌀Pets()->hydrateObject($className, $payload), + \ApiClients\Client\PetStore\Schema\Operations\Pets\Grouped\By\Type\Response\ApplicationJson\Ok::class => $this->getObjectMapperOperation🌀Pets🌀GroupedByType()->hydrateObject($className, $payload), }; } - public function hydrateObjects(string $className, iterable $payloads) : \EventSauce\ObjectHydrator\IterableList + public function hydrateObjects(string $className, iterable $payloads): \EventSauce\ObjectHydrator\IterableList { return new \EventSauce\ObjectHydrator\IterableList($this->doHydrateObjects($className, $payloads)); } - private function doHydrateObjects(string $className, iterable $payloads) : \Generator + private function doHydrateObjects(string $className, iterable $payloads): \Generator { foreach ($payloads as $index => $payload) { - (yield $index => $this->hydrateObject($className, $payload)); + yield $index => $this->hydrateObject($className, $payload); } } - public function serializeObject(object $object) : mixed + public function serializeObject(object $object): mixed { return $this->serializeObjectOfType($object, $object::class); } - public function serializeObjectOfType(object $object, string $className) : mixed + public function serializeObjectOfType(object $object, string $className): mixed { return match ($className) { - '\\ApiClients\\Client\\PetStore\\Schema\\Error' => $this->getObjectMapperOperation🌀Pets()->serializeObject($object), - '\\ApiClients\\Client\\PetStore\\Schema\\Operations\\Pets\\Grouped\\By\\Type\\Response\\ApplicationJson\\Ok' => $this->getObjectMapperOperation🌀Pets🌀GroupedByType()->serializeObject($object), + \ApiClients\Client\PetStore\Schema\Error::class => $this->getObjectMapperOperation🌀Pets()->serializeObject($object), + \ApiClients\Client\PetStore\Schema\Operations\Pets\Grouped\By\Type\Response\ApplicationJson\Ok::class => $this->getObjectMapperOperation🌀Pets🌀GroupedByType()->serializeObject($object), }; } - public function serializeObjects(iterable $payloads) : \EventSauce\ObjectHydrator\IterableList + public function serializeObjects(iterable $payloads): \EventSauce\ObjectHydrator\IterableList { return new \EventSauce\ObjectHydrator\IterableList($this->doSerializeObjects($payloads)); } - private function doSerializeObjects(iterable $objects) : \Generator + private function doSerializeObjects(iterable $objects): \Generator { foreach ($objects as $index => $object) { - (yield $index => $this->serializeObject($object)); + yield $index => $this->serializeObject($object); } } - public function getObjectMapperOperation🌀Pets() : Internal\Hydrator\Operation\Pets + public function getObjectMapperOperation🌀Pets(): \ApiClients\Client\PetStore\Internal\Hydrator\Operation\Pets { - if ($this->operation🌀Pets instanceof Internal\Hydrator\Operation\Pets === false) { - $this->operation🌀Pets = new Internal\Hydrator\Operation\Pets(); + if ($this->operation🌀Pets instanceof \ApiClients\Client\PetStore\Internal\Hydrator\Operation\Pets === false) { + $this->operation🌀Pets = new \ApiClients\Client\PetStore\Internal\Hydrator\Operation\Pets(); } return $this->operation🌀Pets; } - public function getObjectMapperOperation🌀Pets🌀Gatos() : Internal\Hydrator\Operation\Pets\Gatos + public function getObjectMapperOperation🌀Pets🌀Gatos(): \ApiClients\Client\PetStore\Internal\Hydrator\Operation\Pets\Gatos { - if ($this->operation🌀Pets🌀Gatos instanceof Internal\Hydrator\Operation\Pets\Gatos === false) { - $this->operation🌀Pets🌀Gatos = new Internal\Hydrator\Operation\Pets\Gatos(); + if ($this->operation🌀Pets🌀Gatos instanceof \ApiClients\Client\PetStore\Internal\Hydrator\Operation\Pets\Gatos === false) { + $this->operation🌀Pets🌀Gatos = new \ApiClients\Client\PetStore\Internal\Hydrator\Operation\Pets\Gatos(); } return $this->operation🌀Pets🌀Gatos; } - public function getObjectMapperOperation🌀Pets🌀Kinds🌀Walking() : Internal\Hydrator\Operation\Pets\Kinds\Walking + public function getObjectMapperOperation🌀Pets🌀Kinds🌀Walking(): \ApiClients\Client\PetStore\Internal\Hydrator\Operation\Pets\Kinds\Walking { - if ($this->operation🌀Pets🌀Kinds🌀Walking instanceof Internal\Hydrator\Operation\Pets\Kinds\Walking === false) { - $this->operation🌀Pets🌀Kinds🌀Walking = new Internal\Hydrator\Operation\Pets\Kinds\Walking(); + if ($this->operation🌀Pets🌀Kinds🌀Walking instanceof \ApiClients\Client\PetStore\Internal\Hydrator\Operation\Pets\Kinds\Walking === false) { + $this->operation🌀Pets🌀Kinds🌀Walking = new \ApiClients\Client\PetStore\Internal\Hydrator\Operation\Pets\Kinds\Walking(); } return $this->operation🌀Pets🌀Kinds🌀Walking; } - public function getObjectMapperOperation🌀Pets🌀GroupedByType() : Internal\Hydrator\Operation\Pets\GroupedByType + public function getObjectMapperOperation🌀Pets🌀GroupedByType(): \ApiClients\Client\PetStore\Internal\Hydrator\Operation\Pets\GroupedByType { - if ($this->operation🌀Pets🌀GroupedByType instanceof Internal\Hydrator\Operation\Pets\GroupedByType === false) { - $this->operation🌀Pets🌀GroupedByType = new Internal\Hydrator\Operation\Pets\GroupedByType(); + if ($this->operation🌀Pets🌀GroupedByType instanceof \ApiClients\Client\PetStore\Internal\Hydrator\Operation\Pets\GroupedByType === false) { + $this->operation🌀Pets🌀GroupedByType = new \ApiClients\Client\PetStore\Internal\Hydrator\Operation\Pets\GroupedByType(); } return $this->operation🌀Pets🌀GroupedByType; } - public function getObjectMapperOperation🌀Pets🌀Names() : Internal\Hydrator\Operation\Pets\Names + public function getObjectMapperOperation🌀Pets🌀Names(): \ApiClients\Client\PetStore\Internal\Hydrator\Operation\Pets\Names { - if ($this->operation🌀Pets🌀Names instanceof Internal\Hydrator\Operation\Pets\Names === false) { - $this->operation🌀Pets🌀Names = new Internal\Hydrator\Operation\Pets\Names(); + if ($this->operation🌀Pets🌀Names instanceof \ApiClients\Client\PetStore\Internal\Hydrator\Operation\Pets\Names === false) { + $this->operation🌀Pets🌀Names = new \ApiClients\Client\PetStore\Internal\Hydrator\Operation\Pets\Names(); } return $this->operation🌀Pets🌀Names; } - public function getObjectMapperOperation🌀Pets🌀PetId() : Internal\Hydrator\Operation\Pets\PetId + public function getObjectMapperOperation🌀Pets🌀Petid(): \ApiClients\Client\PetStore\Internal\Hydrator\Operation\Pets\Petid { - if ($this->operation🌀Pets🌀PetId instanceof Internal\Hydrator\Operation\Pets\PetId === false) { - $this->operation🌀Pets🌀PetId = new Internal\Hydrator\Operation\Pets\PetId(); + if ($this->operation🌀Pets🌀Petid instanceof \ApiClients\Client\PetStore\Internal\Hydrator\Operation\Pets\Petid === false) { + $this->operation🌀Pets🌀Petid = new \ApiClients\Client\PetStore\Internal\Hydrator\Operation\Pets\Petid(); } - return $this->operation🌀Pets🌀PetId; + return $this->operation🌀Pets🌀Petid; } } diff --git a/tests/app/src/Internal/Operation/Pets/Create.php b/tests/app/src/Internal/Operation/Pets/Create.php index 84b1ade..3e5b936 100644 --- a/tests/app/src/Internal/Operation/Pets/Create.php +++ b/tests/app/src/Internal/Operation/Pets/Create.php @@ -3,36 +3,25 @@ declare (strict_types=1); namespace ApiClients\Client\PetStore\Internal\Operation\Pets; -use ApiClients\Client\PetStore\Contract; -use ApiClients\Client\PetStore\Error as ErrorSchemas; -use ApiClients\Client\PetStore\Internal; -use ApiClients\Client\PetStore\Operation; -use ApiClients\Client\PetStore\Schema; -use League\OpenAPIValidation; -use React\Http; -use ApiClients\Contracts; final class Create { public const OPERATION_ID = 'pets/create'; public const OPERATION_MATCH = 'POST /pets'; - private readonly \League\OpenAPIValidation\Schema\SchemaValidator $requestSchemaValidator; - private readonly \League\OpenAPIValidation\Schema\SchemaValidator $responseSchemaValidator; - private readonly Internal\Hydrator\Operation\Pets $hydrator; - public function __construct(\League\OpenAPIValidation\Schema\SchemaValidator $requestSchemaValidator, \League\OpenAPIValidation\Schema\SchemaValidator $responseSchemaValidator, Internal\Hydrator\Operation\Pets $hydrator) + public function __construct(private \League\OpenAPIValidation\Schema\SchemaValidator $requestSchemaValidator, private \League\OpenAPIValidation\Schema\SchemaValidator $responseSchemaValidator, private \ApiClients\Client\PetStore\Internal\Hydrator\Operation\Pets $hydrator) { $this->requestSchemaValidator = $requestSchemaValidator; $this->responseSchemaValidator = $responseSchemaValidator; $this->hydrator = $hydrator; } - public function createRequest(array $data) : \Psr\Http\Message\RequestInterface + public function createRequest(array $data): \Psr\Http\Message\RequestInterface { - $this->requestSchemaValidator->validate($data, \cebe\openapi\Reader::readFromJson(Schema\Pets\Create\Request\ApplicationJson::SCHEMA_JSON, \cebe\openapi\spec\Schema::class)); - return new \RingCentral\Psr7\Request('POST', (string) (new \League\Uri\UriTemplate('/pets'))->expand(array()), array('Content-Type' => 'application/json'), json_encode($data)); + $this->requestSchemaValidator->validate($data, \cebe\openapi\Reader::readFromJson(\ApiClients\Client\PetStore\Schema\Pets\Create\Request\ApplicationJson::SCHEMA_JSON, \cebe\openapi\spec\Schema::class)); + return new \React\Http\Message\Request('POST', (string) (new \League\Uri\UriTemplate('/pets'))->expand([]), ['Content-Type' => 'application/json'], json_encode($data)); } /** - * @return \ApiClients\Tools\OpenApiClient\Utils\Response\WithoutBody + * @return \ApiClients\Client\PetStore\Schema\Error|\ApiClients\Tools\OpenApiClient\Utils\Response\WithoutBody */ - public function createResponse(\Psr\Http\Message\ResponseInterface $response) : \ApiClients\Tools\OpenApiClient\Utils\Response\WithoutBody + public function createResponse(\Psr\Http\Message\ResponseInterface $response): \ApiClients\Client\PetStore\Schema\Error|\ApiClients\Tools\OpenApiClient\Utils\Response\WithoutBody { $code = $response->getStatusCode(); [$contentType] = explode(';', $response->getHeaderLine('Content-Type')); @@ -44,8 +33,8 @@ public function createResponse(\Psr\Http\Message\ResponseInterface $response) : * unexpected error **/ default: - $this->responseSchemaValidator->validate($body, \cebe\openapi\Reader::readFromJson(Schema\Error::SCHEMA_JSON, \cebe\openapi\spec\Schema::class)); - throw new ErrorSchemas\Error($code, $this->hydrator->hydrateObject(Schema\Error::class, $body)); + $this->responseSchemaValidator->validate($body, \cebe\openapi\Reader::readFromJson(\ApiClients\Client\PetStore\Schema\Error::SCHEMA_JSON, \cebe\openapi\spec\Schema::class)); + return $this->hydrator->hydrateObject(\ApiClients\Client\PetStore\Schema\Error::class, $body); } break; } @@ -54,7 +43,7 @@ public function createResponse(\Psr\Http\Message\ResponseInterface $response) : * Null response **/ case 201: - return new \ApiClients\Tools\OpenApiClient\Utils\Response\WithoutBody(201, array()); + return new \ApiClients\Tools\OpenApiClient\Utils\Response\WithoutBody(201, []); } throw new \RuntimeException('Unable to find matching response code and content type'); } diff --git a/tests/app/src/Internal/Operation/Pets/Grouped/By/Type.php b/tests/app/src/Internal/Operation/Pets/Grouped/By/Type.php index 9fe8eca..0936419 100644 --- a/tests/app/src/Internal/Operation/Pets/Grouped/By/Type.php +++ b/tests/app/src/Internal/Operation/Pets/Grouped/By/Type.php @@ -3,14 +3,6 @@ declare (strict_types=1); namespace ApiClients\Client\PetStore\Internal\Operation\Pets\Grouped\By; -use ApiClients\Client\PetStore\Contract; -use ApiClients\Client\PetStore\Error as ErrorSchemas; -use ApiClients\Client\PetStore\Internal; -use ApiClients\Client\PetStore\Operation; -use ApiClients\Client\PetStore\Schema; -use League\OpenAPIValidation; -use React\Http; -use ApiClients\Contracts; final class Type { public const OPERATION_ID = 'pets/grouped/by/type'; @@ -19,23 +11,21 @@ final class Type private int $perPage; /**Page number of the results to fetch. **/ private int $page; - private readonly \League\OpenAPIValidation\Schema\SchemaValidator $responseSchemaValidator; - private readonly Internal\Hydrator\Operation\Pets\GroupedByType $hydrator; - public function __construct(\League\OpenAPIValidation\Schema\SchemaValidator $responseSchemaValidator, Internal\Hydrator\Operation\Pets\GroupedByType $hydrator, int $perPage = 30, int $page = 1) + public function __construct(private \League\OpenAPIValidation\Schema\SchemaValidator $responseSchemaValidator, private \ApiClients\Client\PetStore\Internal\Hydrator\Operation\Pets\GroupedByType $hydrator, int $perPage = 30, int $page = 1) { $this->perPage = $perPage; $this->page = $page; $this->responseSchemaValidator = $responseSchemaValidator; $this->hydrator = $hydrator; } - public function createRequest() : \Psr\Http\Message\RequestInterface + public function createRequest(): \Psr\Http\Message\RequestInterface { - return new \RingCentral\Psr7\Request('GET', (string) (new \League\Uri\UriTemplate('/pets/groupedByType{?page,per_page}'))->expand(array('page' => $this->page, 'per_page' => $this->perPage))); + return new \React\Http\Message\Request('GET', (string) (new \League\Uri\UriTemplate('/pets/groupedByType{?page,per_page}'))->expand(['page' => $this->page, 'per_page' => $this->perPage])); } /** - * @return Schema\Operations\Pets\Grouped\By\Type\Response\ApplicationJson\Ok + * @return \ApiClients\Client\PetStore\Schema\Operations\Pets\Grouped\By\Type\Response\ApplicationJson\Ok|\ApiClients\Client\PetStore\Schema\Error */ - public function createResponse(\Psr\Http\Message\ResponseInterface $response) : Schema\Operations\Pets\Grouped\By\Type\Response\ApplicationJson\Ok + public function createResponse(\Psr\Http\Message\ResponseInterface $response): \ApiClients\Client\PetStore\Schema\Operations\Pets\Grouped\By\Type\Response\ApplicationJson\Ok|\ApiClients\Client\PetStore\Schema\Error { $code = $response->getStatusCode(); [$contentType] = explode(';', $response->getHeaderLine('Content-Type')); @@ -47,14 +37,14 @@ public function createResponse(\Psr\Http\Message\ResponseInterface $response) : * A shitty design choice to test a specific situation in the generator **/ case 200: - $this->responseSchemaValidator->validate($body, \cebe\openapi\Reader::readFromJson(Schema\Operations\Pets\Grouped\By\Type\Response\ApplicationJson\Ok::SCHEMA_JSON, \cebe\openapi\spec\Schema::class)); - return $this->hydrator->hydrateObject(Schema\Operations\Pets\Grouped\By\Type\Response\ApplicationJson\Ok::class, $body); + $this->responseSchemaValidator->validate($body, \cebe\openapi\Reader::readFromJson(\ApiClients\Client\PetStore\Schema\Operations\Pets\Grouped\By\Type\Response\ApplicationJson\Ok::SCHEMA_JSON, \cebe\openapi\spec\Schema::class)); + return $this->hydrator->hydrateObject(\ApiClients\Client\PetStore\Schema\Operations\Pets\Grouped\By\Type\Response\ApplicationJson\Ok::class, $body); /** * unexpected error **/ default: - $this->responseSchemaValidator->validate($body, \cebe\openapi\Reader::readFromJson(Schema\Error::SCHEMA_JSON, \cebe\openapi\spec\Schema::class)); - throw new ErrorSchemas\Error($code, $this->hydrator->hydrateObject(Schema\Error::class, $body)); + $this->responseSchemaValidator->validate($body, \cebe\openapi\Reader::readFromJson(\ApiClients\Client\PetStore\Schema\Error::SCHEMA_JSON, \cebe\openapi\spec\Schema::class)); + return $this->hydrator->hydrateObject(\ApiClients\Client\PetStore\Schema\Error::class, $body); } break; } diff --git a/tests/app/src/Internal/Operation/Pets/Kinds/Walking.php b/tests/app/src/Internal/Operation/Pets/Kinds/Walking.php index a641523..bbb8582 100644 --- a/tests/app/src/Internal/Operation/Pets/Kinds/Walking.php +++ b/tests/app/src/Internal/Operation/Pets/Kinds/Walking.php @@ -3,14 +3,6 @@ declare (strict_types=1); namespace ApiClients\Client\PetStore\Internal\Operation\Pets\Kinds; -use ApiClients\Client\PetStore\Contract; -use ApiClients\Client\PetStore\Error as ErrorSchemas; -use ApiClients\Client\PetStore\Internal; -use ApiClients\Client\PetStore\Operation; -use ApiClients\Client\PetStore\Schema; -use League\OpenAPIValidation; -use React\Http; -use ApiClients\Contracts; final class Walking { public const OPERATION_ID = 'pets/kinds/walking'; @@ -19,23 +11,21 @@ final class Walking private int $perPage; /**Page number of the results to fetch. **/ private int $page; - private readonly \League\OpenAPIValidation\Schema\SchemaValidator $responseSchemaValidator; - private readonly Internal\Hydrator\Operation\Pets\Kinds\Walking $hydrator; - public function __construct(\League\OpenAPIValidation\Schema\SchemaValidator $responseSchemaValidator, Internal\Hydrator\Operation\Pets\Kinds\Walking $hydrator, int $perPage = 30, int $page = 1) + public function __construct(private \League\OpenAPIValidation\Schema\SchemaValidator $responseSchemaValidator, private \ApiClients\Client\PetStore\Internal\Hydrator\Operation\Pets\Kinds\Walking $hydrator, int $perPage = 30, int $page = 1) { $this->perPage = $perPage; $this->page = $page; $this->responseSchemaValidator = $responseSchemaValidator; $this->hydrator = $hydrator; } - public function createRequest() : \Psr\Http\Message\RequestInterface + public function createRequest(): \Psr\Http\Message\RequestInterface { - return new \RingCentral\Psr7\Request('GET', (string) (new \League\Uri\UriTemplate('/pets/kinds/walking{?page,per_page}'))->expand(array('page' => $this->page, 'per_page' => $this->perPage))); + return new \React\Http\Message\Request('GET', (string) (new \League\Uri\UriTemplate('/pets/kinds/walking{?page,per_page}'))->expand(['page' => $this->page, 'per_page' => $this->perPage])); } /** - * @return \Rx\Observable + * @return \Rx\Observable<\ApiClients\Client\PetStore\Schema\Cat|\ApiClients\Client\PetStore\Schema\Dog|\ApiClients\Client\PetStore\Schema\HellHound>|\ApiClients\Client\PetStore\Schema\Error */ - public function createResponse(\Psr\Http\Message\ResponseInterface $response) : \Rx\Observable + public function createResponse(\Psr\Http\Message\ResponseInterface $response): \Rx\Observable|\ApiClients\Client\PetStore\Schema\Error { $code = $response->getStatusCode(); [$contentType] = explode(';', $response->getHeaderLine('Content-Type')); @@ -47,37 +37,37 @@ public function createResponse(\Psr\Http\Message\ResponseInterface $response) : * A paged array of cats **/ case 200: - return \Rx\Observable::fromArray($body, new \Rx\Scheduler\ImmediateScheduler())->map(function (array $body) : Schema\Cat|Schema\Dog|Schema\HellHound { + return \Rx\Observable::fromArray($body, new \Rx\Scheduler\ImmediateScheduler())->map(function (array $body): \ApiClients\Client\PetStore\Schema\Cat|\ApiClients\Client\PetStore\Schema\Dog|\ApiClients\Client\PetStore\Schema\HellHound { $error = new \RuntimeException(); try { - $this->responseSchemaValidator->validate($body, \cebe\openapi\Reader::readFromJson(Schema\Cat::SCHEMA_JSON, '\\cebe\\openapi\\spec\\Schema')); - return $this->hydrator->hydrateObject(Schema\Cat::class, $body); + $this->responseSchemaValidator->validate($body, \cebe\openapi\Reader::readFromJson(\ApiClients\Client\PetStore\Schema\Cat::SCHEMA_JSON, '\cebe\openapi\spec\Schema')); + return $this->hydrator->hydrateObject(\ApiClients\Client\PetStore\Schema\Cat::class, $body); } catch (\Throwable $error) { - goto items_application_json_two_hundred_aaaaa; + goto items_application_json_two_hundred_0; } - items_application_json_two_hundred_aaaaa: + items_application_json_two_hundred_0: try { - $this->responseSchemaValidator->validate($body, \cebe\openapi\Reader::readFromJson(Schema\Dog::SCHEMA_JSON, '\\cebe\\openapi\\spec\\Schema')); - return $this->hydrator->hydrateObject(Schema\Dog::class, $body); + $this->responseSchemaValidator->validate($body, \cebe\openapi\Reader::readFromJson(\ApiClients\Client\PetStore\Schema\Dog::SCHEMA_JSON, '\cebe\openapi\spec\Schema')); + return $this->hydrator->hydrateObject(\ApiClients\Client\PetStore\Schema\Dog::class, $body); } catch (\Throwable $error) { - goto items_application_json_two_hundred_aaaab; + goto items_application_json_two_hundred_1; } - items_application_json_two_hundred_aaaab: + items_application_json_two_hundred_1: try { - $this->responseSchemaValidator->validate($body, \cebe\openapi\Reader::readFromJson(Schema\HellHound::SCHEMA_JSON, '\\cebe\\openapi\\spec\\Schema')); - return $this->hydrator->hydrateObject(Schema\HellHound::class, $body); + $this->responseSchemaValidator->validate($body, \cebe\openapi\Reader::readFromJson(\ApiClients\Client\PetStore\Schema\HellHound::SCHEMA_JSON, '\cebe\openapi\spec\Schema')); + return $this->hydrator->hydrateObject(\ApiClients\Client\PetStore\Schema\HellHound::class, $body); } catch (\Throwable $error) { - goto items_application_json_two_hundred_aaaac; + goto items_application_json_two_hundred_2; } - items_application_json_two_hundred_aaaac: + items_application_json_two_hundred_2: throw $error; }); /** * unexpected error **/ default: - $this->responseSchemaValidator->validate($body, \cebe\openapi\Reader::readFromJson(Schema\Error::SCHEMA_JSON, \cebe\openapi\spec\Schema::class)); - throw new ErrorSchemas\Error($code, $this->hydrator->hydrateObject(Schema\Error::class, $body)); + $this->responseSchemaValidator->validate($body, \cebe\openapi\Reader::readFromJson(\ApiClients\Client\PetStore\Schema\Error::SCHEMA_JSON, \cebe\openapi\spec\Schema::class)); + return $this->hydrator->hydrateObject(\ApiClients\Client\PetStore\Schema\Error::class, $body); } break; } diff --git a/tests/app/src/Internal/Operation/Pets/Kinds/WalkingListing.php b/tests/app/src/Internal/Operation/Pets/Kinds/WalkingListing.php deleted file mode 100644 index bf22191..0000000 --- a/tests/app/src/Internal/Operation/Pets/Kinds/WalkingListing.php +++ /dev/null @@ -1,86 +0,0 @@ -perPage = $perPage; - $this->page = $page; - $this->responseSchemaValidator = $responseSchemaValidator; - $this->hydrator = $hydrator; - } - public function createRequest() : \Psr\Http\Message\RequestInterface - { - return new \RingCentral\Psr7\Request('GET', (string) (new \League\Uri\UriTemplate('/pets/kinds/walking{?page,per_page}'))->expand(array('page' => $this->page, 'per_page' => $this->perPage))); - } - /** - * @return \Rx\Observable - */ - public function createResponse(\Psr\Http\Message\ResponseInterface $response) : \Rx\Observable - { - $code = $response->getStatusCode(); - [$contentType] = explode(';', $response->getHeaderLine('Content-Type')); - switch ($contentType) { - case 'application/json': - $body = json_decode($response->getBody()->getContents(), true); - switch ($code) { - /** - * A paged array of cats - **/ - case 200: - return \Rx\Observable::fromArray($body, new \Rx\Scheduler\ImmediateScheduler())->map(function (array $body) : Schema\Cat|Schema\Dog|Schema\HellHound { - $error = new \RuntimeException(); - try { - $this->responseSchemaValidator->validate($body, \cebe\openapi\Reader::readFromJson(Schema\Cat::SCHEMA_JSON, '\\cebe\\openapi\\spec\\Schema')); - return $this->hydrator->hydrateObject(Schema\Cat::class, $body); - } catch (\Throwable $error) { - goto items_application_json_two_hundred_aaaaa; - } - items_application_json_two_hundred_aaaaa: - try { - $this->responseSchemaValidator->validate($body, \cebe\openapi\Reader::readFromJson(Schema\Dog::SCHEMA_JSON, '\\cebe\\openapi\\spec\\Schema')); - return $this->hydrator->hydrateObject(Schema\Dog::class, $body); - } catch (\Throwable $error) { - goto items_application_json_two_hundred_aaaab; - } - items_application_json_two_hundred_aaaab: - try { - $this->responseSchemaValidator->validate($body, \cebe\openapi\Reader::readFromJson(Schema\HellHound::SCHEMA_JSON, '\\cebe\\openapi\\spec\\Schema')); - return $this->hydrator->hydrateObject(Schema\HellHound::class, $body); - } catch (\Throwable $error) { - goto items_application_json_two_hundred_aaaac; - } - items_application_json_two_hundred_aaaac: - throw $error; - }); - /** - * unexpected error - **/ - default: - $this->responseSchemaValidator->validate($body, \cebe\openapi\Reader::readFromJson(Schema\Error::SCHEMA_JSON, \cebe\openapi\spec\Schema::class)); - throw new ErrorSchemas\Error($code, $this->hydrator->hydrateObject(Schema\Error::class, $body)); - } - break; - } - throw new \RuntimeException('Unable to find matching response code and content type'); - } -} diff --git a/tests/app/src/Internal/Operation/Pets/ListListing.php b/tests/app/src/Internal/Operation/Pets/ListListing.php deleted file mode 100644 index 71339e2..0000000 --- a/tests/app/src/Internal/Operation/Pets/ListListing.php +++ /dev/null @@ -1,107 +0,0 @@ -perPage = $perPage; - $this->page = $page; - $this->responseSchemaValidator = $responseSchemaValidator; - $this->hydrator = $hydrator; - } - public function createRequest() : \Psr\Http\Message\RequestInterface - { - return new \RingCentral\Psr7\Request('GET', (string) (new \League\Uri\UriTemplate('/pets{?page,per_page}'))->expand(array('page' => $this->page, 'per_page' => $this->perPage))); - } - /** - * @return \Rx\Observable - */ - public function createResponse(\Psr\Http\Message\ResponseInterface $response) : \Rx\Observable - { - $code = $response->getStatusCode(); - [$contentType] = explode(';', $response->getHeaderLine('Content-Type')); - switch ($contentType) { - case 'application/json': - $body = json_decode($response->getBody()->getContents(), true); - switch ($code) { - /** - * A paged array of pets - **/ - case 200: - return \Rx\Observable::fromArray($body, new \Rx\Scheduler\ImmediateScheduler())->map(function (array $body) : Schema\Cat|Schema\Dog|Schema\HellHound|Schema\Bird|Schema\Fish|Schema\Spider { - $error = new \RuntimeException(); - try { - $this->responseSchemaValidator->validate($body, \cebe\openapi\Reader::readFromJson(Schema\Cat::SCHEMA_JSON, '\\cebe\\openapi\\spec\\Schema')); - return $this->hydrator->hydrateObject(Schema\Cat::class, $body); - } catch (\Throwable $error) { - goto items_application_json_two_hundred_aaaaa; - } - items_application_json_two_hundred_aaaaa: - try { - $this->responseSchemaValidator->validate($body, \cebe\openapi\Reader::readFromJson(Schema\Dog::SCHEMA_JSON, '\\cebe\\openapi\\spec\\Schema')); - return $this->hydrator->hydrateObject(Schema\Dog::class, $body); - } catch (\Throwable $error) { - goto items_application_json_two_hundred_aaaab; - } - items_application_json_two_hundred_aaaab: - try { - $this->responseSchemaValidator->validate($body, \cebe\openapi\Reader::readFromJson(Schema\HellHound::SCHEMA_JSON, '\\cebe\\openapi\\spec\\Schema')); - return $this->hydrator->hydrateObject(Schema\HellHound::class, $body); - } catch (\Throwable $error) { - goto items_application_json_two_hundred_aaaac; - } - items_application_json_two_hundred_aaaac: - try { - $this->responseSchemaValidator->validate($body, \cebe\openapi\Reader::readFromJson(Schema\Bird::SCHEMA_JSON, '\\cebe\\openapi\\spec\\Schema')); - return $this->hydrator->hydrateObject(Schema\Bird::class, $body); - } catch (\Throwable $error) { - goto items_application_json_two_hundred_aaaad; - } - items_application_json_two_hundred_aaaad: - try { - $this->responseSchemaValidator->validate($body, \cebe\openapi\Reader::readFromJson(Schema\Fish::SCHEMA_JSON, '\\cebe\\openapi\\spec\\Schema')); - return $this->hydrator->hydrateObject(Schema\Fish::class, $body); - } catch (\Throwable $error) { - goto items_application_json_two_hundred_aaaae; - } - items_application_json_two_hundred_aaaae: - try { - $this->responseSchemaValidator->validate($body, \cebe\openapi\Reader::readFromJson(Schema\Spider::SCHEMA_JSON, '\\cebe\\openapi\\spec\\Schema')); - return $this->hydrator->hydrateObject(Schema\Spider::class, $body); - } catch (\Throwable $error) { - goto items_application_json_two_hundred_aaaaf; - } - items_application_json_two_hundred_aaaaf: - throw $error; - }); - /** - * unexpected error - **/ - default: - $this->responseSchemaValidator->validate($body, \cebe\openapi\Reader::readFromJson(Schema\Error::SCHEMA_JSON, \cebe\openapi\spec\Schema::class)); - throw new ErrorSchemas\Error($code, $this->hydrator->hydrateObject(Schema\Error::class, $body)); - } - break; - } - throw new \RuntimeException('Unable to find matching response code and content type'); - } -} diff --git a/tests/app/src/Internal/Operation/Pets/List_.php b/tests/app/src/Internal/Operation/Pets/List_.php index d729cdc..7fd9c7b 100644 --- a/tests/app/src/Internal/Operation/Pets/List_.php +++ b/tests/app/src/Internal/Operation/Pets/List_.php @@ -3,14 +3,6 @@ declare (strict_types=1); namespace ApiClients\Client\PetStore\Internal\Operation\Pets; -use ApiClients\Client\PetStore\Contract; -use ApiClients\Client\PetStore\Error as ErrorSchemas; -use ApiClients\Client\PetStore\Internal; -use ApiClients\Client\PetStore\Operation; -use ApiClients\Client\PetStore\Schema; -use League\OpenAPIValidation; -use React\Http; -use ApiClients\Contracts; final class List_ { public const OPERATION_ID = 'pets/list'; @@ -19,23 +11,21 @@ final class List_ private int $perPage; /**Page number of the results to fetch. **/ private int $page; - private readonly \League\OpenAPIValidation\Schema\SchemaValidator $responseSchemaValidator; - private readonly Internal\Hydrator\Operation\Pets $hydrator; - public function __construct(\League\OpenAPIValidation\Schema\SchemaValidator $responseSchemaValidator, Internal\Hydrator\Operation\Pets $hydrator, int $perPage = 30, int $page = 1) + public function __construct(private \League\OpenAPIValidation\Schema\SchemaValidator $responseSchemaValidator, private \ApiClients\Client\PetStore\Internal\Hydrator\Operation\Pets $hydrator, int $perPage = 30, int $page = 1) { $this->perPage = $perPage; $this->page = $page; $this->responseSchemaValidator = $responseSchemaValidator; $this->hydrator = $hydrator; } - public function createRequest() : \Psr\Http\Message\RequestInterface + public function createRequest(): \Psr\Http\Message\RequestInterface { - return new \RingCentral\Psr7\Request('GET', (string) (new \League\Uri\UriTemplate('/pets{?page,per_page}'))->expand(array('page' => $this->page, 'per_page' => $this->perPage))); + return new \React\Http\Message\Request('GET', (string) (new \League\Uri\UriTemplate('/pets{?page,per_page}'))->expand(['page' => $this->page, 'per_page' => $this->perPage])); } /** - * @return \Rx\Observable + * @return \Rx\Observable<\ApiClients\Client\PetStore\Schema\Cat|\ApiClients\Client\PetStore\Schema\Dog|\ApiClients\Client\PetStore\Schema\HellHound|\ApiClients\Client\PetStore\Schema\Bird|\ApiClients\Client\PetStore\Schema\Fish|\ApiClients\Client\PetStore\Schema\Spider>|\ApiClients\Client\PetStore\Schema\Error */ - public function createResponse(\Psr\Http\Message\ResponseInterface $response) : \Rx\Observable + public function createResponse(\Psr\Http\Message\ResponseInterface $response): \Rx\Observable|\ApiClients\Client\PetStore\Schema\Error { $code = $response->getStatusCode(); [$contentType] = explode(';', $response->getHeaderLine('Content-Type')); @@ -47,58 +37,58 @@ public function createResponse(\Psr\Http\Message\ResponseInterface $response) : * A paged array of pets **/ case 200: - return \Rx\Observable::fromArray($body, new \Rx\Scheduler\ImmediateScheduler())->map(function (array $body) : Schema\Cat|Schema\Dog|Schema\HellHound|Schema\Bird|Schema\Fish|Schema\Spider { + return \Rx\Observable::fromArray($body, new \Rx\Scheduler\ImmediateScheduler())->map(function (array $body): \ApiClients\Client\PetStore\Schema\Cat|\ApiClients\Client\PetStore\Schema\Dog|\ApiClients\Client\PetStore\Schema\HellHound|\ApiClients\Client\PetStore\Schema\Bird|\ApiClients\Client\PetStore\Schema\Fish|\ApiClients\Client\PetStore\Schema\Spider { $error = new \RuntimeException(); try { - $this->responseSchemaValidator->validate($body, \cebe\openapi\Reader::readFromJson(Schema\Cat::SCHEMA_JSON, '\\cebe\\openapi\\spec\\Schema')); - return $this->hydrator->hydrateObject(Schema\Cat::class, $body); + $this->responseSchemaValidator->validate($body, \cebe\openapi\Reader::readFromJson(\ApiClients\Client\PetStore\Schema\Cat::SCHEMA_JSON, '\cebe\openapi\spec\Schema')); + return $this->hydrator->hydrateObject(\ApiClients\Client\PetStore\Schema\Cat::class, $body); } catch (\Throwable $error) { - goto items_application_json_two_hundred_aaaaa; + goto items_application_json_two_hundred_0; } - items_application_json_two_hundred_aaaaa: + items_application_json_two_hundred_0: try { - $this->responseSchemaValidator->validate($body, \cebe\openapi\Reader::readFromJson(Schema\Dog::SCHEMA_JSON, '\\cebe\\openapi\\spec\\Schema')); - return $this->hydrator->hydrateObject(Schema\Dog::class, $body); + $this->responseSchemaValidator->validate($body, \cebe\openapi\Reader::readFromJson(\ApiClients\Client\PetStore\Schema\Dog::SCHEMA_JSON, '\cebe\openapi\spec\Schema')); + return $this->hydrator->hydrateObject(\ApiClients\Client\PetStore\Schema\Dog::class, $body); } catch (\Throwable $error) { - goto items_application_json_two_hundred_aaaab; + goto items_application_json_two_hundred_1; } - items_application_json_two_hundred_aaaab: + items_application_json_two_hundred_1: try { - $this->responseSchemaValidator->validate($body, \cebe\openapi\Reader::readFromJson(Schema\HellHound::SCHEMA_JSON, '\\cebe\\openapi\\spec\\Schema')); - return $this->hydrator->hydrateObject(Schema\HellHound::class, $body); + $this->responseSchemaValidator->validate($body, \cebe\openapi\Reader::readFromJson(\ApiClients\Client\PetStore\Schema\HellHound::SCHEMA_JSON, '\cebe\openapi\spec\Schema')); + return $this->hydrator->hydrateObject(\ApiClients\Client\PetStore\Schema\HellHound::class, $body); } catch (\Throwable $error) { - goto items_application_json_two_hundred_aaaac; + goto items_application_json_two_hundred_2; } - items_application_json_two_hundred_aaaac: + items_application_json_two_hundred_2: try { - $this->responseSchemaValidator->validate($body, \cebe\openapi\Reader::readFromJson(Schema\Bird::SCHEMA_JSON, '\\cebe\\openapi\\spec\\Schema')); - return $this->hydrator->hydrateObject(Schema\Bird::class, $body); + $this->responseSchemaValidator->validate($body, \cebe\openapi\Reader::readFromJson(\ApiClients\Client\PetStore\Schema\Bird::SCHEMA_JSON, '\cebe\openapi\spec\Schema')); + return $this->hydrator->hydrateObject(\ApiClients\Client\PetStore\Schema\Bird::class, $body); } catch (\Throwable $error) { - goto items_application_json_two_hundred_aaaad; + goto items_application_json_two_hundred_3; } - items_application_json_two_hundred_aaaad: + items_application_json_two_hundred_3: try { - $this->responseSchemaValidator->validate($body, \cebe\openapi\Reader::readFromJson(Schema\Fish::SCHEMA_JSON, '\\cebe\\openapi\\spec\\Schema')); - return $this->hydrator->hydrateObject(Schema\Fish::class, $body); + $this->responseSchemaValidator->validate($body, \cebe\openapi\Reader::readFromJson(\ApiClients\Client\PetStore\Schema\Fish::SCHEMA_JSON, '\cebe\openapi\spec\Schema')); + return $this->hydrator->hydrateObject(\ApiClients\Client\PetStore\Schema\Fish::class, $body); } catch (\Throwable $error) { - goto items_application_json_two_hundred_aaaae; + goto items_application_json_two_hundred_4; } - items_application_json_two_hundred_aaaae: + items_application_json_two_hundred_4: try { - $this->responseSchemaValidator->validate($body, \cebe\openapi\Reader::readFromJson(Schema\Spider::SCHEMA_JSON, '\\cebe\\openapi\\spec\\Schema')); - return $this->hydrator->hydrateObject(Schema\Spider::class, $body); + $this->responseSchemaValidator->validate($body, \cebe\openapi\Reader::readFromJson(\ApiClients\Client\PetStore\Schema\Spider::SCHEMA_JSON, '\cebe\openapi\spec\Schema')); + return $this->hydrator->hydrateObject(\ApiClients\Client\PetStore\Schema\Spider::class, $body); } catch (\Throwable $error) { - goto items_application_json_two_hundred_aaaaf; + goto items_application_json_two_hundred_5; } - items_application_json_two_hundred_aaaaf: + items_application_json_two_hundred_5: throw $error; }); /** * unexpected error **/ default: - $this->responseSchemaValidator->validate($body, \cebe\openapi\Reader::readFromJson(Schema\Error::SCHEMA_JSON, \cebe\openapi\spec\Schema::class)); - throw new ErrorSchemas\Error($code, $this->hydrator->hydrateObject(Schema\Error::class, $body)); + $this->responseSchemaValidator->validate($body, \cebe\openapi\Reader::readFromJson(\ApiClients\Client\PetStore\Schema\Error::SCHEMA_JSON, \cebe\openapi\spec\Schema::class)); + return $this->hydrator->hydrateObject(\ApiClients\Client\PetStore\Schema\Error::class, $body); } break; } diff --git a/tests/app/src/Internal/Operation/Pets/List_/Gatos.php b/tests/app/src/Internal/Operation/Pets/List_/Gatos.php index b734bbb..4bdd397 100644 --- a/tests/app/src/Internal/Operation/Pets/List_/Gatos.php +++ b/tests/app/src/Internal/Operation/Pets/List_/Gatos.php @@ -3,14 +3,6 @@ declare (strict_types=1); namespace ApiClients\Client\PetStore\Internal\Operation\Pets\List_; -use ApiClients\Client\PetStore\Contract; -use ApiClients\Client\PetStore\Error as ErrorSchemas; -use ApiClients\Client\PetStore\Internal; -use ApiClients\Client\PetStore\Operation; -use ApiClients\Client\PetStore\Schema; -use League\OpenAPIValidation; -use React\Http; -use ApiClients\Contracts; final class Gatos { public const OPERATION_ID = 'pets/list/gatos'; @@ -19,23 +11,21 @@ final class Gatos private int $perPage; /**Page number of the results to fetch. **/ private int $page; - private readonly \League\OpenAPIValidation\Schema\SchemaValidator $responseSchemaValidator; - private readonly Internal\Hydrator\Operation\Pets\Gatos $hydrator; - public function __construct(\League\OpenAPIValidation\Schema\SchemaValidator $responseSchemaValidator, Internal\Hydrator\Operation\Pets\Gatos $hydrator, int $perPage = 30, int $page = 1) + public function __construct(private \League\OpenAPIValidation\Schema\SchemaValidator $responseSchemaValidator, private \ApiClients\Client\PetStore\Internal\Hydrator\Operation\Pets\Gatos $hydrator, int $perPage = 30, int $page = 1) { $this->perPage = $perPage; $this->page = $page; $this->responseSchemaValidator = $responseSchemaValidator; $this->hydrator = $hydrator; } - public function createRequest() : \Psr\Http\Message\RequestInterface + public function createRequest(): \Psr\Http\Message\RequestInterface { - return new \RingCentral\Psr7\Request('GET', (string) (new \League\Uri\UriTemplate('/pets/gatos{?page,per_page}'))->expand(array('page' => $this->page, 'per_page' => $this->perPage))); + return new \React\Http\Message\Request('GET', (string) (new \League\Uri\UriTemplate('/pets/gatos{?page,per_page}'))->expand(['page' => $this->page, 'per_page' => $this->perPage])); } /** - * @return \Rx\Observable + * @return \Rx\Observable<\ApiClients\Client\PetStore\Schema\Cat>|\ApiClients\Client\PetStore\Schema\Error */ - public function createResponse(\Psr\Http\Message\ResponseInterface $response) : \Rx\Observable + public function createResponse(\Psr\Http\Message\ResponseInterface $response): \Rx\Observable|\ApiClients\Client\PetStore\Schema\Error { $code = $response->getStatusCode(); [$contentType] = explode(';', $response->getHeaderLine('Content-Type')); @@ -47,23 +37,23 @@ public function createResponse(\Psr\Http\Message\ResponseInterface $response) : * A paged array of cats **/ case 200: - return \Rx\Observable::fromArray($body, new \Rx\Scheduler\ImmediateScheduler())->map(function (array $body) : Schema\Cat { + return \Rx\Observable::fromArray($body, new \Rx\Scheduler\ImmediateScheduler())->map(function (array $body): \ApiClients\Client\PetStore\Schema\Cat { $error = new \RuntimeException(); try { - $this->responseSchemaValidator->validate($body, \cebe\openapi\Reader::readFromJson(Schema\Cat::SCHEMA_JSON, '\\cebe\\openapi\\spec\\Schema')); - return $this->hydrator->hydrateObject(Schema\Cat::class, $body); + $this->responseSchemaValidator->validate($body, \cebe\openapi\Reader::readFromJson(\ApiClients\Client\PetStore\Schema\Cat::SCHEMA_JSON, '\cebe\openapi\spec\Schema')); + return $this->hydrator->hydrateObject(\ApiClients\Client\PetStore\Schema\Cat::class, $body); } catch (\Throwable $error) { - goto items_application_json_two_hundred_aaaaa; + goto items_application_json_two_hundred_0; } - items_application_json_two_hundred_aaaaa: + items_application_json_two_hundred_0: throw $error; }); /** * unexpected error **/ default: - $this->responseSchemaValidator->validate($body, \cebe\openapi\Reader::readFromJson(Schema\Error::SCHEMA_JSON, \cebe\openapi\spec\Schema::class)); - throw new ErrorSchemas\Error($code, $this->hydrator->hydrateObject(Schema\Error::class, $body)); + $this->responseSchemaValidator->validate($body, \cebe\openapi\Reader::readFromJson(\ApiClients\Client\PetStore\Schema\Error::SCHEMA_JSON, \cebe\openapi\spec\Schema::class)); + return $this->hydrator->hydrateObject(\ApiClients\Client\PetStore\Schema\Error::class, $body); } break; } diff --git a/tests/app/src/Internal/Operation/Pets/List_/GatosListing.php b/tests/app/src/Internal/Operation/Pets/List_/GatosListing.php deleted file mode 100644 index 5414868..0000000 --- a/tests/app/src/Internal/Operation/Pets/List_/GatosListing.php +++ /dev/null @@ -1,72 +0,0 @@ -perPage = $perPage; - $this->page = $page; - $this->responseSchemaValidator = $responseSchemaValidator; - $this->hydrator = $hydrator; - } - public function createRequest() : \Psr\Http\Message\RequestInterface - { - return new \RingCentral\Psr7\Request('GET', (string) (new \League\Uri\UriTemplate('/pets/gatos{?page,per_page}'))->expand(array('page' => $this->page, 'per_page' => $this->perPage))); - } - /** - * @return \Rx\Observable - */ - public function createResponse(\Psr\Http\Message\ResponseInterface $response) : \Rx\Observable - { - $code = $response->getStatusCode(); - [$contentType] = explode(';', $response->getHeaderLine('Content-Type')); - switch ($contentType) { - case 'application/json': - $body = json_decode($response->getBody()->getContents(), true); - switch ($code) { - /** - * A paged array of cats - **/ - case 200: - return \Rx\Observable::fromArray($body, new \Rx\Scheduler\ImmediateScheduler())->map(function (array $body) : Schema\Cat { - $error = new \RuntimeException(); - try { - $this->responseSchemaValidator->validate($body, \cebe\openapi\Reader::readFromJson(Schema\Cat::SCHEMA_JSON, '\\cebe\\openapi\\spec\\Schema')); - return $this->hydrator->hydrateObject(Schema\Cat::class, $body); - } catch (\Throwable $error) { - goto items_application_json_two_hundred_aaaaa; - } - items_application_json_two_hundred_aaaaa: - throw $error; - }); - /** - * unexpected error - **/ - default: - $this->responseSchemaValidator->validate($body, \cebe\openapi\Reader::readFromJson(Schema\Error::SCHEMA_JSON, \cebe\openapi\spec\Schema::class)); - throw new ErrorSchemas\Error($code, $this->hydrator->hydrateObject(Schema\Error::class, $body)); - } - break; - } - throw new \RuntimeException('Unable to find matching response code and content type'); - } -} diff --git a/tests/app/src/Internal/Operation/Pets/Names.php b/tests/app/src/Internal/Operation/Pets/Names.php index f7a31d7..ca06f8c 100644 --- a/tests/app/src/Internal/Operation/Pets/Names.php +++ b/tests/app/src/Internal/Operation/Pets/Names.php @@ -3,14 +3,6 @@ declare (strict_types=1); namespace ApiClients\Client\PetStore\Internal\Operation\Pets; -use ApiClients\Client\PetStore\Contract; -use ApiClients\Client\PetStore\Error as ErrorSchemas; -use ApiClients\Client\PetStore\Internal; -use ApiClients\Client\PetStore\Operation; -use ApiClients\Client\PetStore\Schema; -use League\OpenAPIValidation; -use React\Http; -use ApiClients\Contracts; final class Names { public const OPERATION_ID = 'pets/names'; @@ -19,23 +11,21 @@ final class Names private int $perPage; /**Page number of the results to fetch. **/ private int $page; - private readonly \League\OpenAPIValidation\Schema\SchemaValidator $responseSchemaValidator; - private readonly Internal\Hydrator\Operation\Pets\Names $hydrator; - public function __construct(\League\OpenAPIValidation\Schema\SchemaValidator $responseSchemaValidator, Internal\Hydrator\Operation\Pets\Names $hydrator, int $perPage = 30, int $page = 1) + public function __construct(private \League\OpenAPIValidation\Schema\SchemaValidator $responseSchemaValidator, private \ApiClients\Client\PetStore\Internal\Hydrator\Operation\Pets\Names $hydrator, int $perPage = 30, int $page = 1) { $this->perPage = $perPage; $this->page = $page; $this->responseSchemaValidator = $responseSchemaValidator; $this->hydrator = $hydrator; } - public function createRequest() : \Psr\Http\Message\RequestInterface + public function createRequest(): \Psr\Http\Message\RequestInterface { - return new \RingCentral\Psr7\Request('GET', (string) (new \League\Uri\UriTemplate('/pets/names{?page,per_page}'))->expand(array('page' => $this->page, 'per_page' => $this->perPage))); + return new \React\Http\Message\Request('GET', (string) (new \League\Uri\UriTemplate('/pets/names{?page,per_page}'))->expand(['page' => $this->page, 'per_page' => $this->perPage])); } /** - * @return \Rx\Observable + * @return \Rx\Observable|\ApiClients\Client\PetStore\Schema\Error */ - public function createResponse(\Psr\Http\Message\ResponseInterface $response) : \Rx\Observable + public function createResponse(\Psr\Http\Message\ResponseInterface $response): \Rx\Observable|\ApiClients\Client\PetStore\Schema\Error { $code = $response->getStatusCode(); [$contentType] = explode(';', $response->getHeaderLine('Content-Type')); @@ -47,7 +37,7 @@ public function createResponse(\Psr\Http\Message\ResponseInterface $response) : * A paged array of cats **/ case 200: - return \Rx\Observable::fromArray($body, new \Rx\Scheduler\ImmediateScheduler())->map(function (array $body) : string { + return \Rx\Observable::fromArray($body, new \Rx\Scheduler\ImmediateScheduler())->map(function (array $body): string { $error = new \RuntimeException(); if (\is_string($body)) { return $body; @@ -58,8 +48,8 @@ public function createResponse(\Psr\Http\Message\ResponseInterface $response) : * unexpected error **/ default: - $this->responseSchemaValidator->validate($body, \cebe\openapi\Reader::readFromJson(Schema\Error::SCHEMA_JSON, \cebe\openapi\spec\Schema::class)); - throw new ErrorSchemas\Error($code, $this->hydrator->hydrateObject(Schema\Error::class, $body)); + $this->responseSchemaValidator->validate($body, \cebe\openapi\Reader::readFromJson(\ApiClients\Client\PetStore\Schema\Error::SCHEMA_JSON, \cebe\openapi\spec\Schema::class)); + return $this->hydrator->hydrateObject(\ApiClients\Client\PetStore\Schema\Error::class, $body); } break; } diff --git a/tests/app/src/Internal/Operation/Pets/NamesListing.php b/tests/app/src/Internal/Operation/Pets/NamesListing.php deleted file mode 100644 index a5fc250..0000000 --- a/tests/app/src/Internal/Operation/Pets/NamesListing.php +++ /dev/null @@ -1,68 +0,0 @@ -perPage = $perPage; - $this->page = $page; - $this->responseSchemaValidator = $responseSchemaValidator; - $this->hydrator = $hydrator; - } - public function createRequest() : \Psr\Http\Message\RequestInterface - { - return new \RingCentral\Psr7\Request('GET', (string) (new \League\Uri\UriTemplate('/pets/names{?page,per_page}'))->expand(array('page' => $this->page, 'per_page' => $this->perPage))); - } - /** - * @return \Rx\Observable - */ - public function createResponse(\Psr\Http\Message\ResponseInterface $response) : \Rx\Observable - { - $code = $response->getStatusCode(); - [$contentType] = explode(';', $response->getHeaderLine('Content-Type')); - switch ($contentType) { - case 'application/json': - $body = json_decode($response->getBody()->getContents(), true); - switch ($code) { - /** - * A paged array of cats - **/ - case 200: - return \Rx\Observable::fromArray($body, new \Rx\Scheduler\ImmediateScheduler())->map(function (array $body) : string { - $error = new \RuntimeException(); - if (\is_string($body)) { - return $body; - } - throw $error; - }); - /** - * unexpected error - **/ - default: - $this->responseSchemaValidator->validate($body, \cebe\openapi\Reader::readFromJson(Schema\Error::SCHEMA_JSON, \cebe\openapi\spec\Schema::class)); - throw new ErrorSchemas\Error($code, $this->hydrator->hydrateObject(Schema\Error::class, $body)); - } - break; - } - throw new \RuntimeException('Unable to find matching response code and content type'); - } -} diff --git a/tests/app/src/Internal/Operation/ShowPetById.php b/tests/app/src/Internal/Operation/ShowPetById.php index 4bfd760..d0a6772 100644 --- a/tests/app/src/Internal/Operation/ShowPetById.php +++ b/tests/app/src/Internal/Operation/ShowPetById.php @@ -3,33 +3,23 @@ declare (strict_types=1); namespace ApiClients\Client\PetStore\Internal\Operation; -use ApiClients\Client\PetStore\Contract; -use ApiClients\Client\PetStore\Error as ErrorSchemas; -use ApiClients\Client\PetStore\Internal; -use ApiClients\Client\PetStore\Operation; -use ApiClients\Client\PetStore\Schema; -use League\OpenAPIValidation; -use React\Http; -use ApiClients\Contracts; final class ShowPetById { public const OPERATION_ID = 'showPetById'; public const OPERATION_MATCH = 'GET /pets/{petId}'; - private readonly \League\OpenAPIValidation\Schema\SchemaValidator $responseSchemaValidator; - private readonly Internal\Hydrator\Operation\Pets\PetId $hydrator; - public function __construct(\League\OpenAPIValidation\Schema\SchemaValidator $responseSchemaValidator, Internal\Hydrator\Operation\Pets\PetId $hydrator) + public function __construct(private \League\OpenAPIValidation\Schema\SchemaValidator $responseSchemaValidator, private \ApiClients\Client\PetStore\Internal\Hydrator\Operation\Pets\Petid $hydrator) { $this->responseSchemaValidator = $responseSchemaValidator; $this->hydrator = $hydrator; } - public function createRequest() : \Psr\Http\Message\RequestInterface + public function createRequest(): \Psr\Http\Message\RequestInterface { - return new \RingCentral\Psr7\Request('GET', (string) (new \League\Uri\UriTemplate('/pets/{petId}'))->expand(array())); + return new \React\Http\Message\Request('GET', (string) (new \League\Uri\UriTemplate('/pets/{petId}'))->expand([])); } /** - * @return Schema\Cat|Schema\Dog|Schema\Bird|Schema\Fish|Schema\Spider + * @return \ApiClients\Client\PetStore\Schema\Cat|\ApiClients\Client\PetStore\Schema\Dog|\ApiClients\Client\PetStore\Schema\Bird|\ApiClients\Client\PetStore\Schema\Fish|\ApiClients\Client\PetStore\Schema\Spider|\ApiClients\Client\PetStore\Schema\Error */ - public function createResponse(\Psr\Http\Message\ResponseInterface $response) : Schema\Cat|Schema\Dog|Schema\Bird|Schema\Fish|Schema\Spider + public function createResponse(\Psr\Http\Message\ResponseInterface $response): \ApiClients\Client\PetStore\Schema\Cat|\ApiClients\Client\PetStore\Schema\Dog|\ApiClients\Client\PetStore\Schema\Bird|\ApiClients\Client\PetStore\Schema\Fish|\ApiClients\Client\PetStore\Schema\Spider|\ApiClients\Client\PetStore\Schema\Error { $code = $response->getStatusCode(); [$contentType] = explode(';', $response->getHeaderLine('Content-Type')); @@ -43,47 +33,47 @@ public function createResponse(\Psr\Http\Message\ResponseInterface $response) : case 200: $error = new \RuntimeException(); try { - $this->responseSchemaValidator->validate($body, \cebe\openapi\Reader::readFromJson(Schema\Cat::SCHEMA_JSON, '\\cebe\\openapi\\spec\\Schema')); - return $this->hydrator->hydrateObject(Schema\Cat::class, $body); + $this->responseSchemaValidator->validate($body, \cebe\openapi\Reader::readFromJson(\ApiClients\Client\PetStore\Schema\Cat::SCHEMA_JSON, '\cebe\openapi\spec\Schema')); + return $this->hydrator->hydrateObject(\ApiClients\Client\PetStore\Schema\Cat::class, $body); } catch (\Throwable $error) { - goto items_application_json_two_hundred_aaaaa; + goto items_application_json_two_hundred_0; } - items_application_json_two_hundred_aaaaa: + items_application_json_two_hundred_0: try { - $this->responseSchemaValidator->validate($body, \cebe\openapi\Reader::readFromJson(Schema\Dog::SCHEMA_JSON, '\\cebe\\openapi\\spec\\Schema')); - return $this->hydrator->hydrateObject(Schema\Dog::class, $body); + $this->responseSchemaValidator->validate($body, \cebe\openapi\Reader::readFromJson(\ApiClients\Client\PetStore\Schema\Dog::SCHEMA_JSON, '\cebe\openapi\spec\Schema')); + return $this->hydrator->hydrateObject(\ApiClients\Client\PetStore\Schema\Dog::class, $body); } catch (\Throwable $error) { - goto items_application_json_two_hundred_aaaab; + goto items_application_json_two_hundred_1; } - items_application_json_two_hundred_aaaab: + items_application_json_two_hundred_1: try { - $this->responseSchemaValidator->validate($body, \cebe\openapi\Reader::readFromJson(Schema\Bird::SCHEMA_JSON, '\\cebe\\openapi\\spec\\Schema')); - return $this->hydrator->hydrateObject(Schema\Bird::class, $body); + $this->responseSchemaValidator->validate($body, \cebe\openapi\Reader::readFromJson(\ApiClients\Client\PetStore\Schema\Bird::SCHEMA_JSON, '\cebe\openapi\spec\Schema')); + return $this->hydrator->hydrateObject(\ApiClients\Client\PetStore\Schema\Bird::class, $body); } catch (\Throwable $error) { - goto items_application_json_two_hundred_aaaac; + goto items_application_json_two_hundred_2; } - items_application_json_two_hundred_aaaac: + items_application_json_two_hundred_2: try { - $this->responseSchemaValidator->validate($body, \cebe\openapi\Reader::readFromJson(Schema\Fish::SCHEMA_JSON, '\\cebe\\openapi\\spec\\Schema')); - return $this->hydrator->hydrateObject(Schema\Fish::class, $body); + $this->responseSchemaValidator->validate($body, \cebe\openapi\Reader::readFromJson(\ApiClients\Client\PetStore\Schema\Fish::SCHEMA_JSON, '\cebe\openapi\spec\Schema')); + return $this->hydrator->hydrateObject(\ApiClients\Client\PetStore\Schema\Fish::class, $body); } catch (\Throwable $error) { - goto items_application_json_two_hundred_aaaad; + goto items_application_json_two_hundred_3; } - items_application_json_two_hundred_aaaad: + items_application_json_two_hundred_3: try { - $this->responseSchemaValidator->validate($body, \cebe\openapi\Reader::readFromJson(Schema\Spider::SCHEMA_JSON, '\\cebe\\openapi\\spec\\Schema')); - return $this->hydrator->hydrateObject(Schema\Spider::class, $body); + $this->responseSchemaValidator->validate($body, \cebe\openapi\Reader::readFromJson(\ApiClients\Client\PetStore\Schema\Spider::SCHEMA_JSON, '\cebe\openapi\spec\Schema')); + return $this->hydrator->hydrateObject(\ApiClients\Client\PetStore\Schema\Spider::class, $body); } catch (\Throwable $error) { - goto items_application_json_two_hundred_aaaae; + goto items_application_json_two_hundred_4; } - items_application_json_two_hundred_aaaae: + items_application_json_two_hundred_4: throw $error; /** * unexpected error **/ default: - $this->responseSchemaValidator->validate($body, \cebe\openapi\Reader::readFromJson(Schema\Error::SCHEMA_JSON, \cebe\openapi\spec\Schema::class)); - throw new ErrorSchemas\Error($code, $this->hydrator->hydrateObject(Schema\Error::class, $body)); + $this->responseSchemaValidator->validate($body, \cebe\openapi\Reader::readFromJson(\ApiClients\Client\PetStore\Schema\Error::SCHEMA_JSON, \cebe\openapi\spec\Schema::class)); + return $this->hydrator->hydrateObject(\ApiClients\Client\PetStore\Schema\Error::class, $body); } break; } diff --git a/tests/app/src/Internal/Operator/Pets/Create.php b/tests/app/src/Internal/Operator/Pets/Create.php index 2c1e048..e7d5082 100644 --- a/tests/app/src/Internal/Operator/Pets/Create.php +++ b/tests/app/src/Internal/Operator/Pets/Create.php @@ -3,29 +3,21 @@ declare (strict_types=1); namespace ApiClients\Client\PetStore\Internal\Operator\Pets; -use ApiClients\Client\PetStore\Contract; -use ApiClients\Client\PetStore\Error as ErrorSchemas; -use ApiClients\Client\PetStore\Internal; -use ApiClients\Client\PetStore\Operation; -use ApiClients\Client\PetStore\Schema; -use League\OpenAPIValidation; -use React\Http; -use ApiClients\Contracts; final readonly class Create { public const OPERATION_ID = 'pets/create'; public const OPERATION_MATCH = 'POST /pets'; - public function __construct(private \React\Http\Browser $browser, private \ApiClients\Contracts\HTTP\Headers\AuthenticationInterface $authentication, private \League\OpenAPIValidation\Schema\SchemaValidator $requestSchemaValidator, private \League\OpenAPIValidation\Schema\SchemaValidator $responseSchemaValidator, private Internal\Hydrator\Operation\Pets $hydrator) + public function __construct(private \React\Http\Browser $browser, private \ApiClients\Contracts\HTTP\Headers\AuthenticationInterface $authentication, private \League\OpenAPIValidation\Schema\SchemaValidator $requestSchemaValidator, private \League\OpenAPIValidation\Schema\SchemaValidator $responseSchemaValidator, private \ApiClients\Client\PetStore\Internal\Hydrator\Operation\Pets $hydrator) { } /** - * @return \ApiClients\Tools\OpenApiClient\Utils\Response\WithoutBody + * @return \ApiClients\Client\PetStore\Schema\Error|\ApiClients\Tools\OpenApiClient\Utils\Response\WithoutBody */ - public function call(array $params) : \ApiClients\Tools\OpenApiClient\Utils\Response\WithoutBody + public function call(array $params): \ApiClients\Client\PetStore\Schema\Error|\ApiClients\Tools\OpenApiClient\Utils\Response\WithoutBody { $operation = new \ApiClients\Client\PetStore\Internal\Operation\Pets\Create($this->requestSchemaValidator, $this->responseSchemaValidator, $this->hydrator); $request = $operation->createRequest($params); - $result = \React\Async\await($this->browser->request($request->getMethod(), (string) $request->getUri(), $request->withHeader('Authorization', $this->authentication->authHeader())->getHeaders(), (string) $request->getBody())->then(function (\Psr\Http\Message\ResponseInterface $response) use($operation) : \ApiClients\Tools\OpenApiClient\Utils\Response\WithoutBody { + $result = \React\Async\await($this->browser->request($request->getMethod(), (string) $request->getUri(), $request->withHeader('Authorization', $this->authentication->authHeader())->getHeaders(), (string) $request->getBody())->then(function (\Psr\Http\Message\ResponseInterface $response) use ($operation): \ApiClients\Client\PetStore\Schema\Error|\ApiClients\Tools\OpenApiClient\Utils\Response\WithoutBody { return $operation->createResponse($response); })); if ($result instanceof \Rx\Observable) { diff --git a/tests/app/src/Internal/Operator/Pets/Grouped/By/Type.php b/tests/app/src/Internal/Operator/Pets/Grouped/By/Type.php index 7427038..7b62a0b 100644 --- a/tests/app/src/Internal/Operator/Pets/Grouped/By/Type.php +++ b/tests/app/src/Internal/Operator/Pets/Grouped/By/Type.php @@ -3,29 +3,21 @@ declare (strict_types=1); namespace ApiClients\Client\PetStore\Internal\Operator\Pets\Grouped\By; -use ApiClients\Client\PetStore\Contract; -use ApiClients\Client\PetStore\Error as ErrorSchemas; -use ApiClients\Client\PetStore\Internal; -use ApiClients\Client\PetStore\Operation; -use ApiClients\Client\PetStore\Schema; -use League\OpenAPIValidation; -use React\Http; -use ApiClients\Contracts; final readonly class Type { public const OPERATION_ID = 'pets/grouped/by/type'; public const OPERATION_MATCH = 'GET /pets/groupedByType'; - public function __construct(private \React\Http\Browser $browser, private \ApiClients\Contracts\HTTP\Headers\AuthenticationInterface $authentication, private \League\OpenAPIValidation\Schema\SchemaValidator $responseSchemaValidator, private Internal\Hydrator\Operation\Pets\GroupedByType $hydrator) + public function __construct(private \React\Http\Browser $browser, private \ApiClients\Contracts\HTTP\Headers\AuthenticationInterface $authentication, private \League\OpenAPIValidation\Schema\SchemaValidator $responseSchemaValidator, private \ApiClients\Client\PetStore\Internal\Hydrator\Operation\Pets\GroupedByType $hydrator) { } /** - * @return Schema\Operations\Pets\Grouped\By\Type\Response\ApplicationJson\Ok + * @return \ApiClients\Client\PetStore\Schema\Operations\Pets\Grouped\By\Type\Response\ApplicationJson\Ok|\ApiClients\Client\PetStore\Schema\Error */ - public function call(int $perPage = 30, int $page = 1) : \ApiClients\Client\PetStore\Schema\Operations\Pets\Grouped\By\Type\Response\ApplicationJson\Ok + public function call(int $perPage = 30, int $page = 1): \ApiClients\Client\PetStore\Schema\Operations\Pets\Grouped\By\Type\Response\ApplicationJson\Ok|\ApiClients\Client\PetStore\Schema\Error { $operation = new \ApiClients\Client\PetStore\Internal\Operation\Pets\Grouped\By\Type($this->responseSchemaValidator, $this->hydrator, $perPage, $page); $request = $operation->createRequest(); - $result = \React\Async\await($this->browser->request($request->getMethod(), (string) $request->getUri(), $request->withHeader('Authorization', $this->authentication->authHeader())->getHeaders(), (string) $request->getBody())->then(function (\Psr\Http\Message\ResponseInterface $response) use($operation) : \ApiClients\Client\PetStore\Schema\Operations\Pets\Grouped\By\Type\Response\ApplicationJson\Ok { + $result = \React\Async\await($this->browser->request($request->getMethod(), (string) $request->getUri(), $request->withHeader('Authorization', $this->authentication->authHeader())->getHeaders(), (string) $request->getBody())->then(function (\Psr\Http\Message\ResponseInterface $response) use ($operation): \ApiClients\Client\PetStore\Schema\Operations\Pets\Grouped\By\Type\Response\ApplicationJson\Ok|\ApiClients\Client\PetStore\Schema\Error { return $operation->createResponse($response); })); if ($result instanceof \Rx\Observable) { diff --git a/tests/app/src/Internal/Operator/Pets/Kinds/Walking.php b/tests/app/src/Internal/Operator/Pets/Kinds/Walking.php index e43326c..bc8b12e 100644 --- a/tests/app/src/Internal/Operator/Pets/Kinds/Walking.php +++ b/tests/app/src/Internal/Operator/Pets/Kinds/Walking.php @@ -3,29 +3,21 @@ declare (strict_types=1); namespace ApiClients\Client\PetStore\Internal\Operator\Pets\Kinds; -use ApiClients\Client\PetStore\Contract; -use ApiClients\Client\PetStore\Error as ErrorSchemas; -use ApiClients\Client\PetStore\Internal; -use ApiClients\Client\PetStore\Operation; -use ApiClients\Client\PetStore\Schema; -use League\OpenAPIValidation; -use React\Http; -use ApiClients\Contracts; final readonly class Walking { public const OPERATION_ID = 'pets/kinds/walking'; public const OPERATION_MATCH = 'GET /pets/kinds/walking'; - public function __construct(private \React\Http\Browser $browser, private \ApiClients\Contracts\HTTP\Headers\AuthenticationInterface $authentication, private \League\OpenAPIValidation\Schema\SchemaValidator $responseSchemaValidator, private Internal\Hydrator\Operation\Pets\Kinds\Walking $hydrator) + public function __construct(private \React\Http\Browser $browser, private \ApiClients\Contracts\HTTP\Headers\AuthenticationInterface $authentication, private \League\OpenAPIValidation\Schema\SchemaValidator $responseSchemaValidator, private \ApiClients\Client\PetStore\Internal\Hydrator\Operation\Pets\Kinds\Walking $hydrator) { } /** - * @return iterable + * @return iterable|\ApiClients\Client\PetStore\Schema\Error */ - public function call(int $perPage = 30, int $page = 1) : iterable + public function call(int $perPage = 30, int $page = 1): \Rx\Observable|\ApiClients\Client\PetStore\Schema\Error { $operation = new \ApiClients\Client\PetStore\Internal\Operation\Pets\Kinds\Walking($this->responseSchemaValidator, $this->hydrator, $perPage, $page); $request = $operation->createRequest(); - $result = \React\Async\await($this->browser->request($request->getMethod(), (string) $request->getUri(), $request->withHeader('Authorization', $this->authentication->authHeader())->getHeaders(), (string) $request->getBody())->then(function (\Psr\Http\Message\ResponseInterface $response) use($operation) : \Rx\Observable { + $result = \React\Async\await($this->browser->request($request->getMethod(), (string) $request->getUri(), $request->withHeader('Authorization', $this->authentication->authHeader())->getHeaders(), (string) $request->getBody())->then(function (\Psr\Http\Message\ResponseInterface $response) use ($operation): \Rx\Observable|\ApiClients\Client\PetStore\Schema\Error { return $operation->createResponse($response); })); if ($result instanceof \Rx\Observable) { diff --git a/tests/app/src/Internal/Operator/Pets/Kinds/WalkingListing.php b/tests/app/src/Internal/Operator/Pets/Kinds/WalkingListing.php deleted file mode 100644 index 4d3e5c0..0000000 --- a/tests/app/src/Internal/Operator/Pets/Kinds/WalkingListing.php +++ /dev/null @@ -1,36 +0,0 @@ - - */ - public function call(int $perPage = 30, int $page = 1) : iterable - { - $operation = new \ApiClients\Client\PetStore\Internal\Operation\Pets\Kinds\WalkingListing($this->responseSchemaValidator, $this->hydrator, $perPage, $page); - $request = $operation->createRequest(); - $result = \React\Async\await($this->browser->request($request->getMethod(), (string) $request->getUri(), $request->withHeader('Authorization', $this->authentication->authHeader())->getHeaders(), (string) $request->getBody())->then(function (\Psr\Http\Message\ResponseInterface $response) use($operation) : \Rx\Observable { - return $operation->createResponse($response); - })); - if ($result instanceof \Rx\Observable) { - $result = \WyriHaximus\React\awaitObservable($result); - } - return $result; - } -} diff --git a/tests/app/src/Internal/Operator/Pets/ListListing.php b/tests/app/src/Internal/Operator/Pets/ListListing.php deleted file mode 100644 index a8d3390..0000000 --- a/tests/app/src/Internal/Operator/Pets/ListListing.php +++ /dev/null @@ -1,36 +0,0 @@ - - */ - public function call(int $perPage = 30, int $page = 1) : iterable - { - $operation = new \ApiClients\Client\PetStore\Internal\Operation\Pets\ListListing($this->responseSchemaValidator, $this->hydrator, $perPage, $page); - $request = $operation->createRequest(); - $result = \React\Async\await($this->browser->request($request->getMethod(), (string) $request->getUri(), $request->withHeader('Authorization', $this->authentication->authHeader())->getHeaders(), (string) $request->getBody())->then(function (\Psr\Http\Message\ResponseInterface $response) use($operation) : \Rx\Observable { - return $operation->createResponse($response); - })); - if ($result instanceof \Rx\Observable) { - $result = \WyriHaximus\React\awaitObservable($result); - } - return $result; - } -} diff --git a/tests/app/src/Internal/Operator/Pets/List_.php b/tests/app/src/Internal/Operator/Pets/List_.php index c59393e..702dc52 100644 --- a/tests/app/src/Internal/Operator/Pets/List_.php +++ b/tests/app/src/Internal/Operator/Pets/List_.php @@ -3,29 +3,21 @@ declare (strict_types=1); namespace ApiClients\Client\PetStore\Internal\Operator\Pets; -use ApiClients\Client\PetStore\Contract; -use ApiClients\Client\PetStore\Error as ErrorSchemas; -use ApiClients\Client\PetStore\Internal; -use ApiClients\Client\PetStore\Operation; -use ApiClients\Client\PetStore\Schema; -use League\OpenAPIValidation; -use React\Http; -use ApiClients\Contracts; final readonly class List_ { public const OPERATION_ID = 'pets/list'; public const OPERATION_MATCH = 'GET /pets'; - public function __construct(private \React\Http\Browser $browser, private \ApiClients\Contracts\HTTP\Headers\AuthenticationInterface $authentication, private \League\OpenAPIValidation\Schema\SchemaValidator $responseSchemaValidator, private Internal\Hydrator\Operation\Pets $hydrator) + public function __construct(private \React\Http\Browser $browser, private \ApiClients\Contracts\HTTP\Headers\AuthenticationInterface $authentication, private \League\OpenAPIValidation\Schema\SchemaValidator $responseSchemaValidator, private \ApiClients\Client\PetStore\Internal\Hydrator\Operation\Pets $hydrator) { } /** - * @return iterable + * @return iterable|\ApiClients\Client\PetStore\Schema\Error */ - public function call(int $perPage = 30, int $page = 1) : iterable + public function call(int $perPage = 30, int $page = 1): \Rx\Observable|\ApiClients\Client\PetStore\Schema\Error { $operation = new \ApiClients\Client\PetStore\Internal\Operation\Pets\List_($this->responseSchemaValidator, $this->hydrator, $perPage, $page); $request = $operation->createRequest(); - $result = \React\Async\await($this->browser->request($request->getMethod(), (string) $request->getUri(), $request->withHeader('Authorization', $this->authentication->authHeader())->getHeaders(), (string) $request->getBody())->then(function (\Psr\Http\Message\ResponseInterface $response) use($operation) : \Rx\Observable { + $result = \React\Async\await($this->browser->request($request->getMethod(), (string) $request->getUri(), $request->withHeader('Authorization', $this->authentication->authHeader())->getHeaders(), (string) $request->getBody())->then(function (\Psr\Http\Message\ResponseInterface $response) use ($operation): \Rx\Observable|\ApiClients\Client\PetStore\Schema\Error { return $operation->createResponse($response); })); if ($result instanceof \Rx\Observable) { diff --git a/tests/app/src/Internal/Operator/Pets/List_/Gatos.php b/tests/app/src/Internal/Operator/Pets/List_/Gatos.php index d0b00ad..2f01c1c 100644 --- a/tests/app/src/Internal/Operator/Pets/List_/Gatos.php +++ b/tests/app/src/Internal/Operator/Pets/List_/Gatos.php @@ -3,29 +3,21 @@ declare (strict_types=1); namespace ApiClients\Client\PetStore\Internal\Operator\Pets\List_; -use ApiClients\Client\PetStore\Contract; -use ApiClients\Client\PetStore\Error as ErrorSchemas; -use ApiClients\Client\PetStore\Internal; -use ApiClients\Client\PetStore\Operation; -use ApiClients\Client\PetStore\Schema; -use League\OpenAPIValidation; -use React\Http; -use ApiClients\Contracts; final readonly class Gatos { public const OPERATION_ID = 'pets/list/gatos'; public const OPERATION_MATCH = 'GET /pets/gatos'; - public function __construct(private \React\Http\Browser $browser, private \ApiClients\Contracts\HTTP\Headers\AuthenticationInterface $authentication, private \League\OpenAPIValidation\Schema\SchemaValidator $responseSchemaValidator, private Internal\Hydrator\Operation\Pets\Gatos $hydrator) + public function __construct(private \React\Http\Browser $browser, private \ApiClients\Contracts\HTTP\Headers\AuthenticationInterface $authentication, private \League\OpenAPIValidation\Schema\SchemaValidator $responseSchemaValidator, private \ApiClients\Client\PetStore\Internal\Hydrator\Operation\Pets\Gatos $hydrator) { } /** - * @return iterable + * @return iterable|\ApiClients\Client\PetStore\Schema\Error */ - public function call(int $perPage = 30, int $page = 1) : iterable + public function call(int $perPage = 30, int $page = 1): \Rx\Observable|\ApiClients\Client\PetStore\Schema\Error { $operation = new \ApiClients\Client\PetStore\Internal\Operation\Pets\List_\Gatos($this->responseSchemaValidator, $this->hydrator, $perPage, $page); $request = $operation->createRequest(); - $result = \React\Async\await($this->browser->request($request->getMethod(), (string) $request->getUri(), $request->withHeader('Authorization', $this->authentication->authHeader())->getHeaders(), (string) $request->getBody())->then(function (\Psr\Http\Message\ResponseInterface $response) use($operation) : \Rx\Observable { + $result = \React\Async\await($this->browser->request($request->getMethod(), (string) $request->getUri(), $request->withHeader('Authorization', $this->authentication->authHeader())->getHeaders(), (string) $request->getBody())->then(function (\Psr\Http\Message\ResponseInterface $response) use ($operation): \Rx\Observable|\ApiClients\Client\PetStore\Schema\Error { return $operation->createResponse($response); })); if ($result instanceof \Rx\Observable) { diff --git a/tests/app/src/Internal/Operator/Pets/List_/GatosListing.php b/tests/app/src/Internal/Operator/Pets/List_/GatosListing.php deleted file mode 100644 index 3595e7a..0000000 --- a/tests/app/src/Internal/Operator/Pets/List_/GatosListing.php +++ /dev/null @@ -1,36 +0,0 @@ - - */ - public function call(int $perPage = 30, int $page = 1) : iterable - { - $operation = new \ApiClients\Client\PetStore\Internal\Operation\Pets\List_\GatosListing($this->responseSchemaValidator, $this->hydrator, $perPage, $page); - $request = $operation->createRequest(); - $result = \React\Async\await($this->browser->request($request->getMethod(), (string) $request->getUri(), $request->withHeader('Authorization', $this->authentication->authHeader())->getHeaders(), (string) $request->getBody())->then(function (\Psr\Http\Message\ResponseInterface $response) use($operation) : \Rx\Observable { - return $operation->createResponse($response); - })); - if ($result instanceof \Rx\Observable) { - $result = \WyriHaximus\React\awaitObservable($result); - } - return $result; - } -} diff --git a/tests/app/src/Internal/Operator/Pets/Names.php b/tests/app/src/Internal/Operator/Pets/Names.php index 9769957..99cb305 100644 --- a/tests/app/src/Internal/Operator/Pets/Names.php +++ b/tests/app/src/Internal/Operator/Pets/Names.php @@ -3,29 +3,21 @@ declare (strict_types=1); namespace ApiClients\Client\PetStore\Internal\Operator\Pets; -use ApiClients\Client\PetStore\Contract; -use ApiClients\Client\PetStore\Error as ErrorSchemas; -use ApiClients\Client\PetStore\Internal; -use ApiClients\Client\PetStore\Operation; -use ApiClients\Client\PetStore\Schema; -use League\OpenAPIValidation; -use React\Http; -use ApiClients\Contracts; final readonly class Names { public const OPERATION_ID = 'pets/names'; public const OPERATION_MATCH = 'GET /pets/names'; - public function __construct(private \React\Http\Browser $browser, private \ApiClients\Contracts\HTTP\Headers\AuthenticationInterface $authentication, private \League\OpenAPIValidation\Schema\SchemaValidator $responseSchemaValidator, private Internal\Hydrator\Operation\Pets\Names $hydrator) + public function __construct(private \React\Http\Browser $browser, private \ApiClients\Contracts\HTTP\Headers\AuthenticationInterface $authentication, private \League\OpenAPIValidation\Schema\SchemaValidator $responseSchemaValidator, private \ApiClients\Client\PetStore\Internal\Hydrator\Operation\Pets\Names $hydrator) { } /** - * @return iterable + * @return iterable|\ApiClients\Client\PetStore\Schema\Error */ - public function call(int $perPage = 30, int $page = 1) : iterable + public function call(int $perPage = 30, int $page = 1): \Rx\Observable|\ApiClients\Client\PetStore\Schema\Error { $operation = new \ApiClients\Client\PetStore\Internal\Operation\Pets\Names($this->responseSchemaValidator, $this->hydrator, $perPage, $page); $request = $operation->createRequest(); - $result = \React\Async\await($this->browser->request($request->getMethod(), (string) $request->getUri(), $request->withHeader('Authorization', $this->authentication->authHeader())->getHeaders(), (string) $request->getBody())->then(function (\Psr\Http\Message\ResponseInterface $response) use($operation) : \Rx\Observable { + $result = \React\Async\await($this->browser->request($request->getMethod(), (string) $request->getUri(), $request->withHeader('Authorization', $this->authentication->authHeader())->getHeaders(), (string) $request->getBody())->then(function (\Psr\Http\Message\ResponseInterface $response) use ($operation): \Rx\Observable|\ApiClients\Client\PetStore\Schema\Error { return $operation->createResponse($response); })); if ($result instanceof \Rx\Observable) { diff --git a/tests/app/src/Internal/Operator/Pets/NamesListing.php b/tests/app/src/Internal/Operator/Pets/NamesListing.php deleted file mode 100644 index 55f7874..0000000 --- a/tests/app/src/Internal/Operator/Pets/NamesListing.php +++ /dev/null @@ -1,36 +0,0 @@ - - */ - public function call(int $perPage = 30, int $page = 1) : iterable - { - $operation = new \ApiClients\Client\PetStore\Internal\Operation\Pets\NamesListing($this->responseSchemaValidator, $this->hydrator, $perPage, $page); - $request = $operation->createRequest(); - $result = \React\Async\await($this->browser->request($request->getMethod(), (string) $request->getUri(), $request->withHeader('Authorization', $this->authentication->authHeader())->getHeaders(), (string) $request->getBody())->then(function (\Psr\Http\Message\ResponseInterface $response) use($operation) : \Rx\Observable { - return $operation->createResponse($response); - })); - if ($result instanceof \Rx\Observable) { - $result = \WyriHaximus\React\awaitObservable($result); - } - return $result; - } -} diff --git a/tests/app/src/Internal/Operator/ShowPetById.php b/tests/app/src/Internal/Operator/ShowPetById.php index 5a963cb..856e156 100644 --- a/tests/app/src/Internal/Operator/ShowPetById.php +++ b/tests/app/src/Internal/Operator/ShowPetById.php @@ -3,29 +3,21 @@ declare (strict_types=1); namespace ApiClients\Client\PetStore\Internal\Operator; -use ApiClients\Client\PetStore\Contract; -use ApiClients\Client\PetStore\Error as ErrorSchemas; -use ApiClients\Client\PetStore\Internal; -use ApiClients\Client\PetStore\Operation; -use ApiClients\Client\PetStore\Schema; -use League\OpenAPIValidation; -use React\Http; -use ApiClients\Contracts; final readonly class ShowPetById { public const OPERATION_ID = 'showPetById'; public const OPERATION_MATCH = 'GET /pets/{petId}'; - public function __construct(private \React\Http\Browser $browser, private \ApiClients\Contracts\HTTP\Headers\AuthenticationInterface $authentication, private \League\OpenAPIValidation\Schema\SchemaValidator $responseSchemaValidator, private Internal\Hydrator\Operation\Pets\PetId $hydrator) + public function __construct(private \React\Http\Browser $browser, private \ApiClients\Contracts\HTTP\Headers\AuthenticationInterface $authentication, private \League\OpenAPIValidation\Schema\SchemaValidator $responseSchemaValidator, private \ApiClients\Client\PetStore\Internal\Hydrator\Operation\Pets\Petid $hydrator) { } /** - * @return Schema\Cat|Schema\Dog|Schema\Bird|Schema\Fish|Schema\Spider + * @return \ApiClients\Client\PetStore\Schema\Cat|\ApiClients\Client\PetStore\Schema\Dog|\ApiClients\Client\PetStore\Schema\Bird|\ApiClients\Client\PetStore\Schema\Fish|\ApiClients\Client\PetStore\Schema\Spider|\ApiClients\Client\PetStore\Schema\Error */ - public function call() : \ApiClients\Client\PetStore\Schema\Cat|\ApiClients\Client\PetStore\Schema\Dog|\ApiClients\Client\PetStore\Schema\Bird|\ApiClients\Client\PetStore\Schema\Fish|\ApiClients\Client\PetStore\Schema\Spider + public function call(): \ApiClients\Client\PetStore\Schema\Cat|\ApiClients\Client\PetStore\Schema\Dog|\ApiClients\Client\PetStore\Schema\Bird|\ApiClients\Client\PetStore\Schema\Fish|\ApiClients\Client\PetStore\Schema\Spider|\ApiClients\Client\PetStore\Schema\Error { $operation = new \ApiClients\Client\PetStore\Internal\Operation\ShowPetById($this->responseSchemaValidator, $this->hydrator); $request = $operation->createRequest(); - $result = \React\Async\await($this->browser->request($request->getMethod(), (string) $request->getUri(), $request->withHeader('Authorization', $this->authentication->authHeader())->getHeaders(), (string) $request->getBody())->then(function (\Psr\Http\Message\ResponseInterface $response) use($operation) : \ApiClients\Client\PetStore\Schema\Cat|\ApiClients\Client\PetStore\Schema\Dog|\ApiClients\Client\PetStore\Schema\Bird|\ApiClients\Client\PetStore\Schema\Fish|\ApiClients\Client\PetStore\Schema\Spider { + $result = \React\Async\await($this->browser->request($request->getMethod(), (string) $request->getUri(), $request->withHeader('Authorization', $this->authentication->authHeader())->getHeaders(), (string) $request->getBody())->then(function (\Psr\Http\Message\ResponseInterface $response) use ($operation): \ApiClients\Client\PetStore\Schema\Cat|\ApiClients\Client\PetStore\Schema\Dog|\ApiClients\Client\PetStore\Schema\Bird|\ApiClients\Client\PetStore\Schema\Fish|\ApiClients\Client\PetStore\Schema\Spider|\ApiClients\Client\PetStore\Schema\Error { return $operation->createResponse($response); })); if ($result instanceof \Rx\Observable) { diff --git a/tests/app/src/Internal/Operators.php b/tests/app/src/Internal/Operators.php index 02d04b7..6972004 100644 --- a/tests/app/src/Internal/Operators.php +++ b/tests/app/src/Internal/Operators.php @@ -3,104 +3,64 @@ declare (strict_types=1); namespace ApiClients\Client\PetStore\Internal; -use ApiClients\Client\PetStore\Contract; -use ApiClients\Client\PetStore\Error as ErrorSchemas; -use ApiClients\Client\PetStore\Internal; -use ApiClients\Client\PetStore\Operation; -use ApiClients\Client\PetStore\Schema; -use League\OpenAPIValidation; -use React\Http; -use ApiClients\Contracts; final class Operators { - private ?Internal\Operator\Pets\List_ $pets👷List_ = null; - private ?Internal\Operator\Pets\ListListing $pets👷ListListing = null; - private ?Internal\Operator\Pets\Create $pets👷Create = null; - private ?Internal\Operator\Pets\List_\Gatos $pets👷List_👷Gatos = null; - private ?Internal\Operator\Pets\List_\GatosListing $pets👷List_👷GatosListing = null; - private ?Internal\Operator\Pets\Kinds\Walking $pets👷Kinds👷Walking = null; - private ?Internal\Operator\Pets\Kinds\WalkingListing $pets👷Kinds👷WalkingListing = null; - private ?Internal\Operator\Pets\Grouped\By\Type $pets👷Grouped👷By👷Type = null; - private ?Internal\Operator\Pets\Names $pets👷Names = null; - private ?Internal\Operator\Pets\NamesListing $pets👷NamesListing = null; - private ?Internal\Operator\ShowPetById $showPetById = null; - public function __construct(private \ApiClients\Contracts\HTTP\Headers\AuthenticationInterface $authentication, private \React\Http\Browser $browser, private \League\OpenAPIValidation\Schema\SchemaValidator $requestSchemaValidator, private \League\OpenAPIValidation\Schema\SchemaValidator $responseSchemaValidator, private Internal\Hydrators $hydrators) + private ?\ApiClients\Client\PetStore\Internal\Operator\Pets\List_ $pets👷List_ = null; + private ?\ApiClients\Client\PetStore\Internal\Operator\Pets\Create $pets👷Create = null; + private ?\ApiClients\Client\PetStore\Internal\Operator\Pets\List_\Gatos $pets👷List👷Gatos = null; + private ?\ApiClients\Client\PetStore\Internal\Operator\Pets\Kinds\Walking $pets👷Kinds👷Walking = null; + private ?\ApiClients\Client\PetStore\Internal\Operator\Pets\Grouped\By\Type $pets👷Grouped👷By👷Type = null; + private ?\ApiClients\Client\PetStore\Internal\Operator\Pets\Names $pets👷Names = null; + private ?\ApiClients\Client\PetStore\Internal\Operator\ShowPetById $showPetById = null; + public function __construct(private readonly \ApiClients\Contracts\HTTP\Headers\AuthenticationInterface $authentication, private readonly \React\Http\Browser $browser, private readonly \League\OpenAPIValidation\Schema\SchemaValidator $requestSchemaValidator, private readonly \League\OpenAPIValidation\Schema\SchemaValidator $responseSchemaValidator, private readonly Hydrators $hydrators) { } - public function pets👷List_() : Internal\Operator\Pets\List_ + public function pets👷List_(): \ApiClients\Client\PetStore\Internal\Operator\Pets\List_ { - if ($this->pets👷List_ instanceof Internal\Operator\Pets\List_ === false) { - $this->pets👷List_ = new Internal\Operator\Pets\List_($this->browser, $this->authentication, $this->responseSchemaValidator, $this->hydrators->getObjectMapperOperation🌀Pets()); + if ($this->pets👷List_ instanceof \ApiClients\Client\PetStore\Internal\Operator\Pets\List_ === false) { + $this->pets👷List_ = new \ApiClients\Client\PetStore\Internal\Operator\Pets\List_($this->browser, $this->authentication, $this->responseSchemaValidator, $this->hydrators->getObjectMapperOperation🌀Pets()); } return $this->pets👷List_; } - public function pets👷ListListing() : Internal\Operator\Pets\ListListing + public function pets👷Create(): \ApiClients\Client\PetStore\Internal\Operator\Pets\Create { - if ($this->pets👷ListListing instanceof Internal\Operator\Pets\ListListing === false) { - $this->pets👷ListListing = new Internal\Operator\Pets\ListListing($this->browser, $this->authentication, $this->responseSchemaValidator, $this->hydrators->getObjectMapperOperation🌀Pets()); - } - return $this->pets👷ListListing; - } - public function pets👷Create() : Internal\Operator\Pets\Create - { - if ($this->pets👷Create instanceof Internal\Operator\Pets\Create === false) { - $this->pets👷Create = new Internal\Operator\Pets\Create($this->browser, $this->authentication, $this->requestSchemaValidator, $this->responseSchemaValidator, $this->hydrators->getObjectMapperOperation🌀Pets()); + if ($this->pets👷Create instanceof \ApiClients\Client\PetStore\Internal\Operator\Pets\Create === false) { + $this->pets👷Create = new \ApiClients\Client\PetStore\Internal\Operator\Pets\Create($this->browser, $this->authentication, $this->requestSchemaValidator, $this->responseSchemaValidator, $this->hydrators->getObjectMapperOperation🌀Pets()); } return $this->pets👷Create; } - public function pets👷List_👷Gatos() : Internal\Operator\Pets\List_\Gatos - { - if ($this->pets👷List_👷Gatos instanceof Internal\Operator\Pets\List_\Gatos === false) { - $this->pets👷List_👷Gatos = new Internal\Operator\Pets\List_\Gatos($this->browser, $this->authentication, $this->responseSchemaValidator, $this->hydrators->getObjectMapperOperation🌀Pets🌀Gatos()); - } - return $this->pets👷List_👷Gatos; - } - public function pets👷List_👷GatosListing() : Internal\Operator\Pets\List_\GatosListing + public function pets👷List👷Gatos(): \ApiClients\Client\PetStore\Internal\Operator\Pets\List_\Gatos { - if ($this->pets👷List_👷GatosListing instanceof Internal\Operator\Pets\List_\GatosListing === false) { - $this->pets👷List_👷GatosListing = new Internal\Operator\Pets\List_\GatosListing($this->browser, $this->authentication, $this->responseSchemaValidator, $this->hydrators->getObjectMapperOperation🌀Pets🌀Gatos()); + if ($this->pets👷List👷Gatos instanceof \ApiClients\Client\PetStore\Internal\Operator\Pets\List_\Gatos === false) { + $this->pets👷List👷Gatos = new \ApiClients\Client\PetStore\Internal\Operator\Pets\List_\Gatos($this->browser, $this->authentication, $this->responseSchemaValidator, $this->hydrators->getObjectMapperOperation🌀Pets🌀Gatos()); } - return $this->pets👷List_👷GatosListing; + return $this->pets👷List👷Gatos; } - public function pets👷Kinds👷Walking() : Internal\Operator\Pets\Kinds\Walking + public function pets👷Kinds👷Walking(): \ApiClients\Client\PetStore\Internal\Operator\Pets\Kinds\Walking { - if ($this->pets👷Kinds👷Walking instanceof Internal\Operator\Pets\Kinds\Walking === false) { - $this->pets👷Kinds👷Walking = new Internal\Operator\Pets\Kinds\Walking($this->browser, $this->authentication, $this->responseSchemaValidator, $this->hydrators->getObjectMapperOperation🌀Pets🌀Kinds🌀Walking()); + if ($this->pets👷Kinds👷Walking instanceof \ApiClients\Client\PetStore\Internal\Operator\Pets\Kinds\Walking === false) { + $this->pets👷Kinds👷Walking = new \ApiClients\Client\PetStore\Internal\Operator\Pets\Kinds\Walking($this->browser, $this->authentication, $this->responseSchemaValidator, $this->hydrators->getObjectMapperOperation🌀Pets🌀Kinds🌀Walking()); } return $this->pets👷Kinds👷Walking; } - public function pets👷Kinds👷WalkingListing() : Internal\Operator\Pets\Kinds\WalkingListing + public function pets👷Grouped👷By👷Type(): \ApiClients\Client\PetStore\Internal\Operator\Pets\Grouped\By\Type { - if ($this->pets👷Kinds👷WalkingListing instanceof Internal\Operator\Pets\Kinds\WalkingListing === false) { - $this->pets👷Kinds👷WalkingListing = new Internal\Operator\Pets\Kinds\WalkingListing($this->browser, $this->authentication, $this->responseSchemaValidator, $this->hydrators->getObjectMapperOperation🌀Pets🌀Kinds🌀Walking()); - } - return $this->pets👷Kinds👷WalkingListing; - } - public function pets👷Grouped👷By👷Type() : Internal\Operator\Pets\Grouped\By\Type - { - if ($this->pets👷Grouped👷By👷Type instanceof Internal\Operator\Pets\Grouped\By\Type === false) { - $this->pets👷Grouped👷By👷Type = new Internal\Operator\Pets\Grouped\By\Type($this->browser, $this->authentication, $this->responseSchemaValidator, $this->hydrators->getObjectMapperOperation🌀Pets🌀GroupedByType()); + if ($this->pets👷Grouped👷By👷Type instanceof \ApiClients\Client\PetStore\Internal\Operator\Pets\Grouped\By\Type === false) { + $this->pets👷Grouped👷By👷Type = new \ApiClients\Client\PetStore\Internal\Operator\Pets\Grouped\By\Type($this->browser, $this->authentication, $this->responseSchemaValidator, $this->hydrators->getObjectMapperOperation🌀Pets🌀GroupedByType()); } return $this->pets👷Grouped👷By👷Type; } - public function pets👷Names() : Internal\Operator\Pets\Names + public function pets👷Names(): \ApiClients\Client\PetStore\Internal\Operator\Pets\Names { - if ($this->pets👷Names instanceof Internal\Operator\Pets\Names === false) { - $this->pets👷Names = new Internal\Operator\Pets\Names($this->browser, $this->authentication, $this->responseSchemaValidator, $this->hydrators->getObjectMapperOperation🌀Pets🌀Names()); + if ($this->pets👷Names instanceof \ApiClients\Client\PetStore\Internal\Operator\Pets\Names === false) { + $this->pets👷Names = new \ApiClients\Client\PetStore\Internal\Operator\Pets\Names($this->browser, $this->authentication, $this->responseSchemaValidator, $this->hydrators->getObjectMapperOperation🌀Pets🌀Names()); } return $this->pets👷Names; } - public function pets👷NamesListing() : Internal\Operator\Pets\NamesListing - { - if ($this->pets👷NamesListing instanceof Internal\Operator\Pets\NamesListing === false) { - $this->pets👷NamesListing = new Internal\Operator\Pets\NamesListing($this->browser, $this->authentication, $this->responseSchemaValidator, $this->hydrators->getObjectMapperOperation🌀Pets🌀Names()); - } - return $this->pets👷NamesListing; - } - public function showPetById() : Internal\Operator\ShowPetById + public function showPetById(): \ApiClients\Client\PetStore\Internal\Operator\ShowPetById { - if ($this->showPetById instanceof Internal\Operator\ShowPetById === false) { - $this->showPetById = new Internal\Operator\ShowPetById($this->browser, $this->authentication, $this->responseSchemaValidator, $this->hydrators->getObjectMapperOperation🌀Pets🌀PetId()); + if ($this->showPetById instanceof \ApiClients\Client\PetStore\Internal\Operator\ShowPetById === false) { + $this->showPetById = new \ApiClients\Client\PetStore\Internal\Operator\ShowPetById($this->browser, $this->authentication, $this->responseSchemaValidator, $this->hydrators->getObjectMapperOperation🌀Pets🌀Petid()); } return $this->showPetById; } diff --git a/tests/app/src/Internal/Router/Get.php b/tests/app/src/Internal/Router/Get.php index ccdeacb..f2f7971 100644 --- a/tests/app/src/Internal/Router/Get.php +++ b/tests/app/src/Internal/Router/Get.php @@ -3,25 +3,17 @@ declare (strict_types=1); namespace ApiClients\Client\PetStore\Internal\Router; -use ApiClients\Client\PetStore\Contract; -use ApiClients\Client\PetStore\Error as ErrorSchemas; -use ApiClients\Client\PetStore\Internal; -use ApiClients\Client\PetStore\Operation; -use ApiClients\Client\PetStore\Schema; -use League\OpenAPIValidation; -use React\Http; -use ApiClients\Contracts; final class Get { - public function __construct(private \League\OpenAPIValidation\Schema\SchemaValidator $requestSchemaValidator, private \League\OpenAPIValidation\Schema\SchemaValidator $responseSchemaValidator, private Internal\Hydrators $hydrators, private \React\Http\Browser $browser, private \ApiClients\Contracts\HTTP\Headers\AuthenticationInterface $authentication) + public function __construct(private \League\OpenAPIValidation\Schema\SchemaValidator $requestSchemaValidator, private \League\OpenAPIValidation\Schema\SchemaValidator $responseSchemaValidator, private \ApiClients\Client\PetStore\Internal\Hydrators $hydrators, private \React\Http\Browser $browser, private \ApiClients\Contracts\HTTP\Headers\AuthenticationInterface $authentication) { } /** - * @return Schema\Cat|Schema\Dog|Schema\Bird|Schema\Fish|Schema\Spider + * @return \ApiClients\Client\PetStore\Schema\Cat|\ApiClients\Client\PetStore\Schema\Dog|\ApiClients\Client\PetStore\Schema\Bird|\ApiClients\Client\PetStore\Schema\Fish|\ApiClients\Client\PetStore\Schema\Spider|\ApiClients\Client\PetStore\Schema\Error */ - public function showPetById(array $params) : \ApiClients\Client\PetStore\Schema\Cat|\ApiClients\Client\PetStore\Schema\Dog|\ApiClients\Client\PetStore\Schema\Bird|\ApiClients\Client\PetStore\Schema\Fish|\ApiClients\Client\PetStore\Schema\Spider + public function showPetById(array $params): ApiClients\Client\PetStore\Schema\Cat|ApiClients\Client\PetStore\Schema\Dog|ApiClients\Client\PetStore\Schema\Bird|ApiClients\Client\PetStore\Schema\Fish|ApiClients\Client\PetStore\Schema\Spider|ApiClients\Client\PetStore\Schema\Error { - $operator = new Internal\Operator\ShowPetById($this->browser, $this->authentication, $this->responseSchemaValidator, $this->hydrators->getObjectMapperOperation🌀Pets🌀PetId()); + $operator = new \ApiClients\Client\PetStore\Internal\Operator\ShowPetById($this->browser, $this->authentication, $this->responseSchemaValidator, $this->hydrators->getObjectMapperOperation🌀Pets🌀Petid()); return $operator->call(); } } diff --git a/tests/app/src/Internal/Router/Get/Four.php b/tests/app/src/Internal/Router/Get/Four.php index e2c38ed..91bb062 100644 --- a/tests/app/src/Internal/Router/Get/Four.php +++ b/tests/app/src/Internal/Router/Get/Four.php @@ -3,29 +3,21 @@ declare (strict_types=1); namespace ApiClients\Client\PetStore\Internal\Router\Get; -use ApiClients\Client\PetStore\Contract; -use ApiClients\Client\PetStore\Error as ErrorSchemas; -use ApiClients\Client\PetStore\Internal; -use ApiClients\Client\PetStore\Operation; -use ApiClients\Client\PetStore\Schema; -use League\OpenAPIValidation; -use React\Http; -use ApiClients\Contracts; -final class Four +final readonly class Four { public function __construct(private \ApiClients\Client\PetStore\Internal\Routers $routers) { } /** - * @return iterable + * @return iterable|\ApiClients\Client\PetStore\Schema\Error */ - public function call(string $call, array $params, array $pathChunks) : iterable + public function call(string $call, array $params, array $pathChunks): Rx\Observable|ApiClients\Client\PetStore\Schema\Error { if ($pathChunks[0] == '') { if ($pathChunks[1] == 'pets') { if ($pathChunks[2] == 'kinds') { if ($pathChunks[3] == 'walking') { - if ($call == 'GET /pets/kinds/walking') { + if ($call === 'GET /pets/kinds/walking') { return $this->routers->internal🔀Router🔀Get🔀PetsKinds()->walking($params); } } diff --git a/tests/app/src/Internal/Router/Get/Pets.php b/tests/app/src/Internal/Router/Get/Pets.php index 8dd8dc7..d3f73e8 100644 --- a/tests/app/src/Internal/Router/Get/Pets.php +++ b/tests/app/src/Internal/Router/Get/Pets.php @@ -3,25 +3,17 @@ declare (strict_types=1); namespace ApiClients\Client\PetStore\Internal\Router\Get; -use ApiClients\Client\PetStore\Contract; -use ApiClients\Client\PetStore\Error as ErrorSchemas; -use ApiClients\Client\PetStore\Internal; -use ApiClients\Client\PetStore\Operation; -use ApiClients\Client\PetStore\Schema; -use League\OpenAPIValidation; -use React\Http; -use ApiClients\Contracts; final class Pets { - public function __construct(private \League\OpenAPIValidation\Schema\SchemaValidator $requestSchemaValidator, private \League\OpenAPIValidation\Schema\SchemaValidator $responseSchemaValidator, private Internal\Hydrators $hydrators, private \React\Http\Browser $browser, private \ApiClients\Contracts\HTTP\Headers\AuthenticationInterface $authentication) + public function __construct(private \League\OpenAPIValidation\Schema\SchemaValidator $requestSchemaValidator, private \League\OpenAPIValidation\Schema\SchemaValidator $responseSchemaValidator, private \ApiClients\Client\PetStore\Internal\Hydrators $hydrators, private \React\Http\Browser $browser, private \ApiClients\Contracts\HTTP\Headers\AuthenticationInterface $authentication) { } /** - * @return iterable + * @return iterable|\ApiClients\Client\PetStore\Schema\Error */ - public function list(array $params) : iterable + public function list(array $params): Rx\Observable|ApiClients\Client\PetStore\Schema\Error { - $arguments = array(); + $arguments = []; if (array_key_exists('per_page', $params) === false) { throw new \InvalidArgumentException('Missing mandatory field: per_page'); } @@ -32,15 +24,15 @@ public function list(array $params) : iterable } $arguments['page'] = $params['page']; unset($params['page']); - $operator = new Internal\Operator\Pets\List_($this->browser, $this->authentication, $this->responseSchemaValidator, $this->hydrators->getObjectMapperOperation🌀Pets()); + $operator = new \ApiClients\Client\PetStore\Internal\Operator\Pets\List_($this->browser, $this->authentication, $this->responseSchemaValidator, $this->hydrators->getObjectMapperOperation🌀Pets()); return $operator->call($arguments['per_page'], $arguments['page']); } /** - * @return iterable + * @return iterable|\ApiClients\Client\PetStore\Schema\Error */ - public function names(array $params) : iterable + public function names(array $params): Rx\Observable|ApiClients\Client\PetStore\Schema\Error { - $arguments = array(); + $arguments = []; if (array_key_exists('per_page', $params) === false) { throw new \InvalidArgumentException('Missing mandatory field: per_page'); } @@ -51,7 +43,7 @@ public function names(array $params) : iterable } $arguments['page'] = $params['page']; unset($params['page']); - $operator = new Internal\Operator\Pets\Names($this->browser, $this->authentication, $this->responseSchemaValidator, $this->hydrators->getObjectMapperOperation🌀Pets🌀Names()); + $operator = new \ApiClients\Client\PetStore\Internal\Operator\Pets\Names($this->browser, $this->authentication, $this->responseSchemaValidator, $this->hydrators->getObjectMapperOperation🌀Pets🌀Names()); return $operator->call($arguments['per_page'], $arguments['page']); } } diff --git a/tests/app/src/Internal/Router/Get/PetsGroupedBy.php b/tests/app/src/Internal/Router/Get/PetsGroupedBy.php index b143825..638c40d 100644 --- a/tests/app/src/Internal/Router/Get/PetsGroupedBy.php +++ b/tests/app/src/Internal/Router/Get/PetsGroupedBy.php @@ -3,25 +3,17 @@ declare (strict_types=1); namespace ApiClients\Client\PetStore\Internal\Router\Get; -use ApiClients\Client\PetStore\Contract; -use ApiClients\Client\PetStore\Error as ErrorSchemas; -use ApiClients\Client\PetStore\Internal; -use ApiClients\Client\PetStore\Operation; -use ApiClients\Client\PetStore\Schema; -use League\OpenAPIValidation; -use React\Http; -use ApiClients\Contracts; final class PetsGroupedBy { - public function __construct(private \League\OpenAPIValidation\Schema\SchemaValidator $requestSchemaValidator, private \League\OpenAPIValidation\Schema\SchemaValidator $responseSchemaValidator, private Internal\Hydrators $hydrators, private \React\Http\Browser $browser, private \ApiClients\Contracts\HTTP\Headers\AuthenticationInterface $authentication) + public function __construct(private \League\OpenAPIValidation\Schema\SchemaValidator $requestSchemaValidator, private \League\OpenAPIValidation\Schema\SchemaValidator $responseSchemaValidator, private \ApiClients\Client\PetStore\Internal\Hydrators $hydrators, private \React\Http\Browser $browser, private \ApiClients\Contracts\HTTP\Headers\AuthenticationInterface $authentication) { } /** - * @return Schema\Operations\Pets\Grouped\By\Type\Response\ApplicationJson\Ok + * @return \ApiClients\Client\PetStore\Schema\Operations\Pets\Grouped\By\Type\Response\ApplicationJson\Ok|\ApiClients\Client\PetStore\Schema\Error */ - public function type(array $params) : \ApiClients\Client\PetStore\Schema\Operations\Pets\Grouped\By\Type\Response\ApplicationJson\Ok + public function type(array $params): ApiClients\Client\PetStore\Schema\Operations\Pets\Grouped\By\Type\Response\ApplicationJson\Ok|ApiClients\Client\PetStore\Schema\Error { - $arguments = array(); + $arguments = []; if (array_key_exists('per_page', $params) === false) { throw new \InvalidArgumentException('Missing mandatory field: per_page'); } @@ -32,7 +24,7 @@ public function type(array $params) : \ApiClients\Client\PetStore\Schema\Operati } $arguments['page'] = $params['page']; unset($params['page']); - $operator = new Internal\Operator\Pets\Grouped\By\Type($this->browser, $this->authentication, $this->responseSchemaValidator, $this->hydrators->getObjectMapperOperation🌀Pets🌀GroupedByType()); + $operator = new \ApiClients\Client\PetStore\Internal\Operator\Pets\Grouped\By\Type($this->browser, $this->authentication, $this->responseSchemaValidator, $this->hydrators->getObjectMapperOperation🌀Pets🌀GroupedByType()); return $operator->call($arguments['per_page'], $arguments['page']); } } diff --git a/tests/app/src/Internal/Router/Get/PetsKinds.php b/tests/app/src/Internal/Router/Get/PetsKinds.php index 7be50ed..e204376 100644 --- a/tests/app/src/Internal/Router/Get/PetsKinds.php +++ b/tests/app/src/Internal/Router/Get/PetsKinds.php @@ -3,25 +3,17 @@ declare (strict_types=1); namespace ApiClients\Client\PetStore\Internal\Router\Get; -use ApiClients\Client\PetStore\Contract; -use ApiClients\Client\PetStore\Error as ErrorSchemas; -use ApiClients\Client\PetStore\Internal; -use ApiClients\Client\PetStore\Operation; -use ApiClients\Client\PetStore\Schema; -use League\OpenAPIValidation; -use React\Http; -use ApiClients\Contracts; final class PetsKinds { - public function __construct(private \League\OpenAPIValidation\Schema\SchemaValidator $requestSchemaValidator, private \League\OpenAPIValidation\Schema\SchemaValidator $responseSchemaValidator, private Internal\Hydrators $hydrators, private \React\Http\Browser $browser, private \ApiClients\Contracts\HTTP\Headers\AuthenticationInterface $authentication) + public function __construct(private \League\OpenAPIValidation\Schema\SchemaValidator $requestSchemaValidator, private \League\OpenAPIValidation\Schema\SchemaValidator $responseSchemaValidator, private \ApiClients\Client\PetStore\Internal\Hydrators $hydrators, private \React\Http\Browser $browser, private \ApiClients\Contracts\HTTP\Headers\AuthenticationInterface $authentication) { } /** - * @return iterable + * @return iterable|\ApiClients\Client\PetStore\Schema\Error */ - public function walking(array $params) : iterable + public function walking(array $params): Rx\Observable|ApiClients\Client\PetStore\Schema\Error { - $arguments = array(); + $arguments = []; if (array_key_exists('per_page', $params) === false) { throw new \InvalidArgumentException('Missing mandatory field: per_page'); } @@ -32,7 +24,7 @@ public function walking(array $params) : iterable } $arguments['page'] = $params['page']; unset($params['page']); - $operator = new Internal\Operator\Pets\Kinds\Walking($this->browser, $this->authentication, $this->responseSchemaValidator, $this->hydrators->getObjectMapperOperation🌀Pets🌀Kinds🌀Walking()); + $operator = new \ApiClients\Client\PetStore\Internal\Operator\Pets\Kinds\Walking($this->browser, $this->authentication, $this->responseSchemaValidator, $this->hydrators->getObjectMapperOperation🌀Pets🌀Kinds🌀Walking()); return $operator->call($arguments['per_page'], $arguments['page']); } } diff --git a/tests/app/src/Internal/Router/Get/PetsList.php b/tests/app/src/Internal/Router/Get/PetsList.php index 41767a0..ea42dc0 100644 --- a/tests/app/src/Internal/Router/Get/PetsList.php +++ b/tests/app/src/Internal/Router/Get/PetsList.php @@ -3,25 +3,17 @@ declare (strict_types=1); namespace ApiClients\Client\PetStore\Internal\Router\Get; -use ApiClients\Client\PetStore\Contract; -use ApiClients\Client\PetStore\Error as ErrorSchemas; -use ApiClients\Client\PetStore\Internal; -use ApiClients\Client\PetStore\Operation; -use ApiClients\Client\PetStore\Schema; -use League\OpenAPIValidation; -use React\Http; -use ApiClients\Contracts; final class PetsList { - public function __construct(private \League\OpenAPIValidation\Schema\SchemaValidator $requestSchemaValidator, private \League\OpenAPIValidation\Schema\SchemaValidator $responseSchemaValidator, private Internal\Hydrators $hydrators, private \React\Http\Browser $browser, private \ApiClients\Contracts\HTTP\Headers\AuthenticationInterface $authentication) + public function __construct(private \League\OpenAPIValidation\Schema\SchemaValidator $requestSchemaValidator, private \League\OpenAPIValidation\Schema\SchemaValidator $responseSchemaValidator, private \ApiClients\Client\PetStore\Internal\Hydrators $hydrators, private \React\Http\Browser $browser, private \ApiClients\Contracts\HTTP\Headers\AuthenticationInterface $authentication) { } /** - * @return iterable + * @return iterable|\ApiClients\Client\PetStore\Schema\Error */ - public function gatos(array $params) : iterable + public function gatos(array $params): Rx\Observable|ApiClients\Client\PetStore\Schema\Error { - $arguments = array(); + $arguments = []; if (array_key_exists('per_page', $params) === false) { throw new \InvalidArgumentException('Missing mandatory field: per_page'); } @@ -32,7 +24,7 @@ public function gatos(array $params) : iterable } $arguments['page'] = $params['page']; unset($params['page']); - $operator = new Internal\Operator\Pets\List_\Gatos($this->browser, $this->authentication, $this->responseSchemaValidator, $this->hydrators->getObjectMapperOperation🌀Pets🌀Gatos()); + $operator = new \ApiClients\Client\PetStore\Internal\Operator\Pets\List_\Gatos($this->browser, $this->authentication, $this->responseSchemaValidator, $this->hydrators->getObjectMapperOperation🌀Pets🌀Gatos()); return $operator->call($arguments['per_page'], $arguments['page']); } } diff --git a/tests/app/src/Internal/Router/Get/Three.php b/tests/app/src/Internal/Router/Get/Three.php index e5ed37d..eff1924 100644 --- a/tests/app/src/Internal/Router/Get/Three.php +++ b/tests/app/src/Internal/Router/Get/Three.php @@ -3,40 +3,32 @@ declare (strict_types=1); namespace ApiClients\Client\PetStore\Internal\Router\Get; -use ApiClients\Client\PetStore\Contract; -use ApiClients\Client\PetStore\Error as ErrorSchemas; -use ApiClients\Client\PetStore\Internal; -use ApiClients\Client\PetStore\Operation; -use ApiClients\Client\PetStore\Schema; -use League\OpenAPIValidation; -use React\Http; -use ApiClients\Contracts; -final class Three +final readonly class Three { public function __construct(private \ApiClients\Client\PetStore\Internal\Routers $routers) { } /** - * @return iterable|Schema\Operations\Pets\Grouped\By\Type\Response\ApplicationJson\Ok|iterable|Schema\Cat|Schema\Dog|Schema\Bird|Schema\Fish|Schema\Spider + * @return iterable|\ApiClients\Client\PetStore\Schema\Error|\ApiClients\Client\PetStore\Schema\Operations\Pets\Grouped\By\Type\Response\ApplicationJson\Ok|iterable|\ApiClients\Client\PetStore\Schema\Cat|\ApiClients\Client\PetStore\Schema\Dog|\ApiClients\Client\PetStore\Schema\Bird|\ApiClients\Client\PetStore\Schema\Fish|\ApiClients\Client\PetStore\Schema\Spider */ - public function call(string $call, array $params, array $pathChunks) : iterable|\ApiClients\Client\PetStore\Schema\Operations\Pets\Grouped\By\Type\Response\ApplicationJson\Ok|\ApiClients\Client\PetStore\Schema\Cat|\ApiClients\Client\PetStore\Schema\Dog|\ApiClients\Client\PetStore\Schema\Bird|\ApiClients\Client\PetStore\Schema\Fish|\ApiClients\Client\PetStore\Schema\Spider + public function call(string $call, array $params, array $pathChunks): Rx\Observable|ApiClients\Client\PetStore\Schema\Error|ApiClients\Client\PetStore\Schema\Operations\Pets\Grouped\By\Type\Response\ApplicationJson\Ok|ApiClients\Client\PetStore\Schema\Cat|ApiClients\Client\PetStore\Schema\Dog|ApiClients\Client\PetStore\Schema\Bird|ApiClients\Client\PetStore\Schema\Fish|ApiClients\Client\PetStore\Schema\Spider { if ($pathChunks[0] == '') { if ($pathChunks[1] == 'pets') { if ($pathChunks[2] == 'gatos') { - if ($call == 'GET /pets/gatos') { + if ($call === 'GET /pets/gatos') { return $this->routers->internal🔀Router🔀Get🔀PetsList()->gatos($params); } } elseif ($pathChunks[2] == 'groupedByType') { - if ($call == 'GET /pets/groupedByType') { + if ($call === 'GET /pets/groupedByType') { return $this->routers->internal🔀Router🔀Get🔀PetsGroupedBy()->type($params); } } elseif ($pathChunks[2] == 'names') { - if ($call == 'GET /pets/names') { + if ($call === 'GET /pets/names') { return $this->routers->internal🔀Router🔀Get🔀Pets()->names($params); } } elseif ($pathChunks[2] == '{petId}') { - if ($call == 'GET /pets/{petId}') { + if ($call === 'GET /pets/{petId}') { return $this->routers->internal🔀Router🔀Get()->showPetById($params); } } diff --git a/tests/app/src/Internal/Router/Get/Two.php b/tests/app/src/Internal/Router/Get/Two.php index d00168e..0be6383 100644 --- a/tests/app/src/Internal/Router/Get/Two.php +++ b/tests/app/src/Internal/Router/Get/Two.php @@ -3,27 +3,19 @@ declare (strict_types=1); namespace ApiClients\Client\PetStore\Internal\Router\Get; -use ApiClients\Client\PetStore\Contract; -use ApiClients\Client\PetStore\Error as ErrorSchemas; -use ApiClients\Client\PetStore\Internal; -use ApiClients\Client\PetStore\Operation; -use ApiClients\Client\PetStore\Schema; -use League\OpenAPIValidation; -use React\Http; -use ApiClients\Contracts; -final class Two +final readonly class Two { public function __construct(private \ApiClients\Client\PetStore\Internal\Routers $routers) { } /** - * @return iterable + * @return iterable|\ApiClients\Client\PetStore\Schema\Error */ - public function call(string $call, array $params, array $pathChunks) : iterable + public function call(string $call, array $params, array $pathChunks): Rx\Observable|ApiClients\Client\PetStore\Schema\Error { if ($pathChunks[0] == '') { if ($pathChunks[1] == 'pets') { - if ($call == 'GET /pets') { + if ($call === 'GET /pets') { return $this->routers->internal🔀Router🔀Get🔀Pets()->list($params); } } diff --git a/tests/app/src/Internal/Router/List/Four.php b/tests/app/src/Internal/Router/List/Four.php deleted file mode 100644 index 2e39657..0000000 --- a/tests/app/src/Internal/Router/List/Four.php +++ /dev/null @@ -1,37 +0,0 @@ - - */ - public function call(string $call, array $params, array $pathChunks) : iterable - { - if ($pathChunks[0] == '') { - if ($pathChunks[1] == 'pets') { - if ($pathChunks[2] == 'kinds') { - if ($pathChunks[3] == 'walking') { - if ($call == 'LIST /pets/kinds/walking') { - return $this->routers->internal🔀Router🔀List🔀PetsKinds()->walkingListing($params); - } - } - } - } - } - throw new \InvalidArgumentException(); - } -} diff --git a/tests/app/src/Internal/Router/List/Pets.php b/tests/app/src/Internal/Router/List/Pets.php deleted file mode 100644 index 8853ce8..0000000 --- a/tests/app/src/Internal/Router/List/Pets.php +++ /dev/null @@ -1,67 +0,0 @@ - - */ - public function listListing(array $params) : iterable - { - $arguments = array(); - if (array_key_exists('per_page', $params) === false) { - throw new \InvalidArgumentException('Missing mandatory field: per_page'); - } - $arguments['per_page'] = $params['per_page']; - unset($params['per_page']); - if (array_key_exists('page', $params) === false) { - throw new \InvalidArgumentException('Missing mandatory field: page'); - } - $arguments['page'] = $params['page']; - unset($params['page']); - $arguments['page'] = 1; - do { - $operator = new Internal\Operator\Pets\ListListing($this->browser, $this->authentication, $this->responseSchemaValidator, $this->hydrators->getObjectMapperOperation🌀Pets()); - $items = [...$operator->call($arguments['per_page'], $arguments['page'])]; - yield from $items; - $arguments['page']++; - } while (count($items) > 0); - } - /** - * @return iterable - */ - public function namesListing(array $params) : iterable - { - $arguments = array(); - if (array_key_exists('per_page', $params) === false) { - throw new \InvalidArgumentException('Missing mandatory field: per_page'); - } - $arguments['per_page'] = $params['per_page']; - unset($params['per_page']); - if (array_key_exists('page', $params) === false) { - throw new \InvalidArgumentException('Missing mandatory field: page'); - } - $arguments['page'] = $params['page']; - unset($params['page']); - $arguments['page'] = 1; - do { - $operator = new Internal\Operator\Pets\NamesListing($this->browser, $this->authentication, $this->responseSchemaValidator, $this->hydrators->getObjectMapperOperation🌀Pets🌀Names()); - $items = [...$operator->call($arguments['per_page'], $arguments['page'])]; - yield from $items; - $arguments['page']++; - } while (count($items) > 0); - } -} diff --git a/tests/app/src/Internal/Router/List/PetsKinds.php b/tests/app/src/Internal/Router/List/PetsKinds.php deleted file mode 100644 index 79fc13d..0000000 --- a/tests/app/src/Internal/Router/List/PetsKinds.php +++ /dev/null @@ -1,43 +0,0 @@ - - */ - public function walkingListing(array $params) : iterable - { - $arguments = array(); - if (array_key_exists('per_page', $params) === false) { - throw new \InvalidArgumentException('Missing mandatory field: per_page'); - } - $arguments['per_page'] = $params['per_page']; - unset($params['per_page']); - if (array_key_exists('page', $params) === false) { - throw new \InvalidArgumentException('Missing mandatory field: page'); - } - $arguments['page'] = $params['page']; - unset($params['page']); - $arguments['page'] = 1; - do { - $operator = new Internal\Operator\Pets\Kinds\WalkingListing($this->browser, $this->authentication, $this->responseSchemaValidator, $this->hydrators->getObjectMapperOperation🌀Pets🌀Kinds🌀Walking()); - $items = [...$operator->call($arguments['per_page'], $arguments['page'])]; - yield from $items; - $arguments['page']++; - } while (count($items) > 0); - } -} diff --git a/tests/app/src/Internal/Router/List/PetsList.php b/tests/app/src/Internal/Router/List/PetsList.php deleted file mode 100644 index fb3f9a4..0000000 --- a/tests/app/src/Internal/Router/List/PetsList.php +++ /dev/null @@ -1,43 +0,0 @@ - - */ - public function gatosListing(array $params) : iterable - { - $arguments = array(); - if (array_key_exists('per_page', $params) === false) { - throw new \InvalidArgumentException('Missing mandatory field: per_page'); - } - $arguments['per_page'] = $params['per_page']; - unset($params['per_page']); - if (array_key_exists('page', $params) === false) { - throw new \InvalidArgumentException('Missing mandatory field: page'); - } - $arguments['page'] = $params['page']; - unset($params['page']); - $arguments['page'] = 1; - do { - $operator = new Internal\Operator\Pets\List_\GatosListing($this->browser, $this->authentication, $this->responseSchemaValidator, $this->hydrators->getObjectMapperOperation🌀Pets🌀Gatos()); - $items = [...$operator->call($arguments['per_page'], $arguments['page'])]; - yield from $items; - $arguments['page']++; - } while (count($items) > 0); - } -} diff --git a/tests/app/src/Internal/Router/List/Three.php b/tests/app/src/Internal/Router/List/Three.php deleted file mode 100644 index 05beb59..0000000 --- a/tests/app/src/Internal/Router/List/Three.php +++ /dev/null @@ -1,39 +0,0 @@ -|iterable - */ - public function call(string $call, array $params, array $pathChunks) : iterable - { - if ($pathChunks[0] == '') { - if ($pathChunks[1] == 'pets') { - if ($pathChunks[2] == 'gatos') { - if ($call == 'LIST /pets/gatos') { - return $this->routers->internal🔀Router🔀List🔀PetsList()->gatosListing($params); - } - } elseif ($pathChunks[2] == 'names') { - if ($call == 'LIST /pets/names') { - return $this->routers->internal🔀Router🔀List🔀Pets()->namesListing($params); - } - } - } - } - throw new \InvalidArgumentException(); - } -} diff --git a/tests/app/src/Internal/Router/List/Two.php b/tests/app/src/Internal/Router/List/Two.php deleted file mode 100644 index 5fbbb2e..0000000 --- a/tests/app/src/Internal/Router/List/Two.php +++ /dev/null @@ -1,33 +0,0 @@ - - */ - public function call(string $call, array $params, array $pathChunks) : iterable - { - if ($pathChunks[0] == '') { - if ($pathChunks[1] == 'pets') { - if ($call == 'LIST /pets') { - return $this->routers->internal🔀Router🔀List🔀Pets()->listListing($params); - } - } - } - throw new \InvalidArgumentException(); - } -} diff --git a/tests/app/src/Internal/Router/Post/Pets.php b/tests/app/src/Internal/Router/Post/Pets.php index 6e80294..2fd6f70 100644 --- a/tests/app/src/Internal/Router/Post/Pets.php +++ b/tests/app/src/Internal/Router/Post/Pets.php @@ -3,25 +3,17 @@ declare (strict_types=1); namespace ApiClients\Client\PetStore\Internal\Router\Post; -use ApiClients\Client\PetStore\Contract; -use ApiClients\Client\PetStore\Error as ErrorSchemas; -use ApiClients\Client\PetStore\Internal; -use ApiClients\Client\PetStore\Operation; -use ApiClients\Client\PetStore\Schema; -use League\OpenAPIValidation; -use React\Http; -use ApiClients\Contracts; final class Pets { - public function __construct(private \League\OpenAPIValidation\Schema\SchemaValidator $requestSchemaValidator, private \League\OpenAPIValidation\Schema\SchemaValidator $responseSchemaValidator, private Internal\Hydrators $hydrators, private \React\Http\Browser $browser, private \ApiClients\Contracts\HTTP\Headers\AuthenticationInterface $authentication) + public function __construct(private \League\OpenAPIValidation\Schema\SchemaValidator $requestSchemaValidator, private \League\OpenAPIValidation\Schema\SchemaValidator $responseSchemaValidator, private \ApiClients\Client\PetStore\Internal\Hydrators $hydrators, private \React\Http\Browser $browser, private \ApiClients\Contracts\HTTP\Headers\AuthenticationInterface $authentication) { } /** - * @return \ApiClients\Tools\OpenApiClient\Utils\Response\WithoutBody + * @return \ApiClients\Client\PetStore\Schema\Error|\ApiClients\Tools\OpenApiClient\Utils\Response\WithoutBody */ - public function create(array $params) : \ApiClients\Tools\OpenApiClient\Utils\Response\WithoutBody + public function create(array $params): ApiClients\Client\PetStore\Schema\Error|ApiClients\Tools\OpenApiClient\Utils\Response\WithoutBody { - $operator = new Internal\Operator\Pets\Create($this->browser, $this->authentication, $this->requestSchemaValidator, $this->responseSchemaValidator, $this->hydrators->getObjectMapperOperation🌀Pets()); + $operator = new \ApiClients\Client\PetStore\Internal\Operator\Pets\Create($this->browser, $this->authentication, $this->requestSchemaValidator, $this->responseSchemaValidator, $this->hydrators->getObjectMapperOperation🌀Pets()); return $operator->call($params); } } diff --git a/tests/app/src/Internal/Router/Post/Two.php b/tests/app/src/Internal/Router/Post/Two.php index dba200b..cec86e3 100644 --- a/tests/app/src/Internal/Router/Post/Two.php +++ b/tests/app/src/Internal/Router/Post/Two.php @@ -3,27 +3,19 @@ declare (strict_types=1); namespace ApiClients\Client\PetStore\Internal\Router\Post; -use ApiClients\Client\PetStore\Contract; -use ApiClients\Client\PetStore\Error as ErrorSchemas; -use ApiClients\Client\PetStore\Internal; -use ApiClients\Client\PetStore\Operation; -use ApiClients\Client\PetStore\Schema; -use League\OpenAPIValidation; -use React\Http; -use ApiClients\Contracts; -final class Two +final readonly class Two { public function __construct(private \ApiClients\Client\PetStore\Internal\Routers $routers) { } /** - * @return \ApiClients\Tools\OpenApiClient\Utils\Response\WithoutBody + * @return \ApiClients\Client\PetStore\Schema\Error|\ApiClients\Tools\OpenApiClient\Utils\Response\WithoutBody */ - public function call(string $call, array $params, array $pathChunks) : \ApiClients\Tools\OpenApiClient\Utils\Response\WithoutBody + public function call(string $call, array $params, array $pathChunks): ApiClients\Client\PetStore\Schema\Error|ApiClients\Tools\OpenApiClient\Utils\Response\WithoutBody { if ($pathChunks[0] == '') { if ($pathChunks[1] == 'pets') { - if ($call == 'POST /pets') { + if ($call === 'POST /pets') { return $this->routers->internal🔀Router🔀Post🔀Pets()->create($params); } } diff --git a/tests/app/src/Internal/Routers.php b/tests/app/src/Internal/Routers.php index 83b01c4..844e523 100644 --- a/tests/app/src/Internal/Routers.php +++ b/tests/app/src/Internal/Routers.php @@ -3,88 +3,56 @@ declare (strict_types=1); namespace ApiClients\Client\PetStore\Internal; -use ApiClients\Client\PetStore\Contract; -use ApiClients\Client\PetStore\Error as ErrorSchemas; -use ApiClients\Client\PetStore\Internal; -use ApiClients\Client\PetStore\Operation; -use ApiClients\Client\PetStore\Schema; -use League\OpenAPIValidation; -use React\Http; -use ApiClients\Contracts; final class Routers { - private ?Internal\Router\Get\Pets $internal🔀Router🔀Get🔀Pets = null; - private ?Internal\Router\Get\PetsList $internal🔀Router🔀Get🔀PetsList = null; - private ?Internal\Router\Get\PetsGroupedBy $internal🔀Router🔀Get🔀PetsGroupedBy = null; - private ?Internal\Router\Get $internal🔀Router🔀Get = null; - private ?Internal\Router\Get\PetsKinds $internal🔀Router🔀Get🔀PetsKinds = null; - private ?Internal\Router\List\Pets $internal🔀Router🔀List🔀Pets = null; - private ?Internal\Router\List\PetsList $internal🔀Router🔀List🔀PetsList = null; - private ?Internal\Router\List\PetsKinds $internal🔀Router🔀List🔀PetsKinds = null; - private ?Internal\Router\Post\Pets $internal🔀Router🔀Post🔀Pets = null; - public function __construct(private \ApiClients\Contracts\HTTP\Headers\AuthenticationInterface $authentication, private \React\Http\Browser $browser, private \League\OpenAPIValidation\Schema\SchemaValidator $requestSchemaValidator, private \League\OpenAPIValidation\Schema\SchemaValidator $responseSchemaValidator, private Internal\Hydrators $hydrators) + private ?\ApiClients\Client\PetStore\Internal\Router\Get\Pets $internal🔀Router🔀Get🔀Pets = null; + private ?\ApiClients\Client\PetStore\Internal\Router\Get\PetsList $internal🔀Router🔀Get🔀PetsList = null; + private ?\ApiClients\Client\PetStore\Internal\Router\Get\PetsGroupedBy $internal🔀Router🔀Get🔀PetsGroupedBy = null; + private ?\ApiClients\Client\PetStore\Internal\Router\Get $internal🔀Router🔀Get = null; + private ?\ApiClients\Client\PetStore\Internal\Router\Get\PetsKinds $internal🔀Router🔀Get🔀PetsKinds = null; + private ?\ApiClients\Client\PetStore\Internal\Router\Post\Pets $internal🔀Router🔀Post🔀Pets = null; + public function __construct(private readonly \ApiClients\Contracts\HTTP\Headers\AuthenticationInterface $authentication, private readonly \React\Http\Browser $browser, private readonly \League\OpenAPIValidation\Schema\SchemaValidator $requestSchemaValidator, private readonly \League\OpenAPIValidation\Schema\SchemaValidator $responseSchemaValidator, private readonly Hydrators $hydrators) { } - public function internal🔀Router🔀Get🔀Pets() : Internal\Router\Get\Pets + public function internal🔀Router🔀Get🔀Pets(): \ApiClients\Client\PetStore\Internal\Router\Get\Pets { - if ($this->internal🔀Router🔀Get🔀Pets instanceof Internal\Router\Get\Pets === false) { - $this->internal🔀Router🔀Get🔀Pets = new Internal\Router\Get\Pets(browser: $this->browser, authentication: $this->authentication, requestSchemaValidator: $this->requestSchemaValidator, responseSchemaValidator: $this->responseSchemaValidator, hydrators: $this->hydrators); + if ($this->internal🔀Router🔀Get🔀Pets instanceof \ApiClients\Client\PetStore\Internal\Router\Get\Pets === false) { + $this->internal🔀Router🔀Get🔀Pets = new \ApiClients\Client\PetStore\Internal\Router\Get\Pets(browser: $this->browser, authentication: $this->authentication, requestSchemaValidator: $this->requestSchemaValidator, responseSchemaValidator: $this->responseSchemaValidator, hydrators: $this->hydrators); } return $this->internal🔀Router🔀Get🔀Pets; } - public function internal🔀Router🔀Get🔀PetsList() : Internal\Router\Get\PetsList + public function internal🔀Router🔀Get🔀PetsList(): \ApiClients\Client\PetStore\Internal\Router\Get\PetsList { - if ($this->internal🔀Router🔀Get🔀PetsList instanceof Internal\Router\Get\PetsList === false) { - $this->internal🔀Router🔀Get🔀PetsList = new Internal\Router\Get\PetsList(browser: $this->browser, authentication: $this->authentication, requestSchemaValidator: $this->requestSchemaValidator, responseSchemaValidator: $this->responseSchemaValidator, hydrators: $this->hydrators); + if ($this->internal🔀Router🔀Get🔀PetsList instanceof \ApiClients\Client\PetStore\Internal\Router\Get\PetsList === false) { + $this->internal🔀Router🔀Get🔀PetsList = new \ApiClients\Client\PetStore\Internal\Router\Get\PetsList(browser: $this->browser, authentication: $this->authentication, requestSchemaValidator: $this->requestSchemaValidator, responseSchemaValidator: $this->responseSchemaValidator, hydrators: $this->hydrators); } return $this->internal🔀Router🔀Get🔀PetsList; } - public function internal🔀Router🔀Get🔀PetsGroupedBy() : Internal\Router\Get\PetsGroupedBy + public function internal🔀Router🔀Get🔀PetsGroupedBy(): \ApiClients\Client\PetStore\Internal\Router\Get\PetsGroupedBy { - if ($this->internal🔀Router🔀Get🔀PetsGroupedBy instanceof Internal\Router\Get\PetsGroupedBy === false) { - $this->internal🔀Router🔀Get🔀PetsGroupedBy = new Internal\Router\Get\PetsGroupedBy(browser: $this->browser, authentication: $this->authentication, requestSchemaValidator: $this->requestSchemaValidator, responseSchemaValidator: $this->responseSchemaValidator, hydrators: $this->hydrators); + if ($this->internal🔀Router🔀Get🔀PetsGroupedBy instanceof \ApiClients\Client\PetStore\Internal\Router\Get\PetsGroupedBy === false) { + $this->internal🔀Router🔀Get🔀PetsGroupedBy = new \ApiClients\Client\PetStore\Internal\Router\Get\PetsGroupedBy(browser: $this->browser, authentication: $this->authentication, requestSchemaValidator: $this->requestSchemaValidator, responseSchemaValidator: $this->responseSchemaValidator, hydrators: $this->hydrators); } return $this->internal🔀Router🔀Get🔀PetsGroupedBy; } - public function internal🔀Router🔀Get() : Internal\Router\Get + public function internal🔀Router🔀Get(): \ApiClients\Client\PetStore\Internal\Router\Get { - if ($this->internal🔀Router🔀Get instanceof Internal\Router\Get === false) { - $this->internal🔀Router🔀Get = new Internal\Router\Get(browser: $this->browser, authentication: $this->authentication, requestSchemaValidator: $this->requestSchemaValidator, responseSchemaValidator: $this->responseSchemaValidator, hydrators: $this->hydrators); + if ($this->internal🔀Router🔀Get instanceof \ApiClients\Client\PetStore\Internal\Router\Get === false) { + $this->internal🔀Router🔀Get = new \ApiClients\Client\PetStore\Internal\Router\Get(browser: $this->browser, authentication: $this->authentication, requestSchemaValidator: $this->requestSchemaValidator, responseSchemaValidator: $this->responseSchemaValidator, hydrators: $this->hydrators); } return $this->internal🔀Router🔀Get; } - public function internal🔀Router🔀Get🔀PetsKinds() : Internal\Router\Get\PetsKinds + public function internal🔀Router🔀Get🔀PetsKinds(): \ApiClients\Client\PetStore\Internal\Router\Get\PetsKinds { - if ($this->internal🔀Router🔀Get🔀PetsKinds instanceof Internal\Router\Get\PetsKinds === false) { - $this->internal🔀Router🔀Get🔀PetsKinds = new Internal\Router\Get\PetsKinds(browser: $this->browser, authentication: $this->authentication, requestSchemaValidator: $this->requestSchemaValidator, responseSchemaValidator: $this->responseSchemaValidator, hydrators: $this->hydrators); + if ($this->internal🔀Router🔀Get🔀PetsKinds instanceof \ApiClients\Client\PetStore\Internal\Router\Get\PetsKinds === false) { + $this->internal🔀Router🔀Get🔀PetsKinds = new \ApiClients\Client\PetStore\Internal\Router\Get\PetsKinds(browser: $this->browser, authentication: $this->authentication, requestSchemaValidator: $this->requestSchemaValidator, responseSchemaValidator: $this->responseSchemaValidator, hydrators: $this->hydrators); } return $this->internal🔀Router🔀Get🔀PetsKinds; } - public function internal🔀Router🔀List🔀Pets() : Internal\Router\List\Pets + public function internal🔀Router🔀Post🔀Pets(): \ApiClients\Client\PetStore\Internal\Router\Post\Pets { - if ($this->internal🔀Router🔀List🔀Pets instanceof Internal\Router\List\Pets === false) { - $this->internal🔀Router🔀List🔀Pets = new Internal\Router\List\Pets(browser: $this->browser, authentication: $this->authentication, requestSchemaValidator: $this->requestSchemaValidator, responseSchemaValidator: $this->responseSchemaValidator, hydrators: $this->hydrators); - } - return $this->internal🔀Router🔀List🔀Pets; - } - public function internal🔀Router🔀List🔀PetsList() : Internal\Router\List\PetsList - { - if ($this->internal🔀Router🔀List🔀PetsList instanceof Internal\Router\List\PetsList === false) { - $this->internal🔀Router🔀List🔀PetsList = new Internal\Router\List\PetsList(browser: $this->browser, authentication: $this->authentication, requestSchemaValidator: $this->requestSchemaValidator, responseSchemaValidator: $this->responseSchemaValidator, hydrators: $this->hydrators); - } - return $this->internal🔀Router🔀List🔀PetsList; - } - public function internal🔀Router🔀List🔀PetsKinds() : Internal\Router\List\PetsKinds - { - if ($this->internal🔀Router🔀List🔀PetsKinds instanceof Internal\Router\List\PetsKinds === false) { - $this->internal🔀Router🔀List🔀PetsKinds = new Internal\Router\List\PetsKinds(browser: $this->browser, authentication: $this->authentication, requestSchemaValidator: $this->requestSchemaValidator, responseSchemaValidator: $this->responseSchemaValidator, hydrators: $this->hydrators); - } - return $this->internal🔀Router🔀List🔀PetsKinds; - } - public function internal🔀Router🔀Post🔀Pets() : Internal\Router\Post\Pets - { - if ($this->internal🔀Router🔀Post🔀Pets instanceof Internal\Router\Post\Pets === false) { - $this->internal🔀Router🔀Post🔀Pets = new Internal\Router\Post\Pets(browser: $this->browser, authentication: $this->authentication, requestSchemaValidator: $this->requestSchemaValidator, responseSchemaValidator: $this->responseSchemaValidator, hydrators: $this->hydrators); + if ($this->internal🔀Router🔀Post🔀Pets instanceof \ApiClients\Client\PetStore\Internal\Router\Post\Pets === false) { + $this->internal🔀Router🔀Post🔀Pets = new \ApiClients\Client\PetStore\Internal\Router\Post\Pets(browser: $this->browser, authentication: $this->authentication, requestSchemaValidator: $this->requestSchemaValidator, responseSchemaValidator: $this->responseSchemaValidator, hydrators: $this->hydrators); } return $this->internal🔀Router🔀Post🔀Pets; } diff --git a/tests/app/src/Operation/Pets.php b/tests/app/src/Operation/Pets.php index 74fd4f0..5bcde82 100644 --- a/tests/app/src/Operation/Pets.php +++ b/tests/app/src/Operation/Pets.php @@ -3,52 +3,30 @@ declare (strict_types=1); namespace ApiClients\Client\PetStore\Operation; -use ApiClients\Client\PetStore\Contract; -use ApiClients\Client\PetStore\Error as ErrorSchemas; -use ApiClients\Client\PetStore\Internal; -use ApiClients\Client\PetStore\Operation; -use ApiClients\Client\PetStore\Schema; -use League\OpenAPIValidation; -use React\Http; -use ApiClients\Contracts; final class Pets { - public function __construct(private Internal\Operators $operators) + public function __construct(public \ApiClients\Client\PetStore\Internal\Operators $operators) { } /** - * @return iterable + * @return iterable|\ApiClients\Client\PetStore\Schema\Error */ - public function list(int $perPage, int $page) : iterable + public function list(int $perPage, int $page): \Rx\Observable|\ApiClients\Client\PetStore\Schema\Error { return $this->operators->pets👷List_()->call($perPage, $page); } /** - * @return iterable + * @return \ApiClients\Client\PetStore\Schema\Error|\ApiClients\Tools\OpenApiClient\Utils\Response\WithoutBody */ - public function listListing(int $perPage, int $page) : iterable - { - return $this->operators->pets👷ListListing()->call($perPage, $page); - } - /** - * @return \ApiClients\Tools\OpenApiClient\Utils\Response\WithoutBody - */ - public function create(array $params) : \ApiClients\Tools\OpenApiClient\Utils\Response\WithoutBody + public function create(array $params): \ApiClients\Client\PetStore\Schema\Error|\ApiClients\Tools\OpenApiClient\Utils\Response\WithoutBody { return $this->operators->pets👷Create()->call($params); } /** - * @return iterable + * @return iterable|\ApiClients\Client\PetStore\Schema\Error */ - public function names(int $perPage, int $page) : iterable + public function names(int $perPage, int $page): \Rx\Observable|\ApiClients\Client\PetStore\Schema\Error { return $this->operators->pets👷Names()->call($perPage, $page); } - /** - * @return iterable - */ - public function namesListing(int $perPage, int $page) : iterable - { - return $this->operators->pets👷NamesListing()->call($perPage, $page); - } } diff --git a/tests/app/src/Operation/PetsGroupedBy.php b/tests/app/src/Operation/PetsGroupedBy.php index a03c06e..2a39bf4 100644 --- a/tests/app/src/Operation/PetsGroupedBy.php +++ b/tests/app/src/Operation/PetsGroupedBy.php @@ -3,23 +3,15 @@ declare (strict_types=1); namespace ApiClients\Client\PetStore\Operation; -use ApiClients\Client\PetStore\Contract; -use ApiClients\Client\PetStore\Error as ErrorSchemas; -use ApiClients\Client\PetStore\Internal; -use ApiClients\Client\PetStore\Operation; -use ApiClients\Client\PetStore\Schema; -use League\OpenAPIValidation; -use React\Http; -use ApiClients\Contracts; final class PetsGroupedBy { - public function __construct(private Internal\Operators $operators) + public function __construct(public \ApiClients\Client\PetStore\Internal\Operators $operators) { } /** - * @return Schema\Operations\Pets\Grouped\By\Type\Response\ApplicationJson\Ok + * @return \ApiClients\Client\PetStore\Schema\Operations\Pets\Grouped\By\Type\Response\ApplicationJson\Ok|\ApiClients\Client\PetStore\Schema\Error */ - public function type(int $perPage, int $page) : \ApiClients\Client\PetStore\Schema\Operations\Pets\Grouped\By\Type\Response\ApplicationJson\Ok + public function type(int $perPage, int $page): \ApiClients\Client\PetStore\Schema\Operations\Pets\Grouped\By\Type\Response\ApplicationJson\Ok|\ApiClients\Client\PetStore\Schema\Error { return $this->operators->pets👷Grouped👷By👷Type()->call($perPage, $page); } diff --git a/tests/app/src/Operation/PetsKinds.php b/tests/app/src/Operation/PetsKinds.php index e100f3a..2102ae4 100644 --- a/tests/app/src/Operation/PetsKinds.php +++ b/tests/app/src/Operation/PetsKinds.php @@ -3,31 +3,16 @@ declare (strict_types=1); namespace ApiClients\Client\PetStore\Operation; -use ApiClients\Client\PetStore\Contract; -use ApiClients\Client\PetStore\Error as ErrorSchemas; -use ApiClients\Client\PetStore\Internal; -use ApiClients\Client\PetStore\Operation; -use ApiClients\Client\PetStore\Schema; -use League\OpenAPIValidation; -use React\Http; -use ApiClients\Contracts; final class PetsKinds { - public function __construct(private Internal\Operators $operators) + public function __construct(public \ApiClients\Client\PetStore\Internal\Operators $operators) { } /** - * @return iterable + * @return iterable|\ApiClients\Client\PetStore\Schema\Error */ - public function walking(int $perPage, int $page) : iterable + public function walking(int $perPage, int $page): \Rx\Observable|\ApiClients\Client\PetStore\Schema\Error { return $this->operators->pets👷Kinds👷Walking()->call($perPage, $page); } - /** - * @return iterable - */ - public function walkingListing(int $perPage, int $page) : iterable - { - return $this->operators->pets👷Kinds👷WalkingListing()->call($perPage, $page); - } } diff --git a/tests/app/src/Operation/PetsList.php b/tests/app/src/Operation/PetsList.php index 2094acc..8c24484 100644 --- a/tests/app/src/Operation/PetsList.php +++ b/tests/app/src/Operation/PetsList.php @@ -3,31 +3,16 @@ declare (strict_types=1); namespace ApiClients\Client\PetStore\Operation; -use ApiClients\Client\PetStore\Contract; -use ApiClients\Client\PetStore\Error as ErrorSchemas; -use ApiClients\Client\PetStore\Internal; -use ApiClients\Client\PetStore\Operation; -use ApiClients\Client\PetStore\Schema; -use League\OpenAPIValidation; -use React\Http; -use ApiClients\Contracts; final class PetsList { - public function __construct(private Internal\Operators $operators) + public function __construct(public \ApiClients\Client\PetStore\Internal\Operators $operators) { } /** - * @return iterable + * @return iterable|\ApiClients\Client\PetStore\Schema\Error */ - public function gatos(int $perPage, int $page) : iterable + public function gatos(int $perPage, int $page): \Rx\Observable|\ApiClients\Client\PetStore\Schema\Error { - return $this->operators->pets👷List_👷Gatos()->call($perPage, $page); - } - /** - * @return iterable - */ - public function gatosListing(int $perPage, int $page) : iterable - { - return $this->operators->pets👷List_👷GatosListing()->call($perPage, $page); + return $this->operators->pets👷List👷Gatos()->call($perPage, $page); } } diff --git a/tests/app/src/Operations.php b/tests/app/src/Operations.php index 6be9f6f..bc0a1e7 100644 --- a/tests/app/src/Operations.php +++ b/tests/app/src/Operations.php @@ -3,39 +3,31 @@ declare (strict_types=1); namespace ApiClients\Client\PetStore; -use ApiClients\Client\PetStore\Contract; -use ApiClients\Client\PetStore\Error as ErrorSchemas; -use ApiClients\Client\PetStore\Internal; -use ApiClients\Client\PetStore\Operation; -use ApiClients\Client\PetStore\Schema; -use League\OpenAPIValidation; -use React\Http; -use ApiClients\Contracts; final readonly class Operations implements OperationsInterface { - public function __construct(private Internal\Operators $operators) + public function __construct(public \ApiClients\Client\PetStore\Internal\Operators $operators) { } - public function pets() : Operation\Pets + public function pets(): Operation\Pets { return new Operation\Pets($this->operators); } - public function petsList() : Operation\PetsList + public function petsList(): Operation\PetsList { return new Operation\PetsList($this->operators); } - public function petsKinds() : Operation\PetsKinds + public function petsKinds(): Operation\PetsKinds { return new Operation\PetsKinds($this->operators); } - public function petsGroupedBy() : Operation\PetsGroupedBy + public function petsGroupedBy(): Operation\PetsGroupedBy { return new Operation\PetsGroupedBy($this->operators); } /** - * @return Schema\Cat|Schema\Dog|Schema\Bird|Schema\Fish|Schema\Spider + * @return \ApiClients\Client\PetStore\Schema\Cat|\ApiClients\Client\PetStore\Schema\Dog|\ApiClients\Client\PetStore\Schema\Bird|\ApiClients\Client\PetStore\Schema\Fish|\ApiClients\Client\PetStore\Schema\Spider|\ApiClients\Client\PetStore\Schema\Error */ - public function showPetById() : \ApiClients\Client\PetStore\Schema\Cat|\ApiClients\Client\PetStore\Schema\Dog|\ApiClients\Client\PetStore\Schema\Bird|\ApiClients\Client\PetStore\Schema\Fish|\ApiClients\Client\PetStore\Schema\Spider + public function showPetById(): \ApiClients\Client\PetStore\Schema\Cat|\ApiClients\Client\PetStore\Schema\Dog|\ApiClients\Client\PetStore\Schema\Bird|\ApiClients\Client\PetStore\Schema\Fish|\ApiClients\Client\PetStore\Schema\Spider|\ApiClients\Client\PetStore\Schema\Error { return $this->operators->showPetById()->call(); } diff --git a/tests/app/src/OperationsInterface.php b/tests/app/src/OperationsInterface.php index 569628f..06837a1 100644 --- a/tests/app/src/OperationsInterface.php +++ b/tests/app/src/OperationsInterface.php @@ -3,22 +3,14 @@ declare (strict_types=1); namespace ApiClients\Client\PetStore; -use ApiClients\Client\PetStore\Contract; -use ApiClients\Client\PetStore\Error as ErrorSchemas; -use ApiClients\Client\PetStore\Internal; -use ApiClients\Client\PetStore\Operation; -use ApiClients\Client\PetStore\Schema; -use League\OpenAPIValidation; -use React\Http; -use ApiClients\Contracts; interface OperationsInterface { - public function pets() : Operation\Pets; - public function petsList() : Operation\PetsList; - public function petsKinds() : Operation\PetsKinds; - public function petsGroupedBy() : Operation\PetsGroupedBy; + public function pets(): Operation\Pets; + public function petsList(): Operation\PetsList; + public function petsKinds(): Operation\PetsKinds; + public function petsGroupedBy(): Operation\PetsGroupedBy; /** - * @return Schema\Cat|Schema\Dog|Schema\Bird|Schema\Fish|Schema\Spider + * @return \ApiClients\Client\PetStore\Schema\Cat|\ApiClients\Client\PetStore\Schema\Dog|\ApiClients\Client\PetStore\Schema\Bird|\ApiClients\Client\PetStore\Schema\Fish|\ApiClients\Client\PetStore\Schema\Spider|\ApiClients\Client\PetStore\Schema\Error */ - public function showPetById() : \ApiClients\Client\PetStore\Schema\Cat|\ApiClients\Client\PetStore\Schema\Dog|\ApiClients\Client\PetStore\Schema\Bird|\ApiClients\Client\PetStore\Schema\Fish|\ApiClients\Client\PetStore\Schema\Spider; + public function showPetById(): \ApiClients\Client\PetStore\Schema\Cat|\ApiClients\Client\PetStore\Schema\Dog|\ApiClients\Client\PetStore\Schema\Bird|\ApiClients\Client\PetStore\Schema\Fish|\ApiClients\Client\PetStore\Schema\Spider|\ApiClients\Client\PetStore\Schema\Error; } diff --git a/tests/app/src/PHPStan/ClientCallReturnTypes.php b/tests/app/src/PHPStan/ClientCallReturnTypes.php index 5cdb5cb..435a632 100644 --- a/tests/app/src/PHPStan/ClientCallReturnTypes.php +++ b/tests/app/src/PHPStan/ClientCallReturnTypes.php @@ -3,14 +3,6 @@ declare (strict_types=1); namespace ApiClients\Client\PetStore\PHPStan; -use ApiClients\Client\PetStore\Contract; -use ApiClients\Client\PetStore\Error as ErrorSchemas; -use ApiClients\Client\PetStore\Internal; -use ApiClients\Client\PetStore\Operation; -use ApiClients\Client\PetStore\Schema; -use League\OpenAPIValidation; -use React\Http; -use ApiClients\Contracts; final readonly class ClientCallReturnTypes implements \PHPStan\Type\DynamicMethodReturnTypeExtension { private \PhpParser\PrettyPrinter\Standard $printer; @@ -18,15 +10,15 @@ public function __construct(private \PHPStan\PhpDoc\TypeStringResolver $typeReso { $this->printer = new \PhpParser\PrettyPrinter\Standard(); } - public function getClass() : string + public function getClass(): string { return \ApiClients\Client\PetStore\Client::class; } - public function isMethodSupported(\PHPStan\Reflection\MethodReflection $methodReflection) : bool + public function isMethodSupported(\PHPStan\Reflection\MethodReflection $methodReflection): bool { return $methodReflection->getName() === 'call'; } - public function getTypeFromMethodCall(\PHPStan\Reflection\MethodReflection $methodReflection, \PhpParser\Node\Expr\MethodCall $methodCall, \PHPStan\Analyser\Scope $scope) : null|\PHPStan\Type\Type + public function getTypeFromMethodCall(\PHPStan\Reflection\MethodReflection $methodReflection, \PhpParser\Node\Expr\MethodCall $methodCall, \PHPStan\Analyser\Scope $scope): null|\PHPStan\Type\Type { $args = $methodCall->getArgs(); if (count($args) === 0) { @@ -34,37 +26,25 @@ public function getTypeFromMethodCall(\PHPStan\Reflection\MethodReflection $meth } $call = substr($this->printer->prettyPrintExpr($args[0]->value), 1, -1); if ($call === 'GET /pets') { - return $this->typeResolver->resolve('iterable'); - } - if ($call === 'LIST /pets') { - return $this->typeResolver->resolve('iterable'); + return $this->typeResolver->resolve('iterable|\ApiClients\Client\PetStore\Schema\Error'); } if ($call === 'POST /pets') { - return $this->typeResolver->resolve('\\ApiClients\\Tools\\OpenApiClient\\Utils\\Response\\WithoutBody'); + return $this->typeResolver->resolve('\ApiClients\Client\PetStore\Schema\Error|\ApiClients\Tools\OpenApiClient\Utils\Response\WithoutBody'); } if ($call === 'GET /pets/gatos') { - return $this->typeResolver->resolve('iterable'); - } - if ($call === 'LIST /pets/gatos') { - return $this->typeResolver->resolve('iterable'); + return $this->typeResolver->resolve('iterable|\ApiClients\Client\PetStore\Schema\Error'); } if ($call === 'GET /pets/kinds/walking') { - return $this->typeResolver->resolve('iterable'); - } - if ($call === 'LIST /pets/kinds/walking') { - return $this->typeResolver->resolve('iterable'); + return $this->typeResolver->resolve('iterable|\ApiClients\Client\PetStore\Schema\Error'); } if ($call === 'GET /pets/groupedByType') { - return $this->typeResolver->resolve('Schema\\Operations\\Pets\\Grouped\\By\\Type\\Response\\ApplicationJson\\Ok'); + return $this->typeResolver->resolve('\ApiClients\Client\PetStore\Schema\Operations\Pets\Grouped\By\Type\Response\ApplicationJson\Ok|\ApiClients\Client\PetStore\Schema\Error'); } if ($call === 'GET /pets/names') { - return $this->typeResolver->resolve('iterable'); - } - if ($call === 'LIST /pets/names') { - return $this->typeResolver->resolve('iterable'); + return $this->typeResolver->resolve('iterable|\ApiClients\Client\PetStore\Schema\Error'); } if ($call === 'GET /pets/{petId}') { - return $this->typeResolver->resolve('Schema\\Cat|Schema\\Dog|Schema\\Bird|Schema\\Fish|Schema\\Spider'); + return $this->typeResolver->resolve('\ApiClients\Client\PetStore\Schema\Cat|\ApiClients\Client\PetStore\Schema\Dog|\ApiClients\Client\PetStore\Schema\Bird|\ApiClients\Client\PetStore\Schema\Fish|\ApiClients\Client\PetStore\Schema\Spider|\ApiClients\Client\PetStore\Schema\Error'); } return null; } diff --git a/tests/app/src/Pets.php b/tests/app/src/Pets.php new file mode 100644 index 0000000..bc9181f --- /dev/null +++ b/tests/app/src/Pets.php @@ -0,0 +1,32 @@ +|\ApiClients\Client\PetStore\Schema\Error + */ + public function list(int $perPage, int $page): \Rx\Observable|\ApiClients\Client\PetStore\Schema\Error + { + return $this->operators->pets👷List_()->call($perPage, $page); + } + /** + * @return \ApiClients\Client\PetStore\Schema\Error|\ApiClients\Tools\OpenApiClient\Utils\Response\WithoutBody + */ + public function create(array $params): \ApiClients\Client\PetStore\Schema\Error|\ApiClients\Tools\OpenApiClient\Utils\Response\WithoutBody + { + return $this->operators->pets👷Create()->call($params); + } + /** + * @return iterable|\ApiClients\Client\PetStore\Schema\Error + */ + public function names(int $perPage, int $page): \Rx\Observable|\ApiClients\Client\PetStore\Schema\Error + { + return $this->operators->pets👷Names()->call($perPage, $page); + } +} diff --git a/tests/app/src/PetsGroupedBy.php b/tests/app/src/PetsGroupedBy.php new file mode 100644 index 0000000..be4c664 --- /dev/null +++ b/tests/app/src/PetsGroupedBy.php @@ -0,0 +1,18 @@ +operators->pets👷Grouped👷By👷Type()->call($perPage, $page); + } +} diff --git a/tests/app/src/PetsGroupedByOperation.php b/tests/app/src/PetsGroupedByOperation.php new file mode 100644 index 0000000..bc4167d --- /dev/null +++ b/tests/app/src/PetsGroupedByOperation.php @@ -0,0 +1,18 @@ +operators->pets👷Grouped👷By👷Type()->call($perPage, $page); + } +} diff --git a/tests/app/src/PetsKinds.php b/tests/app/src/PetsKinds.php new file mode 100644 index 0000000..0b428d7 --- /dev/null +++ b/tests/app/src/PetsKinds.php @@ -0,0 +1,18 @@ +|\ApiClients\Client\PetStore\Schema\Error + */ + public function walking(int $perPage, int $page): \Rx\Observable|\ApiClients\Client\PetStore\Schema\Error + { + return $this->operators->pets👷Kinds👷Walking()->call($perPage, $page); + } +} diff --git a/tests/app/src/PetsKindsOperation.php b/tests/app/src/PetsKindsOperation.php new file mode 100644 index 0000000..62f2a54 --- /dev/null +++ b/tests/app/src/PetsKindsOperation.php @@ -0,0 +1,18 @@ +|\ApiClients\Client\PetStore\Schema\Error + */ + public function walking(int $perPage, int $page): \Rx\Observable|\ApiClients\Client\PetStore\Schema\Error + { + return $this->operators->pets👷Kinds👷Walking()->call($perPage, $page); + } +} diff --git a/tests/app/src/PetsList.php b/tests/app/src/PetsList.php new file mode 100644 index 0000000..b9f8468 --- /dev/null +++ b/tests/app/src/PetsList.php @@ -0,0 +1,18 @@ +|\ApiClients\Client\PetStore\Schema\Error + */ + public function gatos(int $perPage, int $page): \Rx\Observable|\ApiClients\Client\PetStore\Schema\Error + { + return $this->operators->pets👷List👷Gatos()->call($perPage, $page); + } +} diff --git a/tests/app/src/PetsListOperation.php b/tests/app/src/PetsListOperation.php new file mode 100644 index 0000000..46a70af --- /dev/null +++ b/tests/app/src/PetsListOperation.php @@ -0,0 +1,18 @@ +|\ApiClients\Client\PetStore\Schema\Error + */ + public function gatos(int $perPage, int $page): \Rx\Observable|\ApiClients\Client\PetStore\Schema\Error + { + return $this->operators->pets👷List👷Gatos()->call($perPage, $page); + } +} diff --git a/tests/app/src/PetsOperation.php b/tests/app/src/PetsOperation.php new file mode 100644 index 0000000..8ed7393 --- /dev/null +++ b/tests/app/src/PetsOperation.php @@ -0,0 +1,32 @@ +|\ApiClients\Client\PetStore\Schema\Error + */ + public function list(int $perPage, int $page): \Rx\Observable|\ApiClients\Client\PetStore\Schema\Error + { + return $this->operators->pets👷List_()->call($perPage, $page); + } + /** + * @return \ApiClients\Client\PetStore\Schema\Error|\ApiClients\Tools\OpenApiClient\Utils\Response\WithoutBody + */ + public function create(array $params): \ApiClients\Client\PetStore\Schema\Error|\ApiClients\Tools\OpenApiClient\Utils\Response\WithoutBody + { + return $this->operators->pets👷Create()->call($params); + } + /** + * @return iterable|\ApiClients\Client\PetStore\Schema\Error + */ + public function names(int $perPage, int $page): \Rx\Observable|\ApiClients\Client\PetStore\Schema\Error + { + return $this->operators->pets👷Names()->call($perPage, $page); + } +} diff --git a/tests/app/src/Schema/Bird.php b/tests/app/src/Schema/Bird.php index 5a03f4f..f74bf78 100644 --- a/tests/app/src/Schema/Bird.php +++ b/tests/app/src/Schema/Bird.php @@ -3,17 +3,9 @@ declare (strict_types=1); namespace ApiClients\Client\PetStore\Schema; -use ApiClients\Client\PetStore\Contract; -use ApiClients\Client\PetStore\Error as ErrorSchemas; -use ApiClients\Client\PetStore\Internal; -use ApiClients\Client\PetStore\Operation; -use ApiClients\Client\PetStore\Schema; -use League\OpenAPIValidation; -use React\Http; -use ApiClients\Contracts; -final readonly class Bird implements Contract\Bird +final readonly class Bird implements \ApiClients\Client\PetStore\Contract\Bird { - public const SCHEMA_JSON = '{ + const string SCHEMA_JSON = '{ "required": [ "id", "name", @@ -147,9 +139,9 @@ } } }'; - public const SCHEMA_TITLE = ''; - public const SCHEMA_DESCRIPTION = ''; - public const SCHEMA_EXAMPLE_DATA = '{ + public const string SCHEMA_TITLE = ''; + public const string SCHEMA_DESCRIPTION = ''; + const string SCHEMA_EXAMPLE_DATA = '{ "id": "4ccda740-74c3-4cfa-8571-ebf83c8f300a", "name": null, "flies": false, @@ -158,7 +150,13 @@ "type": "rage" } }'; - public function __construct(public string $id, public string4 $name, public bool $flies, #[\ApiClients\Client\PetStore\Internal\Attribute\CastUnionToType\Single\Schema\Bird\Eyes] public Schema\RedEyes|Schema\BlueEyes|Schema\GreenEyes|Schema\YellowEyes|Schema\BlackEyes $eyes) + public function __construct( + public string $id, + public string4 $name, + public bool $flies, + #[\ApiClients\Client\PetStore\Internal\Attribute\CastUnionToType\Single\Schema\Bird\Eyes] + public \ApiClients\Client\PetStore\Schema\RedEyes|\ApiClients\Client\PetStore\Schema\BlueEyes|\ApiClients\Client\PetStore\Schema\GreenEyes|\ApiClients\Client\PetStore\Schema\YellowEyes|\ApiClients\Client\PetStore\Schema\BlackEyes $eyes + ) { } } diff --git a/tests/app/src/Schema/BlackEyes.php b/tests/app/src/Schema/BlackEyes.php index d2ca3d1..bf62c4d 100644 --- a/tests/app/src/Schema/BlackEyes.php +++ b/tests/app/src/Schema/BlackEyes.php @@ -3,17 +3,9 @@ declare (strict_types=1); namespace ApiClients\Client\PetStore\Schema; -use ApiClients\Client\PetStore\Contract; -use ApiClients\Client\PetStore\Error as ErrorSchemas; -use ApiClients\Client\PetStore\Internal; -use ApiClients\Client\PetStore\Operation; -use ApiClients\Client\PetStore\Schema; -use League\OpenAPIValidation; -use React\Http; -use ApiClients\Contracts; -final readonly class BlackEyes implements Contract\BlackEyes +final readonly class BlackEyes implements \ApiClients\Client\PetStore\Contract\BlackEyes { - public const SCHEMA_JSON = '{ + const string SCHEMA_JSON = '{ "required": [ "count", "type" @@ -31,9 +23,9 @@ } } }'; - public const SCHEMA_TITLE = ''; - public const SCHEMA_DESCRIPTION = ''; - public const SCHEMA_EXAMPLE_DATA = '{ + public const string SCHEMA_TITLE = ''; + public const string SCHEMA_DESCRIPTION = ''; + const string SCHEMA_EXAMPLE_DATA = '{ "count": 5, "type": "rage" }'; diff --git a/tests/app/src/Schema/BlueEyes.php b/tests/app/src/Schema/BlueEyes.php index 8d2b22f..e282a4b 100644 --- a/tests/app/src/Schema/BlueEyes.php +++ b/tests/app/src/Schema/BlueEyes.php @@ -3,17 +3,9 @@ declare (strict_types=1); namespace ApiClients\Client\PetStore\Schema; -use ApiClients\Client\PetStore\Contract; -use ApiClients\Client\PetStore\Error as ErrorSchemas; -use ApiClients\Client\PetStore\Internal; -use ApiClients\Client\PetStore\Operation; -use ApiClients\Client\PetStore\Schema; -use League\OpenAPIValidation; -use React\Http; -use ApiClients\Contracts; -final readonly class BlueEyes implements Contract\BlueEyes +final readonly class BlueEyes implements \ApiClients\Client\PetStore\Contract\BlueEyes { - public const SCHEMA_JSON = '{ + const string SCHEMA_JSON = '{ "required": [ "count", "type" @@ -32,9 +24,9 @@ } } }'; - public const SCHEMA_TITLE = ''; - public const SCHEMA_DESCRIPTION = ''; - public const SCHEMA_EXAMPLE_DATA = '{ + public const string SCHEMA_TITLE = ''; + public const string SCHEMA_DESCRIPTION = ''; + const string SCHEMA_EXAMPLE_DATA = '{ "count": 5, "type": "sky" }'; diff --git a/tests/app/src/Schema/Cat.php b/tests/app/src/Schema/Cat.php index fe92772..18e3963 100644 --- a/tests/app/src/Schema/Cat.php +++ b/tests/app/src/Schema/Cat.php @@ -3,17 +3,9 @@ declare (strict_types=1); namespace ApiClients\Client\PetStore\Schema; -use ApiClients\Client\PetStore\Contract; -use ApiClients\Client\PetStore\Error as ErrorSchemas; -use ApiClients\Client\PetStore\Internal; -use ApiClients\Client\PetStore\Operation; -use ApiClients\Client\PetStore\Schema; -use League\OpenAPIValidation; -use React\Http; -use ApiClients\Contracts; -final readonly class Cat implements Contract\Cat +final readonly class Cat implements \ApiClients\Client\PetStore\Contract\Cat { - public const SCHEMA_JSON = '{ + const string SCHEMA_JSON = '{ "required": [ "id", "name", @@ -156,9 +148,9 @@ } } }'; - public const SCHEMA_TITLE = ''; - public const SCHEMA_DESCRIPTION = ''; - public const SCHEMA_EXAMPLE_DATA = '{ + public const string SCHEMA_TITLE = ''; + public const string SCHEMA_DESCRIPTION = ''; + const string SCHEMA_EXAMPLE_DATA = '{ "id": "4ccda740-74c3-4cfa-8571-ebf83c8f300a", "name": "generated", "indoor": false, @@ -177,7 +169,14 @@ /** * @param array<\ApiClients\Client\PetStore\Schema\RedEyes|\ApiClients\Client\PetStore\Schema\BlueEyes|\ApiClients\Client\PetStore\Schema\GreenEyes|\ApiClients\Client\PetStore\Schema\YellowEyes|\ApiClients\Client\PetStore\Schema\BlackEyes> $eyes */ - public function __construct(public string $id, public string $name, public bool $indoor, public Schema\Cat\Features $features, #[\ApiClients\Client\PetStore\Internal\Attribute\CastUnionToType\Multiple\Schema\Cat\Eyes] public array $eyes) + public function __construct( + public string $id, + public string $name, + public bool $indoor, + public \ApiClients\Client\PetStore\Schema\Cat\Features $features, + #[\ApiClients\Client\PetStore\Internal\Attribute\CastUnionToType\Multiple\Schema\Cat\Eyes] + public array $eyes + ) { } } diff --git a/tests/app/src/Schema/Cat/Features.php b/tests/app/src/Schema/Cat/Features.php index f4599db..b87c2aa 100644 --- a/tests/app/src/Schema/Cat/Features.php +++ b/tests/app/src/Schema/Cat/Features.php @@ -3,22 +3,14 @@ declare (strict_types=1); namespace ApiClients\Client\PetStore\Schema\Cat; -use ApiClients\Client\PetStore\Contract; -use ApiClients\Client\PetStore\Error as ErrorSchemas; -use ApiClients\Client\PetStore\Internal; -use ApiClients\Client\PetStore\Operation; -use ApiClients\Client\PetStore\Schema; -use League\OpenAPIValidation; -use React\Http; -use ApiClients\Contracts; -final readonly class Features implements Contract\Cat\Features +final readonly class Features implements \ApiClients\Client\PetStore\Contract\Cat\Features { - public const SCHEMA_JSON = '{ + const string SCHEMA_JSON = '{ "type": "object" }'; - public const SCHEMA_TITLE = ''; - public const SCHEMA_DESCRIPTION = ''; - public const SCHEMA_EXAMPLE_DATA = '[]'; + public const string SCHEMA_TITLE = ''; + public const string SCHEMA_DESCRIPTION = ''; + const string SCHEMA_EXAMPLE_DATA = '[]'; public function __construct() { } diff --git a/tests/app/src/Schema/Dog.php b/tests/app/src/Schema/Dog.php index f000a07..9bc7645 100644 --- a/tests/app/src/Schema/Dog.php +++ b/tests/app/src/Schema/Dog.php @@ -3,17 +3,9 @@ declare (strict_types=1); namespace ApiClients\Client\PetStore\Schema; -use ApiClients\Client\PetStore\Contract; -use ApiClients\Client\PetStore\Error as ErrorSchemas; -use ApiClients\Client\PetStore\Internal; -use ApiClients\Client\PetStore\Operation; -use ApiClients\Client\PetStore\Schema; -use League\OpenAPIValidation; -use React\Http; -use ApiClients\Contracts; -final readonly class Dog implements Contract\Dog +final readonly class Dog implements \ApiClients\Client\PetStore\Contract\Dog { - public const SCHEMA_JSON = '{ + const string SCHEMA_JSON = '{ "required": [ "id", "name", @@ -152,9 +144,9 @@ } } }'; - public const SCHEMA_TITLE = ''; - public const SCHEMA_DESCRIPTION = ''; - public const SCHEMA_EXAMPLE_DATA = '{ + public const string SCHEMA_TITLE = ''; + public const string SCHEMA_DESCRIPTION = ''; + const string SCHEMA_EXAMPLE_DATA = '{ "id": "4ccda740-74c3-4cfa-8571-ebf83c8f300a", "name": "generated", "good-boy": false, @@ -172,7 +164,14 @@ /** * @param array<\ApiClients\Client\PetStore\Schema\RedEyes|\ApiClients\Client\PetStore\Schema\BlueEyes|\ApiClients\Client\PetStore\Schema\GreenEyes|\ApiClients\Client\PetStore\Schema\YellowEyes|\ApiClients\Client\PetStore\Schema\BlackEyes> $eyes */ - public function __construct(public string $id, public string $name, #[\EventSauce\ObjectHydrator\MapFrom('good-boy')] public bool $goodMinBoy, #[\ApiClients\Client\PetStore\Internal\Attribute\CastUnionToType\Multiple\Schema\Dog\Eyes] public array $eyes) + public function __construct( + public string $id, + public string $name, + #[\EventSauce\ObjectHydrator\MapFrom('good-boy')] + public bool $goodMinBoy, + #[\ApiClients\Client\PetStore\Internal\Attribute\CastUnionToType\Multiple\Schema\Dog\Eyes] + public array $eyes + ) { } } diff --git a/tests/app/src/Schema/Error.php b/tests/app/src/Schema/Error.php index 25f47fc..d75587d 100644 --- a/tests/app/src/Schema/Error.php +++ b/tests/app/src/Schema/Error.php @@ -3,17 +3,9 @@ declare (strict_types=1); namespace ApiClients\Client\PetStore\Schema; -use ApiClients\Client\PetStore\Contract; -use ApiClients\Client\PetStore\Error as ErrorSchemas; -use ApiClients\Client\PetStore\Internal; -use ApiClients\Client\PetStore\Operation; -use ApiClients\Client\PetStore\Schema; -use League\OpenAPIValidation; -use React\Http; -use ApiClients\Contracts; -final readonly class Error implements Contract\Error +final readonly class Error implements \ApiClients\Client\PetStore\Contract\Error { - public const SCHEMA_JSON = '{ + const string SCHEMA_JSON = '{ "required": [ "code", "message" @@ -29,9 +21,9 @@ } } }'; - public const SCHEMA_TITLE = ''; - public const SCHEMA_DESCRIPTION = ''; - public const SCHEMA_EXAMPLE_DATA = '{ + public const string SCHEMA_TITLE = ''; + public const string SCHEMA_DESCRIPTION = ''; + const string SCHEMA_EXAMPLE_DATA = '{ "code": 4, "message": "generated" }'; diff --git a/tests/app/src/Schema/EyeCount.php b/tests/app/src/Schema/EyeCount.php index 6ad20c2..a9d1977 100644 --- a/tests/app/src/Schema/EyeCount.php +++ b/tests/app/src/Schema/EyeCount.php @@ -3,17 +3,9 @@ declare (strict_types=1); namespace ApiClients\Client\PetStore\Schema; -use ApiClients\Client\PetStore\Contract; -use ApiClients\Client\PetStore\Error as ErrorSchemas; -use ApiClients\Client\PetStore\Internal; -use ApiClients\Client\PetStore\Operation; -use ApiClients\Client\PetStore\Schema; -use League\OpenAPIValidation; -use React\Http; -use ApiClients\Contracts; -final readonly class EyeCount implements Contract\RedEyes +final readonly class EyeCount implements \ApiClients\Client\PetStore\Contract\RedEyes { - public const SCHEMA_JSON = '{ + const string SCHEMA_JSON = '{ "required": [ "count" ], @@ -24,9 +16,9 @@ } } }'; - public const SCHEMA_TITLE = ''; - public const SCHEMA_DESCRIPTION = ''; - public const SCHEMA_EXAMPLE_DATA = '{ + public const string SCHEMA_TITLE = ''; + public const string SCHEMA_DESCRIPTION = ''; + const string SCHEMA_EXAMPLE_DATA = '{ "count": 5 }'; public function __construct(public int $count) diff --git a/tests/app/src/Schema/Fins.php b/tests/app/src/Schema/Fins.php index 1a21389..a0c7625 100644 --- a/tests/app/src/Schema/Fins.php +++ b/tests/app/src/Schema/Fins.php @@ -3,17 +3,9 @@ declare (strict_types=1); namespace ApiClients\Client\PetStore\Schema; -use ApiClients\Client\PetStore\Contract; -use ApiClients\Client\PetStore\Error as ErrorSchemas; -use ApiClients\Client\PetStore\Internal; -use ApiClients\Client\PetStore\Operation; -use ApiClients\Client\PetStore\Schema; -use League\OpenAPIValidation; -use React\Http; -use ApiClients\Contracts; -final readonly class Fins implements Contract\Fins +final readonly class Fins implements \ApiClients\Client\PetStore\Contract\Fins { - public const SCHEMA_JSON = '{ + const string SCHEMA_JSON = '{ "required": [ "count", "spikes" @@ -28,9 +20,9 @@ } } }'; - public const SCHEMA_TITLE = ''; - public const SCHEMA_DESCRIPTION = ''; - public const SCHEMA_EXAMPLE_DATA = '{ + public const string SCHEMA_TITLE = ''; + public const string SCHEMA_DESCRIPTION = ''; + const string SCHEMA_EXAMPLE_DATA = '{ "count": 5, "spikes": 6 }'; diff --git a/tests/app/src/Schema/Fish.php b/tests/app/src/Schema/Fish.php index 8a8a4d4..cfd0fe1 100644 --- a/tests/app/src/Schema/Fish.php +++ b/tests/app/src/Schema/Fish.php @@ -3,17 +3,9 @@ declare (strict_types=1); namespace ApiClients\Client\PetStore\Schema; -use ApiClients\Client\PetStore\Contract; -use ApiClients\Client\PetStore\Error as ErrorSchemas; -use ApiClients\Client\PetStore\Internal; -use ApiClients\Client\PetStore\Operation; -use ApiClients\Client\PetStore\Schema; -use League\OpenAPIValidation; -use React\Http; -use ApiClients\Contracts; -final readonly class Fish implements Contract\Fish +final readonly class Fish implements \ApiClients\Client\PetStore\Contract\Fish { - public const SCHEMA_JSON = '{ + const string SCHEMA_JSON = '{ "required": [ "id", "name", @@ -151,9 +143,9 @@ } } }'; - public const SCHEMA_TITLE = ''; - public const SCHEMA_DESCRIPTION = ''; - public const SCHEMA_EXAMPLE_DATA = '{ + public const string SCHEMA_TITLE = ''; + public const string SCHEMA_DESCRIPTION = ''; + const string SCHEMA_EXAMPLE_DATA = '{ "id": "4ccda740-74c3-4cfa-8571-ebf83c8f300a", "name": "generated", "flat": false, @@ -163,7 +155,14 @@ "type": "rage" } }'; - public function __construct(public string $id, public string $name, public bool $flat, public bool $flies, #[\ApiClients\Client\PetStore\Internal\Attribute\CastUnionToType\Single\Schema\Fish\Eyes] public Schema\RedEyes|Schema\BlueEyes|Schema\GreenEyes|Schema\YellowEyes|Schema\BlackEyes $eyes) + public function __construct( + public string $id, + public string $name, + public bool $flat, + public bool $flies, + #[\ApiClients\Client\PetStore\Internal\Attribute\CastUnionToType\Single\Schema\Fish\Eyes] + public \ApiClients\Client\PetStore\Schema\RedEyes|\ApiClients\Client\PetStore\Schema\BlueEyes|\ApiClients\Client\PetStore\Schema\GreenEyes|\ApiClients\Client\PetStore\Schema\YellowEyes|\ApiClients\Client\PetStore\Schema\BlackEyes $eyes + ) { } } diff --git a/tests/app/src/Schema/GreenEyes.php b/tests/app/src/Schema/GreenEyes.php index 74a52dc..c7b7d6a 100644 --- a/tests/app/src/Schema/GreenEyes.php +++ b/tests/app/src/Schema/GreenEyes.php @@ -3,17 +3,9 @@ declare (strict_types=1); namespace ApiClients\Client\PetStore\Schema; -use ApiClients\Client\PetStore\Contract; -use ApiClients\Client\PetStore\Error as ErrorSchemas; -use ApiClients\Client\PetStore\Internal; -use ApiClients\Client\PetStore\Operation; -use ApiClients\Client\PetStore\Schema; -use League\OpenAPIValidation; -use React\Http; -use ApiClients\Contracts; -final readonly class GreenEyes implements Contract\GreenEyes +final readonly class GreenEyes implements \ApiClients\Client\PetStore\Contract\GreenEyes { - public const SCHEMA_JSON = '{ + const string SCHEMA_JSON = '{ "required": [ "count", "type" @@ -33,9 +25,9 @@ } } }'; - public const SCHEMA_TITLE = ''; - public const SCHEMA_DESCRIPTION = ''; - public const SCHEMA_EXAMPLE_DATA = '{ + public const string SCHEMA_TITLE = ''; + public const string SCHEMA_DESCRIPTION = ''; + const string SCHEMA_EXAMPLE_DATA = '{ "count": 5, "type": "hulk" }'; diff --git a/tests/app/src/Schema/HellHound.php b/tests/app/src/Schema/HellHound.php index dd82c64..3a9bfd2 100644 --- a/tests/app/src/Schema/HellHound.php +++ b/tests/app/src/Schema/HellHound.php @@ -3,17 +3,9 @@ declare (strict_types=1); namespace ApiClients\Client\PetStore\Schema; -use ApiClients\Client\PetStore\Contract; -use ApiClients\Client\PetStore\Error as ErrorSchemas; -use ApiClients\Client\PetStore\Internal; -use ApiClients\Client\PetStore\Operation; -use ApiClients\Client\PetStore\Schema; -use League\OpenAPIValidation; -use React\Http; -use ApiClients\Contracts; -final readonly class HellHound implements Contract\HellHound +final readonly class HellHound implements \ApiClients\Client\PetStore\Contract\HellHound { - public const SCHEMA_JSON = '{ + const string SCHEMA_JSON = '{ "required": [ "id", "name", @@ -71,15 +63,21 @@ } } }'; - public const SCHEMA_TITLE = ''; - public const SCHEMA_DESCRIPTION = ''; - public const SCHEMA_EXAMPLE_DATA = '{ + public const string SCHEMA_TITLE = ''; + public const string SCHEMA_DESCRIPTION = ''; + const string SCHEMA_EXAMPLE_DATA = '{ "id": 2, "name": "generated", "bad-boy": false, "eyes": [] }'; - public function __construct(public int $id, public string $name, #[\EventSauce\ObjectHydrator\MapFrom('bad-boy')] public bool $badMinBoy, public ?Schema\HellHound\Eyes $eyes) + public function __construct( + public int $id, + public string $name, + #[\EventSauce\ObjectHydrator\MapFrom('bad-boy')] + public bool $badMinBoy, + public ?\ApiClients\Client\PetStore\Schema\HellHound\Eyes $eyes + ) { } } diff --git a/tests/app/src/Schema/HellHound/Eyes.php b/tests/app/src/Schema/HellHound/Eyes.php index 973cab2..fcd1e3c 100644 --- a/tests/app/src/Schema/HellHound/Eyes.php +++ b/tests/app/src/Schema/HellHound/Eyes.php @@ -3,17 +3,9 @@ declare (strict_types=1); namespace ApiClients\Client\PetStore\Schema\HellHound; -use ApiClients\Client\PetStore\Contract; -use ApiClients\Client\PetStore\Error as ErrorSchemas; -use ApiClients\Client\PetStore\Internal; -use ApiClients\Client\PetStore\Operation; -use ApiClients\Client\PetStore\Schema; -use League\OpenAPIValidation; -use React\Http; -use ApiClients\Contracts; -final readonly class Eyes implements Contract\HellHound\Eyes +final readonly class Eyes implements \ApiClients\Client\PetStore\Contract\HellHound\Eyes { - public const SCHEMA_JSON = '{ + const string SCHEMA_JSON = '{ "type": "object", "allOf": [ { @@ -51,9 +43,9 @@ } ] }'; - public const SCHEMA_TITLE = ''; - public const SCHEMA_DESCRIPTION = ''; - public const SCHEMA_EXAMPLE_DATA = '[]'; + public const string SCHEMA_TITLE = ''; + public const string SCHEMA_DESCRIPTION = ''; + const string SCHEMA_EXAMPLE_DATA = '[]'; public function __construct() { } diff --git a/tests/app/src/Schema/Legs.php b/tests/app/src/Schema/Legs.php index 1e1b324..edabe79 100644 --- a/tests/app/src/Schema/Legs.php +++ b/tests/app/src/Schema/Legs.php @@ -3,17 +3,9 @@ declare (strict_types=1); namespace ApiClients\Client\PetStore\Schema; -use ApiClients\Client\PetStore\Contract; -use ApiClients\Client\PetStore\Error as ErrorSchemas; -use ApiClients\Client\PetStore\Internal; -use ApiClients\Client\PetStore\Operation; -use ApiClients\Client\PetStore\Schema; -use League\OpenAPIValidation; -use React\Http; -use ApiClients\Contracts; -final readonly class Legs implements Contract\Legs +final readonly class Legs implements \ApiClients\Client\PetStore\Contract\Legs { - public const SCHEMA_JSON = '{ + const string SCHEMA_JSON = '{ "required": [ "count", "joints" @@ -28,9 +20,9 @@ } } }'; - public const SCHEMA_TITLE = ''; - public const SCHEMA_DESCRIPTION = ''; - public const SCHEMA_EXAMPLE_DATA = '{ + public const string SCHEMA_TITLE = ''; + public const string SCHEMA_DESCRIPTION = ''; + const string SCHEMA_EXAMPLE_DATA = '{ "count": 5, "joins": 5 }'; diff --git a/tests/app/src/Schema/Operations/Pets/Grouped/By/Type/Response/ApplicationJson/Ok.php b/tests/app/src/Schema/Operations/Pets/Grouped/By/Type/Response/ApplicationJson/Ok.php index 48e8b60..3da3aa1 100644 --- a/tests/app/src/Schema/Operations/Pets/Grouped/By/Type/Response/ApplicationJson/Ok.php +++ b/tests/app/src/Schema/Operations/Pets/Grouped/By/Type/Response/ApplicationJson/Ok.php @@ -3,17 +3,9 @@ declare (strict_types=1); namespace ApiClients\Client\PetStore\Schema\Operations\Pets\Grouped\By\Type\Response\ApplicationJson; -use ApiClients\Client\PetStore\Contract; -use ApiClients\Client\PetStore\Error as ErrorSchemas; -use ApiClients\Client\PetStore\Internal; -use ApiClients\Client\PetStore\Operation; -use ApiClients\Client\PetStore\Schema; -use League\OpenAPIValidation; -use React\Http; -use ApiClients\Contracts; -final readonly class Ok implements Contract\Operations\Pets\Grouped\By\Type\Response\ApplicationJson\Ok +final readonly class Ok implements \ApiClients\Client\PetStore\Contract\Operations\Pets\Grouped\By\Type\Response\ApplicationJson\Ok { - public const SCHEMA_JSON = '{ + const string SCHEMA_JSON = '{ "required": [ "pets" ], @@ -369,9 +361,9 @@ } } }'; - public const SCHEMA_TITLE = ''; - public const SCHEMA_DESCRIPTION = ''; - public const SCHEMA_EXAMPLE_DATA = '{ + public const string SCHEMA_TITLE = ''; + public const string SCHEMA_DESCRIPTION = ''; + const string SCHEMA_EXAMPLE_DATA = '{ "pets": [ { "id": "4ccda740-74c3-4cfa-8571-ebf83c8f300a", @@ -409,7 +401,10 @@ /** * @param array<\ApiClients\Client\PetStore\Schema\Cat|\ApiClients\Client\PetStore\Schema\Dog|\ApiClients\Client\PetStore\Schema\HellHound> $pets */ - public function __construct(#[\ApiClients\Client\PetStore\Internal\Attribute\CastUnionToType\Multiple\Schema\Operations\Pets\Grouped\By\Type\Response\ApplicationJson\Ok\Pets] public array $pets) + public function __construct( + #[\ApiClients\Client\PetStore\Internal\Attribute\CastUnionToType\Multiple\Schema\Operations\Pets\Grouped\By\Type\Response\ApplicationJson\Ok\Pets] + public array $pets + ) { } } diff --git a/tests/app/src/Schema/Operations/Pets/Kinds/Walking/Response/ApplicationJson/Ok.php b/tests/app/src/Schema/Operations/Pets/Kinds/Walking/Response/ApplicationJson/Ok.php index 6a69c47..965cf6d 100644 --- a/tests/app/src/Schema/Operations/Pets/Kinds/Walking/Response/ApplicationJson/Ok.php +++ b/tests/app/src/Schema/Operations/Pets/Kinds/Walking/Response/ApplicationJson/Ok.php @@ -3,17 +3,9 @@ declare (strict_types=1); namespace ApiClients\Client\PetStore\Schema\Operations\Pets\Kinds\Walking\Response\ApplicationJson; -use ApiClients\Client\PetStore\Contract; -use ApiClients\Client\PetStore\Error as ErrorSchemas; -use ApiClients\Client\PetStore\Internal; -use ApiClients\Client\PetStore\Operation; -use ApiClients\Client\PetStore\Schema; -use League\OpenAPIValidation; -use React\Http; -use ApiClients\Contracts; -final readonly class Ok implements Contract\Operations\Pets\Kinds\Walking\Response\ApplicationJson\Ok +final readonly class Ok implements \ApiClients\Client\PetStore\Contract\Operations\Pets\Kinds\Walking\Response\ApplicationJson\Ok { - public const SCHEMA_JSON = '{ + const string SCHEMA_JSON = '{ "type": "object", "oneOf": [ { @@ -358,9 +350,9 @@ } ] }'; - public const SCHEMA_TITLE = ''; - public const SCHEMA_DESCRIPTION = ''; - public const SCHEMA_EXAMPLE_DATA = '[]'; + public const string SCHEMA_TITLE = ''; + public const string SCHEMA_DESCRIPTION = ''; + const string SCHEMA_EXAMPLE_DATA = '[]'; public function __construct() { } diff --git a/tests/app/src/Schema/Operations/Pets/List_/Response/ApplicationJson/Ok.php b/tests/app/src/Schema/Operations/Pets/List_/Response/ApplicationJson/Ok.php index 3b8d20b..4032fb4 100644 --- a/tests/app/src/Schema/Operations/Pets/List_/Response/ApplicationJson/Ok.php +++ b/tests/app/src/Schema/Operations/Pets/List_/Response/ApplicationJson/Ok.php @@ -3,17 +3,9 @@ declare (strict_types=1); namespace ApiClients\Client\PetStore\Schema\Operations\Pets\List_\Response\ApplicationJson; -use ApiClients\Client\PetStore\Contract; -use ApiClients\Client\PetStore\Error as ErrorSchemas; -use ApiClients\Client\PetStore\Internal; -use ApiClients\Client\PetStore\Operation; -use ApiClients\Client\PetStore\Schema; -use League\OpenAPIValidation; -use React\Http; -use ApiClients\Contracts; -final readonly class Ok implements Contract\Operations\Pets\List_\Response\ApplicationJson\Ok +final readonly class Ok implements \ApiClients\Client\PetStore\Contract\Operations\Pets\List_\Response\ApplicationJson\Ok { - public const SCHEMA_JSON = '{ + const string SCHEMA_JSON = '{ "anyOf": [ { "required": [ @@ -773,9 +765,9 @@ } ] }'; - public const SCHEMA_TITLE = ''; - public const SCHEMA_DESCRIPTION = ''; - public const SCHEMA_EXAMPLE_DATA = '[]'; + public const string SCHEMA_TITLE = ''; + public const string SCHEMA_DESCRIPTION = ''; + const string SCHEMA_EXAMPLE_DATA = '[]'; public function __construct() { } diff --git a/tests/app/src/Schema/Operations/Pets/Names/Response/ApplicationJson/Ok.php b/tests/app/src/Schema/Operations/Pets/Names/Response/ApplicationJson/Ok.php index c7c83a0..5c64e01 100644 --- a/tests/app/src/Schema/Operations/Pets/Names/Response/ApplicationJson/Ok.php +++ b/tests/app/src/Schema/Operations/Pets/Names/Response/ApplicationJson/Ok.php @@ -3,22 +3,14 @@ declare (strict_types=1); namespace ApiClients\Client\PetStore\Schema\Operations\Pets\Names\Response\ApplicationJson; -use ApiClients\Client\PetStore\Contract; -use ApiClients\Client\PetStore\Error as ErrorSchemas; -use ApiClients\Client\PetStore\Internal; -use ApiClients\Client\PetStore\Operation; -use ApiClients\Client\PetStore\Schema; -use League\OpenAPIValidation; -use React\Http; -use ApiClients\Contracts; -final readonly class Ok implements Contract\Operations\Pets\Names\Response\ApplicationJson\Ok +final readonly class Ok implements \ApiClients\Client\PetStore\Contract\Operations\Pets\Names\Response\ApplicationJson\Ok { - public const SCHEMA_JSON = '{ + const string SCHEMA_JSON = '{ "type": "string" }'; - public const SCHEMA_TITLE = ''; - public const SCHEMA_DESCRIPTION = ''; - public const SCHEMA_EXAMPLE_DATA = '[]'; + public const string SCHEMA_TITLE = ''; + public const string SCHEMA_DESCRIPTION = ''; + const string SCHEMA_EXAMPLE_DATA = '[]'; public function __construct() { } diff --git a/tests/app/src/Schema/Operations/ShowPetById/Response/ApplicationJson/Ok.php b/tests/app/src/Schema/Operations/ShowPetById/Response/ApplicationJson/Ok.php index d8b11e5..beddb66 100644 --- a/tests/app/src/Schema/Operations/ShowPetById/Response/ApplicationJson/Ok.php +++ b/tests/app/src/Schema/Operations/ShowPetById/Response/ApplicationJson/Ok.php @@ -3,17 +3,9 @@ declare (strict_types=1); namespace ApiClients\Client\PetStore\Schema\Operations\ShowPetById\Response\ApplicationJson; -use ApiClients\Client\PetStore\Contract; -use ApiClients\Client\PetStore\Error as ErrorSchemas; -use ApiClients\Client\PetStore\Internal; -use ApiClients\Client\PetStore\Operation; -use ApiClients\Client\PetStore\Schema; -use League\OpenAPIValidation; -use React\Http; -use ApiClients\Contracts; -final readonly class Ok implements Contract\Operations\ShowPetById\Response\ApplicationJson\Ok +final readonly class Ok implements \ApiClients\Client\PetStore\Contract\Operations\ShowPetById\Response\ApplicationJson\Ok { - public const SCHEMA_JSON = '{ + const string SCHEMA_JSON = '{ "oneOf": [ { "required": [ @@ -715,9 +707,9 @@ } ] }'; - public const SCHEMA_TITLE = ''; - public const SCHEMA_DESCRIPTION = ''; - public const SCHEMA_EXAMPLE_DATA = '[]'; + public const string SCHEMA_TITLE = ''; + public const string SCHEMA_DESCRIPTION = ''; + const string SCHEMA_EXAMPLE_DATA = '[]'; public function __construct() { } diff --git a/tests/app/src/Schema/Pets/Create/Request/ApplicationJson.php b/tests/app/src/Schema/Pets/Create/Request/ApplicationJson.php index 51597bb..d272fa2 100644 --- a/tests/app/src/Schema/Pets/Create/Request/ApplicationJson.php +++ b/tests/app/src/Schema/Pets/Create/Request/ApplicationJson.php @@ -3,17 +3,9 @@ declare (strict_types=1); namespace ApiClients\Client\PetStore\Schema\Pets\Create\Request; -use ApiClients\Client\PetStore\Contract; -use ApiClients\Client\PetStore\Error as ErrorSchemas; -use ApiClients\Client\PetStore\Internal; -use ApiClients\Client\PetStore\Operation; -use ApiClients\Client\PetStore\Schema; -use League\OpenAPIValidation; -use React\Http; -use ApiClients\Contracts; -final readonly class ApplicationJson implements Contract\Pets\Create\Request\ApplicationJson +final readonly class ApplicationJson implements \ApiClients\Client\PetStore\Contract\Pets\Create\Request\ApplicationJson { - public const SCHEMA_JSON = '{ + const string SCHEMA_JSON = '{ "oneOf": [ { "required": [ @@ -773,9 +765,9 @@ } ] }'; - public const SCHEMA_TITLE = ''; - public const SCHEMA_DESCRIPTION = ''; - public const SCHEMA_EXAMPLE_DATA = '[]'; + public const string SCHEMA_TITLE = ''; + public const string SCHEMA_DESCRIPTION = ''; + const string SCHEMA_EXAMPLE_DATA = '[]'; public function __construct() { } diff --git a/tests/app/src/Schema/RedEyes.php b/tests/app/src/Schema/RedEyes.php index 909dfd3..0329eab 100644 --- a/tests/app/src/Schema/RedEyes.php +++ b/tests/app/src/Schema/RedEyes.php @@ -3,17 +3,9 @@ declare (strict_types=1); namespace ApiClients\Client\PetStore\Schema; -use ApiClients\Client\PetStore\Contract; -use ApiClients\Client\PetStore\Error as ErrorSchemas; -use ApiClients\Client\PetStore\Internal; -use ApiClients\Client\PetStore\Operation; -use ApiClients\Client\PetStore\Schema; -use League\OpenAPIValidation; -use React\Http; -use ApiClients\Contracts; -final readonly class RedEyes implements Contract\RedEyes, Contract\RedEyes\A +final readonly class RedEyes implements \ApiClients\Client\PetStore\Contract\RedEyes, \ApiClients\Client\PetStore\Contract\RedEyes\B { - public const SCHEMA_JSON = '{ + const string SCHEMA_JSON = '{ "required": [ "count", "type" @@ -46,9 +38,9 @@ } ] }'; - public const SCHEMA_TITLE = ''; - public const SCHEMA_DESCRIPTION = ''; - public const SCHEMA_EXAMPLE_DATA = '{ + public const string SCHEMA_TITLE = ''; + public const string SCHEMA_DESCRIPTION = ''; + const string SCHEMA_EXAMPLE_DATA = '{ "count": 5, "type": "blood" }'; diff --git a/tests/app/src/Schema/Spider.php b/tests/app/src/Schema/Spider.php index d621c53..0b14840 100644 --- a/tests/app/src/Schema/Spider.php +++ b/tests/app/src/Schema/Spider.php @@ -3,17 +3,9 @@ declare (strict_types=1); namespace ApiClients\Client\PetStore\Schema; -use ApiClients\Client\PetStore\Contract; -use ApiClients\Client\PetStore\Error as ErrorSchemas; -use ApiClients\Client\PetStore\Internal; -use ApiClients\Client\PetStore\Operation; -use ApiClients\Client\PetStore\Schema; -use League\OpenAPIValidation; -use React\Http; -use ApiClients\Contracts; -final readonly class Spider implements Contract\Spider +final readonly class Spider implements \ApiClients\Client\PetStore\Contract\Spider { - public const SCHEMA_JSON = '{ + const string SCHEMA_JSON = '{ "required": [ "id", "name", @@ -157,9 +149,9 @@ } } }'; - public const SCHEMA_TITLE = ''; - public const SCHEMA_DESCRIPTION = ''; - public const SCHEMA_EXAMPLE_DATA = '{ + public const string SCHEMA_TITLE = ''; + public const string SCHEMA_DESCRIPTION = ''; + const string SCHEMA_EXAMPLE_DATA = '{ "id": "4ccda740-74c3-4cfa-8571-ebf83c8f300a", "name": "generated", "legs": [ @@ -210,7 +202,13 @@ /** * @param array<\ApiClients\Client\PetStore\Schema\RedEyes|\ApiClients\Client\PetStore\Schema\BlueEyes|\ApiClients\Client\PetStore\Schema\GreenEyes|\ApiClients\Client\PetStore\Schema\YellowEyes|\ApiClients\Client\PetStore\Schema\BlackEyes> $eyes */ - public function __construct(public string $id, public string $name, public array $legs, #[\ApiClients\Client\PetStore\Internal\Attribute\CastUnionToType\Multiple\Schema\Spider\Eyes] public array $eyes) + public function __construct( + public string $id, + public string $name, + public array $legs, + #[\ApiClients\Client\PetStore\Internal\Attribute\CastUnionToType\Multiple\Schema\Spider\Eyes] + public array $eyes + ) { } } diff --git a/tests/app/src/Schema/Tails.php b/tests/app/src/Schema/Tails.php index 459318c..11bd9c6 100644 --- a/tests/app/src/Schema/Tails.php +++ b/tests/app/src/Schema/Tails.php @@ -3,17 +3,9 @@ declare (strict_types=1); namespace ApiClients\Client\PetStore\Schema; -use ApiClients\Client\PetStore\Contract; -use ApiClients\Client\PetStore\Error as ErrorSchemas; -use ApiClients\Client\PetStore\Internal; -use ApiClients\Client\PetStore\Operation; -use ApiClients\Client\PetStore\Schema; -use League\OpenAPIValidation; -use React\Http; -use ApiClients\Contracts; -final readonly class Tails implements Contract\Tails +final readonly class Tails implements \ApiClients\Client\PetStore\Contract\Tails { - public const SCHEMA_JSON = '{ + const string SCHEMA_JSON = '{ "required": [ "count" ], @@ -24,9 +16,9 @@ } } }'; - public const SCHEMA_TITLE = ''; - public const SCHEMA_DESCRIPTION = ''; - public const SCHEMA_EXAMPLE_DATA = '{ + public const string SCHEMA_TITLE = ''; + public const string SCHEMA_DESCRIPTION = ''; + const string SCHEMA_EXAMPLE_DATA = '{ "count": 5 }'; public function __construct(public int $count) diff --git a/tests/app/src/Schema/Wings.php b/tests/app/src/Schema/Wings.php index ad9af16..0d7b4de 100644 --- a/tests/app/src/Schema/Wings.php +++ b/tests/app/src/Schema/Wings.php @@ -3,17 +3,9 @@ declare (strict_types=1); namespace ApiClients\Client\PetStore\Schema; -use ApiClients\Client\PetStore\Contract; -use ApiClients\Client\PetStore\Error as ErrorSchemas; -use ApiClients\Client\PetStore\Internal; -use ApiClients\Client\PetStore\Operation; -use ApiClients\Client\PetStore\Schema; -use League\OpenAPIValidation; -use React\Http; -use ApiClients\Contracts; -final readonly class Wings implements Contract\Wings +final readonly class Wings implements \ApiClients\Client\PetStore\Contract\Wings { - public const SCHEMA_JSON = '{ + const string SCHEMA_JSON = '{ "required": [ "count", "features" @@ -28,9 +20,9 @@ } } }'; - public const SCHEMA_TITLE = ''; - public const SCHEMA_DESCRIPTION = ''; - public const SCHEMA_EXAMPLE_DATA = '{ + public const string SCHEMA_TITLE = ''; + public const string SCHEMA_DESCRIPTION = ''; + const string SCHEMA_EXAMPLE_DATA = '{ "count": 5, "features": 8 }'; diff --git a/tests/app/src/Schema/YellowEyes.php b/tests/app/src/Schema/YellowEyes.php index d3c5356..dd079cc 100644 --- a/tests/app/src/Schema/YellowEyes.php +++ b/tests/app/src/Schema/YellowEyes.php @@ -3,17 +3,9 @@ declare (strict_types=1); namespace ApiClients\Client\PetStore\Schema; -use ApiClients\Client\PetStore\Contract; -use ApiClients\Client\PetStore\Error as ErrorSchemas; -use ApiClients\Client\PetStore\Internal; -use ApiClients\Client\PetStore\Operation; -use ApiClients\Client\PetStore\Schema; -use League\OpenAPIValidation; -use React\Http; -use ApiClients\Contracts; -final readonly class YellowEyes implements Contract\YellowEyes +final readonly class YellowEyes implements \ApiClients\Client\PetStore\Contract\YellowEyes { - public const SCHEMA_JSON = '{ + const string SCHEMA_JSON = '{ "required": [ "count", "type" @@ -31,9 +23,9 @@ } } }'; - public const SCHEMA_TITLE = ''; - public const SCHEMA_DESCRIPTION = ''; - public const SCHEMA_EXAMPLE_DATA = '{ + public const string SCHEMA_TITLE = ''; + public const string SCHEMA_DESCRIPTION = ''; + const string SCHEMA_EXAMPLE_DATA = '{ "count": 5, "type": "snake" }'; diff --git a/tests/app/tests/Internal/Operation/Pets/CreateTest.php b/tests/app/tests/Internal/Operation/Pets/CreateTest.php index cfac119..2716a7b 100644 --- a/tests/app/tests/Internal/Operation/Pets/CreateTest.php +++ b/tests/app/tests/Internal/Operation/Pets/CreateTest.php @@ -3,14 +3,6 @@ declare (strict_types=1); namespace ApiClients\Tests\Client\PetStore\Internal\Operation\Pets; -use ApiClients\Client\PetStore\Contract; -use ApiClients\Client\PetStore\Error as ErrorSchemas; -use ApiClients\Client\PetStore\Internal; -use ApiClients\Client\PetStore\Operation; -use ApiClients\Client\PetStore\Schema; -use League\OpenAPIValidation; -use React\Http; -use ApiClients\Contracts; /** * @covers \ApiClients\Client\PetStore\Internal\Operation\Pets\Create */ @@ -21,64 +13,64 @@ final class CreateTest extends \WyriHaximus\AsyncTestUtilities\AsyncTestCase */ public function call_httpCode_default_requestContentType_application_json_responseContentType_application_json_zero() { - $response = new \React\Http\Message\Response(999, array('Content-Type' => 'application/json'), json_encode(json_decode(Schema\Error::SCHEMA_EXAMPLE_DATA, true))); + $response = new \React\Http\Message\Response(999, ['Content-Type' => 'application/json'], json_encode(json_decode(\ApiClients\Client\PetStore\Schema\Error::SCHEMA_EXAMPLE_DATA, true))); $auth = $this->prophesize(\ApiClients\Contracts\HTTP\Headers\AuthenticationInterface::class); $auth->authHeader(\Prophecy\Argument::any())->willReturn('Bearer beer')->shouldBeCalled(); $browser = $this->prophesize(\React\Http\Browser::class); $browser->withBase(\Prophecy\Argument::any())->willReturn($browser->reveal()); $browser->withFollowRedirects(\Prophecy\Argument::any())->willReturn($browser->reveal()); - $browser->request('POST', '/pets', \Prophecy\Argument::type('array'), json_encode(json_decode(Schema\Pets\Create\Request\ApplicationJson::SCHEMA_EXAMPLE_DATA, true)))->willReturn(\React\Promise\resolve($response))->shouldBeCalled(); + $browser->request('POST', '/pets', \Prophecy\Argument::type('array'), json_encode(json_decode(\ApiClients\Client\PetStore\Schema\Pets\Create\Request\ApplicationJson::SCHEMA_EXAMPLE_DATA, true)))->willReturn(\React\Promise\resolve($response))->shouldBeCalled(); $client = new \ApiClients\Client\PetStore\Client($auth->reveal(), $browser->reveal()); - $result = $client->call(Internal\Operation\Pets\Create::OPERATION_MATCH, (static function (array $data) : array { + $result = $client->call(\ApiClients\Client\PetStore\Internal\Operation\Pets\Create::OPERATION_MATCH, (static function (array $data): array { return $data; - })(json_decode(Schema\Pets\Create\Request\ApplicationJson::SCHEMA_EXAMPLE_DATA, true))); + })(json_decode(\ApiClients\Client\PetStore\Schema\Pets\Create\Request\ApplicationJson::SCHEMA_EXAMPLE_DATA, true))); } /** * @test */ public function operations_httpCode_default_requestContentType_application_json_responseContentType_application_json_zero() { - $response = new \React\Http\Message\Response(999, array('Content-Type' => 'application/json'), json_encode(json_decode(Schema\Error::SCHEMA_EXAMPLE_DATA, true))); + $response = new \React\Http\Message\Response(999, ['Content-Type' => 'application/json'], json_encode(json_decode(\ApiClients\Client\PetStore\Schema\Error::SCHEMA_EXAMPLE_DATA, true))); $auth = $this->prophesize(\ApiClients\Contracts\HTTP\Headers\AuthenticationInterface::class); $auth->authHeader(\Prophecy\Argument::any())->willReturn('Bearer beer')->shouldBeCalled(); $browser = $this->prophesize(\React\Http\Browser::class); $browser->withBase(\Prophecy\Argument::any())->willReturn($browser->reveal()); $browser->withFollowRedirects(\Prophecy\Argument::any())->willReturn($browser->reveal()); - $browser->request('POST', '/pets', \Prophecy\Argument::type('array'), json_encode(json_decode(Schema\Pets\Create\Request\ApplicationJson::SCHEMA_EXAMPLE_DATA, true)))->willReturn(\React\Promise\resolve($response))->shouldBeCalled(); + $browser->request('POST', '/pets', \Prophecy\Argument::type('array'), json_encode(json_decode(\ApiClients\Client\PetStore\Schema\Pets\Create\Request\ApplicationJson::SCHEMA_EXAMPLE_DATA, true)))->willReturn(\React\Promise\resolve($response))->shouldBeCalled(); $client = new \ApiClients\Client\PetStore\Client($auth->reveal(), $browser->reveal()); - $result = $client->operations()->pets()->create(json_decode(Schema\Pets\Create\Request\ApplicationJson::SCHEMA_EXAMPLE_DATA, true)); + $result = $client->operations()->pets()->create(json_decode(\ApiClients\Client\PetStore\Schema\Pets\Create\Request\ApplicationJson::SCHEMA_EXAMPLE_DATA, true)); } /** * @test */ public function call_httpCode_201_requestContentType_application_json_empty() { - $response = new \React\Http\Message\Response(201, array()); + $response = new \React\Http\Message\Response(201, []); $auth = $this->prophesize(\ApiClients\Contracts\HTTP\Headers\AuthenticationInterface::class); $auth->authHeader(\Prophecy\Argument::any())->willReturn('Bearer beer')->shouldBeCalled(); $browser = $this->prophesize(\React\Http\Browser::class); $browser->withBase(\Prophecy\Argument::any())->willReturn($browser->reveal()); $browser->withFollowRedirects(\Prophecy\Argument::any())->willReturn($browser->reveal()); - $browser->request('POST', '/pets', \Prophecy\Argument::type('array'), json_encode(json_decode(Schema\Pets\Create\Request\ApplicationJson::SCHEMA_EXAMPLE_DATA, true)))->willReturn(\React\Promise\resolve($response))->shouldBeCalled(); + $browser->request('POST', '/pets', \Prophecy\Argument::type('array'), json_encode(json_decode(\ApiClients\Client\PetStore\Schema\Pets\Create\Request\ApplicationJson::SCHEMA_EXAMPLE_DATA, true)))->willReturn(\React\Promise\resolve($response))->shouldBeCalled(); $client = new \ApiClients\Client\PetStore\Client($auth->reveal(), $browser->reveal()); - $result = $client->call(Internal\Operation\Pets\Create::OPERATION_MATCH, (static function (array $data) : array { + $result = $client->call(\ApiClients\Client\PetStore\Internal\Operation\Pets\Create::OPERATION_MATCH, (static function (array $data): array { return $data; - })(json_decode(Schema\Pets\Create\Request\ApplicationJson::SCHEMA_EXAMPLE_DATA, true))); + })(json_decode(\ApiClients\Client\PetStore\Schema\Pets\Create\Request\ApplicationJson::SCHEMA_EXAMPLE_DATA, true))); } /** * @test */ public function operations_httpCode_201_requestContentType_application_json_empty() { - $response = new \React\Http\Message\Response(201, array()); + $response = new \React\Http\Message\Response(201, []); $auth = $this->prophesize(\ApiClients\Contracts\HTTP\Headers\AuthenticationInterface::class); $auth->authHeader(\Prophecy\Argument::any())->willReturn('Bearer beer')->shouldBeCalled(); $browser = $this->prophesize(\React\Http\Browser::class); $browser->withBase(\Prophecy\Argument::any())->willReturn($browser->reveal()); $browser->withFollowRedirects(\Prophecy\Argument::any())->willReturn($browser->reveal()); - $browser->request('POST', '/pets', \Prophecy\Argument::type('array'), json_encode(json_decode(Schema\Pets\Create\Request\ApplicationJson::SCHEMA_EXAMPLE_DATA, true)))->willReturn(\React\Promise\resolve($response))->shouldBeCalled(); + $browser->request('POST', '/pets', \Prophecy\Argument::type('array'), json_encode(json_decode(\ApiClients\Client\PetStore\Schema\Pets\Create\Request\ApplicationJson::SCHEMA_EXAMPLE_DATA, true)))->willReturn(\React\Promise\resolve($response))->shouldBeCalled(); $client = new \ApiClients\Client\PetStore\Client($auth->reveal(), $browser->reveal()); - $result = $client->operations()->pets()->create(json_decode(Schema\Pets\Create\Request\ApplicationJson::SCHEMA_EXAMPLE_DATA, true)); + $result = $client->operations()->pets()->create(json_decode(\ApiClients\Client\PetStore\Schema\Pets\Create\Request\ApplicationJson::SCHEMA_EXAMPLE_DATA, true)); self::assertArrayHasKey('code', $result); self::assertSame(201, $result['code']); } diff --git a/tests/app/tests/Internal/Operation/Pets/Grouped/By/TypeTest.php b/tests/app/tests/Internal/Operation/Pets/Grouped/By/TypeTest.php index bc013ee..3612acf 100644 --- a/tests/app/tests/Internal/Operation/Pets/Grouped/By/TypeTest.php +++ b/tests/app/tests/Internal/Operation/Pets/Grouped/By/TypeTest.php @@ -3,14 +3,6 @@ declare (strict_types=1); namespace ApiClients\Tests\Client\PetStore\Internal\Operation\Pets\Grouped\By; -use ApiClients\Client\PetStore\Contract; -use ApiClients\Client\PetStore\Error as ErrorSchemas; -use ApiClients\Client\PetStore\Internal; -use ApiClients\Client\PetStore\Operation; -use ApiClients\Client\PetStore\Schema; -use League\OpenAPIValidation; -use React\Http; -use ApiClients\Contracts; /** * @covers \ApiClients\Client\PetStore\Internal\Operation\Pets\Grouped\By\Type */ @@ -21,7 +13,7 @@ final class TypeTest extends \WyriHaximus\AsyncTestUtilities\AsyncTestCase */ public function call_httpCode_200_responseContentType_application_json_zero() { - $response = new \React\Http\Message\Response(200, array('Content-Type' => 'application/json'), json_encode(json_decode(Schema\Operations\Pets\Grouped\By\Type\Response\ApplicationJson\Ok::SCHEMA_EXAMPLE_DATA, true))); + $response = new \React\Http\Message\Response(200, ['Content-Type' => 'application/json'], json_encode(json_decode(\ApiClients\Client\PetStore\Schema\Operations\Pets\Grouped\By\Type\Response\ApplicationJson\Ok::SCHEMA_EXAMPLE_DATA, true))); $auth = $this->prophesize(\ApiClients\Contracts\HTTP\Headers\AuthenticationInterface::class); $auth->authHeader(\Prophecy\Argument::any())->willReturn('Bearer beer')->shouldBeCalled(); $browser = $this->prophesize(\React\Http\Browser::class); @@ -29,18 +21,18 @@ public function call_httpCode_200_responseContentType_application_json_zero() $browser->withFollowRedirects(\Prophecy\Argument::any())->willReturn($browser->reveal()); $browser->request('GET', '/pets/groupedByType?page=1&per_page=8', \Prophecy\Argument::type('array'), \Prophecy\Argument::any())->willReturn(\React\Promise\resolve($response))->shouldBeCalled(); $client = new \ApiClients\Client\PetStore\Client($auth->reveal(), $browser->reveal()); - $result = $client->call(Internal\Operation\Pets\Grouped\By\Type::OPERATION_MATCH, (static function (array $data) : array { + $result = $client->call(\ApiClients\Client\PetStore\Internal\Operation\Pets\Grouped\By\Type::OPERATION_MATCH, (static function (array $data): array { $data['per_page'] = 8; $data['page'] = 1; return $data; - })(array())); + })([])); } /** * @test */ public function operations_httpCode_200_responseContentType_application_json_zero() { - $response = new \React\Http\Message\Response(200, array('Content-Type' => 'application/json'), json_encode(json_decode(Schema\Operations\Pets\Grouped\By\Type\Response\ApplicationJson\Ok::SCHEMA_EXAMPLE_DATA, true))); + $response = new \React\Http\Message\Response(200, ['Content-Type' => 'application/json'], json_encode(json_decode(\ApiClients\Client\PetStore\Schema\Operations\Pets\Grouped\By\Type\Response\ApplicationJson\Ok::SCHEMA_EXAMPLE_DATA, true))); $auth = $this->prophesize(\ApiClients\Contracts\HTTP\Headers\AuthenticationInterface::class); $auth->authHeader(\Prophecy\Argument::any())->willReturn('Bearer beer')->shouldBeCalled(); $browser = $this->prophesize(\React\Http\Browser::class); @@ -55,7 +47,7 @@ public function operations_httpCode_200_responseContentType_application_json_zer */ public function call_httpCode_default_responseContentType_application_json_zero() { - $response = new \React\Http\Message\Response(999, array('Content-Type' => 'application/json'), json_encode(json_decode(Schema\Error::SCHEMA_EXAMPLE_DATA, true))); + $response = new \React\Http\Message\Response(999, ['Content-Type' => 'application/json'], json_encode(json_decode(\ApiClients\Client\PetStore\Schema\Error::SCHEMA_EXAMPLE_DATA, true))); $auth = $this->prophesize(\ApiClients\Contracts\HTTP\Headers\AuthenticationInterface::class); $auth->authHeader(\Prophecy\Argument::any())->willReturn('Bearer beer')->shouldBeCalled(); $browser = $this->prophesize(\React\Http\Browser::class); @@ -63,18 +55,18 @@ public function call_httpCode_default_responseContentType_application_json_zero( $browser->withFollowRedirects(\Prophecy\Argument::any())->willReturn($browser->reveal()); $browser->request('GET', '/pets/groupedByType?page=1&per_page=8', \Prophecy\Argument::type('array'), \Prophecy\Argument::any())->willReturn(\React\Promise\resolve($response))->shouldBeCalled(); $client = new \ApiClients\Client\PetStore\Client($auth->reveal(), $browser->reveal()); - $result = $client->call(Internal\Operation\Pets\Grouped\By\Type::OPERATION_MATCH, (static function (array $data) : array { + $result = $client->call(\ApiClients\Client\PetStore\Internal\Operation\Pets\Grouped\By\Type::OPERATION_MATCH, (static function (array $data): array { $data['per_page'] = 8; $data['page'] = 1; return $data; - })(array())); + })([])); } /** * @test */ public function operations_httpCode_default_responseContentType_application_json_zero() { - $response = new \React\Http\Message\Response(999, array('Content-Type' => 'application/json'), json_encode(json_decode(Schema\Error::SCHEMA_EXAMPLE_DATA, true))); + $response = new \React\Http\Message\Response(999, ['Content-Type' => 'application/json'], json_encode(json_decode(\ApiClients\Client\PetStore\Schema\Error::SCHEMA_EXAMPLE_DATA, true))); $auth = $this->prophesize(\ApiClients\Contracts\HTTP\Headers\AuthenticationInterface::class); $auth->authHeader(\Prophecy\Argument::any())->willReturn('Bearer beer')->shouldBeCalled(); $browser = $this->prophesize(\React\Http\Browser::class); diff --git a/tests/app/tests/Internal/Operation/Pets/Kinds/WalkingListingTest.php b/tests/app/tests/Internal/Operation/Pets/Kinds/WalkingListingTest.php deleted file mode 100644 index e43ab64..0000000 --- a/tests/app/tests/Internal/Operation/Pets/Kinds/WalkingListingTest.php +++ /dev/null @@ -1,57 +0,0 @@ - 'application/json'), json_encode(json_decode(Schema\Error::SCHEMA_EXAMPLE_DATA, true))); - $auth = $this->prophesize(\ApiClients\Contracts\HTTP\Headers\AuthenticationInterface::class); - $auth->authHeader(\Prophecy\Argument::any())->willReturn('Bearer beer')->shouldBeCalled(); - $browser = $this->prophesize(\React\Http\Browser::class); - $browser->withBase(\Prophecy\Argument::any())->willReturn($browser->reveal()); - $browser->withFollowRedirects(\Prophecy\Argument::any())->willReturn($browser->reveal()); - $browser->request('GET', '/pets/kinds/walking?page=1&per_page=8', \Prophecy\Argument::type('array'), \Prophecy\Argument::any())->willReturn(\React\Promise\resolve($response))->shouldBeCalled(); - $client = new \ApiClients\Client\PetStore\Client($auth->reveal(), $browser->reveal()); - $result = $client->call(Internal\Operation\Pets\Kinds\WalkingListing::OPERATION_MATCH, (static function (array $data) : array { - $data['per_page'] = 8; - $data['page'] = 1; - return $data; - })(array())); - foreach ($result as $item) { - } - } - /** - * @test - */ - public function operations_httpCode_default_responseContentType_application_json_zero() - { - $response = new \React\Http\Message\Response(999, array('Content-Type' => 'application/json'), json_encode(json_decode(Schema\Error::SCHEMA_EXAMPLE_DATA, true))); - $auth = $this->prophesize(\ApiClients\Contracts\HTTP\Headers\AuthenticationInterface::class); - $auth->authHeader(\Prophecy\Argument::any())->willReturn('Bearer beer')->shouldBeCalled(); - $browser = $this->prophesize(\React\Http\Browser::class); - $browser->withBase(\Prophecy\Argument::any())->willReturn($browser->reveal()); - $browser->withFollowRedirects(\Prophecy\Argument::any())->willReturn($browser->reveal()); - $browser->request('GET', '/pets/kinds/walking?page=1&per_page=8', \Prophecy\Argument::type('array'), \Prophecy\Argument::any())->willReturn(\React\Promise\resolve($response))->shouldBeCalled(); - $client = new \ApiClients\Client\PetStore\Client($auth->reveal(), $browser->reveal()); - $result = $client->operations()->petsKinds()->walkingListing(8, 1); - foreach ($result as $item) { - } - } -} diff --git a/tests/app/tests/Internal/Operation/Pets/Kinds/WalkingTest.php b/tests/app/tests/Internal/Operation/Pets/Kinds/WalkingTest.php index 54a7dce..d7545eb 100644 --- a/tests/app/tests/Internal/Operation/Pets/Kinds/WalkingTest.php +++ b/tests/app/tests/Internal/Operation/Pets/Kinds/WalkingTest.php @@ -3,25 +3,85 @@ declare (strict_types=1); namespace ApiClients\Tests\Client\PetStore\Internal\Operation\Pets\Kinds; -use ApiClients\Client\PetStore\Contract; -use ApiClients\Client\PetStore\Error as ErrorSchemas; -use ApiClients\Client\PetStore\Internal; -use ApiClients\Client\PetStore\Operation; -use ApiClients\Client\PetStore\Schema; -use League\OpenAPIValidation; -use React\Http; -use ApiClients\Contracts; /** * @covers \ApiClients\Client\PetStore\Internal\Operation\Pets\Kinds\Walking */ final class WalkingTest extends \WyriHaximus\AsyncTestUtilities\AsyncTestCase { + /** + * @test + */ + public function call_httpCode_200_responseContentType_application_json_zero() + { + $response = new \React\Http\Message\Response(200, ['Content-Type' => 'application/json'], \json_decode('[]', false)); + $auth = $this->prophesize(\ApiClients\Contracts\HTTP\Headers\AuthenticationInterface::class); + $auth->authHeader(\Prophecy\Argument::any())->willReturn('Bearer beer')->shouldBeCalled(); + $browser = $this->prophesize(\React\Http\Browser::class); + $browser->withBase(\Prophecy\Argument::any())->willReturn($browser->reveal()); + $browser->withFollowRedirects(\Prophecy\Argument::any())->willReturn($browser->reveal()); + $browser->request('GET', '/pets/kinds/walking?page=1&per_page=8', \Prophecy\Argument::type('array'), \Prophecy\Argument::any())->willReturn(\React\Promise\resolve($response))->shouldBeCalled(); + $client = new \ApiClients\Client\PetStore\Client($auth->reveal(), $browser->reveal()); + $result = $client->call(\ApiClients\Client\PetStore\Internal\Operation\Pets\Kinds\Walking::OPERATION_MATCH, (static function (array $data): array { + $data['per_page'] = 8; + $data['page'] = 1; + return $data; + })([])); + } + /** + * @test + */ + public function operations_httpCode_200_responseContentType_application_json_zero() + { + $response = new \React\Http\Message\Response(200, ['Content-Type' => 'application/json'], \json_decode('[]', false)); + $auth = $this->prophesize(\ApiClients\Contracts\HTTP\Headers\AuthenticationInterface::class); + $auth->authHeader(\Prophecy\Argument::any())->willReturn('Bearer beer')->shouldBeCalled(); + $browser = $this->prophesize(\React\Http\Browser::class); + $browser->withBase(\Prophecy\Argument::any())->willReturn($browser->reveal()); + $browser->withFollowRedirects(\Prophecy\Argument::any())->willReturn($browser->reveal()); + $browser->request('GET', '/pets/kinds/walking?page=1&per_page=8', \Prophecy\Argument::type('array'), \Prophecy\Argument::any())->willReturn(\React\Promise\resolve($response))->shouldBeCalled(); + $client = new \ApiClients\Client\PetStore\Client($auth->reveal(), $browser->reveal()); + $result = $client->operations()->petsKinds()->walking(8, 1); + } + /** + * @test + */ + public function call_httpCode_200_responseContentType_application_json_one() + { + $response = new \React\Http\Message\Response(200, ['Content-Type' => 'application/json'], \json_decode('[]', false)); + $auth = $this->prophesize(\ApiClients\Contracts\HTTP\Headers\AuthenticationInterface::class); + $auth->authHeader(\Prophecy\Argument::any())->willReturn('Bearer beer')->shouldBeCalled(); + $browser = $this->prophesize(\React\Http\Browser::class); + $browser->withBase(\Prophecy\Argument::any())->willReturn($browser->reveal()); + $browser->withFollowRedirects(\Prophecy\Argument::any())->willReturn($browser->reveal()); + $browser->request('GET', '/pets/kinds/walking?page=1&per_page=8', \Prophecy\Argument::type('array'), \Prophecy\Argument::any())->willReturn(\React\Promise\resolve($response))->shouldBeCalled(); + $client = new \ApiClients\Client\PetStore\Client($auth->reveal(), $browser->reveal()); + $result = $client->call(\ApiClients\Client\PetStore\Internal\Operation\Pets\Kinds\Walking::OPERATION_MATCH, (static function (array $data): array { + $data['per_page'] = 8; + $data['page'] = 1; + return $data; + })([])); + } + /** + * @test + */ + public function operations_httpCode_200_responseContentType_application_json_one() + { + $response = new \React\Http\Message\Response(200, ['Content-Type' => 'application/json'], \json_decode('[]', false)); + $auth = $this->prophesize(\ApiClients\Contracts\HTTP\Headers\AuthenticationInterface::class); + $auth->authHeader(\Prophecy\Argument::any())->willReturn('Bearer beer')->shouldBeCalled(); + $browser = $this->prophesize(\React\Http\Browser::class); + $browser->withBase(\Prophecy\Argument::any())->willReturn($browser->reveal()); + $browser->withFollowRedirects(\Prophecy\Argument::any())->willReturn($browser->reveal()); + $browser->request('GET', '/pets/kinds/walking?page=1&per_page=8', \Prophecy\Argument::type('array'), \Prophecy\Argument::any())->willReturn(\React\Promise\resolve($response))->shouldBeCalled(); + $client = new \ApiClients\Client\PetStore\Client($auth->reveal(), $browser->reveal()); + $result = $client->operations()->petsKinds()->walking(8, 1); + } /** * @test */ public function call_httpCode_default_responseContentType_application_json_zero() { - $response = new \React\Http\Message\Response(999, array('Content-Type' => 'application/json'), json_encode(json_decode(Schema\Error::SCHEMA_EXAMPLE_DATA, true))); + $response = new \React\Http\Message\Response(999, ['Content-Type' => 'application/json'], json_encode(json_decode(\ApiClients\Client\PetStore\Schema\Error::SCHEMA_EXAMPLE_DATA, true))); $auth = $this->prophesize(\ApiClients\Contracts\HTTP\Headers\AuthenticationInterface::class); $auth->authHeader(\Prophecy\Argument::any())->willReturn('Bearer beer')->shouldBeCalled(); $browser = $this->prophesize(\React\Http\Browser::class); @@ -29,18 +89,18 @@ public function call_httpCode_default_responseContentType_application_json_zero( $browser->withFollowRedirects(\Prophecy\Argument::any())->willReturn($browser->reveal()); $browser->request('GET', '/pets/kinds/walking?page=1&per_page=8', \Prophecy\Argument::type('array'), \Prophecy\Argument::any())->willReturn(\React\Promise\resolve($response))->shouldBeCalled(); $client = new \ApiClients\Client\PetStore\Client($auth->reveal(), $browser->reveal()); - $result = $client->call(Internal\Operation\Pets\Kinds\Walking::OPERATION_MATCH, (static function (array $data) : array { + $result = $client->call(\ApiClients\Client\PetStore\Internal\Operation\Pets\Kinds\Walking::OPERATION_MATCH, (static function (array $data): array { $data['per_page'] = 8; $data['page'] = 1; return $data; - })(array())); + })([])); } /** * @test */ public function operations_httpCode_default_responseContentType_application_json_zero() { - $response = new \React\Http\Message\Response(999, array('Content-Type' => 'application/json'), json_encode(json_decode(Schema\Error::SCHEMA_EXAMPLE_DATA, true))); + $response = new \React\Http\Message\Response(999, ['Content-Type' => 'application/json'], json_encode(json_decode(\ApiClients\Client\PetStore\Schema\Error::SCHEMA_EXAMPLE_DATA, true))); $auth = $this->prophesize(\ApiClients\Contracts\HTTP\Headers\AuthenticationInterface::class); $auth->authHeader(\Prophecy\Argument::any())->willReturn('Bearer beer')->shouldBeCalled(); $browser = $this->prophesize(\React\Http\Browser::class); diff --git a/tests/app/tests/Internal/Operation/Pets/ListListingTest.php b/tests/app/tests/Internal/Operation/Pets/ListListingTest.php deleted file mode 100644 index 22eeed4..0000000 --- a/tests/app/tests/Internal/Operation/Pets/ListListingTest.php +++ /dev/null @@ -1,57 +0,0 @@ - 'application/json'), json_encode(json_decode(Schema\Error::SCHEMA_EXAMPLE_DATA, true))); - $auth = $this->prophesize(\ApiClients\Contracts\HTTP\Headers\AuthenticationInterface::class); - $auth->authHeader(\Prophecy\Argument::any())->willReturn('Bearer beer')->shouldBeCalled(); - $browser = $this->prophesize(\React\Http\Browser::class); - $browser->withBase(\Prophecy\Argument::any())->willReturn($browser->reveal()); - $browser->withFollowRedirects(\Prophecy\Argument::any())->willReturn($browser->reveal()); - $browser->request('GET', '/pets?page=1&per_page=8', \Prophecy\Argument::type('array'), \Prophecy\Argument::any())->willReturn(\React\Promise\resolve($response))->shouldBeCalled(); - $client = new \ApiClients\Client\PetStore\Client($auth->reveal(), $browser->reveal()); - $result = $client->call(Internal\Operation\Pets\ListListing::OPERATION_MATCH, (static function (array $data) : array { - $data['per_page'] = 8; - $data['page'] = 1; - return $data; - })(array())); - foreach ($result as $item) { - } - } - /** - * @test - */ - public function operations_httpCode_default_responseContentType_application_json_zero() - { - $response = new \React\Http\Message\Response(999, array('Content-Type' => 'application/json'), json_encode(json_decode(Schema\Error::SCHEMA_EXAMPLE_DATA, true))); - $auth = $this->prophesize(\ApiClients\Contracts\HTTP\Headers\AuthenticationInterface::class); - $auth->authHeader(\Prophecy\Argument::any())->willReturn('Bearer beer')->shouldBeCalled(); - $browser = $this->prophesize(\React\Http\Browser::class); - $browser->withBase(\Prophecy\Argument::any())->willReturn($browser->reveal()); - $browser->withFollowRedirects(\Prophecy\Argument::any())->willReturn($browser->reveal()); - $browser->request('GET', '/pets?page=1&per_page=8', \Prophecy\Argument::type('array'), \Prophecy\Argument::any())->willReturn(\React\Promise\resolve($response))->shouldBeCalled(); - $client = new \ApiClients\Client\PetStore\Client($auth->reveal(), $browser->reveal()); - $result = $client->operations()->pets()->listListing(8, 1); - foreach ($result as $item) { - } - } -} diff --git a/tests/app/tests/Internal/Operation/Pets/List_/GatosListingTest.php b/tests/app/tests/Internal/Operation/Pets/List_/GatosListingTest.php deleted file mode 100644 index a100ada..0000000 --- a/tests/app/tests/Internal/Operation/Pets/List_/GatosListingTest.php +++ /dev/null @@ -1,57 +0,0 @@ - 'application/json'), json_encode(json_decode(Schema\Error::SCHEMA_EXAMPLE_DATA, true))); - $auth = $this->prophesize(\ApiClients\Contracts\HTTP\Headers\AuthenticationInterface::class); - $auth->authHeader(\Prophecy\Argument::any())->willReturn('Bearer beer')->shouldBeCalled(); - $browser = $this->prophesize(\React\Http\Browser::class); - $browser->withBase(\Prophecy\Argument::any())->willReturn($browser->reveal()); - $browser->withFollowRedirects(\Prophecy\Argument::any())->willReturn($browser->reveal()); - $browser->request('GET', '/pets/gatos?page=1&per_page=8', \Prophecy\Argument::type('array'), \Prophecy\Argument::any())->willReturn(\React\Promise\resolve($response))->shouldBeCalled(); - $client = new \ApiClients\Client\PetStore\Client($auth->reveal(), $browser->reveal()); - $result = $client->call(Internal\Operation\Pets\List_\GatosListing::OPERATION_MATCH, (static function (array $data) : array { - $data['per_page'] = 8; - $data['page'] = 1; - return $data; - })(array())); - foreach ($result as $item) { - } - } - /** - * @test - */ - public function operations_httpCode_default_responseContentType_application_json_zero() - { - $response = new \React\Http\Message\Response(999, array('Content-Type' => 'application/json'), json_encode(json_decode(Schema\Error::SCHEMA_EXAMPLE_DATA, true))); - $auth = $this->prophesize(\ApiClients\Contracts\HTTP\Headers\AuthenticationInterface::class); - $auth->authHeader(\Prophecy\Argument::any())->willReturn('Bearer beer')->shouldBeCalled(); - $browser = $this->prophesize(\React\Http\Browser::class); - $browser->withBase(\Prophecy\Argument::any())->willReturn($browser->reveal()); - $browser->withFollowRedirects(\Prophecy\Argument::any())->willReturn($browser->reveal()); - $browser->request('GET', '/pets/gatos?page=1&per_page=8', \Prophecy\Argument::type('array'), \Prophecy\Argument::any())->willReturn(\React\Promise\resolve($response))->shouldBeCalled(); - $client = new \ApiClients\Client\PetStore\Client($auth->reveal(), $browser->reveal()); - $result = $client->operations()->petsList()->gatosListing(8, 1); - foreach ($result as $item) { - } - } -} diff --git a/tests/app/tests/Internal/Operation/Pets/List_/GatosTest.php b/tests/app/tests/Internal/Operation/Pets/List_/GatosTest.php index ff4d3a5..35cd6c7 100644 --- a/tests/app/tests/Internal/Operation/Pets/List_/GatosTest.php +++ b/tests/app/tests/Internal/Operation/Pets/List_/GatosTest.php @@ -3,25 +3,85 @@ declare (strict_types=1); namespace ApiClients\Tests\Client\PetStore\Internal\Operation\Pets\List_; -use ApiClients\Client\PetStore\Contract; -use ApiClients\Client\PetStore\Error as ErrorSchemas; -use ApiClients\Client\PetStore\Internal; -use ApiClients\Client\PetStore\Operation; -use ApiClients\Client\PetStore\Schema; -use League\OpenAPIValidation; -use React\Http; -use ApiClients\Contracts; /** * @covers \ApiClients\Client\PetStore\Internal\Operation\Pets\List_\Gatos */ final class GatosTest extends \WyriHaximus\AsyncTestUtilities\AsyncTestCase { + /** + * @test + */ + public function call_httpCode_200_responseContentType_application_json_zero() + { + $response = new \React\Http\Message\Response(200, ['Content-Type' => 'application/json'], \json_decode('[]', false)); + $auth = $this->prophesize(\ApiClients\Contracts\HTTP\Headers\AuthenticationInterface::class); + $auth->authHeader(\Prophecy\Argument::any())->willReturn('Bearer beer')->shouldBeCalled(); + $browser = $this->prophesize(\React\Http\Browser::class); + $browser->withBase(\Prophecy\Argument::any())->willReturn($browser->reveal()); + $browser->withFollowRedirects(\Prophecy\Argument::any())->willReturn($browser->reveal()); + $browser->request('GET', '/pets/gatos?page=1&per_page=8', \Prophecy\Argument::type('array'), \Prophecy\Argument::any())->willReturn(\React\Promise\resolve($response))->shouldBeCalled(); + $client = new \ApiClients\Client\PetStore\Client($auth->reveal(), $browser->reveal()); + $result = $client->call(\ApiClients\Client\PetStore\Internal\Operation\Pets\List_\Gatos::OPERATION_MATCH, (static function (array $data): array { + $data['per_page'] = 8; + $data['page'] = 1; + return $data; + })([])); + } + /** + * @test + */ + public function operations_httpCode_200_responseContentType_application_json_zero() + { + $response = new \React\Http\Message\Response(200, ['Content-Type' => 'application/json'], \json_decode('[]', false)); + $auth = $this->prophesize(\ApiClients\Contracts\HTTP\Headers\AuthenticationInterface::class); + $auth->authHeader(\Prophecy\Argument::any())->willReturn('Bearer beer')->shouldBeCalled(); + $browser = $this->prophesize(\React\Http\Browser::class); + $browser->withBase(\Prophecy\Argument::any())->willReturn($browser->reveal()); + $browser->withFollowRedirects(\Prophecy\Argument::any())->willReturn($browser->reveal()); + $browser->request('GET', '/pets/gatos?page=1&per_page=8', \Prophecy\Argument::type('array'), \Prophecy\Argument::any())->willReturn(\React\Promise\resolve($response))->shouldBeCalled(); + $client = new \ApiClients\Client\PetStore\Client($auth->reveal(), $browser->reveal()); + $result = $client->operations()->petsList()->gatos(8, 1); + } + /** + * @test + */ + public function call_httpCode_200_responseContentType_application_json_one() + { + $response = new \React\Http\Message\Response(200, ['Content-Type' => 'application/json'], \json_decode('[]', false)); + $auth = $this->prophesize(\ApiClients\Contracts\HTTP\Headers\AuthenticationInterface::class); + $auth->authHeader(\Prophecy\Argument::any())->willReturn('Bearer beer')->shouldBeCalled(); + $browser = $this->prophesize(\React\Http\Browser::class); + $browser->withBase(\Prophecy\Argument::any())->willReturn($browser->reveal()); + $browser->withFollowRedirects(\Prophecy\Argument::any())->willReturn($browser->reveal()); + $browser->request('GET', '/pets/gatos?page=1&per_page=8', \Prophecy\Argument::type('array'), \Prophecy\Argument::any())->willReturn(\React\Promise\resolve($response))->shouldBeCalled(); + $client = new \ApiClients\Client\PetStore\Client($auth->reveal(), $browser->reveal()); + $result = $client->call(\ApiClients\Client\PetStore\Internal\Operation\Pets\List_\Gatos::OPERATION_MATCH, (static function (array $data): array { + $data['per_page'] = 8; + $data['page'] = 1; + return $data; + })([])); + } + /** + * @test + */ + public function operations_httpCode_200_responseContentType_application_json_one() + { + $response = new \React\Http\Message\Response(200, ['Content-Type' => 'application/json'], \json_decode('[]', false)); + $auth = $this->prophesize(\ApiClients\Contracts\HTTP\Headers\AuthenticationInterface::class); + $auth->authHeader(\Prophecy\Argument::any())->willReturn('Bearer beer')->shouldBeCalled(); + $browser = $this->prophesize(\React\Http\Browser::class); + $browser->withBase(\Prophecy\Argument::any())->willReturn($browser->reveal()); + $browser->withFollowRedirects(\Prophecy\Argument::any())->willReturn($browser->reveal()); + $browser->request('GET', '/pets/gatos?page=1&per_page=8', \Prophecy\Argument::type('array'), \Prophecy\Argument::any())->willReturn(\React\Promise\resolve($response))->shouldBeCalled(); + $client = new \ApiClients\Client\PetStore\Client($auth->reveal(), $browser->reveal()); + $result = $client->operations()->petsList()->gatos(8, 1); + } /** * @test */ public function call_httpCode_default_responseContentType_application_json_zero() { - $response = new \React\Http\Message\Response(999, array('Content-Type' => 'application/json'), json_encode(json_decode(Schema\Error::SCHEMA_EXAMPLE_DATA, true))); + $response = new \React\Http\Message\Response(999, ['Content-Type' => 'application/json'], json_encode(json_decode(\ApiClients\Client\PetStore\Schema\Error::SCHEMA_EXAMPLE_DATA, true))); $auth = $this->prophesize(\ApiClients\Contracts\HTTP\Headers\AuthenticationInterface::class); $auth->authHeader(\Prophecy\Argument::any())->willReturn('Bearer beer')->shouldBeCalled(); $browser = $this->prophesize(\React\Http\Browser::class); @@ -29,18 +89,18 @@ public function call_httpCode_default_responseContentType_application_json_zero( $browser->withFollowRedirects(\Prophecy\Argument::any())->willReturn($browser->reveal()); $browser->request('GET', '/pets/gatos?page=1&per_page=8', \Prophecy\Argument::type('array'), \Prophecy\Argument::any())->willReturn(\React\Promise\resolve($response))->shouldBeCalled(); $client = new \ApiClients\Client\PetStore\Client($auth->reveal(), $browser->reveal()); - $result = $client->call(Internal\Operation\Pets\List_\Gatos::OPERATION_MATCH, (static function (array $data) : array { + $result = $client->call(\ApiClients\Client\PetStore\Internal\Operation\Pets\List_\Gatos::OPERATION_MATCH, (static function (array $data): array { $data['per_page'] = 8; $data['page'] = 1; return $data; - })(array())); + })([])); } /** * @test */ public function operations_httpCode_default_responseContentType_application_json_zero() { - $response = new \React\Http\Message\Response(999, array('Content-Type' => 'application/json'), json_encode(json_decode(Schema\Error::SCHEMA_EXAMPLE_DATA, true))); + $response = new \React\Http\Message\Response(999, ['Content-Type' => 'application/json'], json_encode(json_decode(\ApiClients\Client\PetStore\Schema\Error::SCHEMA_EXAMPLE_DATA, true))); $auth = $this->prophesize(\ApiClients\Contracts\HTTP\Headers\AuthenticationInterface::class); $auth->authHeader(\Prophecy\Argument::any())->willReturn('Bearer beer')->shouldBeCalled(); $browser = $this->prophesize(\React\Http\Browser::class); diff --git a/tests/app/tests/Internal/Operation/Pets/List_Test.php b/tests/app/tests/Internal/Operation/Pets/List_Test.php index 03ebd92..cc95c66 100644 --- a/tests/app/tests/Internal/Operation/Pets/List_Test.php +++ b/tests/app/tests/Internal/Operation/Pets/List_Test.php @@ -3,25 +3,85 @@ declare (strict_types=1); namespace ApiClients\Tests\Client\PetStore\Internal\Operation\Pets; -use ApiClients\Client\PetStore\Contract; -use ApiClients\Client\PetStore\Error as ErrorSchemas; -use ApiClients\Client\PetStore\Internal; -use ApiClients\Client\PetStore\Operation; -use ApiClients\Client\PetStore\Schema; -use League\OpenAPIValidation; -use React\Http; -use ApiClients\Contracts; /** * @covers \ApiClients\Client\PetStore\Internal\Operation\Pets\List_ */ final class List_Test extends \WyriHaximus\AsyncTestUtilities\AsyncTestCase { + /** + * @test + */ + public function call_httpCode_200_responseContentType_application_json_zero() + { + $response = new \React\Http\Message\Response(200, ['Content-Type' => 'application/json'], \json_decode('[]', false)); + $auth = $this->prophesize(\ApiClients\Contracts\HTTP\Headers\AuthenticationInterface::class); + $auth->authHeader(\Prophecy\Argument::any())->willReturn('Bearer beer')->shouldBeCalled(); + $browser = $this->prophesize(\React\Http\Browser::class); + $browser->withBase(\Prophecy\Argument::any())->willReturn($browser->reveal()); + $browser->withFollowRedirects(\Prophecy\Argument::any())->willReturn($browser->reveal()); + $browser->request('GET', '/pets?page=1&per_page=8', \Prophecy\Argument::type('array'), \Prophecy\Argument::any())->willReturn(\React\Promise\resolve($response))->shouldBeCalled(); + $client = new \ApiClients\Client\PetStore\Client($auth->reveal(), $browser->reveal()); + $result = $client->call(\ApiClients\Client\PetStore\Internal\Operation\Pets\List_::OPERATION_MATCH, (static function (array $data): array { + $data['per_page'] = 8; + $data['page'] = 1; + return $data; + })([])); + } + /** + * @test + */ + public function operations_httpCode_200_responseContentType_application_json_zero() + { + $response = new \React\Http\Message\Response(200, ['Content-Type' => 'application/json'], \json_decode('[]', false)); + $auth = $this->prophesize(\ApiClients\Contracts\HTTP\Headers\AuthenticationInterface::class); + $auth->authHeader(\Prophecy\Argument::any())->willReturn('Bearer beer')->shouldBeCalled(); + $browser = $this->prophesize(\React\Http\Browser::class); + $browser->withBase(\Prophecy\Argument::any())->willReturn($browser->reveal()); + $browser->withFollowRedirects(\Prophecy\Argument::any())->willReturn($browser->reveal()); + $browser->request('GET', '/pets?page=1&per_page=8', \Prophecy\Argument::type('array'), \Prophecy\Argument::any())->willReturn(\React\Promise\resolve($response))->shouldBeCalled(); + $client = new \ApiClients\Client\PetStore\Client($auth->reveal(), $browser->reveal()); + $result = $client->operations()->pets()->list(8, 1); + } + /** + * @test + */ + public function call_httpCode_200_responseContentType_application_json_one() + { + $response = new \React\Http\Message\Response(200, ['Content-Type' => 'application/json'], \json_decode('[]', false)); + $auth = $this->prophesize(\ApiClients\Contracts\HTTP\Headers\AuthenticationInterface::class); + $auth->authHeader(\Prophecy\Argument::any())->willReturn('Bearer beer')->shouldBeCalled(); + $browser = $this->prophesize(\React\Http\Browser::class); + $browser->withBase(\Prophecy\Argument::any())->willReturn($browser->reveal()); + $browser->withFollowRedirects(\Prophecy\Argument::any())->willReturn($browser->reveal()); + $browser->request('GET', '/pets?page=1&per_page=8', \Prophecy\Argument::type('array'), \Prophecy\Argument::any())->willReturn(\React\Promise\resolve($response))->shouldBeCalled(); + $client = new \ApiClients\Client\PetStore\Client($auth->reveal(), $browser->reveal()); + $result = $client->call(\ApiClients\Client\PetStore\Internal\Operation\Pets\List_::OPERATION_MATCH, (static function (array $data): array { + $data['per_page'] = 8; + $data['page'] = 1; + return $data; + })([])); + } + /** + * @test + */ + public function operations_httpCode_200_responseContentType_application_json_one() + { + $response = new \React\Http\Message\Response(200, ['Content-Type' => 'application/json'], \json_decode('[]', false)); + $auth = $this->prophesize(\ApiClients\Contracts\HTTP\Headers\AuthenticationInterface::class); + $auth->authHeader(\Prophecy\Argument::any())->willReturn('Bearer beer')->shouldBeCalled(); + $browser = $this->prophesize(\React\Http\Browser::class); + $browser->withBase(\Prophecy\Argument::any())->willReturn($browser->reveal()); + $browser->withFollowRedirects(\Prophecy\Argument::any())->willReturn($browser->reveal()); + $browser->request('GET', '/pets?page=1&per_page=8', \Prophecy\Argument::type('array'), \Prophecy\Argument::any())->willReturn(\React\Promise\resolve($response))->shouldBeCalled(); + $client = new \ApiClients\Client\PetStore\Client($auth->reveal(), $browser->reveal()); + $result = $client->operations()->pets()->list(8, 1); + } /** * @test */ public function call_httpCode_default_responseContentType_application_json_zero() { - $response = new \React\Http\Message\Response(999, array('Content-Type' => 'application/json'), json_encode(json_decode(Schema\Error::SCHEMA_EXAMPLE_DATA, true))); + $response = new \React\Http\Message\Response(999, ['Content-Type' => 'application/json'], json_encode(json_decode(\ApiClients\Client\PetStore\Schema\Error::SCHEMA_EXAMPLE_DATA, true))); $auth = $this->prophesize(\ApiClients\Contracts\HTTP\Headers\AuthenticationInterface::class); $auth->authHeader(\Prophecy\Argument::any())->willReturn('Bearer beer')->shouldBeCalled(); $browser = $this->prophesize(\React\Http\Browser::class); @@ -29,18 +89,18 @@ public function call_httpCode_default_responseContentType_application_json_zero( $browser->withFollowRedirects(\Prophecy\Argument::any())->willReturn($browser->reveal()); $browser->request('GET', '/pets?page=1&per_page=8', \Prophecy\Argument::type('array'), \Prophecy\Argument::any())->willReturn(\React\Promise\resolve($response))->shouldBeCalled(); $client = new \ApiClients\Client\PetStore\Client($auth->reveal(), $browser->reveal()); - $result = $client->call(Internal\Operation\Pets\List_::OPERATION_MATCH, (static function (array $data) : array { + $result = $client->call(\ApiClients\Client\PetStore\Internal\Operation\Pets\List_::OPERATION_MATCH, (static function (array $data): array { $data['per_page'] = 8; $data['page'] = 1; return $data; - })(array())); + })([])); } /** * @test */ public function operations_httpCode_default_responseContentType_application_json_zero() { - $response = new \React\Http\Message\Response(999, array('Content-Type' => 'application/json'), json_encode(json_decode(Schema\Error::SCHEMA_EXAMPLE_DATA, true))); + $response = new \React\Http\Message\Response(999, ['Content-Type' => 'application/json'], json_encode(json_decode(\ApiClients\Client\PetStore\Schema\Error::SCHEMA_EXAMPLE_DATA, true))); $auth = $this->prophesize(\ApiClients\Contracts\HTTP\Headers\AuthenticationInterface::class); $auth->authHeader(\Prophecy\Argument::any())->willReturn('Bearer beer')->shouldBeCalled(); $browser = $this->prophesize(\React\Http\Browser::class); diff --git a/tests/app/tests/Internal/Operation/Pets/NamesListingTest.php b/tests/app/tests/Internal/Operation/Pets/NamesListingTest.php deleted file mode 100644 index ad41249..0000000 --- a/tests/app/tests/Internal/Operation/Pets/NamesListingTest.php +++ /dev/null @@ -1,57 +0,0 @@ - 'application/json'), json_encode(json_decode(Schema\Error::SCHEMA_EXAMPLE_DATA, true))); - $auth = $this->prophesize(\ApiClients\Contracts\HTTP\Headers\AuthenticationInterface::class); - $auth->authHeader(\Prophecy\Argument::any())->willReturn('Bearer beer')->shouldBeCalled(); - $browser = $this->prophesize(\React\Http\Browser::class); - $browser->withBase(\Prophecy\Argument::any())->willReturn($browser->reveal()); - $browser->withFollowRedirects(\Prophecy\Argument::any())->willReturn($browser->reveal()); - $browser->request('GET', '/pets/names?page=1&per_page=8', \Prophecy\Argument::type('array'), \Prophecy\Argument::any())->willReturn(\React\Promise\resolve($response))->shouldBeCalled(); - $client = new \ApiClients\Client\PetStore\Client($auth->reveal(), $browser->reveal()); - $result = $client->call(Internal\Operation\Pets\NamesListing::OPERATION_MATCH, (static function (array $data) : array { - $data['per_page'] = 8; - $data['page'] = 1; - return $data; - })(array())); - foreach ($result as $item) { - } - } - /** - * @test - */ - public function operations_httpCode_default_responseContentType_application_json_zero() - { - $response = new \React\Http\Message\Response(999, array('Content-Type' => 'application/json'), json_encode(json_decode(Schema\Error::SCHEMA_EXAMPLE_DATA, true))); - $auth = $this->prophesize(\ApiClients\Contracts\HTTP\Headers\AuthenticationInterface::class); - $auth->authHeader(\Prophecy\Argument::any())->willReturn('Bearer beer')->shouldBeCalled(); - $browser = $this->prophesize(\React\Http\Browser::class); - $browser->withBase(\Prophecy\Argument::any())->willReturn($browser->reveal()); - $browser->withFollowRedirects(\Prophecy\Argument::any())->willReturn($browser->reveal()); - $browser->request('GET', '/pets/names?page=1&per_page=8', \Prophecy\Argument::type('array'), \Prophecy\Argument::any())->willReturn(\React\Promise\resolve($response))->shouldBeCalled(); - $client = new \ApiClients\Client\PetStore\Client($auth->reveal(), $browser->reveal()); - $result = $client->operations()->pets()->namesListing(8, 1); - foreach ($result as $item) { - } - } -} diff --git a/tests/app/tests/Internal/Operation/Pets/NamesTest.php b/tests/app/tests/Internal/Operation/Pets/NamesTest.php index 97ad505..91b6652 100644 --- a/tests/app/tests/Internal/Operation/Pets/NamesTest.php +++ b/tests/app/tests/Internal/Operation/Pets/NamesTest.php @@ -3,25 +3,85 @@ declare (strict_types=1); namespace ApiClients\Tests\Client\PetStore\Internal\Operation\Pets; -use ApiClients\Client\PetStore\Contract; -use ApiClients\Client\PetStore\Error as ErrorSchemas; -use ApiClients\Client\PetStore\Internal; -use ApiClients\Client\PetStore\Operation; -use ApiClients\Client\PetStore\Schema; -use League\OpenAPIValidation; -use React\Http; -use ApiClients\Contracts; /** * @covers \ApiClients\Client\PetStore\Internal\Operation\Pets\Names */ final class NamesTest extends \WyriHaximus\AsyncTestUtilities\AsyncTestCase { + /** + * @test + */ + public function call_httpCode_200_responseContentType_application_json_zero() + { + $response = new \React\Http\Message\Response(200, ['Content-Type' => 'application/json'], \json_decode('[]', false)); + $auth = $this->prophesize(\ApiClients\Contracts\HTTP\Headers\AuthenticationInterface::class); + $auth->authHeader(\Prophecy\Argument::any())->willReturn('Bearer beer')->shouldBeCalled(); + $browser = $this->prophesize(\React\Http\Browser::class); + $browser->withBase(\Prophecy\Argument::any())->willReturn($browser->reveal()); + $browser->withFollowRedirects(\Prophecy\Argument::any())->willReturn($browser->reveal()); + $browser->request('GET', '/pets/names?page=1&per_page=8', \Prophecy\Argument::type('array'), \Prophecy\Argument::any())->willReturn(\React\Promise\resolve($response))->shouldBeCalled(); + $client = new \ApiClients\Client\PetStore\Client($auth->reveal(), $browser->reveal()); + $result = $client->call(\ApiClients\Client\PetStore\Internal\Operation\Pets\Names::OPERATION_MATCH, (static function (array $data): array { + $data['per_page'] = 8; + $data['page'] = 1; + return $data; + })([])); + } + /** + * @test + */ + public function operations_httpCode_200_responseContentType_application_json_zero() + { + $response = new \React\Http\Message\Response(200, ['Content-Type' => 'application/json'], \json_decode('[]', false)); + $auth = $this->prophesize(\ApiClients\Contracts\HTTP\Headers\AuthenticationInterface::class); + $auth->authHeader(\Prophecy\Argument::any())->willReturn('Bearer beer')->shouldBeCalled(); + $browser = $this->prophesize(\React\Http\Browser::class); + $browser->withBase(\Prophecy\Argument::any())->willReturn($browser->reveal()); + $browser->withFollowRedirects(\Prophecy\Argument::any())->willReturn($browser->reveal()); + $browser->request('GET', '/pets/names?page=1&per_page=8', \Prophecy\Argument::type('array'), \Prophecy\Argument::any())->willReturn(\React\Promise\resolve($response))->shouldBeCalled(); + $client = new \ApiClients\Client\PetStore\Client($auth->reveal(), $browser->reveal()); + $result = $client->operations()->pets()->names(8, 1); + } + /** + * @test + */ + public function call_httpCode_200_responseContentType_application_json_one() + { + $response = new \React\Http\Message\Response(200, ['Content-Type' => 'application/json'], \json_decode('[]', false)); + $auth = $this->prophesize(\ApiClients\Contracts\HTTP\Headers\AuthenticationInterface::class); + $auth->authHeader(\Prophecy\Argument::any())->willReturn('Bearer beer')->shouldBeCalled(); + $browser = $this->prophesize(\React\Http\Browser::class); + $browser->withBase(\Prophecy\Argument::any())->willReturn($browser->reveal()); + $browser->withFollowRedirects(\Prophecy\Argument::any())->willReturn($browser->reveal()); + $browser->request('GET', '/pets/names?page=1&per_page=8', \Prophecy\Argument::type('array'), \Prophecy\Argument::any())->willReturn(\React\Promise\resolve($response))->shouldBeCalled(); + $client = new \ApiClients\Client\PetStore\Client($auth->reveal(), $browser->reveal()); + $result = $client->call(\ApiClients\Client\PetStore\Internal\Operation\Pets\Names::OPERATION_MATCH, (static function (array $data): array { + $data['per_page'] = 8; + $data['page'] = 1; + return $data; + })([])); + } + /** + * @test + */ + public function operations_httpCode_200_responseContentType_application_json_one() + { + $response = new \React\Http\Message\Response(200, ['Content-Type' => 'application/json'], \json_decode('[]', false)); + $auth = $this->prophesize(\ApiClients\Contracts\HTTP\Headers\AuthenticationInterface::class); + $auth->authHeader(\Prophecy\Argument::any())->willReturn('Bearer beer')->shouldBeCalled(); + $browser = $this->prophesize(\React\Http\Browser::class); + $browser->withBase(\Prophecy\Argument::any())->willReturn($browser->reveal()); + $browser->withFollowRedirects(\Prophecy\Argument::any())->willReturn($browser->reveal()); + $browser->request('GET', '/pets/names?page=1&per_page=8', \Prophecy\Argument::type('array'), \Prophecy\Argument::any())->willReturn(\React\Promise\resolve($response))->shouldBeCalled(); + $client = new \ApiClients\Client\PetStore\Client($auth->reveal(), $browser->reveal()); + $result = $client->operations()->pets()->names(8, 1); + } /** * @test */ public function call_httpCode_default_responseContentType_application_json_zero() { - $response = new \React\Http\Message\Response(999, array('Content-Type' => 'application/json'), json_encode(json_decode(Schema\Error::SCHEMA_EXAMPLE_DATA, true))); + $response = new \React\Http\Message\Response(999, ['Content-Type' => 'application/json'], json_encode(json_decode(\ApiClients\Client\PetStore\Schema\Error::SCHEMA_EXAMPLE_DATA, true))); $auth = $this->prophesize(\ApiClients\Contracts\HTTP\Headers\AuthenticationInterface::class); $auth->authHeader(\Prophecy\Argument::any())->willReturn('Bearer beer')->shouldBeCalled(); $browser = $this->prophesize(\React\Http\Browser::class); @@ -29,18 +89,18 @@ public function call_httpCode_default_responseContentType_application_json_zero( $browser->withFollowRedirects(\Prophecy\Argument::any())->willReturn($browser->reveal()); $browser->request('GET', '/pets/names?page=1&per_page=8', \Prophecy\Argument::type('array'), \Prophecy\Argument::any())->willReturn(\React\Promise\resolve($response))->shouldBeCalled(); $client = new \ApiClients\Client\PetStore\Client($auth->reveal(), $browser->reveal()); - $result = $client->call(Internal\Operation\Pets\Names::OPERATION_MATCH, (static function (array $data) : array { + $result = $client->call(\ApiClients\Client\PetStore\Internal\Operation\Pets\Names::OPERATION_MATCH, (static function (array $data): array { $data['per_page'] = 8; $data['page'] = 1; return $data; - })(array())); + })([])); } /** * @test */ public function operations_httpCode_default_responseContentType_application_json_zero() { - $response = new \React\Http\Message\Response(999, array('Content-Type' => 'application/json'), json_encode(json_decode(Schema\Error::SCHEMA_EXAMPLE_DATA, true))); + $response = new \React\Http\Message\Response(999, ['Content-Type' => 'application/json'], json_encode(json_decode(\ApiClients\Client\PetStore\Schema\Error::SCHEMA_EXAMPLE_DATA, true))); $auth = $this->prophesize(\ApiClients\Contracts\HTTP\Headers\AuthenticationInterface::class); $auth->authHeader(\Prophecy\Argument::any())->willReturn('Bearer beer')->shouldBeCalled(); $browser = $this->prophesize(\React\Http\Browser::class); diff --git a/tests/app/tests/Internal/Operation/ShowPetByIdTest.php b/tests/app/tests/Internal/Operation/ShowPetByIdTest.php index 8b0424d..3b677c9 100644 --- a/tests/app/tests/Internal/Operation/ShowPetByIdTest.php +++ b/tests/app/tests/Internal/Operation/ShowPetByIdTest.php @@ -3,25 +3,177 @@ declare (strict_types=1); namespace ApiClients\Tests\Client\PetStore\Internal\Operation; -use ApiClients\Client\PetStore\Contract; -use ApiClients\Client\PetStore\Error as ErrorSchemas; -use ApiClients\Client\PetStore\Internal; -use ApiClients\Client\PetStore\Operation; -use ApiClients\Client\PetStore\Schema; -use League\OpenAPIValidation; -use React\Http; -use ApiClients\Contracts; /** * @covers \ApiClients\Client\PetStore\Internal\Operation\ShowPetById */ final class ShowPetByIdTest extends \WyriHaximus\AsyncTestUtilities\AsyncTestCase { + /** + * @test + */ + public function call_httpCode_200_responseContentType_application_json_zero() + { + $response = new \React\Http\Message\Response(200, ['Content-Type' => 'application/json'], \json_decode('[]', false)); + $auth = $this->prophesize(\ApiClients\Contracts\HTTP\Headers\AuthenticationInterface::class); + $auth->authHeader(\Prophecy\Argument::any())->willReturn('Bearer beer')->shouldBeCalled(); + $browser = $this->prophesize(\React\Http\Browser::class); + $browser->withBase(\Prophecy\Argument::any())->willReturn($browser->reveal()); + $browser->withFollowRedirects(\Prophecy\Argument::any())->willReturn($browser->reveal()); + $browser->request('GET', '/pets/{petId}', \Prophecy\Argument::type('array'), \Prophecy\Argument::any())->willReturn(\React\Promise\resolve($response))->shouldBeCalled(); + $client = new \ApiClients\Client\PetStore\Client($auth->reveal(), $browser->reveal()); + $result = $client->call(\ApiClients\Client\PetStore\Internal\Operation\ShowPetById::OPERATION_MATCH, (static function (array $data): array { + return $data; + })([])); + } + /** + * @test + */ + public function operations_httpCode_200_responseContentType_application_json_zero() + { + $response = new \React\Http\Message\Response(200, ['Content-Type' => 'application/json'], \json_decode('[]', false)); + $auth = $this->prophesize(\ApiClients\Contracts\HTTP\Headers\AuthenticationInterface::class); + $auth->authHeader(\Prophecy\Argument::any())->willReturn('Bearer beer')->shouldBeCalled(); + $browser = $this->prophesize(\React\Http\Browser::class); + $browser->withBase(\Prophecy\Argument::any())->willReturn($browser->reveal()); + $browser->withFollowRedirects(\Prophecy\Argument::any())->willReturn($browser->reveal()); + $browser->request('GET', '/pets/{petId}', \Prophecy\Argument::type('array'), \Prophecy\Argument::any())->willReturn(\React\Promise\resolve($response))->shouldBeCalled(); + $client = new \ApiClients\Client\PetStore\Client($auth->reveal(), $browser->reveal()); + $result = $client->operations()->showPetById(); + } + /** + * @test + */ + public function call_httpCode_200_responseContentType_application_json_one() + { + $response = new \React\Http\Message\Response(200, ['Content-Type' => 'application/json'], \json_decode('[]', false)); + $auth = $this->prophesize(\ApiClients\Contracts\HTTP\Headers\AuthenticationInterface::class); + $auth->authHeader(\Prophecy\Argument::any())->willReturn('Bearer beer')->shouldBeCalled(); + $browser = $this->prophesize(\React\Http\Browser::class); + $browser->withBase(\Prophecy\Argument::any())->willReturn($browser->reveal()); + $browser->withFollowRedirects(\Prophecy\Argument::any())->willReturn($browser->reveal()); + $browser->request('GET', '/pets/{petId}', \Prophecy\Argument::type('array'), \Prophecy\Argument::any())->willReturn(\React\Promise\resolve($response))->shouldBeCalled(); + $client = new \ApiClients\Client\PetStore\Client($auth->reveal(), $browser->reveal()); + $result = $client->call(\ApiClients\Client\PetStore\Internal\Operation\ShowPetById::OPERATION_MATCH, (static function (array $data): array { + return $data; + })([])); + } + /** + * @test + */ + public function operations_httpCode_200_responseContentType_application_json_one() + { + $response = new \React\Http\Message\Response(200, ['Content-Type' => 'application/json'], \json_decode('[]', false)); + $auth = $this->prophesize(\ApiClients\Contracts\HTTP\Headers\AuthenticationInterface::class); + $auth->authHeader(\Prophecy\Argument::any())->willReturn('Bearer beer')->shouldBeCalled(); + $browser = $this->prophesize(\React\Http\Browser::class); + $browser->withBase(\Prophecy\Argument::any())->willReturn($browser->reveal()); + $browser->withFollowRedirects(\Prophecy\Argument::any())->willReturn($browser->reveal()); + $browser->request('GET', '/pets/{petId}', \Prophecy\Argument::type('array'), \Prophecy\Argument::any())->willReturn(\React\Promise\resolve($response))->shouldBeCalled(); + $client = new \ApiClients\Client\PetStore\Client($auth->reveal(), $browser->reveal()); + $result = $client->operations()->showPetById(); + } + /** + * @test + */ + public function call_httpCode_200_responseContentType_application_json_two() + { + $response = new \React\Http\Message\Response(200, ['Content-Type' => 'application/json'], \json_decode('[]', false)); + $auth = $this->prophesize(\ApiClients\Contracts\HTTP\Headers\AuthenticationInterface::class); + $auth->authHeader(\Prophecy\Argument::any())->willReturn('Bearer beer')->shouldBeCalled(); + $browser = $this->prophesize(\React\Http\Browser::class); + $browser->withBase(\Prophecy\Argument::any())->willReturn($browser->reveal()); + $browser->withFollowRedirects(\Prophecy\Argument::any())->willReturn($browser->reveal()); + $browser->request('GET', '/pets/{petId}', \Prophecy\Argument::type('array'), \Prophecy\Argument::any())->willReturn(\React\Promise\resolve($response))->shouldBeCalled(); + $client = new \ApiClients\Client\PetStore\Client($auth->reveal(), $browser->reveal()); + $result = $client->call(\ApiClients\Client\PetStore\Internal\Operation\ShowPetById::OPERATION_MATCH, (static function (array $data): array { + return $data; + })([])); + } + /** + * @test + */ + public function operations_httpCode_200_responseContentType_application_json_two() + { + $response = new \React\Http\Message\Response(200, ['Content-Type' => 'application/json'], \json_decode('[]', false)); + $auth = $this->prophesize(\ApiClients\Contracts\HTTP\Headers\AuthenticationInterface::class); + $auth->authHeader(\Prophecy\Argument::any())->willReturn('Bearer beer')->shouldBeCalled(); + $browser = $this->prophesize(\React\Http\Browser::class); + $browser->withBase(\Prophecy\Argument::any())->willReturn($browser->reveal()); + $browser->withFollowRedirects(\Prophecy\Argument::any())->willReturn($browser->reveal()); + $browser->request('GET', '/pets/{petId}', \Prophecy\Argument::type('array'), \Prophecy\Argument::any())->willReturn(\React\Promise\resolve($response))->shouldBeCalled(); + $client = new \ApiClients\Client\PetStore\Client($auth->reveal(), $browser->reveal()); + $result = $client->operations()->showPetById(); + } + /** + * @test + */ + public function call_httpCode_200_responseContentType_application_json_three() + { + $response = new \React\Http\Message\Response(200, ['Content-Type' => 'application/json'], \json_decode('[]', false)); + $auth = $this->prophesize(\ApiClients\Contracts\HTTP\Headers\AuthenticationInterface::class); + $auth->authHeader(\Prophecy\Argument::any())->willReturn('Bearer beer')->shouldBeCalled(); + $browser = $this->prophesize(\React\Http\Browser::class); + $browser->withBase(\Prophecy\Argument::any())->willReturn($browser->reveal()); + $browser->withFollowRedirects(\Prophecy\Argument::any())->willReturn($browser->reveal()); + $browser->request('GET', '/pets/{petId}', \Prophecy\Argument::type('array'), \Prophecy\Argument::any())->willReturn(\React\Promise\resolve($response))->shouldBeCalled(); + $client = new \ApiClients\Client\PetStore\Client($auth->reveal(), $browser->reveal()); + $result = $client->call(\ApiClients\Client\PetStore\Internal\Operation\ShowPetById::OPERATION_MATCH, (static function (array $data): array { + return $data; + })([])); + } + /** + * @test + */ + public function operations_httpCode_200_responseContentType_application_json_three() + { + $response = new \React\Http\Message\Response(200, ['Content-Type' => 'application/json'], \json_decode('[]', false)); + $auth = $this->prophesize(\ApiClients\Contracts\HTTP\Headers\AuthenticationInterface::class); + $auth->authHeader(\Prophecy\Argument::any())->willReturn('Bearer beer')->shouldBeCalled(); + $browser = $this->prophesize(\React\Http\Browser::class); + $browser->withBase(\Prophecy\Argument::any())->willReturn($browser->reveal()); + $browser->withFollowRedirects(\Prophecy\Argument::any())->willReturn($browser->reveal()); + $browser->request('GET', '/pets/{petId}', \Prophecy\Argument::type('array'), \Prophecy\Argument::any())->willReturn(\React\Promise\resolve($response))->shouldBeCalled(); + $client = new \ApiClients\Client\PetStore\Client($auth->reveal(), $browser->reveal()); + $result = $client->operations()->showPetById(); + } + /** + * @test + */ + public function call_httpCode_200_responseContentType_application_json_four() + { + $response = new \React\Http\Message\Response(200, ['Content-Type' => 'application/json'], \json_decode('[]', false)); + $auth = $this->prophesize(\ApiClients\Contracts\HTTP\Headers\AuthenticationInterface::class); + $auth->authHeader(\Prophecy\Argument::any())->willReturn('Bearer beer')->shouldBeCalled(); + $browser = $this->prophesize(\React\Http\Browser::class); + $browser->withBase(\Prophecy\Argument::any())->willReturn($browser->reveal()); + $browser->withFollowRedirects(\Prophecy\Argument::any())->willReturn($browser->reveal()); + $browser->request('GET', '/pets/{petId}', \Prophecy\Argument::type('array'), \Prophecy\Argument::any())->willReturn(\React\Promise\resolve($response))->shouldBeCalled(); + $client = new \ApiClients\Client\PetStore\Client($auth->reveal(), $browser->reveal()); + $result = $client->call(\ApiClients\Client\PetStore\Internal\Operation\ShowPetById::OPERATION_MATCH, (static function (array $data): array { + return $data; + })([])); + } + /** + * @test + */ + public function operations_httpCode_200_responseContentType_application_json_four() + { + $response = new \React\Http\Message\Response(200, ['Content-Type' => 'application/json'], \json_decode('[]', false)); + $auth = $this->prophesize(\ApiClients\Contracts\HTTP\Headers\AuthenticationInterface::class); + $auth->authHeader(\Prophecy\Argument::any())->willReturn('Bearer beer')->shouldBeCalled(); + $browser = $this->prophesize(\React\Http\Browser::class); + $browser->withBase(\Prophecy\Argument::any())->willReturn($browser->reveal()); + $browser->withFollowRedirects(\Prophecy\Argument::any())->willReturn($browser->reveal()); + $browser->request('GET', '/pets/{petId}', \Prophecy\Argument::type('array'), \Prophecy\Argument::any())->willReturn(\React\Promise\resolve($response))->shouldBeCalled(); + $client = new \ApiClients\Client\PetStore\Client($auth->reveal(), $browser->reveal()); + $result = $client->operations()->showPetById(); + } /** * @test */ public function call_httpCode_default_responseContentType_application_json_zero() { - $response = new \React\Http\Message\Response(999, array('Content-Type' => 'application/json'), json_encode(json_decode(Schema\Error::SCHEMA_EXAMPLE_DATA, true))); + $response = new \React\Http\Message\Response(999, ['Content-Type' => 'application/json'], json_encode(json_decode(\ApiClients\Client\PetStore\Schema\Error::SCHEMA_EXAMPLE_DATA, true))); $auth = $this->prophesize(\ApiClients\Contracts\HTTP\Headers\AuthenticationInterface::class); $auth->authHeader(\Prophecy\Argument::any())->willReturn('Bearer beer')->shouldBeCalled(); $browser = $this->prophesize(\React\Http\Browser::class); @@ -29,16 +181,16 @@ public function call_httpCode_default_responseContentType_application_json_zero( $browser->withFollowRedirects(\Prophecy\Argument::any())->willReturn($browser->reveal()); $browser->request('GET', '/pets/{petId}', \Prophecy\Argument::type('array'), \Prophecy\Argument::any())->willReturn(\React\Promise\resolve($response))->shouldBeCalled(); $client = new \ApiClients\Client\PetStore\Client($auth->reveal(), $browser->reveal()); - $result = $client->call(Internal\Operation\ShowPetById::OPERATION_MATCH, (static function (array $data) : array { + $result = $client->call(\ApiClients\Client\PetStore\Internal\Operation\ShowPetById::OPERATION_MATCH, (static function (array $data): array { return $data; - })(array())); + })([])); } /** * @test */ public function operations_httpCode_default_responseContentType_application_json_zero() { - $response = new \React\Http\Message\Response(999, array('Content-Type' => 'application/json'), json_encode(json_decode(Schema\Error::SCHEMA_EXAMPLE_DATA, true))); + $response = new \React\Http\Message\Response(999, ['Content-Type' => 'application/json'], json_encode(json_decode(\ApiClients\Client\PetStore\Schema\Error::SCHEMA_EXAMPLE_DATA, true))); $auth = $this->prophesize(\ApiClients\Contracts\HTTP\Headers\AuthenticationInterface::class); $auth->authHeader(\Prophecy\Argument::any())->willReturn('Bearer beer')->shouldBeCalled(); $browser = $this->prophesize(\React\Http\Browser::class); diff --git a/tests/app/tests/Test.php b/tests/app/tests/Test.php new file mode 100644 index 0000000..f3967ec --- /dev/null +++ b/tests/app/tests/Test.php @@ -0,0 +1,165 @@ + 'application/json'], \json_decode('[]', false)); + $auth = $this->prophesize(\ApiClients\Contracts\HTTP\Headers\AuthenticationInterface::class); + $auth->authHeader(Prophecy\Argument::any())->willReturn('Bearer beer')->shouldBeCalled(); + $browser = $this->prophesize(\React\Http\Browser::class); + $browser->withBase(Prophecy\Argument::any())->willReturn($browser->reveal()); + $browser->withFollowRedirects(Prophecy\Argument::any())->willReturn($browser->reveal()); + $browser->request('GET', '/pets/{petId}', Prophecy\Argument::type('array'), Prophecy\Argument::any())->willReturn(\React\Promise\resolve($response))->shouldBeCalled(); + $client = new \ApiClients\Client\PetStore\Client($auth->reveal(), $browser->reveal()); + $result = $client->call(\ApiClients\Client\PetStore\Internal\Operation\ShowPetById::OPERATION_MATCH, (static fn(array $data): array => $data)([])); + } + #[\PHPUnit\Framework\Attributes\Test] + public function operations_httpCode_200_responseContentType_application_json_zero(): void + { + $response = new \React\Http\Message\Response(200, ['Content-Type' => 'application/json'], \json_decode('[]', false)); + $auth = $this->prophesize(\ApiClients\Contracts\HTTP\Headers\AuthenticationInterface::class); + $auth->authHeader(Prophecy\Argument::any())->willReturn('Bearer beer')->shouldBeCalled(); + $browser = $this->prophesize(\React\Http\Browser::class); + $browser->withBase(Prophecy\Argument::any())->willReturn($browser->reveal()); + $browser->withFollowRedirects(Prophecy\Argument::any())->willReturn($browser->reveal()); + $browser->request('GET', '/pets/{petId}', Prophecy\Argument::type('array'), Prophecy\Argument::any())->willReturn(\React\Promise\resolve($response))->shouldBeCalled(); + $client = new \ApiClients\Client\PetStore\Client($auth->reveal(), $browser->reveal()); + $result = $client->operations()->showPetById(); + } + #[\PHPUnit\Framework\Attributes\Test] + public function call_httpCode_200_responseContentType_application_json_one(): void + { + $response = new \React\Http\Message\Response(200, ['Content-Type' => 'application/json'], \json_decode('[]', false)); + $auth = $this->prophesize(\ApiClients\Contracts\HTTP\Headers\AuthenticationInterface::class); + $auth->authHeader(Prophecy\Argument::any())->willReturn('Bearer beer')->shouldBeCalled(); + $browser = $this->prophesize(\React\Http\Browser::class); + $browser->withBase(Prophecy\Argument::any())->willReturn($browser->reveal()); + $browser->withFollowRedirects(Prophecy\Argument::any())->willReturn($browser->reveal()); + $browser->request('GET', '/pets/{petId}', Prophecy\Argument::type('array'), Prophecy\Argument::any())->willReturn(\React\Promise\resolve($response))->shouldBeCalled(); + $client = new \ApiClients\Client\PetStore\Client($auth->reveal(), $browser->reveal()); + $result = $client->call(\ApiClients\Client\PetStore\Internal\Operation\ShowPetById::OPERATION_MATCH, (static fn(array $data): array => $data)([])); + } + #[\PHPUnit\Framework\Attributes\Test] + public function operations_httpCode_200_responseContentType_application_json_one(): void + { + $response = new \React\Http\Message\Response(200, ['Content-Type' => 'application/json'], \json_decode('[]', false)); + $auth = $this->prophesize(\ApiClients\Contracts\HTTP\Headers\AuthenticationInterface::class); + $auth->authHeader(Prophecy\Argument::any())->willReturn('Bearer beer')->shouldBeCalled(); + $browser = $this->prophesize(\React\Http\Browser::class); + $browser->withBase(Prophecy\Argument::any())->willReturn($browser->reveal()); + $browser->withFollowRedirects(Prophecy\Argument::any())->willReturn($browser->reveal()); + $browser->request('GET', '/pets/{petId}', Prophecy\Argument::type('array'), Prophecy\Argument::any())->willReturn(\React\Promise\resolve($response))->shouldBeCalled(); + $client = new \ApiClients\Client\PetStore\Client($auth->reveal(), $browser->reveal()); + $result = $client->operations()->showPetById(); + } + #[\PHPUnit\Framework\Attributes\Test] + public function call_httpCode_200_responseContentType_application_json_two(): void + { + $response = new \React\Http\Message\Response(200, ['Content-Type' => 'application/json'], \json_decode('[]', false)); + $auth = $this->prophesize(\ApiClients\Contracts\HTTP\Headers\AuthenticationInterface::class); + $auth->authHeader(Prophecy\Argument::any())->willReturn('Bearer beer')->shouldBeCalled(); + $browser = $this->prophesize(\React\Http\Browser::class); + $browser->withBase(Prophecy\Argument::any())->willReturn($browser->reveal()); + $browser->withFollowRedirects(Prophecy\Argument::any())->willReturn($browser->reveal()); + $browser->request('GET', '/pets/{petId}', Prophecy\Argument::type('array'), Prophecy\Argument::any())->willReturn(\React\Promise\resolve($response))->shouldBeCalled(); + $client = new \ApiClients\Client\PetStore\Client($auth->reveal(), $browser->reveal()); + $result = $client->call(\ApiClients\Client\PetStore\Internal\Operation\ShowPetById::OPERATION_MATCH, (static fn(array $data): array => $data)([])); + } + #[\PHPUnit\Framework\Attributes\Test] + public function operations_httpCode_200_responseContentType_application_json_two(): void + { + $response = new \React\Http\Message\Response(200, ['Content-Type' => 'application/json'], \json_decode('[]', false)); + $auth = $this->prophesize(\ApiClients\Contracts\HTTP\Headers\AuthenticationInterface::class); + $auth->authHeader(Prophecy\Argument::any())->willReturn('Bearer beer')->shouldBeCalled(); + $browser = $this->prophesize(\React\Http\Browser::class); + $browser->withBase(Prophecy\Argument::any())->willReturn($browser->reveal()); + $browser->withFollowRedirects(Prophecy\Argument::any())->willReturn($browser->reveal()); + $browser->request('GET', '/pets/{petId}', Prophecy\Argument::type('array'), Prophecy\Argument::any())->willReturn(\React\Promise\resolve($response))->shouldBeCalled(); + $client = new \ApiClients\Client\PetStore\Client($auth->reveal(), $browser->reveal()); + $result = $client->operations()->showPetById(); + } + #[\PHPUnit\Framework\Attributes\Test] + public function call_httpCode_200_responseContentType_application_json_three(): void + { + $response = new \React\Http\Message\Response(200, ['Content-Type' => 'application/json'], \json_decode('[]', false)); + $auth = $this->prophesize(\ApiClients\Contracts\HTTP\Headers\AuthenticationInterface::class); + $auth->authHeader(Prophecy\Argument::any())->willReturn('Bearer beer')->shouldBeCalled(); + $browser = $this->prophesize(\React\Http\Browser::class); + $browser->withBase(Prophecy\Argument::any())->willReturn($browser->reveal()); + $browser->withFollowRedirects(Prophecy\Argument::any())->willReturn($browser->reveal()); + $browser->request('GET', '/pets/{petId}', Prophecy\Argument::type('array'), Prophecy\Argument::any())->willReturn(\React\Promise\resolve($response))->shouldBeCalled(); + $client = new \ApiClients\Client\PetStore\Client($auth->reveal(), $browser->reveal()); + $result = $client->call(\ApiClients\Client\PetStore\Internal\Operation\ShowPetById::OPERATION_MATCH, (static fn(array $data): array => $data)([])); + } + #[\PHPUnit\Framework\Attributes\Test] + public function operations_httpCode_200_responseContentType_application_json_three(): void + { + $response = new \React\Http\Message\Response(200, ['Content-Type' => 'application/json'], \json_decode('[]', false)); + $auth = $this->prophesize(\ApiClients\Contracts\HTTP\Headers\AuthenticationInterface::class); + $auth->authHeader(Prophecy\Argument::any())->willReturn('Bearer beer')->shouldBeCalled(); + $browser = $this->prophesize(\React\Http\Browser::class); + $browser->withBase(Prophecy\Argument::any())->willReturn($browser->reveal()); + $browser->withFollowRedirects(Prophecy\Argument::any())->willReturn($browser->reveal()); + $browser->request('GET', '/pets/{petId}', Prophecy\Argument::type('array'), Prophecy\Argument::any())->willReturn(\React\Promise\resolve($response))->shouldBeCalled(); + $client = new \ApiClients\Client\PetStore\Client($auth->reveal(), $browser->reveal()); + $result = $client->operations()->showPetById(); + } + #[\PHPUnit\Framework\Attributes\Test] + public function call_httpCode_200_responseContentType_application_json_four(): void + { + $response = new \React\Http\Message\Response(200, ['Content-Type' => 'application/json'], \json_decode('[]', false)); + $auth = $this->prophesize(\ApiClients\Contracts\HTTP\Headers\AuthenticationInterface::class); + $auth->authHeader(Prophecy\Argument::any())->willReturn('Bearer beer')->shouldBeCalled(); + $browser = $this->prophesize(\React\Http\Browser::class); + $browser->withBase(Prophecy\Argument::any())->willReturn($browser->reveal()); + $browser->withFollowRedirects(Prophecy\Argument::any())->willReturn($browser->reveal()); + $browser->request('GET', '/pets/{petId}', Prophecy\Argument::type('array'), Prophecy\Argument::any())->willReturn(\React\Promise\resolve($response))->shouldBeCalled(); + $client = new \ApiClients\Client\PetStore\Client($auth->reveal(), $browser->reveal()); + $result = $client->call(\ApiClients\Client\PetStore\Internal\Operation\ShowPetById::OPERATION_MATCH, (static fn(array $data): array => $data)([])); + } + #[\PHPUnit\Framework\Attributes\Test] + public function operations_httpCode_200_responseContentType_application_json_four(): void + { + $response = new \React\Http\Message\Response(200, ['Content-Type' => 'application/json'], \json_decode('[]', false)); + $auth = $this->prophesize(\ApiClients\Contracts\HTTP\Headers\AuthenticationInterface::class); + $auth->authHeader(Prophecy\Argument::any())->willReturn('Bearer beer')->shouldBeCalled(); + $browser = $this->prophesize(\React\Http\Browser::class); + $browser->withBase(Prophecy\Argument::any())->willReturn($browser->reveal()); + $browser->withFollowRedirects(Prophecy\Argument::any())->willReturn($browser->reveal()); + $browser->request('GET', '/pets/{petId}', Prophecy\Argument::type('array'), Prophecy\Argument::any())->willReturn(\React\Promise\resolve($response))->shouldBeCalled(); + $client = new \ApiClients\Client\PetStore\Client($auth->reveal(), $browser->reveal()); + $result = $client->operations()->showPetById(); + } + #[\PHPUnit\Framework\Attributes\Test] + public function call_httpCode_default_responseContentType_application_json_zero(): void + { + $response = new \React\Http\Message\Response(999, ['Content-Type' => 'application/json'], json_encode(json_decode(\ApiClients\Client\PetStore\Schema\Error::SCHEMA_EXAMPLE_DATA, true))); + $auth = $this->prophesize(\ApiClients\Contracts\HTTP\Headers\AuthenticationInterface::class); + $auth->authHeader(Prophecy\Argument::any())->willReturn('Bearer beer')->shouldBeCalled(); + $browser = $this->prophesize(\React\Http\Browser::class); + $browser->withBase(Prophecy\Argument::any())->willReturn($browser->reveal()); + $browser->withFollowRedirects(Prophecy\Argument::any())->willReturn($browser->reveal()); + $browser->request('GET', '/pets/{petId}', Prophecy\Argument::type('array'), Prophecy\Argument::any())->willReturn(\React\Promise\resolve($response))->shouldBeCalled(); + $client = new \ApiClients\Client\PetStore\Client($auth->reveal(), $browser->reveal()); + $result = $client->call(\ApiClients\Client\PetStore\Internal\Operation\ShowPetById::OPERATION_MATCH, (static fn(array $data): array => $data)([])); + } + #[\PHPUnit\Framework\Attributes\Test] + public function operations_httpCode_default_responseContentType_application_json_zero(): void + { + $response = new \React\Http\Message\Response(999, ['Content-Type' => 'application/json'], json_encode(json_decode(\ApiClients\Client\PetStore\Schema\Error::SCHEMA_EXAMPLE_DATA, true))); + $auth = $this->prophesize(\ApiClients\Contracts\HTTP\Headers\AuthenticationInterface::class); + $auth->authHeader(Prophecy\Argument::any())->willReturn('Bearer beer')->shouldBeCalled(); + $browser = $this->prophesize(\React\Http\Browser::class); + $browser->withBase(Prophecy\Argument::any())->willReturn($browser->reveal()); + $browser->withFollowRedirects(Prophecy\Argument::any())->willReturn($browser->reveal()); + $browser->request('GET', '/pets/{petId}', Prophecy\Argument::type('array'), Prophecy\Argument::any())->willReturn(\React\Promise\resolve($response))->shouldBeCalled(); + $client = new \ApiClients\Client\PetStore\Client($auth->reveal(), $browser->reveal()); + $result = $client->operations()->showPetById(); + } +} diff --git a/tests/app/tests/TestInternal/Operation/Pets/Create.php b/tests/app/tests/TestInternal/Operation/Pets/Create.php new file mode 100644 index 0000000..63d119d --- /dev/null +++ b/tests/app/tests/TestInternal/Operation/Pets/Create.php @@ -0,0 +1,63 @@ + 'application/json'], json_encode(json_decode(\ApiClients\Client\PetStore\Schema\Error::SCHEMA_EXAMPLE_DATA, true))); + $auth = $this->prophesize(\ApiClients\Contracts\HTTP\Headers\AuthenticationInterface::class); + $auth->authHeader(Prophecy\Argument::any())->willReturn('Bearer beer')->shouldBeCalled(); + $browser = $this->prophesize(\React\Http\Browser::class); + $browser->withBase(Prophecy\Argument::any())->willReturn($browser->reveal()); + $browser->withFollowRedirects(Prophecy\Argument::any())->willReturn($browser->reveal()); + $browser->request('POST', '/pets', Prophecy\Argument::type('array'), json_encode(json_decode(\ApiClients\Client\PetStore\Schema\Pets\Create\Request\ApplicationJson::SCHEMA_EXAMPLE_DATA, true)))->willReturn(\React\Promise\resolve($response))->shouldBeCalled(); + $client = new \ApiClients\Client\PetStore\Client($auth->reveal(), $browser->reveal()); + $result = $client->call(\ApiClients\Client\PetStore\Internal\Operation\Pets\Create::OPERATION_MATCH, (static fn(array $data): array => $data)(json_decode(\ApiClients\Client\PetStore\Schema\Pets\Create\Request\ApplicationJson::SCHEMA_EXAMPLE_DATA, true))); + } + #[\PHPUnit\Framework\Attributes\Test] + public function operations_httpCode_default_requestContentType_application_json_responseContentType_application_json_zero(): void + { + $response = new \React\Http\Message\Response(999, ['Content-Type' => 'application/json'], json_encode(json_decode(\ApiClients\Client\PetStore\Schema\Error::SCHEMA_EXAMPLE_DATA, true))); + $auth = $this->prophesize(\ApiClients\Contracts\HTTP\Headers\AuthenticationInterface::class); + $auth->authHeader(Prophecy\Argument::any())->willReturn('Bearer beer')->shouldBeCalled(); + $browser = $this->prophesize(\React\Http\Browser::class); + $browser->withBase(Prophecy\Argument::any())->willReturn($browser->reveal()); + $browser->withFollowRedirects(Prophecy\Argument::any())->willReturn($browser->reveal()); + $browser->request('POST', '/pets', Prophecy\Argument::type('array'), json_encode(json_decode(\ApiClients\Client\PetStore\Schema\Pets\Create\Request\ApplicationJson::SCHEMA_EXAMPLE_DATA, true)))->willReturn(\React\Promise\resolve($response))->shouldBeCalled(); + $client = new \ApiClients\Client\PetStore\Client($auth->reveal(), $browser->reveal()); + $result = $client->operations()->pets()->create(json_decode(\ApiClients\Client\PetStore\Schema\Pets\Create\Request\ApplicationJson::SCHEMA_EXAMPLE_DATA, true)); + } + #[\PHPUnit\Framework\Attributes\Test] + public function call_httpCode_201_requestContentType_application_json_empty(): void + { + $response = new \React\Http\Message\Response(201, []); + $auth = $this->prophesize(\ApiClients\Contracts\HTTP\Headers\AuthenticationInterface::class); + $auth->authHeader(Prophecy\Argument::any())->willReturn('Bearer beer')->shouldBeCalled(); + $browser = $this->prophesize(\React\Http\Browser::class); + $browser->withBase(Prophecy\Argument::any())->willReturn($browser->reveal()); + $browser->withFollowRedirects(Prophecy\Argument::any())->willReturn($browser->reveal()); + $browser->request('POST', '/pets', Prophecy\Argument::type('array'), json_encode(json_decode(\ApiClients\Client\PetStore\Schema\Pets\Create\Request\ApplicationJson::SCHEMA_EXAMPLE_DATA, true)))->willReturn(\React\Promise\resolve($response))->shouldBeCalled(); + $client = new \ApiClients\Client\PetStore\Client($auth->reveal(), $browser->reveal()); + $result = $client->call(\ApiClients\Client\PetStore\Internal\Operation\Pets\Create::OPERATION_MATCH, (static fn(array $data): array => $data)(json_decode(\ApiClients\Client\PetStore\Schema\Pets\Create\Request\ApplicationJson::SCHEMA_EXAMPLE_DATA, true))); + } + #[\PHPUnit\Framework\Attributes\Test] + public function operations_httpCode_201_requestContentType_application_json_empty(): void + { + $response = new \React\Http\Message\Response(201, []); + $auth = $this->prophesize(\ApiClients\Contracts\HTTP\Headers\AuthenticationInterface::class); + $auth->authHeader(Prophecy\Argument::any())->willReturn('Bearer beer')->shouldBeCalled(); + $browser = $this->prophesize(\React\Http\Browser::class); + $browser->withBase(Prophecy\Argument::any())->willReturn($browser->reveal()); + $browser->withFollowRedirects(Prophecy\Argument::any())->willReturn($browser->reveal()); + $browser->request('POST', '/pets', Prophecy\Argument::type('array'), json_encode(json_decode(\ApiClients\Client\PetStore\Schema\Pets\Create\Request\ApplicationJson::SCHEMA_EXAMPLE_DATA, true)))->willReturn(\React\Promise\resolve($response))->shouldBeCalled(); + $client = new \ApiClients\Client\PetStore\Client($auth->reveal(), $browser->reveal()); + $result = $client->operations()->pets()->create(json_decode(\ApiClients\Client\PetStore\Schema\Pets\Create\Request\ApplicationJson::SCHEMA_EXAMPLE_DATA, true)); + self::assertArrayHasKey('code', $result); + self::assertSame(201, $result['code']); + } +} diff --git a/tests/app/tests/TestInternal/Operation/Pets/Grouped/By/Type.php b/tests/app/tests/TestInternal/Operation/Pets/Grouped/By/Type.php new file mode 100644 index 0000000..c109a50 --- /dev/null +++ b/tests/app/tests/TestInternal/Operation/Pets/Grouped/By/Type.php @@ -0,0 +1,69 @@ + 'application/json'], json_encode(json_decode(\ApiClients\Client\PetStore\Schema\Operations\Pets\Grouped\By\Type\Response\ApplicationJson\Ok::SCHEMA_EXAMPLE_DATA, true))); + $auth = $this->prophesize(\ApiClients\Contracts\HTTP\Headers\AuthenticationInterface::class); + $auth->authHeader(Prophecy\Argument::any())->willReturn('Bearer beer')->shouldBeCalled(); + $browser = $this->prophesize(\React\Http\Browser::class); + $browser->withBase(Prophecy\Argument::any())->willReturn($browser->reveal()); + $browser->withFollowRedirects(Prophecy\Argument::any())->willReturn($browser->reveal()); + $browser->request('GET', '/pets/groupedByType?page=1&per_page=8', Prophecy\Argument::type('array'), Prophecy\Argument::any())->willReturn(\React\Promise\resolve($response))->shouldBeCalled(); + $client = new \ApiClients\Client\PetStore\Client($auth->reveal(), $browser->reveal()); + $result = $client->call(\ApiClients\Client\PetStore\Internal\Operation\Pets\Grouped\By\Type::OPERATION_MATCH, (static function (array $data): array { + $data['per_page'] = 8; + $data['page'] = 1; + return $data; + })([])); + } + #[\PHPUnit\Framework\Attributes\Test] + public function operations_httpCode_200_responseContentType_application_json_zero(): void + { + $response = new \React\Http\Message\Response(200, ['Content-Type' => 'application/json'], json_encode(json_decode(\ApiClients\Client\PetStore\Schema\Operations\Pets\Grouped\By\Type\Response\ApplicationJson\Ok::SCHEMA_EXAMPLE_DATA, true))); + $auth = $this->prophesize(\ApiClients\Contracts\HTTP\Headers\AuthenticationInterface::class); + $auth->authHeader(Prophecy\Argument::any())->willReturn('Bearer beer')->shouldBeCalled(); + $browser = $this->prophesize(\React\Http\Browser::class); + $browser->withBase(Prophecy\Argument::any())->willReturn($browser->reveal()); + $browser->withFollowRedirects(Prophecy\Argument::any())->willReturn($browser->reveal()); + $browser->request('GET', '/pets/groupedByType?page=1&per_page=8', Prophecy\Argument::type('array'), Prophecy\Argument::any())->willReturn(\React\Promise\resolve($response))->shouldBeCalled(); + $client = new \ApiClients\Client\PetStore\Client($auth->reveal(), $browser->reveal()); + $result = $client->operations()->petsGroupedBy()->type(8, 1); + } + #[\PHPUnit\Framework\Attributes\Test] + public function call_httpCode_default_responseContentType_application_json_zero(): void + { + $response = new \React\Http\Message\Response(999, ['Content-Type' => 'application/json'], json_encode(json_decode(\ApiClients\Client\PetStore\Schema\Error::SCHEMA_EXAMPLE_DATA, true))); + $auth = $this->prophesize(\ApiClients\Contracts\HTTP\Headers\AuthenticationInterface::class); + $auth->authHeader(Prophecy\Argument::any())->willReturn('Bearer beer')->shouldBeCalled(); + $browser = $this->prophesize(\React\Http\Browser::class); + $browser->withBase(Prophecy\Argument::any())->willReturn($browser->reveal()); + $browser->withFollowRedirects(Prophecy\Argument::any())->willReturn($browser->reveal()); + $browser->request('GET', '/pets/groupedByType?page=1&per_page=8', Prophecy\Argument::type('array'), Prophecy\Argument::any())->willReturn(\React\Promise\resolve($response))->shouldBeCalled(); + $client = new \ApiClients\Client\PetStore\Client($auth->reveal(), $browser->reveal()); + $result = $client->call(\ApiClients\Client\PetStore\Internal\Operation\Pets\Grouped\By\Type::OPERATION_MATCH, (static function (array $data): array { + $data['per_page'] = 8; + $data['page'] = 1; + return $data; + })([])); + } + #[\PHPUnit\Framework\Attributes\Test] + public function operations_httpCode_default_responseContentType_application_json_zero(): void + { + $response = new \React\Http\Message\Response(999, ['Content-Type' => 'application/json'], json_encode(json_decode(\ApiClients\Client\PetStore\Schema\Error::SCHEMA_EXAMPLE_DATA, true))); + $auth = $this->prophesize(\ApiClients\Contracts\HTTP\Headers\AuthenticationInterface::class); + $auth->authHeader(Prophecy\Argument::any())->willReturn('Bearer beer')->shouldBeCalled(); + $browser = $this->prophesize(\React\Http\Browser::class); + $browser->withBase(Prophecy\Argument::any())->willReturn($browser->reveal()); + $browser->withFollowRedirects(Prophecy\Argument::any())->willReturn($browser->reveal()); + $browser->request('GET', '/pets/groupedByType?page=1&per_page=8', Prophecy\Argument::type('array'), Prophecy\Argument::any())->willReturn(\React\Promise\resolve($response))->shouldBeCalled(); + $client = new \ApiClients\Client\PetStore\Client($auth->reveal(), $browser->reveal()); + $result = $client->operations()->petsGroupedBy()->type(8, 1); + } +} diff --git a/tests/app/tests/TestInternal/Operation/Pets/Kinds/Walking.php b/tests/app/tests/TestInternal/Operation/Pets/Kinds/Walking.php new file mode 100644 index 0000000..7ac9033 --- /dev/null +++ b/tests/app/tests/TestInternal/Operation/Pets/Kinds/Walking.php @@ -0,0 +1,99 @@ + 'application/json'], \json_decode('[]', false)); + $auth = $this->prophesize(\ApiClients\Contracts\HTTP\Headers\AuthenticationInterface::class); + $auth->authHeader(Prophecy\Argument::any())->willReturn('Bearer beer')->shouldBeCalled(); + $browser = $this->prophesize(\React\Http\Browser::class); + $browser->withBase(Prophecy\Argument::any())->willReturn($browser->reveal()); + $browser->withFollowRedirects(Prophecy\Argument::any())->willReturn($browser->reveal()); + $browser->request('GET', '/pets/kinds/walking?page=1&per_page=8', Prophecy\Argument::type('array'), Prophecy\Argument::any())->willReturn(\React\Promise\resolve($response))->shouldBeCalled(); + $client = new \ApiClients\Client\PetStore\Client($auth->reveal(), $browser->reveal()); + $result = $client->call(\ApiClients\Client\PetStore\Internal\Operation\Pets\Kinds\Walking::OPERATION_MATCH, (static function (array $data): array { + $data['per_page'] = 8; + $data['page'] = 1; + return $data; + })([])); + } + #[\PHPUnit\Framework\Attributes\Test] + public function operations_httpCode_200_responseContentType_application_json_zero(): void + { + $response = new \React\Http\Message\Response(200, ['Content-Type' => 'application/json'], \json_decode('[]', false)); + $auth = $this->prophesize(\ApiClients\Contracts\HTTP\Headers\AuthenticationInterface::class); + $auth->authHeader(Prophecy\Argument::any())->willReturn('Bearer beer')->shouldBeCalled(); + $browser = $this->prophesize(\React\Http\Browser::class); + $browser->withBase(Prophecy\Argument::any())->willReturn($browser->reveal()); + $browser->withFollowRedirects(Prophecy\Argument::any())->willReturn($browser->reveal()); + $browser->request('GET', '/pets/kinds/walking?page=1&per_page=8', Prophecy\Argument::type('array'), Prophecy\Argument::any())->willReturn(\React\Promise\resolve($response))->shouldBeCalled(); + $client = new \ApiClients\Client\PetStore\Client($auth->reveal(), $browser->reveal()); + $result = $client->operations()->petsKinds()->walking(8, 1); + } + #[\PHPUnit\Framework\Attributes\Test] + public function call_httpCode_200_responseContentType_application_json_one(): void + { + $response = new \React\Http\Message\Response(200, ['Content-Type' => 'application/json'], \json_decode('[]', false)); + $auth = $this->prophesize(\ApiClients\Contracts\HTTP\Headers\AuthenticationInterface::class); + $auth->authHeader(Prophecy\Argument::any())->willReturn('Bearer beer')->shouldBeCalled(); + $browser = $this->prophesize(\React\Http\Browser::class); + $browser->withBase(Prophecy\Argument::any())->willReturn($browser->reveal()); + $browser->withFollowRedirects(Prophecy\Argument::any())->willReturn($browser->reveal()); + $browser->request('GET', '/pets/kinds/walking?page=1&per_page=8', Prophecy\Argument::type('array'), Prophecy\Argument::any())->willReturn(\React\Promise\resolve($response))->shouldBeCalled(); + $client = new \ApiClients\Client\PetStore\Client($auth->reveal(), $browser->reveal()); + $result = $client->call(\ApiClients\Client\PetStore\Internal\Operation\Pets\Kinds\Walking::OPERATION_MATCH, (static function (array $data): array { + $data['per_page'] = 8; + $data['page'] = 1; + return $data; + })([])); + } + #[\PHPUnit\Framework\Attributes\Test] + public function operations_httpCode_200_responseContentType_application_json_one(): void + { + $response = new \React\Http\Message\Response(200, ['Content-Type' => 'application/json'], \json_decode('[]', false)); + $auth = $this->prophesize(\ApiClients\Contracts\HTTP\Headers\AuthenticationInterface::class); + $auth->authHeader(Prophecy\Argument::any())->willReturn('Bearer beer')->shouldBeCalled(); + $browser = $this->prophesize(\React\Http\Browser::class); + $browser->withBase(Prophecy\Argument::any())->willReturn($browser->reveal()); + $browser->withFollowRedirects(Prophecy\Argument::any())->willReturn($browser->reveal()); + $browser->request('GET', '/pets/kinds/walking?page=1&per_page=8', Prophecy\Argument::type('array'), Prophecy\Argument::any())->willReturn(\React\Promise\resolve($response))->shouldBeCalled(); + $client = new \ApiClients\Client\PetStore\Client($auth->reveal(), $browser->reveal()); + $result = $client->operations()->petsKinds()->walking(8, 1); + } + #[\PHPUnit\Framework\Attributes\Test] + public function call_httpCode_default_responseContentType_application_json_zero(): void + { + $response = new \React\Http\Message\Response(999, ['Content-Type' => 'application/json'], json_encode(json_decode(\ApiClients\Client\PetStore\Schema\Error::SCHEMA_EXAMPLE_DATA, true))); + $auth = $this->prophesize(\ApiClients\Contracts\HTTP\Headers\AuthenticationInterface::class); + $auth->authHeader(Prophecy\Argument::any())->willReturn('Bearer beer')->shouldBeCalled(); + $browser = $this->prophesize(\React\Http\Browser::class); + $browser->withBase(Prophecy\Argument::any())->willReturn($browser->reveal()); + $browser->withFollowRedirects(Prophecy\Argument::any())->willReturn($browser->reveal()); + $browser->request('GET', '/pets/kinds/walking?page=1&per_page=8', Prophecy\Argument::type('array'), Prophecy\Argument::any())->willReturn(\React\Promise\resolve($response))->shouldBeCalled(); + $client = new \ApiClients\Client\PetStore\Client($auth->reveal(), $browser->reveal()); + $result = $client->call(\ApiClients\Client\PetStore\Internal\Operation\Pets\Kinds\Walking::OPERATION_MATCH, (static function (array $data): array { + $data['per_page'] = 8; + $data['page'] = 1; + return $data; + })([])); + } + #[\PHPUnit\Framework\Attributes\Test] + public function operations_httpCode_default_responseContentType_application_json_zero(): void + { + $response = new \React\Http\Message\Response(999, ['Content-Type' => 'application/json'], json_encode(json_decode(\ApiClients\Client\PetStore\Schema\Error::SCHEMA_EXAMPLE_DATA, true))); + $auth = $this->prophesize(\ApiClients\Contracts\HTTP\Headers\AuthenticationInterface::class); + $auth->authHeader(Prophecy\Argument::any())->willReturn('Bearer beer')->shouldBeCalled(); + $browser = $this->prophesize(\React\Http\Browser::class); + $browser->withBase(Prophecy\Argument::any())->willReturn($browser->reveal()); + $browser->withFollowRedirects(Prophecy\Argument::any())->willReturn($browser->reveal()); + $browser->request('GET', '/pets/kinds/walking?page=1&per_page=8', Prophecy\Argument::type('array'), Prophecy\Argument::any())->willReturn(\React\Promise\resolve($response))->shouldBeCalled(); + $client = new \ApiClients\Client\PetStore\Client($auth->reveal(), $browser->reveal()); + $result = $client->operations()->petsKinds()->walking(8, 1); + } +} diff --git a/tests/app/tests/TestInternal/Operation/Pets/List_.php b/tests/app/tests/TestInternal/Operation/Pets/List_.php new file mode 100644 index 0000000..da11891 --- /dev/null +++ b/tests/app/tests/TestInternal/Operation/Pets/List_.php @@ -0,0 +1,99 @@ + 'application/json'], \json_decode('[]', false)); + $auth = $this->prophesize(\ApiClients\Contracts\HTTP\Headers\AuthenticationInterface::class); + $auth->authHeader(Prophecy\Argument::any())->willReturn('Bearer beer')->shouldBeCalled(); + $browser = $this->prophesize(\React\Http\Browser::class); + $browser->withBase(Prophecy\Argument::any())->willReturn($browser->reveal()); + $browser->withFollowRedirects(Prophecy\Argument::any())->willReturn($browser->reveal()); + $browser->request('GET', '/pets?page=1&per_page=8', Prophecy\Argument::type('array'), Prophecy\Argument::any())->willReturn(\React\Promise\resolve($response))->shouldBeCalled(); + $client = new \ApiClients\Client\PetStore\Client($auth->reveal(), $browser->reveal()); + $result = $client->call(\ApiClients\Client\PetStore\Internal\Operation\Pets\List_::OPERATION_MATCH, (static function (array $data): array { + $data['per_page'] = 8; + $data['page'] = 1; + return $data; + })([])); + } + #[\PHPUnit\Framework\Attributes\Test] + public function operations_httpCode_200_responseContentType_application_json_zero(): void + { + $response = new \React\Http\Message\Response(200, ['Content-Type' => 'application/json'], \json_decode('[]', false)); + $auth = $this->prophesize(\ApiClients\Contracts\HTTP\Headers\AuthenticationInterface::class); + $auth->authHeader(Prophecy\Argument::any())->willReturn('Bearer beer')->shouldBeCalled(); + $browser = $this->prophesize(\React\Http\Browser::class); + $browser->withBase(Prophecy\Argument::any())->willReturn($browser->reveal()); + $browser->withFollowRedirects(Prophecy\Argument::any())->willReturn($browser->reveal()); + $browser->request('GET', '/pets?page=1&per_page=8', Prophecy\Argument::type('array'), Prophecy\Argument::any())->willReturn(\React\Promise\resolve($response))->shouldBeCalled(); + $client = new \ApiClients\Client\PetStore\Client($auth->reveal(), $browser->reveal()); + $result = $client->operations()->pets()->list(8, 1); + } + #[\PHPUnit\Framework\Attributes\Test] + public function call_httpCode_200_responseContentType_application_json_one(): void + { + $response = new \React\Http\Message\Response(200, ['Content-Type' => 'application/json'], \json_decode('[]', false)); + $auth = $this->prophesize(\ApiClients\Contracts\HTTP\Headers\AuthenticationInterface::class); + $auth->authHeader(Prophecy\Argument::any())->willReturn('Bearer beer')->shouldBeCalled(); + $browser = $this->prophesize(\React\Http\Browser::class); + $browser->withBase(Prophecy\Argument::any())->willReturn($browser->reveal()); + $browser->withFollowRedirects(Prophecy\Argument::any())->willReturn($browser->reveal()); + $browser->request('GET', '/pets?page=1&per_page=8', Prophecy\Argument::type('array'), Prophecy\Argument::any())->willReturn(\React\Promise\resolve($response))->shouldBeCalled(); + $client = new \ApiClients\Client\PetStore\Client($auth->reveal(), $browser->reveal()); + $result = $client->call(\ApiClients\Client\PetStore\Internal\Operation\Pets\List_::OPERATION_MATCH, (static function (array $data): array { + $data['per_page'] = 8; + $data['page'] = 1; + return $data; + })([])); + } + #[\PHPUnit\Framework\Attributes\Test] + public function operations_httpCode_200_responseContentType_application_json_one(): void + { + $response = new \React\Http\Message\Response(200, ['Content-Type' => 'application/json'], \json_decode('[]', false)); + $auth = $this->prophesize(\ApiClients\Contracts\HTTP\Headers\AuthenticationInterface::class); + $auth->authHeader(Prophecy\Argument::any())->willReturn('Bearer beer')->shouldBeCalled(); + $browser = $this->prophesize(\React\Http\Browser::class); + $browser->withBase(Prophecy\Argument::any())->willReturn($browser->reveal()); + $browser->withFollowRedirects(Prophecy\Argument::any())->willReturn($browser->reveal()); + $browser->request('GET', '/pets?page=1&per_page=8', Prophecy\Argument::type('array'), Prophecy\Argument::any())->willReturn(\React\Promise\resolve($response))->shouldBeCalled(); + $client = new \ApiClients\Client\PetStore\Client($auth->reveal(), $browser->reveal()); + $result = $client->operations()->pets()->list(8, 1); + } + #[\PHPUnit\Framework\Attributes\Test] + public function call_httpCode_default_responseContentType_application_json_zero(): void + { + $response = new \React\Http\Message\Response(999, ['Content-Type' => 'application/json'], json_encode(json_decode(\ApiClients\Client\PetStore\Schema\Error::SCHEMA_EXAMPLE_DATA, true))); + $auth = $this->prophesize(\ApiClients\Contracts\HTTP\Headers\AuthenticationInterface::class); + $auth->authHeader(Prophecy\Argument::any())->willReturn('Bearer beer')->shouldBeCalled(); + $browser = $this->prophesize(\React\Http\Browser::class); + $browser->withBase(Prophecy\Argument::any())->willReturn($browser->reveal()); + $browser->withFollowRedirects(Prophecy\Argument::any())->willReturn($browser->reveal()); + $browser->request('GET', '/pets?page=1&per_page=8', Prophecy\Argument::type('array'), Prophecy\Argument::any())->willReturn(\React\Promise\resolve($response))->shouldBeCalled(); + $client = new \ApiClients\Client\PetStore\Client($auth->reveal(), $browser->reveal()); + $result = $client->call(\ApiClients\Client\PetStore\Internal\Operation\Pets\List_::OPERATION_MATCH, (static function (array $data): array { + $data['per_page'] = 8; + $data['page'] = 1; + return $data; + })([])); + } + #[\PHPUnit\Framework\Attributes\Test] + public function operations_httpCode_default_responseContentType_application_json_zero(): void + { + $response = new \React\Http\Message\Response(999, ['Content-Type' => 'application/json'], json_encode(json_decode(\ApiClients\Client\PetStore\Schema\Error::SCHEMA_EXAMPLE_DATA, true))); + $auth = $this->prophesize(\ApiClients\Contracts\HTTP\Headers\AuthenticationInterface::class); + $auth->authHeader(Prophecy\Argument::any())->willReturn('Bearer beer')->shouldBeCalled(); + $browser = $this->prophesize(\React\Http\Browser::class); + $browser->withBase(Prophecy\Argument::any())->willReturn($browser->reveal()); + $browser->withFollowRedirects(Prophecy\Argument::any())->willReturn($browser->reveal()); + $browser->request('GET', '/pets?page=1&per_page=8', Prophecy\Argument::type('array'), Prophecy\Argument::any())->willReturn(\React\Promise\resolve($response))->shouldBeCalled(); + $client = new \ApiClients\Client\PetStore\Client($auth->reveal(), $browser->reveal()); + $result = $client->operations()->pets()->list(8, 1); + } +} diff --git a/tests/app/tests/TestInternal/Operation/Pets/List_/Gatos.php b/tests/app/tests/TestInternal/Operation/Pets/List_/Gatos.php new file mode 100644 index 0000000..a8e9195 --- /dev/null +++ b/tests/app/tests/TestInternal/Operation/Pets/List_/Gatos.php @@ -0,0 +1,99 @@ + 'application/json'], \json_decode('[]', false)); + $auth = $this->prophesize(\ApiClients\Contracts\HTTP\Headers\AuthenticationInterface::class); + $auth->authHeader(Prophecy\Argument::any())->willReturn('Bearer beer')->shouldBeCalled(); + $browser = $this->prophesize(\React\Http\Browser::class); + $browser->withBase(Prophecy\Argument::any())->willReturn($browser->reveal()); + $browser->withFollowRedirects(Prophecy\Argument::any())->willReturn($browser->reveal()); + $browser->request('GET', '/pets/gatos?page=1&per_page=8', Prophecy\Argument::type('array'), Prophecy\Argument::any())->willReturn(\React\Promise\resolve($response))->shouldBeCalled(); + $client = new \ApiClients\Client\PetStore\Client($auth->reveal(), $browser->reveal()); + $result = $client->call(\ApiClients\Client\PetStore\Internal\Operation\Pets\List_\Gatos::OPERATION_MATCH, (static function (array $data): array { + $data['per_page'] = 8; + $data['page'] = 1; + return $data; + })([])); + } + #[\PHPUnit\Framework\Attributes\Test] + public function operations_httpCode_200_responseContentType_application_json_zero(): void + { + $response = new \React\Http\Message\Response(200, ['Content-Type' => 'application/json'], \json_decode('[]', false)); + $auth = $this->prophesize(\ApiClients\Contracts\HTTP\Headers\AuthenticationInterface::class); + $auth->authHeader(Prophecy\Argument::any())->willReturn('Bearer beer')->shouldBeCalled(); + $browser = $this->prophesize(\React\Http\Browser::class); + $browser->withBase(Prophecy\Argument::any())->willReturn($browser->reveal()); + $browser->withFollowRedirects(Prophecy\Argument::any())->willReturn($browser->reveal()); + $browser->request('GET', '/pets/gatos?page=1&per_page=8', Prophecy\Argument::type('array'), Prophecy\Argument::any())->willReturn(\React\Promise\resolve($response))->shouldBeCalled(); + $client = new \ApiClients\Client\PetStore\Client($auth->reveal(), $browser->reveal()); + $result = $client->operations()->petsList()->gatos(8, 1); + } + #[\PHPUnit\Framework\Attributes\Test] + public function call_httpCode_200_responseContentType_application_json_one(): void + { + $response = new \React\Http\Message\Response(200, ['Content-Type' => 'application/json'], \json_decode('[]', false)); + $auth = $this->prophesize(\ApiClients\Contracts\HTTP\Headers\AuthenticationInterface::class); + $auth->authHeader(Prophecy\Argument::any())->willReturn('Bearer beer')->shouldBeCalled(); + $browser = $this->prophesize(\React\Http\Browser::class); + $browser->withBase(Prophecy\Argument::any())->willReturn($browser->reveal()); + $browser->withFollowRedirects(Prophecy\Argument::any())->willReturn($browser->reveal()); + $browser->request('GET', '/pets/gatos?page=1&per_page=8', Prophecy\Argument::type('array'), Prophecy\Argument::any())->willReturn(\React\Promise\resolve($response))->shouldBeCalled(); + $client = new \ApiClients\Client\PetStore\Client($auth->reveal(), $browser->reveal()); + $result = $client->call(\ApiClients\Client\PetStore\Internal\Operation\Pets\List_\Gatos::OPERATION_MATCH, (static function (array $data): array { + $data['per_page'] = 8; + $data['page'] = 1; + return $data; + })([])); + } + #[\PHPUnit\Framework\Attributes\Test] + public function operations_httpCode_200_responseContentType_application_json_one(): void + { + $response = new \React\Http\Message\Response(200, ['Content-Type' => 'application/json'], \json_decode('[]', false)); + $auth = $this->prophesize(\ApiClients\Contracts\HTTP\Headers\AuthenticationInterface::class); + $auth->authHeader(Prophecy\Argument::any())->willReturn('Bearer beer')->shouldBeCalled(); + $browser = $this->prophesize(\React\Http\Browser::class); + $browser->withBase(Prophecy\Argument::any())->willReturn($browser->reveal()); + $browser->withFollowRedirects(Prophecy\Argument::any())->willReturn($browser->reveal()); + $browser->request('GET', '/pets/gatos?page=1&per_page=8', Prophecy\Argument::type('array'), Prophecy\Argument::any())->willReturn(\React\Promise\resolve($response))->shouldBeCalled(); + $client = new \ApiClients\Client\PetStore\Client($auth->reveal(), $browser->reveal()); + $result = $client->operations()->petsList()->gatos(8, 1); + } + #[\PHPUnit\Framework\Attributes\Test] + public function call_httpCode_default_responseContentType_application_json_zero(): void + { + $response = new \React\Http\Message\Response(999, ['Content-Type' => 'application/json'], json_encode(json_decode(\ApiClients\Client\PetStore\Schema\Error::SCHEMA_EXAMPLE_DATA, true))); + $auth = $this->prophesize(\ApiClients\Contracts\HTTP\Headers\AuthenticationInterface::class); + $auth->authHeader(Prophecy\Argument::any())->willReturn('Bearer beer')->shouldBeCalled(); + $browser = $this->prophesize(\React\Http\Browser::class); + $browser->withBase(Prophecy\Argument::any())->willReturn($browser->reveal()); + $browser->withFollowRedirects(Prophecy\Argument::any())->willReturn($browser->reveal()); + $browser->request('GET', '/pets/gatos?page=1&per_page=8', Prophecy\Argument::type('array'), Prophecy\Argument::any())->willReturn(\React\Promise\resolve($response))->shouldBeCalled(); + $client = new \ApiClients\Client\PetStore\Client($auth->reveal(), $browser->reveal()); + $result = $client->call(\ApiClients\Client\PetStore\Internal\Operation\Pets\List_\Gatos::OPERATION_MATCH, (static function (array $data): array { + $data['per_page'] = 8; + $data['page'] = 1; + return $data; + })([])); + } + #[\PHPUnit\Framework\Attributes\Test] + public function operations_httpCode_default_responseContentType_application_json_zero(): void + { + $response = new \React\Http\Message\Response(999, ['Content-Type' => 'application/json'], json_encode(json_decode(\ApiClients\Client\PetStore\Schema\Error::SCHEMA_EXAMPLE_DATA, true))); + $auth = $this->prophesize(\ApiClients\Contracts\HTTP\Headers\AuthenticationInterface::class); + $auth->authHeader(Prophecy\Argument::any())->willReturn('Bearer beer')->shouldBeCalled(); + $browser = $this->prophesize(\React\Http\Browser::class); + $browser->withBase(Prophecy\Argument::any())->willReturn($browser->reveal()); + $browser->withFollowRedirects(Prophecy\Argument::any())->willReturn($browser->reveal()); + $browser->request('GET', '/pets/gatos?page=1&per_page=8', Prophecy\Argument::type('array'), Prophecy\Argument::any())->willReturn(\React\Promise\resolve($response))->shouldBeCalled(); + $client = new \ApiClients\Client\PetStore\Client($auth->reveal(), $browser->reveal()); + $result = $client->operations()->petsList()->gatos(8, 1); + } +} diff --git a/tests/app/tests/TestInternal/Operation/Pets/Names.php b/tests/app/tests/TestInternal/Operation/Pets/Names.php new file mode 100644 index 0000000..3009391 --- /dev/null +++ b/tests/app/tests/TestInternal/Operation/Pets/Names.php @@ -0,0 +1,99 @@ + 'application/json'], \json_decode('[]', false)); + $auth = $this->prophesize(\ApiClients\Contracts\HTTP\Headers\AuthenticationInterface::class); + $auth->authHeader(Prophecy\Argument::any())->willReturn('Bearer beer')->shouldBeCalled(); + $browser = $this->prophesize(\React\Http\Browser::class); + $browser->withBase(Prophecy\Argument::any())->willReturn($browser->reveal()); + $browser->withFollowRedirects(Prophecy\Argument::any())->willReturn($browser->reveal()); + $browser->request('GET', '/pets/names?page=1&per_page=8', Prophecy\Argument::type('array'), Prophecy\Argument::any())->willReturn(\React\Promise\resolve($response))->shouldBeCalled(); + $client = new \ApiClients\Client\PetStore\Client($auth->reveal(), $browser->reveal()); + $result = $client->call(\ApiClients\Client\PetStore\Internal\Operation\Pets\Names::OPERATION_MATCH, (static function (array $data): array { + $data['per_page'] = 8; + $data['page'] = 1; + return $data; + })([])); + } + #[\PHPUnit\Framework\Attributes\Test] + public function operations_httpCode_200_responseContentType_application_json_zero(): void + { + $response = new \React\Http\Message\Response(200, ['Content-Type' => 'application/json'], \json_decode('[]', false)); + $auth = $this->prophesize(\ApiClients\Contracts\HTTP\Headers\AuthenticationInterface::class); + $auth->authHeader(Prophecy\Argument::any())->willReturn('Bearer beer')->shouldBeCalled(); + $browser = $this->prophesize(\React\Http\Browser::class); + $browser->withBase(Prophecy\Argument::any())->willReturn($browser->reveal()); + $browser->withFollowRedirects(Prophecy\Argument::any())->willReturn($browser->reveal()); + $browser->request('GET', '/pets/names?page=1&per_page=8', Prophecy\Argument::type('array'), Prophecy\Argument::any())->willReturn(\React\Promise\resolve($response))->shouldBeCalled(); + $client = new \ApiClients\Client\PetStore\Client($auth->reveal(), $browser->reveal()); + $result = $client->operations()->pets()->names(8, 1); + } + #[\PHPUnit\Framework\Attributes\Test] + public function call_httpCode_200_responseContentType_application_json_one(): void + { + $response = new \React\Http\Message\Response(200, ['Content-Type' => 'application/json'], \json_decode('[]', false)); + $auth = $this->prophesize(\ApiClients\Contracts\HTTP\Headers\AuthenticationInterface::class); + $auth->authHeader(Prophecy\Argument::any())->willReturn('Bearer beer')->shouldBeCalled(); + $browser = $this->prophesize(\React\Http\Browser::class); + $browser->withBase(Prophecy\Argument::any())->willReturn($browser->reveal()); + $browser->withFollowRedirects(Prophecy\Argument::any())->willReturn($browser->reveal()); + $browser->request('GET', '/pets/names?page=1&per_page=8', Prophecy\Argument::type('array'), Prophecy\Argument::any())->willReturn(\React\Promise\resolve($response))->shouldBeCalled(); + $client = new \ApiClients\Client\PetStore\Client($auth->reveal(), $browser->reveal()); + $result = $client->call(\ApiClients\Client\PetStore\Internal\Operation\Pets\Names::OPERATION_MATCH, (static function (array $data): array { + $data['per_page'] = 8; + $data['page'] = 1; + return $data; + })([])); + } + #[\PHPUnit\Framework\Attributes\Test] + public function operations_httpCode_200_responseContentType_application_json_one(): void + { + $response = new \React\Http\Message\Response(200, ['Content-Type' => 'application/json'], \json_decode('[]', false)); + $auth = $this->prophesize(\ApiClients\Contracts\HTTP\Headers\AuthenticationInterface::class); + $auth->authHeader(Prophecy\Argument::any())->willReturn('Bearer beer')->shouldBeCalled(); + $browser = $this->prophesize(\React\Http\Browser::class); + $browser->withBase(Prophecy\Argument::any())->willReturn($browser->reveal()); + $browser->withFollowRedirects(Prophecy\Argument::any())->willReturn($browser->reveal()); + $browser->request('GET', '/pets/names?page=1&per_page=8', Prophecy\Argument::type('array'), Prophecy\Argument::any())->willReturn(\React\Promise\resolve($response))->shouldBeCalled(); + $client = new \ApiClients\Client\PetStore\Client($auth->reveal(), $browser->reveal()); + $result = $client->operations()->pets()->names(8, 1); + } + #[\PHPUnit\Framework\Attributes\Test] + public function call_httpCode_default_responseContentType_application_json_zero(): void + { + $response = new \React\Http\Message\Response(999, ['Content-Type' => 'application/json'], json_encode(json_decode(\ApiClients\Client\PetStore\Schema\Error::SCHEMA_EXAMPLE_DATA, true))); + $auth = $this->prophesize(\ApiClients\Contracts\HTTP\Headers\AuthenticationInterface::class); + $auth->authHeader(Prophecy\Argument::any())->willReturn('Bearer beer')->shouldBeCalled(); + $browser = $this->prophesize(\React\Http\Browser::class); + $browser->withBase(Prophecy\Argument::any())->willReturn($browser->reveal()); + $browser->withFollowRedirects(Prophecy\Argument::any())->willReturn($browser->reveal()); + $browser->request('GET', '/pets/names?page=1&per_page=8', Prophecy\Argument::type('array'), Prophecy\Argument::any())->willReturn(\React\Promise\resolve($response))->shouldBeCalled(); + $client = new \ApiClients\Client\PetStore\Client($auth->reveal(), $browser->reveal()); + $result = $client->call(\ApiClients\Client\PetStore\Internal\Operation\Pets\Names::OPERATION_MATCH, (static function (array $data): array { + $data['per_page'] = 8; + $data['page'] = 1; + return $data; + })([])); + } + #[\PHPUnit\Framework\Attributes\Test] + public function operations_httpCode_default_responseContentType_application_json_zero(): void + { + $response = new \React\Http\Message\Response(999, ['Content-Type' => 'application/json'], json_encode(json_decode(\ApiClients\Client\PetStore\Schema\Error::SCHEMA_EXAMPLE_DATA, true))); + $auth = $this->prophesize(\ApiClients\Contracts\HTTP\Headers\AuthenticationInterface::class); + $auth->authHeader(Prophecy\Argument::any())->willReturn('Bearer beer')->shouldBeCalled(); + $browser = $this->prophesize(\React\Http\Browser::class); + $browser->withBase(Prophecy\Argument::any())->willReturn($browser->reveal()); + $browser->withFollowRedirects(Prophecy\Argument::any())->willReturn($browser->reveal()); + $browser->request('GET', '/pets/names?page=1&per_page=8', Prophecy\Argument::type('array'), Prophecy\Argument::any())->willReturn(\React\Promise\resolve($response))->shouldBeCalled(); + $client = new \ApiClients\Client\PetStore\Client($auth->reveal(), $browser->reveal()); + $result = $client->operations()->pets()->names(8, 1); + } +} diff --git a/tests/app/tests/TestInternal/Operation/ShowPetById.php b/tests/app/tests/TestInternal/Operation/ShowPetById.php new file mode 100644 index 0000000..f3967ec --- /dev/null +++ b/tests/app/tests/TestInternal/Operation/ShowPetById.php @@ -0,0 +1,165 @@ + 'application/json'], \json_decode('[]', false)); + $auth = $this->prophesize(\ApiClients\Contracts\HTTP\Headers\AuthenticationInterface::class); + $auth->authHeader(Prophecy\Argument::any())->willReturn('Bearer beer')->shouldBeCalled(); + $browser = $this->prophesize(\React\Http\Browser::class); + $browser->withBase(Prophecy\Argument::any())->willReturn($browser->reveal()); + $browser->withFollowRedirects(Prophecy\Argument::any())->willReturn($browser->reveal()); + $browser->request('GET', '/pets/{petId}', Prophecy\Argument::type('array'), Prophecy\Argument::any())->willReturn(\React\Promise\resolve($response))->shouldBeCalled(); + $client = new \ApiClients\Client\PetStore\Client($auth->reveal(), $browser->reveal()); + $result = $client->call(\ApiClients\Client\PetStore\Internal\Operation\ShowPetById::OPERATION_MATCH, (static fn(array $data): array => $data)([])); + } + #[\PHPUnit\Framework\Attributes\Test] + public function operations_httpCode_200_responseContentType_application_json_zero(): void + { + $response = new \React\Http\Message\Response(200, ['Content-Type' => 'application/json'], \json_decode('[]', false)); + $auth = $this->prophesize(\ApiClients\Contracts\HTTP\Headers\AuthenticationInterface::class); + $auth->authHeader(Prophecy\Argument::any())->willReturn('Bearer beer')->shouldBeCalled(); + $browser = $this->prophesize(\React\Http\Browser::class); + $browser->withBase(Prophecy\Argument::any())->willReturn($browser->reveal()); + $browser->withFollowRedirects(Prophecy\Argument::any())->willReturn($browser->reveal()); + $browser->request('GET', '/pets/{petId}', Prophecy\Argument::type('array'), Prophecy\Argument::any())->willReturn(\React\Promise\resolve($response))->shouldBeCalled(); + $client = new \ApiClients\Client\PetStore\Client($auth->reveal(), $browser->reveal()); + $result = $client->operations()->showPetById(); + } + #[\PHPUnit\Framework\Attributes\Test] + public function call_httpCode_200_responseContentType_application_json_one(): void + { + $response = new \React\Http\Message\Response(200, ['Content-Type' => 'application/json'], \json_decode('[]', false)); + $auth = $this->prophesize(\ApiClients\Contracts\HTTP\Headers\AuthenticationInterface::class); + $auth->authHeader(Prophecy\Argument::any())->willReturn('Bearer beer')->shouldBeCalled(); + $browser = $this->prophesize(\React\Http\Browser::class); + $browser->withBase(Prophecy\Argument::any())->willReturn($browser->reveal()); + $browser->withFollowRedirects(Prophecy\Argument::any())->willReturn($browser->reveal()); + $browser->request('GET', '/pets/{petId}', Prophecy\Argument::type('array'), Prophecy\Argument::any())->willReturn(\React\Promise\resolve($response))->shouldBeCalled(); + $client = new \ApiClients\Client\PetStore\Client($auth->reveal(), $browser->reveal()); + $result = $client->call(\ApiClients\Client\PetStore\Internal\Operation\ShowPetById::OPERATION_MATCH, (static fn(array $data): array => $data)([])); + } + #[\PHPUnit\Framework\Attributes\Test] + public function operations_httpCode_200_responseContentType_application_json_one(): void + { + $response = new \React\Http\Message\Response(200, ['Content-Type' => 'application/json'], \json_decode('[]', false)); + $auth = $this->prophesize(\ApiClients\Contracts\HTTP\Headers\AuthenticationInterface::class); + $auth->authHeader(Prophecy\Argument::any())->willReturn('Bearer beer')->shouldBeCalled(); + $browser = $this->prophesize(\React\Http\Browser::class); + $browser->withBase(Prophecy\Argument::any())->willReturn($browser->reveal()); + $browser->withFollowRedirects(Prophecy\Argument::any())->willReturn($browser->reveal()); + $browser->request('GET', '/pets/{petId}', Prophecy\Argument::type('array'), Prophecy\Argument::any())->willReturn(\React\Promise\resolve($response))->shouldBeCalled(); + $client = new \ApiClients\Client\PetStore\Client($auth->reveal(), $browser->reveal()); + $result = $client->operations()->showPetById(); + } + #[\PHPUnit\Framework\Attributes\Test] + public function call_httpCode_200_responseContentType_application_json_two(): void + { + $response = new \React\Http\Message\Response(200, ['Content-Type' => 'application/json'], \json_decode('[]', false)); + $auth = $this->prophesize(\ApiClients\Contracts\HTTP\Headers\AuthenticationInterface::class); + $auth->authHeader(Prophecy\Argument::any())->willReturn('Bearer beer')->shouldBeCalled(); + $browser = $this->prophesize(\React\Http\Browser::class); + $browser->withBase(Prophecy\Argument::any())->willReturn($browser->reveal()); + $browser->withFollowRedirects(Prophecy\Argument::any())->willReturn($browser->reveal()); + $browser->request('GET', '/pets/{petId}', Prophecy\Argument::type('array'), Prophecy\Argument::any())->willReturn(\React\Promise\resolve($response))->shouldBeCalled(); + $client = new \ApiClients\Client\PetStore\Client($auth->reveal(), $browser->reveal()); + $result = $client->call(\ApiClients\Client\PetStore\Internal\Operation\ShowPetById::OPERATION_MATCH, (static fn(array $data): array => $data)([])); + } + #[\PHPUnit\Framework\Attributes\Test] + public function operations_httpCode_200_responseContentType_application_json_two(): void + { + $response = new \React\Http\Message\Response(200, ['Content-Type' => 'application/json'], \json_decode('[]', false)); + $auth = $this->prophesize(\ApiClients\Contracts\HTTP\Headers\AuthenticationInterface::class); + $auth->authHeader(Prophecy\Argument::any())->willReturn('Bearer beer')->shouldBeCalled(); + $browser = $this->prophesize(\React\Http\Browser::class); + $browser->withBase(Prophecy\Argument::any())->willReturn($browser->reveal()); + $browser->withFollowRedirects(Prophecy\Argument::any())->willReturn($browser->reveal()); + $browser->request('GET', '/pets/{petId}', Prophecy\Argument::type('array'), Prophecy\Argument::any())->willReturn(\React\Promise\resolve($response))->shouldBeCalled(); + $client = new \ApiClients\Client\PetStore\Client($auth->reveal(), $browser->reveal()); + $result = $client->operations()->showPetById(); + } + #[\PHPUnit\Framework\Attributes\Test] + public function call_httpCode_200_responseContentType_application_json_three(): void + { + $response = new \React\Http\Message\Response(200, ['Content-Type' => 'application/json'], \json_decode('[]', false)); + $auth = $this->prophesize(\ApiClients\Contracts\HTTP\Headers\AuthenticationInterface::class); + $auth->authHeader(Prophecy\Argument::any())->willReturn('Bearer beer')->shouldBeCalled(); + $browser = $this->prophesize(\React\Http\Browser::class); + $browser->withBase(Prophecy\Argument::any())->willReturn($browser->reveal()); + $browser->withFollowRedirects(Prophecy\Argument::any())->willReturn($browser->reveal()); + $browser->request('GET', '/pets/{petId}', Prophecy\Argument::type('array'), Prophecy\Argument::any())->willReturn(\React\Promise\resolve($response))->shouldBeCalled(); + $client = new \ApiClients\Client\PetStore\Client($auth->reveal(), $browser->reveal()); + $result = $client->call(\ApiClients\Client\PetStore\Internal\Operation\ShowPetById::OPERATION_MATCH, (static fn(array $data): array => $data)([])); + } + #[\PHPUnit\Framework\Attributes\Test] + public function operations_httpCode_200_responseContentType_application_json_three(): void + { + $response = new \React\Http\Message\Response(200, ['Content-Type' => 'application/json'], \json_decode('[]', false)); + $auth = $this->prophesize(\ApiClients\Contracts\HTTP\Headers\AuthenticationInterface::class); + $auth->authHeader(Prophecy\Argument::any())->willReturn('Bearer beer')->shouldBeCalled(); + $browser = $this->prophesize(\React\Http\Browser::class); + $browser->withBase(Prophecy\Argument::any())->willReturn($browser->reveal()); + $browser->withFollowRedirects(Prophecy\Argument::any())->willReturn($browser->reveal()); + $browser->request('GET', '/pets/{petId}', Prophecy\Argument::type('array'), Prophecy\Argument::any())->willReturn(\React\Promise\resolve($response))->shouldBeCalled(); + $client = new \ApiClients\Client\PetStore\Client($auth->reveal(), $browser->reveal()); + $result = $client->operations()->showPetById(); + } + #[\PHPUnit\Framework\Attributes\Test] + public function call_httpCode_200_responseContentType_application_json_four(): void + { + $response = new \React\Http\Message\Response(200, ['Content-Type' => 'application/json'], \json_decode('[]', false)); + $auth = $this->prophesize(\ApiClients\Contracts\HTTP\Headers\AuthenticationInterface::class); + $auth->authHeader(Prophecy\Argument::any())->willReturn('Bearer beer')->shouldBeCalled(); + $browser = $this->prophesize(\React\Http\Browser::class); + $browser->withBase(Prophecy\Argument::any())->willReturn($browser->reveal()); + $browser->withFollowRedirects(Prophecy\Argument::any())->willReturn($browser->reveal()); + $browser->request('GET', '/pets/{petId}', Prophecy\Argument::type('array'), Prophecy\Argument::any())->willReturn(\React\Promise\resolve($response))->shouldBeCalled(); + $client = new \ApiClients\Client\PetStore\Client($auth->reveal(), $browser->reveal()); + $result = $client->call(\ApiClients\Client\PetStore\Internal\Operation\ShowPetById::OPERATION_MATCH, (static fn(array $data): array => $data)([])); + } + #[\PHPUnit\Framework\Attributes\Test] + public function operations_httpCode_200_responseContentType_application_json_four(): void + { + $response = new \React\Http\Message\Response(200, ['Content-Type' => 'application/json'], \json_decode('[]', false)); + $auth = $this->prophesize(\ApiClients\Contracts\HTTP\Headers\AuthenticationInterface::class); + $auth->authHeader(Prophecy\Argument::any())->willReturn('Bearer beer')->shouldBeCalled(); + $browser = $this->prophesize(\React\Http\Browser::class); + $browser->withBase(Prophecy\Argument::any())->willReturn($browser->reveal()); + $browser->withFollowRedirects(Prophecy\Argument::any())->willReturn($browser->reveal()); + $browser->request('GET', '/pets/{petId}', Prophecy\Argument::type('array'), Prophecy\Argument::any())->willReturn(\React\Promise\resolve($response))->shouldBeCalled(); + $client = new \ApiClients\Client\PetStore\Client($auth->reveal(), $browser->reveal()); + $result = $client->operations()->showPetById(); + } + #[\PHPUnit\Framework\Attributes\Test] + public function call_httpCode_default_responseContentType_application_json_zero(): void + { + $response = new \React\Http\Message\Response(999, ['Content-Type' => 'application/json'], json_encode(json_decode(\ApiClients\Client\PetStore\Schema\Error::SCHEMA_EXAMPLE_DATA, true))); + $auth = $this->prophesize(\ApiClients\Contracts\HTTP\Headers\AuthenticationInterface::class); + $auth->authHeader(Prophecy\Argument::any())->willReturn('Bearer beer')->shouldBeCalled(); + $browser = $this->prophesize(\React\Http\Browser::class); + $browser->withBase(Prophecy\Argument::any())->willReturn($browser->reveal()); + $browser->withFollowRedirects(Prophecy\Argument::any())->willReturn($browser->reveal()); + $browser->request('GET', '/pets/{petId}', Prophecy\Argument::type('array'), Prophecy\Argument::any())->willReturn(\React\Promise\resolve($response))->shouldBeCalled(); + $client = new \ApiClients\Client\PetStore\Client($auth->reveal(), $browser->reveal()); + $result = $client->call(\ApiClients\Client\PetStore\Internal\Operation\ShowPetById::OPERATION_MATCH, (static fn(array $data): array => $data)([])); + } + #[\PHPUnit\Framework\Attributes\Test] + public function operations_httpCode_default_responseContentType_application_json_zero(): void + { + $response = new \React\Http\Message\Response(999, ['Content-Type' => 'application/json'], json_encode(json_decode(\ApiClients\Client\PetStore\Schema\Error::SCHEMA_EXAMPLE_DATA, true))); + $auth = $this->prophesize(\ApiClients\Contracts\HTTP\Headers\AuthenticationInterface::class); + $auth->authHeader(Prophecy\Argument::any())->willReturn('Bearer beer')->shouldBeCalled(); + $browser = $this->prophesize(\React\Http\Browser::class); + $browser->withBase(Prophecy\Argument::any())->willReturn($browser->reveal()); + $browser->withFollowRedirects(Prophecy\Argument::any())->willReturn($browser->reveal()); + $browser->request('GET', '/pets/{petId}', Prophecy\Argument::type('array'), Prophecy\Argument::any())->willReturn(\React\Promise\resolve($response))->shouldBeCalled(); + $client = new \ApiClients\Client\PetStore\Client($auth->reveal(), $browser->reveal()); + $result = $client->operations()->showPetById(); + } +} diff --git a/tests/app/tests/Types/ClientCallReturnTypes.php b/tests/app/tests/Types/ClientCallReturnTypes.php index d3236cf..af60985 100644 --- a/tests/app/tests/Types/ClientCallReturnTypes.php +++ b/tests/app/tests/Types/ClientCallReturnTypes.php @@ -3,29 +3,17 @@ declare (strict_types=1); namespace ApiClients\Tests\Client\PetStore\Types; -use ApiClients\Client\PetStore\Contract; -use ApiClients\Client\PetStore\Error as ErrorSchemas; -use ApiClients\Client\PetStore\Internal; -use ApiClients\Client\PetStore\Operation; -use ApiClients\Client\PetStore\Schema; -use League\OpenAPIValidation; -use React\Http; -use ApiClients\Contracts; $client = new \ApiClients\Client\PetStore\Client(new class implements \ApiClients\Contracts\HTTP\Headers\AuthenticationInterface { - function authHeader() : string + public function authHeader(): string { return 'Saturn V'; } }, new \React\Http\Browser()); -\PHPStan\Testing\assertType('iterable', $client->call('GET /pets')); -\PHPStan\Testing\assertType('iterable', $client->call('LIST /pets')); -\PHPStan\Testing\assertType('\\ApiClients\\Tools\\OpenApiClient\\Utils\\Response\\WithoutBody', $client->call('POST /pets')); -\PHPStan\Testing\assertType('iterable', $client->call('GET /pets/gatos')); -\PHPStan\Testing\assertType('iterable', $client->call('LIST /pets/gatos')); -\PHPStan\Testing\assertType('iterable', $client->call('GET /pets/kinds/walking')); -\PHPStan\Testing\assertType('iterable', $client->call('LIST /pets/kinds/walking')); -\PHPStan\Testing\assertType('Schema\\Operations\\Pets\\Grouped\\By\\Type\\Response\\ApplicationJson\\Ok', $client->call('GET /pets/groupedByType')); -\PHPStan\Testing\assertType('iterable', $client->call('GET /pets/names')); -\PHPStan\Testing\assertType('iterable', $client->call('LIST /pets/names')); -\PHPStan\Testing\assertType('Schema\\Cat|Schema\\Dog|Schema\\Bird|Schema\\Fish|Schema\\Spider', $client->call('GET /pets/{petId}')); +\PHPStan\Testing\assertType('iterable|\ApiClients\Client\PetStore\Schema\Error', $client->call('GET /pets')); +\PHPStan\Testing\assertType('\ApiClients\Client\PetStore\Schema\Error|\ApiClients\Tools\OpenApiClient\Utils\Response\WithoutBody', $client->call('POST /pets')); +\PHPStan\Testing\assertType('iterable|\ApiClients\Client\PetStore\Schema\Error', $client->call('GET /pets/gatos')); +\PHPStan\Testing\assertType('iterable|\ApiClients\Client\PetStore\Schema\Error', $client->call('GET /pets/kinds/walking')); +\PHPStan\Testing\assertType('\ApiClients\Client\PetStore\Schema\Operations\Pets\Grouped\By\Type\Response\ApplicationJson\Ok|\ApiClients\Client\PetStore\Schema\Error', $client->call('GET /pets/groupedByType')); +\PHPStan\Testing\assertType('iterable|\ApiClients\Client\PetStore\Schema\Error', $client->call('GET /pets/names')); +\PHPStan\Testing\assertType('\ApiClients\Client\PetStore\Schema\Cat|\ApiClients\Client\PetStore\Schema\Dog|\ApiClients\Client\PetStore\Schema\Bird|\ApiClients\Client\PetStore\Schema\Fish|\ApiClients\Client\PetStore\Schema\Spider|\ApiClients\Client\PetStore\Schema\Error', $client->call('GET /pets/{petId}')); diff --git a/tests/app/unit/ConfigurationFactoryTest.php.php b/tests/app/unit/ConfigurationFactoryTest.php.php new file mode 100644 index 0000000..5cb9f10 --- /dev/null +++ b/tests/app/unit/ConfigurationFactoryTest.php.php @@ -0,0 +1,249 @@ + ['file' => 'state.json'], + 'spec' => 'spec.yaml', + 'namespace' => [ + 'source' => 'ApiClients\\Client\\Example', + 'test' => 'ApiClients\\Tests\\Client\\Example', + ], + 'destination' => [ + 'root' => 'generated', + 'source' => 'src', + 'test' => 'tests', + ], + 'entryPoints' => ['webHookMiddleware' => true], + ], '/tmp/'); + + $generators = $this->generatorClassNames($this->packageGenerators($configuration->packages[0])); + + self::assertContains(WebHookMiddlewareGenerator::class, $generators); + self::assertContains(WebHooks::class, $generators); + self::assertContains(WebHook::class, $generators); + self::assertContains(Hydrator::class, $generators); + + $generator = $this->findGenerator($this->packageGenerators($configuration->packages[0]), WebHookMiddlewareGenerator::class); + self::assertInstanceOf(WebHookMiddlewareGenerator::class, $generator); + + $pathsProperty = new ReflectionProperty(WebHookMiddlewareGenerator::class, 'defaultPaths'); + self::assertSame(['/webhook'], $pathsProperty->getValue($generator)); + } + + #[Test] + public function webHookMiddlewareUsesConfiguredPaths(): void + { + $configuration = ConfigurationFactory::fromYaml([ + 'state' => ['file' => 'state.json'], + 'spec' => 'spec.yaml', + 'namespace' => [ + 'source' => 'ApiClients\\Client\\Example', + 'test' => 'ApiClients\\Tests\\Client\\Example', + ], + 'destination' => [ + 'root' => 'generated', + 'source' => 'src', + 'test' => 'tests', + ], + 'entryPoints' => [ + 'webHookMiddleware' => [ + 'paths' => ['/hooks/github', '/webhook'], + ], + ], + ], '/tmp/'); + + $generator = $this->findGenerator($this->packageGenerators($configuration->packages[0]), WebHookMiddlewareGenerator::class); + self::assertInstanceOf(WebHookMiddlewareGenerator::class, $generator); + + $pathsProperty = new ReflectionProperty(WebHookMiddlewareGenerator::class, 'defaultPaths'); + self::assertSame(['/hooks/github', '/webhook'], $pathsProperty->getValue($generator)); + } + + #[Test] + public function webHookMiddlewareAllowsExplicitEmptyPaths(): void + { + $configuration = ConfigurationFactory::fromYaml([ + 'state' => ['file' => 'state.json'], + 'spec' => 'spec.yaml', + 'namespace' => [ + 'source' => 'ApiClients\\Client\\Example', + 'test' => 'ApiClients\\Tests\\Client\\Example', + ], + 'destination' => [ + 'root' => 'generated', + 'source' => 'src', + 'test' => 'tests', + ], + 'entryPoints' => [ + 'webHookMiddleware' => [ + 'paths' => [], + ], + ], + ], '/tmp/'); + + $generator = $this->findGenerator($this->packageGenerators($configuration->packages[0]), WebHookMiddlewareGenerator::class); + self::assertInstanceOf(WebHookMiddlewareGenerator::class, $generator); + + $pathsProperty = new ReflectionProperty(WebHookMiddlewareGenerator::class, 'defaultPaths'); + self::assertSame([], $pathsProperty->getValue($generator)); + } + + #[Test] + public function webHookMiddlewareDisabledByDefault(): void + { + $configuration = ConfigurationFactory::fromYaml([ + 'state' => ['file' => 'state.json'], + 'spec' => 'spec.yaml', + 'namespace' => [ + 'source' => 'ApiClients\\Client\\Example', + 'test' => 'ApiClients\\Tests\\Client\\Example', + ], + 'destination' => [ + 'root' => 'generated', + 'source' => 'src', + 'test' => 'tests', + ], + 'entryPoints' => ['webHooks' => false], + ], '/tmp/'); + + $generators = $this->generatorClassNames($this->packageGenerators($configuration->packages[0])); + + self::assertNotContains(WebHookMiddlewareGenerator::class, $generators); + self::assertContains(Schema::class, $generators); + } + + #[Test] + public function webHookMiddlewareRejectsInvalidConfiguration(): void + { + $this->expectException(InvalidArgumentException::class); + + ConfigurationFactory::fromYaml([ + 'state' => ['file' => 'state.json'], + 'spec' => 'spec.yaml', + 'namespace' => [ + 'source' => 'ApiClients\\Client\\Example', + 'test' => 'ApiClients\\Tests\\Client\\Example', + ], + 'destination' => [ + 'root' => 'generated', + 'source' => 'src', + 'test' => 'tests', + ], + 'entryPoints' => [ + 'webHookMiddleware' => ['paths' => '/webhook'], + ], + ], '/tmp/'); + } + + #[Test] + public function webHookMiddlewareAddsPsrDependenciesToTemplateVariables(): void + { + $configuration = ConfigurationFactory::fromYaml([ + 'state' => ['file' => 'state.json'], + 'spec' => 'spec.yaml', + 'namespace' => [ + 'source' => 'ApiClients\\Client\\Example', + 'test' => 'ApiClients\\Tests\\Client\\Example', + ], + 'destination' => [ + 'root' => 'generated', + 'source' => 'src', + 'test' => 'tests', + ], + 'templates' => [ + 'dir' => 'templates/', + 'variables' => [ + 'requires' => [ + ['name' => 'example/package', 'version' => '^1.0'], + ], + ], + ], + 'entryPoints' => ['webHookMiddleware' => true], + ], '/tmp/'); + + $templates = $this->packageTemplates($configuration->packages[0]); + self::assertNotNull($templates); + self::assertIsArray($templates->variables); + + /** @var list $requires */ + $requires = $templates->variables['requires']; + $names = array_map(static fn (array $require): string => $require['name'], $requires); + + self::assertContains('example/package', $names); + self::assertContains('openapi-tools/contract', $names); + self::assertContains('psr/http-server-handler', $names); + self::assertContains('psr/http-server-middleware', $names); + self::assertCount(4, $requires); + + /** @var mixed $requiresMixed */ + $requiresMixed = $templates->variables['requires']; + self::assertIsArray($requiresMixed); + self::assertTrue(array_is_list($requiresMixed)); + } + + /** + * @param array $generators + * + * @return array + */ + private function generatorClassNames(array $generators): array + { + return array_map(static fn (object $generator): string => $generator::class, $generators); + } + + /** @return list */ + private function packageGenerators(object $package): array + { + $generatorsProperty = new ReflectionProperty($package, 'generators'); + + /** @var list $generators */ + $generators = $generatorsProperty->getValue($package); + + return $generators; + } + + private function packageTemplates(object $package): Templates|null + { + $templatesProperty = new ReflectionProperty($package, 'templates'); + + $templates = $templatesProperty->getValue($package); + + return $templates instanceof Templates ? $templates : null; + } + + /** @param array $generators */ + private function findGenerator(array $generators, string $className): object + { + foreach ($generators as $generator) { + if ($generator::class === $className) { + return $generator; + } + } + + self::fail('Generator not found: ' . $className); + } +} + diff --git a/tests/app/unit/GenerateTest.php.php b/tests/app/unit/GenerateTest.php.php new file mode 100644 index 0000000..baeea2b --- /dev/null +++ b/tests/app/unit/GenerateTest.php.php @@ -0,0 +1,96 @@ + $yaml */ + $yaml = Yaml::parseFile($configurationFile); + + $destination = $yaml['destination'] ?? null; + self::assertIsArray($destination); + $destination['root'] = 'test-app'; + $yaml['destination'] = $destination; + + Generator::generate( + ConfigurationFactory::fromYaml($yaml, $configurationDirectory), + $configurationDirectory, + ); + + $appRootPath = dirname(__DIR__) . '/app/'; + $testAppRootPath = dirname(__DIR__) . '/test-app/'; + + $appMap = []; + $testAppMap = []; + + foreach (new IteratorIterator(new RecursiveIteratorIterator(new RecursiveDirectoryIterator($appRootPath))) as $file) { + if (! $file instanceof SplFileInfo || ! $file->isFile()) { + continue; + } + + $fileName = substr($file->getPathname(), strlen($appRootPath)); + if ($fileName === 'etc/openapi-client-generator.state') { + continue; + } + + $appMap[$fileName] = md5_file($appRootPath . $fileName); + } + + foreach (new IteratorIterator(new RecursiveIteratorIterator(new RecursiveDirectoryIterator($testAppRootPath))) as $file) { + if (! $file instanceof SplFileInfo || ! $file->isFile()) { + continue; + } + + $fileName = substr($file->getPathname(), strlen($testAppRootPath)); + if ($fileName === 'etc/openapi-client-generator.state') { + continue; + } + + $testAppMap[$fileName] = md5_file($testAppRootPath . $fileName); + } + + ksort($appMap); + ksort($testAppMap); + + foreach (array_unique([...array_keys($appMap), ...array_keys($testAppMap)]) as $generatedFileName) { + self::assertFileExists($appRootPath . $generatedFileName); + self::assertFileExists($testAppRootPath . $generatedFileName); + + self::assertSame( + file_get_contents($appRootPath . $generatedFileName), + file_get_contents($testAppRootPath . $generatedFileName), + $generatedFileName, + ); + } + } +} + diff --git a/tests/app/unit/Generator/Helper/TypesTest.php.php b/tests/app/unit/Generator/Helper/TypesTest.php.php new file mode 100644 index 0000000..b82ec1e --- /dev/null +++ b/tests/app/unit/Generator/Helper/TypesTest.php.php @@ -0,0 +1,99 @@ +, array{docBlock: list, raw: list}}> */ + public static function types(): iterable + { + foreach (self::SCALARS as $scalar) { + yield $scalar => [ + [$scalar], + [ + 'docBlock' => [$scalar], + 'raw' => [$scalar], + ], + ]; + } + + yield 'simple-user' => [ + ['SimpleUser'], + [ + 'docBlock' => ['Schema\SimpleUser'], + 'raw' => ['Schema\SimpleUser'], + ], + ]; + + yield 'leading-slash' => [ + ['\SimpleUser'], + [ + 'docBlock' => ['\SimpleUser'], + 'raw' => ['\SimpleUser'], + ], + ]; + } + + /** + * @param array $input + * @param array{docBlock: list, raw: list} $output + */ + #[Test] + #[DataProvider('types')] + public function normalizeDocBlock(array $input, array $output): void + { + self::assertEquals( + Types::normalizeDocBlock(...$input), + $output['docBlock'], + ); + } + + /** + * @param array $input + * @param array{docBlock: list, raw: list} $output + */ + #[Test] + #[DataProvider('types')] + public function normalizeRaw(array $input, array $output): void + { + self::assertEquals( + Types::normalizeRaw(...$input), + $output['raw'], + ); + } + + /** + * @param array $input + * @param array{docBlock: list, raw: list} $output + */ + #[Test] + #[DataProvider('types')] + public function normalizeNodeName(array $input, array $output): void + { + self::assertEquals( + array_map( + static fn (Node\Name $type): string => $type->toString(), + Types::normalizeNodeName(...$input), + ), + $output['raw'], + ); + } +} + diff --git a/tests/openapi-client-petstore.php b/tests/openapi-client-petstore.php new file mode 100644 index 0000000..cfd9f9b --- /dev/null +++ b/tests/openapi-client-petstore.php @@ -0,0 +1,7 @@ + ['file' => 'state.json'], + 'spec' => 'spec.yaml', + 'namespace' => [ + 'source' => 'ApiClients\\Client\\Example', + 'test' => 'ApiClients\\Tests\\Client\\Example', + ], + 'destination' => [ + 'root' => 'generated', + 'source' => 'src', + 'test' => 'tests', + ], + 'entryPoints' => ['webHookMiddleware' => true], + ], '/tmp/'); + + $generators = $this->generatorClassNames($this->packageGenerators($configuration->packages[0])); + + self::assertContains(WebHookMiddlewareGenerator::class, $generators); + self::assertNotContains(WebHooks::class, $generators); + self::assertNotContains(WebHook::class, $generators); + self::assertContains(Hydrator::class, $generators); + + $generator = $this->findGenerator($this->packageGenerators($configuration->packages[0]), WebHookMiddlewareGenerator::class); + self::assertInstanceOf(WebHookMiddlewareGenerator::class, $generator); + + $pathsProperty = new ReflectionProperty(WebHookMiddlewareGenerator::class, 'defaultPaths'); + self::assertSame(['/webhook'], $pathsProperty->getValue($generator)); + } + + #[Test] + public function webHookMiddlewareUsesConfiguredPaths(): void + { + $configuration = ConfigurationFactory::fromYaml([ + 'state' => ['file' => 'state.json'], + 'spec' => 'spec.yaml', + 'namespace' => [ + 'source' => 'ApiClients\\Client\\Example', + 'test' => 'ApiClients\\Tests\\Client\\Example', + ], + 'destination' => [ + 'root' => 'generated', + 'source' => 'src', + 'test' => 'tests', + ], + 'entryPoints' => [ + 'webHookMiddleware' => [ + 'paths' => ['/hooks/github', '/webhook'], + ], + ], + ], '/tmp/'); + + $generator = $this->findGenerator($this->packageGenerators($configuration->packages[0]), WebHookMiddlewareGenerator::class); + self::assertInstanceOf(WebHookMiddlewareGenerator::class, $generator); + + $pathsProperty = new ReflectionProperty(WebHookMiddlewareGenerator::class, 'defaultPaths'); + self::assertSame(['/hooks/github', '/webhook'], $pathsProperty->getValue($generator)); + } + + #[Test] + public function webHookMiddlewareAllowsExplicitEmptyPaths(): void + { + $configuration = ConfigurationFactory::fromYaml([ + 'state' => ['file' => 'state.json'], + 'spec' => 'spec.yaml', + 'namespace' => [ + 'source' => 'ApiClients\\Client\\Example', + 'test' => 'ApiClients\\Tests\\Client\\Example', + ], + 'destination' => [ + 'root' => 'generated', + 'source' => 'src', + 'test' => 'tests', + ], + 'entryPoints' => [ + 'webHookMiddleware' => [ + 'paths' => [], + ], + ], + ], '/tmp/'); + + $generator = $this->findGenerator($this->packageGenerators($configuration->packages[0]), WebHookMiddlewareGenerator::class); + self::assertInstanceOf(WebHookMiddlewareGenerator::class, $generator); + + $pathsProperty = new ReflectionProperty(WebHookMiddlewareGenerator::class, 'defaultPaths'); + self::assertSame([], $pathsProperty->getValue($generator)); + } + + #[Test] + public function webHookMiddlewareDisabledByDefault(): void + { + $configuration = ConfigurationFactory::fromYaml([ + 'state' => ['file' => 'state.json'], + 'spec' => 'spec.yaml', + 'namespace' => [ + 'source' => 'ApiClients\\Client\\Example', + 'test' => 'ApiClients\\Tests\\Client\\Example', + ], + 'destination' => [ + 'root' => 'generated', + 'source' => 'src', + 'test' => 'tests', + ], + 'entryPoints' => ['webHooks' => false], + ], '/tmp/'); + + $generators = $this->generatorClassNames($this->packageGenerators($configuration->packages[0])); + + self::assertNotContains(WebHookMiddlewareGenerator::class, $generators); + self::assertContains(Schema::class, $generators); + } + + #[Test] + public function webHookMiddlewareRejectsInvalidConfiguration(): void + { + $this->expectException(InvalidArgumentException::class); + + ConfigurationFactory::fromYaml([ + 'state' => ['file' => 'state.json'], + 'spec' => 'spec.yaml', + 'namespace' => [ + 'source' => 'ApiClients\\Client\\Example', + 'test' => 'ApiClients\\Tests\\Client\\Example', + ], + 'destination' => [ + 'root' => 'generated', + 'source' => 'src', + 'test' => 'tests', + ], + 'entryPoints' => [ + 'webHookMiddleware' => ['paths' => '/webhook'], + ], + ], '/tmp/'); + } + + #[Test] + public function webHookMiddlewareAddsPsrDependenciesToTemplateVariables(): void + { + $configuration = ConfigurationFactory::fromYaml([ + 'state' => ['file' => 'state.json'], + 'spec' => 'spec.yaml', + 'namespace' => [ + 'source' => 'ApiClients\\Client\\Example', + 'test' => 'ApiClients\\Tests\\Client\\Example', + ], + 'destination' => [ + 'root' => 'generated', + 'source' => 'src', + 'test' => 'tests', + ], + 'templates' => [ + 'dir' => 'templates/', + 'variables' => [ + 'requires' => [ + ['name' => 'example/package', 'version' => '^1.0'], + ], + ], + ], + 'entryPoints' => ['webHookMiddleware' => true], + ], '/tmp/'); + + $templates = $this->packageTemplates($configuration->packages[0]); + self::assertNotNull($templates); + self::assertIsArray($templates->variables); + + /** @var list $requires */ + $requires = $templates->variables['requires']; + $names = array_map(static fn (array $require): string => $require['name'], $requires); + + self::assertContains('example/package', $names); + self::assertContains('openapi-tools/contract', $names); + self::assertContains('psr/http-server-handler', $names); + self::assertContains('psr/http-server-middleware', $names); + self::assertCount(4, $requires); + + /** @var mixed $requiresMixed */ + $requiresMixed = $templates->variables['requires']; + self::assertIsArray($requiresMixed); + self::assertTrue(array_is_list($requiresMixed)); + } + + #[Test] + public function fromYamlFileLoadsConfiguration(): void + { + $configuration = ConfigurationFactory::fromYamlFile(dirname(__DIR__) . '/openapi-client-petstore.yaml'); + + self::assertSame('petstore.yaml', $configuration->gathering->spec); + self::assertSame('ApiClients\\Client\\PetStore', $configuration->packages[0]->namespace->source); + } + + /** + * @param array $generators + * + * @return array + */ + private function generatorClassNames(array $generators): array + { + return array_map(static fn (object $generator): string => $generator::class, $generators); + } + + /** @return list */ + private function packageGenerators(object $package): array + { + $generatorsProperty = new ReflectionProperty($package, 'generators'); + + /** @var list $generators */ + $generators = $generatorsProperty->getValue($package); + + return $generators; + } + + private function packageTemplates(object $package): Templates|null + { + $templatesProperty = new ReflectionProperty($package, 'templates'); + + $templates = $templatesProperty->getValue($package); + + return $templates instanceof Templates ? $templates : null; + } + + /** @param array $generators */ + private function findGenerator(array $generators, string $className): object + { + foreach ($generators as $generator) { + if ($generator::class === $className) { + return $generator; + } + } + + self::fail('Generator not found: ' . $className); + } +} diff --git a/tests/unit/GenerateTest.php b/tests/unit/GenerateTest.php index 11d5fac..68b1f36 100644 --- a/tests/unit/GenerateTest.php +++ b/tests/unit/GenerateTest.php @@ -4,23 +4,22 @@ namespace ApiClients\Tests\Tools\OpenApiClientGenerator; -use ApiClients\Tools\OpenApiClientGenerator\Configuration; -use ApiClients\Tools\OpenApiClientGenerator\Generator; -use EventSauce\ObjectHydrator\ObjectMapperUsingReflection; +use ApiClients\Tools\OpenApiClientGenerator\ConfigurationFactory; use IteratorIterator; +use OpenAPITools\Generator\Generator; +use PHPUnit\Framework\Attributes\Test; use RecursiveDirectoryIterator; use RecursiveIteratorIterator; +use SplFileInfo; use Symfony\Component\Yaml\Yaml; use WyriHaximus\TestUtilities\TestCase; use function array_keys; use function array_unique; -use function assert; use function dirname; -use function is_string; +use function file_get_contents; use function ksort; -use function Safe\file_get_contents; -use function Safe\md5_file; +use function md5_file; use function strlen; use function substr; @@ -28,19 +27,23 @@ final class GenerateTest extends TestCase { - /** @test */ + #[Test] public function generateAndCompare(): void { - $yaml = Yaml::parseFile(dirname(__DIR__) . '/openapi-client-petstore.yaml'); - $yaml['destination']['root'] = 'test-app'; - $configuration = (new ObjectMapperUsingReflection())->hydrateObject(Configuration::class, $yaml); - (new Generator( - $configuration, - dirname(dirname(__DIR__) . '/openapi-client-petstore.yaml') . DIRECTORY_SEPARATOR, - ))->generate( - $configuration->namespace->source . '\\', - $configuration->namespace->test . '\\', - dirname(dirname(__DIR__) . '/openapi-client-petstore.yaml') . DIRECTORY_SEPARATOR, + $configurationFile = dirname(__DIR__) . '/openapi-client-petstore.yaml'; + $configurationDirectory = dirname($configurationFile) . DIRECTORY_SEPARATOR; + + /** @var array $yaml */ + $yaml = Yaml::parseFile($configurationFile); + + $destination = $yaml['destination'] ?? null; + self::assertIsArray($destination); + $destination['root'] = 'test-app'; + $yaml['destination'] = $destination; + + Generator::generate( + ConfigurationFactory::fromYaml($yaml, $configurationDirectory), + $configurationDirectory, ); $appRootPath = dirname(__DIR__) . '/app/'; @@ -50,7 +53,7 @@ public function generateAndCompare(): void $testAppMap = []; foreach (new IteratorIterator(new RecursiveIteratorIterator(new RecursiveDirectoryIterator($appRootPath))) as $file) { - if (! $file->isFile()) { + if (! $file instanceof SplFileInfo || ! $file->isFile()) { continue; } @@ -63,7 +66,7 @@ public function generateAndCompare(): void } foreach (new IteratorIterator(new RecursiveIteratorIterator(new RecursiveDirectoryIterator($testAppRootPath))) as $file) { - if (! $file->isFile()) { + if (! $file instanceof SplFileInfo || ! $file->isFile()) { continue; } @@ -79,8 +82,6 @@ public function generateAndCompare(): void ksort($testAppMap); foreach (array_unique([...array_keys($appMap), ...array_keys($testAppMap)]) as $generatedFileName) { - self::assertIsString($generatedFileName); - assert(is_string($generatedFileName)); self::assertFileExists($appRootPath . $generatedFileName); self::assertFileExists($testAppRootPath . $generatedFileName); diff --git a/tests/unit/Generator/Helper/TypesTest.php b/tests/unit/Generator/Helper/TypesTest.php index 979f367..4ded64c 100644 --- a/tests/unit/Generator/Helper/TypesTest.php +++ b/tests/unit/Generator/Helper/TypesTest.php @@ -4,26 +4,28 @@ namespace ApiClients\Tests\Tools\OpenApiClientGenerator\Generator\Helper; -use ApiClients\Tools\OpenApiClientGenerator\Generator; +use ApiClients\Tools\OpenApiClientGenerator\Generator\Helper\Types; use PhpParser\Node; +use PHPUnit\Framework\Attributes\DataProvider; +use PHPUnit\Framework\Attributes\Test; use WyriHaximus\TestUtilities\TestCase; use function array_map; final class TypesTest extends TestCase { - private const SCALARS = [ + private const array SCALARS = [ 'string', 'int', 'float', 'bool', ]; - /** @return iterable, array{docBlock: array, raw: array}> */ - public function types(): iterable + /** @return iterable, array{docBlock: list, raw: list}}> */ + public static function types(): iterable { foreach (self::SCALARS as $scalar) { - yield [ + yield $scalar => [ [$scalar], [ 'docBlock' => [$scalar], @@ -32,7 +34,7 @@ public function types(): iterable ]; } - yield [ + yield 'simple-user' => [ ['SimpleUser'], [ 'docBlock' => ['Schema\SimpleUser'], @@ -40,7 +42,7 @@ public function types(): iterable ], ]; - yield [ + yield 'leading-slash' => [ ['\SimpleUser'], [ 'docBlock' => ['\SimpleUser'], @@ -50,48 +52,45 @@ public function types(): iterable } /** - * @param array $input - * @param array{docBlock: array} $output - * - * @test - * @dataProvider types + * @param array $input + * @param array{docBlock: list, raw: list} $output */ + #[Test] + #[DataProvider('types')] public function normalizeDocBlock(array $input, array $output): void { self::assertEquals( - Generator\Helper\Types::normalizeDocBlock(...$input), + Types::normalizeDocBlock(...$input), $output['docBlock'], ); } /** - * @param array $input - * @param array{raw: array} $output - * - * @test - * @dataProvider types + * @param array $input + * @param array{docBlock: list, raw: list} $output */ + #[Test] + #[DataProvider('types')] public function normalizeRaw(array $input, array $output): void { self::assertEquals( - Generator\Helper\Types::normalizeRaw(...$input), + Types::normalizeRaw(...$input), $output['raw'], ); } /** - * @param array $input - * @param array{raw: array} $output - * - * @test - * @dataProvider types + * @param array $input + * @param array{docBlock: list, raw: list} $output */ + #[Test] + #[DataProvider('types')] public function normalizeNodeName(array $input, array $output): void { self::assertEquals( array_map( static fn (Node\Name $type): string => $type->toString(), - Generator\Helper\Types::normalizeNodeName(...$input), + Types::normalizeNodeName(...$input), ), $output['raw'], ); diff --git a/var/.gitkeep b/var/.gitkeep new file mode 100644 index 0000000..e69de29