diff --git a/.dxcli/subcommands/run-tests.sh b/.dxcli/subcommands/run-tests.sh index 9bd4681..82c1502 100755 --- a/.dxcli/subcommands/run-tests.sh +++ b/.dxcli/subcommands/run-tests.sh @@ -37,6 +37,10 @@ source "$PROJECT_ROOT/.dxcli/shared.sh" # Validate environment require_command php +echo +log_info "Running architecture tests..." +/usr/bin/env php "$PROJECT_ROOT/vendor/bin/pest" --group=architecture + echo log_info "Running shell-scripts tests..." /usr/bin/env bats "$PROJECT_ROOT/tests/ShellScripts/test-docker-cli-wrapper.bats" diff --git a/.gitignore b/.gitignore index 98528a1..dea0e98 100644 --- a/.gitignore +++ b/.gitignore @@ -1,4 +1,3 @@ - ###> symfony/framework-bundle ### /.env.local /.env.local.php @@ -16,6 +15,7 @@ ###> symfony/phpunit-bridge ### .phpunit.result.cache +.phpunit.cache /phpunit.xml ###< symfony/phpunit-bridge ### @@ -41,9 +41,4 @@ node_modules/ ###> sensiolabs/minify-bundle ### /var/minify/ ###< sensiolabs/minify-bundle ### - -###> deptrac/deptrac ### -.deptrac.cache -###< deptrac/deptrac ### - .cursor/mcp.json diff --git a/composer.json b/composer.json index 2f3960b..9793a9d 100644 --- a/composer.json +++ b/composer.json @@ -64,7 +64,8 @@ "php-http/discovery": true, "symfony/flex": true, "symfony/runtime": true, - "phpstan/extension-installer": true + "phpstan/extension-installer": true, + "pestphp/pest-plugin": true }, "bump-after-update": true, "sort-packages": true @@ -113,15 +114,15 @@ }, "require-dev": { "dbrekelmans/bdi": "^1.4", - "deptrac/deptrac": "^3.0", "ergebnis/phpstan-rules": "^2.11.0", "erickskrauch/php-cs-fixer-custom-fixers": "^1.3", "friendsofphp/php-cs-fixer": "^3.86.0", + "pestphp/pest": "^4.1.0", + "pestphp/pest-plugin-arch": "^4.0.0", "phpstan/extension-installer": "^1.4.3", "phpstan/phpstan-doctrine": "^2.0.4", "phpstan/phpstan-phpunit": "^2.0.7", "phpstan/phpstan-symfony": "^2.0.7", - "phpunit/phpunit": "^9.6.25", "symfony/browser-kit": "7.3.*", "symfony/css-selector": "7.3.*", "symfony/debug-bundle": "7.3.*", diff --git a/composer.lock b/composer.lock index 197d122..cb3657e 100644 --- a/composer.lock +++ b/composer.lock @@ -4,7 +4,7 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "This file is @generated automatically" ], - "content-hash": "f070a471c3ad93edad136ed0eb2fefab", + "content-hash": "4951223c190ba519d8e2a57fa3e1de75", "packages": [ { "name": "brick/math", @@ -3115,16 +3115,16 @@ }, { "name": "phpstan/phpdoc-parser", - "version": "2.2.0", + "version": "2.3.0", "source": { "type": "git", "url": "https://github.com/phpstan/phpdoc-parser.git", - "reference": "b9e61a61e39e02dd90944e9115241c7f7e76bfd8" + "reference": "1e0cd5370df5dd2e556a36b9c62f62e555870495" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/phpstan/phpdoc-parser/zipball/b9e61a61e39e02dd90944e9115241c7f7e76bfd8", - "reference": "b9e61a61e39e02dd90944e9115241c7f7e76bfd8", + "url": "https://api.github.com/repos/phpstan/phpdoc-parser/zipball/1e0cd5370df5dd2e556a36b9c62f62e555870495", + "reference": "1e0cd5370df5dd2e556a36b9c62f62e555870495", "shasum": "" }, "require": { @@ -3156,9 +3156,9 @@ "description": "PHPDoc parser with support for nullable, intersection and generic types", "support": { "issues": "https://github.com/phpstan/phpdoc-parser/issues", - "source": "https://github.com/phpstan/phpdoc-parser/tree/2.2.0" + "source": "https://github.com/phpstan/phpdoc-parser/tree/2.3.0" }, - "time": "2025-07-13T07:04:09+00:00" + "time": "2025-08-30T15:50:23+00:00" }, { "name": "psr/cache", @@ -4492,16 +4492,16 @@ }, { "name": "symfony/console", - "version": "v7.3.2", + "version": "v7.3.3", "source": { "type": "git", "url": "https://github.com/symfony/console.git", - "reference": "5f360ebc65c55265a74d23d7fe27f957870158a1" + "reference": "cb0102a1c5ac3807cf3fdf8bea96007df7fdbea7" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/console/zipball/5f360ebc65c55265a74d23d7fe27f957870158a1", - "reference": "5f360ebc65c55265a74d23d7fe27f957870158a1", + "url": "https://api.github.com/repos/symfony/console/zipball/cb0102a1c5ac3807cf3fdf8bea96007df7fdbea7", + "reference": "cb0102a1c5ac3807cf3fdf8bea96007df7fdbea7", "shasum": "" }, "require": { @@ -4566,7 +4566,7 @@ "terminal" ], "support": { - "source": "https://github.com/symfony/console/tree/v7.3.2" + "source": "https://github.com/symfony/console/tree/v7.3.3" }, "funding": [ { @@ -4586,7 +4586,7 @@ "type": "tidelift" } ], - "time": "2025-07-30T17:13:41+00:00" + "time": "2025-08-25T06:35:40+00:00" }, { "name": "symfony/dependency-injection", @@ -7727,16 +7727,16 @@ }, { "name": "symfony/process", - "version": "v7.3.0", + "version": "v7.3.3", "source": { "type": "git", "url": "https://github.com/symfony/process.git", - "reference": "40c295f2deb408d5e9d2d32b8ba1dd61e36f05af" + "reference": "32241012d521e2e8a9d713adb0812bb773b907f1" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/process/zipball/40c295f2deb408d5e9d2d32b8ba1dd61e36f05af", - "reference": "40c295f2deb408d5e9d2d32b8ba1dd61e36f05af", + "url": "https://api.github.com/repos/symfony/process/zipball/32241012d521e2e8a9d713adb0812bb773b907f1", + "reference": "32241012d521e2e8a9d713adb0812bb773b907f1", "shasum": "" }, "require": { @@ -7768,7 +7768,7 @@ "description": "Executes commands in sub-processes", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/process/tree/v7.3.0" + "source": "https://github.com/symfony/process/tree/v7.3.3" }, "funding": [ { @@ -7779,12 +7779,16 @@ "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": "2025-04-17T09:11:12+00:00" + "time": "2025-08-18T09:42:54+00:00" }, { "name": "symfony/property-access", @@ -8801,16 +8805,16 @@ }, { "name": "symfony/string", - "version": "v7.3.2", + "version": "v7.3.3", "source": { "type": "git", "url": "https://github.com/symfony/string.git", - "reference": "42f505aff654e62ac7ac2ce21033818297ca89ca" + "reference": "17a426cce5fd1f0901fefa9b2a490d0038fd3c9c" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/string/zipball/42f505aff654e62ac7ac2ce21033818297ca89ca", - "reference": "42f505aff654e62ac7ac2ce21033818297ca89ca", + "url": "https://api.github.com/repos/symfony/string/zipball/17a426cce5fd1f0901fefa9b2a490d0038fd3c9c", + "reference": "17a426cce5fd1f0901fefa9b2a490d0038fd3c9c", "shasum": "" }, "require": { @@ -8868,7 +8872,7 @@ "utf8" ], "support": { - "source": "https://github.com/symfony/string/tree/v7.3.2" + "source": "https://github.com/symfony/string/tree/v7.3.3" }, "funding": [ { @@ -8888,7 +8892,7 @@ "type": "tidelift" } ], - "time": "2025-07-10T08:47:49+00:00" + "time": "2025-08-25T06:35:40+00:00" }, { "name": "symfony/translation", @@ -10533,6 +10537,100 @@ } ], "packages-dev": [ + { + "name": "brianium/paratest", + "version": "v7.12.0", + "source": { + "type": "git", + "url": "https://github.com/paratestphp/paratest.git", + "reference": "6a34ddb12a3bd5bd07d831ce95f111087f3bcbd8" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/paratestphp/paratest/zipball/6a34ddb12a3bd5bd07d831ce95f111087f3bcbd8", + "reference": "6a34ddb12a3bd5bd07d831ce95f111087f3bcbd8", + "shasum": "" + }, + "require": { + "ext-dom": "*", + "ext-pcre": "*", + "ext-reflection": "*", + "ext-simplexml": "*", + "fidry/cpu-core-counter": "^1.3.0", + "jean85/pretty-package-versions": "^2.1.1", + "php": "~8.3.0 || ~8.4.0 || ~8.5.0", + "phpunit/php-code-coverage": "^12.3.2", + "phpunit/php-file-iterator": "^6", + "phpunit/php-timer": "^8", + "phpunit/phpunit": "^12.3.6", + "sebastian/environment": "^8.0.3", + "symfony/console": "^6.4.20 || ^7.3.2", + "symfony/process": "^6.4.20 || ^7.3.0" + }, + "require-dev": { + "doctrine/coding-standard": "^13.0.1", + "ext-pcntl": "*", + "ext-pcov": "*", + "ext-posix": "*", + "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", + "squizlabs/php_codesniffer": "^3.13.2", + "symfony/filesystem": "^6.4.13 || ^7.3.2" + }, + "bin": [ + "bin/paratest", + "bin/paratest_for_phpstorm" + ], + "type": "library", + "autoload": { + "psr-4": { + "ParaTest\\": [ + "src/" + ] + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Brian Scaturro", + "email": "scaturrob@gmail.com", + "role": "Developer" + }, + { + "name": "Filippo Tessarotto", + "email": "zoeslam@gmail.com", + "role": "Developer" + } + ], + "description": "Parallel testing for PHP", + "homepage": "https://github.com/paratestphp/paratest", + "keywords": [ + "concurrent", + "parallel", + "phpunit", + "testing" + ], + "support": { + "issues": "https://github.com/paratestphp/paratest/issues", + "source": "https://github.com/paratestphp/paratest/tree/v7.12.0" + }, + "funding": [ + { + "url": "https://github.com/sponsors/Slamdunk", + "type": "github" + }, + { + "url": "https://paypal.me/filippotessarotto", + "type": "paypal" + } + ], + "time": "2025-08-29T05:28:31+00:00" + }, { "name": "clue/ndjson-react", "version": "v1.3.0", @@ -10791,54 +10889,6 @@ }, "time": "2024-12-12T18:36:47+00:00" }, - { - "name": "deptrac/deptrac", - "version": "3.0.0", - "source": { - "type": "git", - "url": "https://github.com/deptrac/deptrac.git", - "reference": "605ee322f273ade1727f5ff2db3b47566140f4bf" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/deptrac/deptrac/zipball/605ee322f273ade1727f5ff2db3b47566140f4bf", - "reference": "605ee322f273ade1727f5ff2db3b47566140f4bf", - "shasum": "" - }, - "require": { - "ext-json": "*", - "php": "^8.1" - }, - "suggest": { - "ext-dom": "For using the JUnit output formatter" - }, - "bin": [ - "bin/deptrac", - "deptrac.phar" - ], - "type": "library", - "autoload": { - "files": [ - "bootstrap.php" - ], - "psr-4": { - "Deptrac\\Deptrac\\": "src/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "description": "Deptrac is a static code analysis tool that helps to enforce rules for dependencies between software layers.", - "keywords": [ - "static analysis" - ], - "support": { - "issues": "https://github.com/deptrac/deptrac/issues", - "source": "https://github.com/deptrac/deptrac/tree/3.0.0" - }, - "time": "2025-02-17T08:20:48+00:00" - }, { "name": "ergebnis/phpstan-rules", "version": "2.11.0", @@ -11088,6 +11138,77 @@ ], "time": "2025-08-14T07:29:31+00:00" }, + { + "name": "filp/whoops", + "version": "2.18.4", + "source": { + "type": "git", + "url": "https://github.com/filp/whoops.git", + "reference": "d2102955e48b9fd9ab24280a7ad12ed552752c4d" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/filp/whoops/zipball/d2102955e48b9fd9ab24280a7ad12ed552752c4d", + "reference": "d2102955e48b9fd9ab24280a7ad12ed552752c4d", + "shasum": "" + }, + "require": { + "php": "^7.1 || ^8.0", + "psr/log": "^1.0.1 || ^2.0 || ^3.0" + }, + "require-dev": { + "mockery/mockery": "^1.0", + "phpunit/phpunit": "^7.5.20 || ^8.5.8 || ^9.3.3", + "symfony/var-dumper": "^4.0 || ^5.0" + }, + "suggest": { + "symfony/var-dumper": "Pretty print complex values better with var-dumper available", + "whoops/soap": "Formats errors as SOAP responses" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "2.7-dev" + } + }, + "autoload": { + "psr-4": { + "Whoops\\": "src/Whoops/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Filipe Dobreira", + "homepage": "https://github.com/filp", + "role": "Developer" + } + ], + "description": "php error handling for cool kids", + "homepage": "https://filp.github.io/whoops/", + "keywords": [ + "error", + "exception", + "handling", + "library", + "throwable", + "whoops" + ], + "support": { + "issues": "https://github.com/filp/whoops/issues", + "source": "https://github.com/filp/whoops/tree/2.18.4" + }, + "funding": [ + { + "url": "https://github.com/denis-sokolov", + "type": "github" + } + ], + "time": "2025-08-08T12:00:00+00:00" + }, { "name": "friendsofphp/php-cs-fixer", "version": "v3.86.0", @@ -11193,6 +11314,66 @@ ], "time": "2025-08-13T22:36:21+00:00" }, + { + "name": "jean85/pretty-package-versions", + "version": "2.1.1", + "source": { + "type": "git", + "url": "https://github.com/Jean85/pretty-package-versions.git", + "reference": "4d7aa5dab42e2a76d99559706022885de0e18e1a" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/Jean85/pretty-package-versions/zipball/4d7aa5dab42e2a76d99559706022885de0e18e1a", + "reference": "4d7aa5dab42e2a76d99559706022885de0e18e1a", + "shasum": "" + }, + "require": { + "composer-runtime-api": "^2.1.0", + "php": "^7.4|^8.0" + }, + "require-dev": { + "friendsofphp/php-cs-fixer": "^3.2", + "jean85/composer-provided-replaced-stub-package": "^1.0", + "phpstan/phpstan": "^2.0", + "phpunit/phpunit": "^7.5|^8.5|^9.6", + "rector/rector": "^2.0", + "vimeo/psalm": "^4.3 || ^5.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.x-dev" + } + }, + "autoload": { + "psr-4": { + "Jean85\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Alessandro Lai", + "email": "alessandro.lai85@gmail.com" + } + ], + "description": "A library to get pretty versions strings of installed dependencies", + "keywords": [ + "composer", + "package", + "release", + "versions" + ], + "support": { + "issues": "https://github.com/Jean85/pretty-package-versions/issues", + "source": "https://github.com/Jean85/pretty-package-versions/tree/2.1.1" + }, + "time": "2025-03-19T14:43:43+00:00" + }, { "name": "masterminds/html5", "version": "2.10.0", @@ -11468,97 +11649,671 @@ "time": "2025-08-13T20:13:15+00:00" }, { - "name": "phar-io/manifest", - "version": "2.0.4", + "name": "nunomaduro/collision", + "version": "v8.8.2", "source": { "type": "git", - "url": "https://github.com/phar-io/manifest.git", - "reference": "54750ef60c58e43759730615a392c31c80e23176" + "url": "https://github.com/nunomaduro/collision.git", + "reference": "60207965f9b7b7a4ce15a0f75d57f9dadb105bdb" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/phar-io/manifest/zipball/54750ef60c58e43759730615a392c31c80e23176", - "reference": "54750ef60c58e43759730615a392c31c80e23176", + "url": "https://api.github.com/repos/nunomaduro/collision/zipball/60207965f9b7b7a4ce15a0f75d57f9dadb105bdb", + "reference": "60207965f9b7b7a4ce15a0f75d57f9dadb105bdb", "shasum": "" }, "require": { - "ext-dom": "*", - "ext-libxml": "*", - "ext-phar": "*", - "ext-xmlwriter": "*", - "phar-io/version": "^3.0.1", - "php": "^7.2 || ^8.0" + "filp/whoops": "^2.18.1", + "nunomaduro/termwind": "^2.3.1", + "php": "^8.2.0", + "symfony/console": "^7.3.0" + }, + "conflict": { + "laravel/framework": "<11.44.2 || >=13.0.0", + "phpunit/phpunit": "<11.5.15 || >=13.0.0" + }, + "require-dev": { + "brianium/paratest": "^7.8.3", + "larastan/larastan": "^3.4.2", + "laravel/framework": "^11.44.2 || ^12.18", + "laravel/pint": "^1.22.1", + "laravel/sail": "^1.43.1", + "laravel/sanctum": "^4.1.1", + "laravel/tinker": "^2.10.1", + "orchestra/testbench-core": "^9.12.0 || ^10.4", + "pestphp/pest": "^3.8.2", + "sebastian/environment": "^7.2.1 || ^8.0" }, "type": "library", "extra": { + "laravel": { + "providers": [ + "NunoMaduro\\Collision\\Adapters\\Laravel\\CollisionServiceProvider" + ] + }, "branch-alias": { - "dev-master": "2.0.x-dev" + "dev-8.x": "8.x-dev" } }, "autoload": { - "classmap": [ - "src/" - ] + "files": [ + "./src/Adapters/Phpunit/Autoload.php" + ], + "psr-4": { + "NunoMaduro\\Collision\\": "src/" + } }, "notification-url": "https://packagist.org/downloads/", "license": [ - "BSD-3-Clause" + "MIT" ], "authors": [ { - "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" + "name": "Nuno Maduro", + "email": "enunomaduro@gmail.com" } ], - "description": "Component for reading phar.io manifest information from a PHP Archive (PHAR)", + "description": "Cli error handling for console/command-line PHP applications.", + "keywords": [ + "artisan", + "cli", + "command-line", + "console", + "dev", + "error", + "handling", + "laravel", + "laravel-zero", + "php", + "symfony" + ], "support": { - "issues": "https://github.com/phar-io/manifest/issues", - "source": "https://github.com/phar-io/manifest/tree/2.0.4" + "issues": "https://github.com/nunomaduro/collision/issues", + "source": "https://github.com/nunomaduro/collision" }, "funding": [ { - "url": "https://github.com/theseer", + "url": "https://www.paypal.com/paypalme/enunomaduro", + "type": "custom" + }, + { + "url": "https://github.com/nunomaduro", "type": "github" + }, + { + "url": "https://www.patreon.com/nunomaduro", + "type": "patreon" } ], - "time": "2024-03-03T12:33:53+00:00" + "time": "2025-06-25T02:12:12+00:00" }, { - "name": "phar-io/version", - "version": "3.2.1", + "name": "nunomaduro/termwind", + "version": "v2.3.1", "source": { "type": "git", - "url": "https://github.com/phar-io/version.git", - "reference": "4f7fd7836c6f332bb2933569e566a0d6c4cbed74" + "url": "https://github.com/nunomaduro/termwind.git", + "reference": "dfa08f390e509967a15c22493dc0bac5733d9123" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/phar-io/version/zipball/4f7fd7836c6f332bb2933569e566a0d6c4cbed74", - "reference": "4f7fd7836c6f332bb2933569e566a0d6c4cbed74", + "url": "https://api.github.com/repos/nunomaduro/termwind/zipball/dfa08f390e509967a15c22493dc0bac5733d9123", + "reference": "dfa08f390e509967a15c22493dc0bac5733d9123", "shasum": "" }, "require": { - "php": "^7.2 || ^8.0" + "ext-mbstring": "*", + "php": "^8.2", + "symfony/console": "^7.2.6" }, - "type": "library", - "autoload": { - "classmap": [ - "src/" - ] + "require-dev": { + "illuminate/console": "^11.44.7", + "laravel/pint": "^1.22.0", + "mockery/mockery": "^1.6.12", + "pestphp/pest": "^2.36.0 || ^3.8.2", + "phpstan/phpstan": "^1.12.25", + "phpstan/phpstan-strict-rules": "^1.6.2", + "symfony/var-dumper": "^7.2.6", + "thecodingmachine/phpstan-strict-rules": "^1.0.0" }, - "notification-url": "https://packagist.org/downloads/", - "license": [ + "type": "library", + "extra": { + "laravel": { + "providers": [ + "Termwind\\Laravel\\TermwindServiceProvider" + ] + }, + "branch-alias": { + "dev-2.x": "2.x-dev" + } + }, + "autoload": { + "files": [ + "src/Functions.php" + ], + "psr-4": { + "Termwind\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Nuno Maduro", + "email": "enunomaduro@gmail.com" + } + ], + "description": "Its like Tailwind CSS, but for the console.", + "keywords": [ + "cli", + "console", + "css", + "package", + "php", + "style" + ], + "support": { + "issues": "https://github.com/nunomaduro/termwind/issues", + "source": "https://github.com/nunomaduro/termwind/tree/v2.3.1" + }, + "funding": [ + { + "url": "https://www.paypal.com/paypalme/enunomaduro", + "type": "custom" + }, + { + "url": "https://github.com/nunomaduro", + "type": "github" + }, + { + "url": "https://github.com/xiCO2k", + "type": "github" + } + ], + "time": "2025-05-08T08:14:37+00:00" + }, + { + "name": "pestphp/pest", + "version": "v4.1.0", + "source": { + "type": "git", + "url": "https://github.com/pestphp/pest.git", + "reference": "b7406938ac9e8d08cf96f031922b0502a8523268" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/pestphp/pest/zipball/b7406938ac9e8d08cf96f031922b0502a8523268", + "reference": "b7406938ac9e8d08cf96f031922b0502a8523268", + "shasum": "" + }, + "require": { + "brianium/paratest": "^7.12.0", + "nunomaduro/collision": "^8.8.2", + "nunomaduro/termwind": "^2.3.1", + "pestphp/pest-plugin": "^4.0.0", + "pestphp/pest-plugin-arch": "^4.0.0", + "pestphp/pest-plugin-mutate": "^4.0.1", + "pestphp/pest-plugin-profanity": "^4.1.0", + "php": "^8.3.0", + "phpunit/phpunit": "^12.3.8", + "symfony/process": "^7.3.3" + }, + "conflict": { + "filp/whoops": "<2.18.3", + "phpunit/phpunit": ">12.3.8", + "sebastian/exporter": "<7.0.0", + "webmozart/assert": "<1.11.0" + }, + "require-dev": { + "pestphp/pest-dev-tools": "^4.0.0", + "pestphp/pest-plugin-browser": "^4.1.0", + "pestphp/pest-plugin-type-coverage": "^4.0.2", + "psy/psysh": "^0.12.10" + }, + "bin": [ + "bin/pest" + ], + "type": "library", + "extra": { + "pest": { + "plugins": [ + "Pest\\Mutate\\Plugins\\Mutate", + "Pest\\Plugins\\Configuration", + "Pest\\Plugins\\Bail", + "Pest\\Plugins\\Cache", + "Pest\\Plugins\\Coverage", + "Pest\\Plugins\\Init", + "Pest\\Plugins\\Environment", + "Pest\\Plugins\\Help", + "Pest\\Plugins\\Memory", + "Pest\\Plugins\\Only", + "Pest\\Plugins\\Printer", + "Pest\\Plugins\\ProcessIsolation", + "Pest\\Plugins\\Profile", + "Pest\\Plugins\\Retry", + "Pest\\Plugins\\Snapshot", + "Pest\\Plugins\\Verbose", + "Pest\\Plugins\\Version", + "Pest\\Plugins\\Shard", + "Pest\\Plugins\\Parallel" + ] + }, + "phpstan": { + "includes": [ + "extension.neon" + ] + } + }, + "autoload": { + "files": [ + "src/Functions.php", + "src/Pest.php" + ], + "psr-4": { + "Pest\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Nuno Maduro", + "email": "enunomaduro@gmail.com" + } + ], + "description": "The elegant PHP Testing Framework.", + "keywords": [ + "framework", + "pest", + "php", + "test", + "testing", + "unit" + ], + "support": { + "issues": "https://github.com/pestphp/pest/issues", + "source": "https://github.com/pestphp/pest/tree/v4.1.0" + }, + "funding": [ + { + "url": "https://www.paypal.com/paypalme/enunomaduro", + "type": "custom" + }, + { + "url": "https://github.com/nunomaduro", + "type": "github" + } + ], + "time": "2025-09-10T13:41:09+00:00" + }, + { + "name": "pestphp/pest-plugin", + "version": "v4.0.0", + "source": { + "type": "git", + "url": "https://github.com/pestphp/pest-plugin.git", + "reference": "9d4b93d7f73d3f9c3189bb22c220fef271cdf568" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/pestphp/pest-plugin/zipball/9d4b93d7f73d3f9c3189bb22c220fef271cdf568", + "reference": "9d4b93d7f73d3f9c3189bb22c220fef271cdf568", + "shasum": "" + }, + "require": { + "composer-plugin-api": "^2.0.0", + "composer-runtime-api": "^2.2.2", + "php": "^8.3" + }, + "conflict": { + "pestphp/pest": "<4.0.0" + }, + "require-dev": { + "composer/composer": "^2.8.10", + "pestphp/pest": "^4.0.0", + "pestphp/pest-dev-tools": "^4.0.0" + }, + "type": "composer-plugin", + "extra": { + "class": "Pest\\Plugin\\Manager" + }, + "autoload": { + "psr-4": { + "Pest\\Plugin\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "description": "The Pest plugin manager", + "keywords": [ + "framework", + "manager", + "pest", + "php", + "plugin", + "test", + "testing", + "unit" + ], + "support": { + "source": "https://github.com/pestphp/pest-plugin/tree/v4.0.0" + }, + "funding": [ + { + "url": "https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=66BYDWAT92N6L", + "type": "custom" + }, + { + "url": "https://github.com/nunomaduro", + "type": "github" + }, + { + "url": "https://www.patreon.com/nunomaduro", + "type": "patreon" + } + ], + "time": "2025-08-20T12:35:58+00:00" + }, + { + "name": "pestphp/pest-plugin-arch", + "version": "v4.0.0", + "source": { + "type": "git", + "url": "https://github.com/pestphp/pest-plugin-arch.git", + "reference": "25bb17e37920ccc35cbbcda3b00d596aadf3e58d" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/pestphp/pest-plugin-arch/zipball/25bb17e37920ccc35cbbcda3b00d596aadf3e58d", + "reference": "25bb17e37920ccc35cbbcda3b00d596aadf3e58d", + "shasum": "" + }, + "require": { + "pestphp/pest-plugin": "^4.0.0", + "php": "^8.3", + "ta-tikoma/phpunit-architecture-test": "^0.8.5" + }, + "require-dev": { + "pestphp/pest": "^4.0.0", + "pestphp/pest-dev-tools": "^4.0.0" + }, + "type": "library", + "extra": { + "pest": { + "plugins": [ + "Pest\\Arch\\Plugin" + ] + } + }, + "autoload": { + "files": [ + "src/Autoload.php" + ], + "psr-4": { + "Pest\\Arch\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "description": "The Arch plugin for Pest PHP.", + "keywords": [ + "arch", + "architecture", + "framework", + "pest", + "php", + "plugin", + "test", + "testing", + "unit" + ], + "support": { + "source": "https://github.com/pestphp/pest-plugin-arch/tree/v4.0.0" + }, + "funding": [ + { + "url": "https://www.paypal.com/paypalme/enunomaduro", + "type": "custom" + }, + { + "url": "https://github.com/nunomaduro", + "type": "github" + } + ], + "time": "2025-08-20T13:10:51+00:00" + }, + { + "name": "pestphp/pest-plugin-mutate", + "version": "v4.0.1", + "source": { + "type": "git", + "url": "https://github.com/pestphp/pest-plugin-mutate.git", + "reference": "d9b32b60b2385e1688a68cc227594738ec26d96c" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/pestphp/pest-plugin-mutate/zipball/d9b32b60b2385e1688a68cc227594738ec26d96c", + "reference": "d9b32b60b2385e1688a68cc227594738ec26d96c", + "shasum": "" + }, + "require": { + "nikic/php-parser": "^5.6.1", + "pestphp/pest-plugin": "^4.0.0", + "php": "^8.3", + "psr/simple-cache": "^3.0.0" + }, + "require-dev": { + "pestphp/pest": "^4.0.0", + "pestphp/pest-dev-tools": "^4.0.0", + "pestphp/pest-plugin-type-coverage": "^4.0.0" + }, + "type": "library", + "autoload": { + "psr-4": { + "Pest\\Mutate\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Nuno Maduro", + "email": "enunomaduro@gmail.com" + }, + { + "name": "Sandro Gehri", + "email": "sandrogehri@gmail.com" + } + ], + "description": "Mutates your code to find untested cases", + "keywords": [ + "framework", + "mutate", + "mutation", + "pest", + "php", + "plugin", + "test", + "testing", + "unit" + ], + "support": { + "source": "https://github.com/pestphp/pest-plugin-mutate/tree/v4.0.1" + }, + "funding": [ + { + "url": "https://www.paypal.com/paypalme/enunomaduro", + "type": "custom" + }, + { + "url": "https://github.com/gehrisandro", + "type": "github" + }, + { + "url": "https://github.com/nunomaduro", + "type": "github" + } + ], + "time": "2025-08-21T20:19:25+00:00" + }, + { + "name": "pestphp/pest-plugin-profanity", + "version": "v4.1.0", + "source": { + "type": "git", + "url": "https://github.com/pestphp/pest-plugin-profanity.git", + "reference": "e279c844b6868da92052be27b5202c2ad7216e80" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/pestphp/pest-plugin-profanity/zipball/e279c844b6868da92052be27b5202c2ad7216e80", + "reference": "e279c844b6868da92052be27b5202c2ad7216e80", + "shasum": "" + }, + "require": { + "pestphp/pest-plugin": "^4.0.0", + "php": "^8.3" + }, + "require-dev": { + "faissaloux/pest-plugin-inside": "^1.9", + "pestphp/pest": "^4.0.0", + "pestphp/pest-dev-tools": "^4.0.0" + }, + "type": "library", + "extra": { + "pest": { + "plugins": [ + "Pest\\Profanity\\Plugin" + ] + } + }, + "autoload": { + "psr-4": { + "Pest\\Profanity\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "description": "The Pest Profanity Plugin", + "keywords": [ + "framework", + "pest", + "php", + "plugin", + "profanity", + "test", + "testing", + "unit" + ], + "support": { + "source": "https://github.com/pestphp/pest-plugin-profanity/tree/v4.1.0" + }, + "time": "2025-09-10T06:17:03+00:00" + }, + { + "name": "phar-io/manifest", + "version": "2.0.4", + "source": { + "type": "git", + "url": "https://github.com/phar-io/manifest.git", + "reference": "54750ef60c58e43759730615a392c31c80e23176" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/phar-io/manifest/zipball/54750ef60c58e43759730615a392c31c80e23176", + "reference": "54750ef60c58e43759730615a392c31c80e23176", + "shasum": "" + }, + "require": { + "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": "2.0.x-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "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": "Component for reading phar.io manifest information from a PHP Archive (PHAR)", + "support": { + "issues": "https://github.com/phar-io/manifest/issues", + "source": "https://github.com/phar-io/manifest/tree/2.0.4" + }, + "funding": [ + { + "url": "https://github.com/theseer", + "type": "github" + } + ], + "time": "2024-03-03T12:33:53+00:00" + }, + { + "name": "phar-io/version", + "version": "3.2.1", + "source": { + "type": "git", + "url": "https://github.com/phar-io/version.git", + "reference": "4f7fd7836c6f332bb2933569e566a0d6c4cbed74" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/phar-io/version/zipball/4f7fd7836c6f332bb2933569e566a0d6c4cbed74", + "reference": "4f7fd7836c6f332bb2933569e566a0d6c4cbed74", + "shasum": "" + }, + "require": { + "php": "^7.2 || ^8.0" + }, + "type": "library", + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ "BSD-3-Clause" ], "authors": [ @@ -11955,35 +12710,34 @@ }, { "name": "phpunit/php-code-coverage", - "version": "9.2.32", + "version": "12.3.7", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/php-code-coverage.git", - "reference": "85402a822d1ecf1db1096959413d35e1c37cf1a5" + "reference": "bbede0f5593dad37af3be6a6f8e6ae1885e8a0a9" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/php-code-coverage/zipball/85402a822d1ecf1db1096959413d35e1c37cf1a5", - "reference": "85402a822d1ecf1db1096959413d35e1c37cf1a5", + "url": "https://api.github.com/repos/sebastianbergmann/php-code-coverage/zipball/bbede0f5593dad37af3be6a6f8e6ae1885e8a0a9", + "reference": "bbede0f5593dad37af3be6a6f8e6ae1885e8a0a9", "shasum": "" }, "require": { "ext-dom": "*", "ext-libxml": "*", "ext-xmlwriter": "*", - "nikic/php-parser": "^4.19.1 || ^5.1.0", - "php": ">=7.3", - "phpunit/php-file-iterator": "^3.0.6", - "phpunit/php-text-template": "^2.0.4", - "sebastian/code-unit-reverse-lookup": "^2.0.3", - "sebastian/complexity": "^2.0.3", - "sebastian/environment": "^5.1.5", - "sebastian/lines-of-code": "^1.0.4", - "sebastian/version": "^3.0.2", + "nikic/php-parser": "^5.6.1", + "php": ">=8.3", + "phpunit/php-file-iterator": "^6.0", + "phpunit/php-text-template": "^5.0", + "sebastian/complexity": "^5.0", + "sebastian/environment": "^8.0.3", + "sebastian/lines-of-code": "^4.0", + "sebastian/version": "^6.0", "theseer/tokenizer": "^1.2.3" }, "require-dev": { - "phpunit/phpunit": "^9.6" + "phpunit/phpunit": "^12.3.7" }, "suggest": { "ext-pcov": "PHP extension that provides line coverage", @@ -11992,7 +12746,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-main": "9.2.x-dev" + "dev-main": "12.3.x-dev" } }, "autoload": { @@ -12021,40 +12775,52 @@ "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.32" + "source": "https://github.com/sebastianbergmann/php-code-coverage/tree/12.3.7" }, "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-code-coverage", + "type": "tidelift" } ], - "time": "2024-08-22T04:23:01+00:00" + "time": "2025-09-10T09:59:06+00:00" }, { "name": "phpunit/php-file-iterator", - "version": "3.0.6", + "version": "6.0.0", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/php-file-iterator.git", - "reference": "cf1c2e7c203ac650e352f4cc675a7021e7d1b3cf" + "reference": "961bc913d42fe24a257bfff826a5068079ac7782" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/php-file-iterator/zipball/cf1c2e7c203ac650e352f4cc675a7021e7d1b3cf", - "reference": "cf1c2e7c203ac650e352f4cc675a7021e7d1b3cf", + "url": "https://api.github.com/repos/sebastianbergmann/php-file-iterator/zipball/961bc913d42fe24a257bfff826a5068079ac7782", + "reference": "961bc913d42fe24a257bfff826a5068079ac7782", "shasum": "" }, "require": { - "php": ">=7.3" + "php": ">=8.3" }, "require-dev": { - "phpunit/phpunit": "^9.3" + "phpunit/phpunit": "^12.0" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "3.0-dev" + "dev-main": "6.0-dev" } }, "autoload": { @@ -12081,7 +12847,8 @@ ], "support": { "issues": "https://github.com/sebastianbergmann/php-file-iterator/issues", - "source": "https://github.com/sebastianbergmann/php-file-iterator/tree/3.0.6" + "security": "https://github.com/sebastianbergmann/php-file-iterator/security/policy", + "source": "https://github.com/sebastianbergmann/php-file-iterator/tree/6.0.0" }, "funding": [ { @@ -12089,28 +12856,28 @@ "type": "github" } ], - "time": "2021-12-02T12:48:52+00:00" + "time": "2025-02-07T04:58:37+00:00" }, { "name": "phpunit/php-invoker", - "version": "3.1.1", + "version": "6.0.0", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/php-invoker.git", - "reference": "5a10147d0aaf65b58940a0b72f71c9ac0423cc67" + "reference": "12b54e689b07a25a9b41e57736dfab6ec9ae5406" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/php-invoker/zipball/5a10147d0aaf65b58940a0b72f71c9ac0423cc67", - "reference": "5a10147d0aaf65b58940a0b72f71c9ac0423cc67", + "url": "https://api.github.com/repos/sebastianbergmann/php-invoker/zipball/12b54e689b07a25a9b41e57736dfab6ec9ae5406", + "reference": "12b54e689b07a25a9b41e57736dfab6ec9ae5406", "shasum": "" }, "require": { - "php": ">=7.3" + "php": ">=8.3" }, "require-dev": { "ext-pcntl": "*", - "phpunit/phpunit": "^9.3" + "phpunit/phpunit": "^12.0" }, "suggest": { "ext-pcntl": "*" @@ -12118,7 +12885,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "3.1-dev" + "dev-main": "6.0-dev" } }, "autoload": { @@ -12144,7 +12911,8 @@ ], "support": { "issues": "https://github.com/sebastianbergmann/php-invoker/issues", - "source": "https://github.com/sebastianbergmann/php-invoker/tree/3.1.1" + "security": "https://github.com/sebastianbergmann/php-invoker/security/policy", + "source": "https://github.com/sebastianbergmann/php-invoker/tree/6.0.0" }, "funding": [ { @@ -12152,32 +12920,32 @@ "type": "github" } ], - "time": "2020-09-28T05:58:55+00:00" + "time": "2025-02-07T04:58:58+00:00" }, { "name": "phpunit/php-text-template", - "version": "2.0.4", + "version": "5.0.0", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/php-text-template.git", - "reference": "5da5f67fc95621df9ff4c4e5a84d6a8a2acf7c28" + "reference": "e1367a453f0eda562eedb4f659e13aa900d66c53" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/php-text-template/zipball/5da5f67fc95621df9ff4c4e5a84d6a8a2acf7c28", - "reference": "5da5f67fc95621df9ff4c4e5a84d6a8a2acf7c28", + "url": "https://api.github.com/repos/sebastianbergmann/php-text-template/zipball/e1367a453f0eda562eedb4f659e13aa900d66c53", + "reference": "e1367a453f0eda562eedb4f659e13aa900d66c53", "shasum": "" }, "require": { - "php": ">=7.3" + "php": ">=8.3" }, "require-dev": { - "phpunit/phpunit": "^9.3" + "phpunit/phpunit": "^12.0" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "2.0-dev" + "dev-main": "5.0-dev" } }, "autoload": { @@ -12203,7 +12971,8 @@ ], "support": { "issues": "https://github.com/sebastianbergmann/php-text-template/issues", - "source": "https://github.com/sebastianbergmann/php-text-template/tree/2.0.4" + "security": "https://github.com/sebastianbergmann/php-text-template/security/policy", + "source": "https://github.com/sebastianbergmann/php-text-template/tree/5.0.0" }, "funding": [ { @@ -12211,32 +12980,32 @@ "type": "github" } ], - "time": "2020-10-26T05:33:50+00:00" + "time": "2025-02-07T04:59:16+00:00" }, { "name": "phpunit/php-timer", - "version": "5.0.3", + "version": "8.0.0", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/php-timer.git", - "reference": "5a63ce20ed1b5bf577850e2c4e87f4aa902afbd2" + "reference": "f258ce36aa457f3aa3339f9ed4c81fc66dc8c2cc" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/php-timer/zipball/5a63ce20ed1b5bf577850e2c4e87f4aa902afbd2", - "reference": "5a63ce20ed1b5bf577850e2c4e87f4aa902afbd2", + "url": "https://api.github.com/repos/sebastianbergmann/php-timer/zipball/f258ce36aa457f3aa3339f9ed4c81fc66dc8c2cc", + "reference": "f258ce36aa457f3aa3339f9ed4c81fc66dc8c2cc", "shasum": "" }, "require": { - "php": ">=7.3" + "php": ">=8.3" }, "require-dev": { - "phpunit/phpunit": "^9.3" + "phpunit/phpunit": "^12.0" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "5.0-dev" + "dev-main": "8.0-dev" } }, "autoload": { @@ -12262,7 +13031,8 @@ ], "support": { "issues": "https://github.com/sebastianbergmann/php-timer/issues", - "source": "https://github.com/sebastianbergmann/php-timer/tree/5.0.3" + "security": "https://github.com/sebastianbergmann/php-timer/security/policy", + "source": "https://github.com/sebastianbergmann/php-timer/tree/8.0.0" }, "funding": [ { @@ -12270,24 +13040,23 @@ "type": "github" } ], - "time": "2020-10-26T13:16:10+00:00" + "time": "2025-02-07T04:59:38+00:00" }, { "name": "phpunit/phpunit", - "version": "9.6.25", + "version": "12.3.8", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/phpunit.git", - "reference": "049c011e01be805202d8eebedef49f769a8ec7b7" + "reference": "9d68c1b41fc21aac106c71cde4669fe7b99fca10" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/049c011e01be805202d8eebedef49f769a8ec7b7", - "reference": "049c011e01be805202d8eebedef49f769a8ec7b7", + "url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/9d68c1b41fc21aac106c71cde4669fe7b99fca10", + "reference": "9d68c1b41fc21aac106c71cde4669fe7b99fca10", "shasum": "" }, "require": { - "doctrine/instantiator": "^1.5.0 || ^2", "ext-dom": "*", "ext-json": "*", "ext-libxml": "*", @@ -12297,27 +13066,22 @@ "myclabs/deep-copy": "^1.13.4", "phar-io/manifest": "^2.0.4", "phar-io/version": "^3.2.1", - "php": ">=7.3", - "phpunit/php-code-coverage": "^9.2.32", - "phpunit/php-file-iterator": "^3.0.6", - "phpunit/php-invoker": "^3.1.1", - "phpunit/php-text-template": "^2.0.4", - "phpunit/php-timer": "^5.0.3", - "sebastian/cli-parser": "^1.0.2", - "sebastian/code-unit": "^1.0.8", - "sebastian/comparator": "^4.0.9", - "sebastian/diff": "^4.0.6", - "sebastian/environment": "^5.1.5", - "sebastian/exporter": "^4.0.6", - "sebastian/global-state": "^5.0.8", - "sebastian/object-enumerator": "^4.0.4", - "sebastian/resource-operations": "^3.0.4", - "sebastian/type": "^3.2.1", - "sebastian/version": "^3.0.2" - }, - "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" + "php": ">=8.3", + "phpunit/php-code-coverage": "^12.3.6", + "phpunit/php-file-iterator": "^6.0.0", + "phpunit/php-invoker": "^6.0.0", + "phpunit/php-text-template": "^5.0.0", + "phpunit/php-timer": "^8.0.0", + "sebastian/cli-parser": "^4.0.0", + "sebastian/comparator": "^7.1.3", + "sebastian/diff": "^7.0.0", + "sebastian/environment": "^8.0.3", + "sebastian/exporter": "^7.0.0", + "sebastian/global-state": "^8.0.2", + "sebastian/object-enumerator": "^7.0.0", + "sebastian/type": "^6.0.3", + "sebastian/version": "^6.0.0", + "staabm/side-effects-detector": "^1.0.5" }, "bin": [ "phpunit" @@ -12325,7 +13089,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "9.6-dev" + "dev-main": "12.3-dev" } }, "autoload": { @@ -12357,7 +13121,7 @@ "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.25" + "source": "https://github.com/sebastianbergmann/phpunit/tree/12.3.8" }, "funding": [ { @@ -12381,7 +13145,7 @@ "type": "tidelift" } ], - "time": "2025-08-20T14:38:31+00:00" + "time": "2025-09-03T06:25:17+00:00" }, { "name": "react/cache", @@ -12911,28 +13675,28 @@ }, { "name": "sebastian/cli-parser", - "version": "1.0.2", + "version": "4.0.0", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/cli-parser.git", - "reference": "2b56bea83a09de3ac06bb18b92f068e60cc6f50b" + "reference": "6d584c727d9114bcdc14c86711cd1cad51778e7c" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/cli-parser/zipball/2b56bea83a09de3ac06bb18b92f068e60cc6f50b", - "reference": "2b56bea83a09de3ac06bb18b92f068e60cc6f50b", + "url": "https://api.github.com/repos/sebastianbergmann/cli-parser/zipball/6d584c727d9114bcdc14c86711cd1cad51778e7c", + "reference": "6d584c727d9114bcdc14c86711cd1cad51778e7c", "shasum": "" }, "require": { - "php": ">=7.3" + "php": ">=8.3" }, "require-dev": { - "phpunit/phpunit": "^9.3" + "phpunit/phpunit": "^12.0" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "1.0-dev" + "dev-main": "4.0-dev" } }, "autoload": { @@ -12955,118 +13719,8 @@ "homepage": "https://github.com/sebastianbergmann/cli-parser", "support": { "issues": "https://github.com/sebastianbergmann/cli-parser/issues", - "source": "https://github.com/sebastianbergmann/cli-parser/tree/1.0.2" - }, - "funding": [ - { - "url": "https://github.com/sebastianbergmann", - "type": "github" - } - ], - "time": "2024-03-02T06:27:43+00:00" - }, - { - "name": "sebastian/code-unit", - "version": "1.0.8", - "source": { - "type": "git", - "url": "https://github.com/sebastianbergmann/code-unit.git", - "reference": "1fc9f64c0927627ef78ba436c9b17d967e68e120" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/code-unit/zipball/1fc9f64c0927627ef78ba436c9b17d967e68e120", - "reference": "1fc9f64c0927627ef78ba436c9b17d967e68e120", - "shasum": "" - }, - "require": { - "php": ">=7.3" - }, - "require-dev": { - "phpunit/phpunit": "^9.3" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.0-dev" - } - }, - "autoload": { - "classmap": [ - "src/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause" - ], - "authors": [ - { - "name": "Sebastian Bergmann", - "email": "sebastian@phpunit.de", - "role": "lead" - } - ], - "description": "Collection of value objects that represent the PHP code units", - "homepage": "https://github.com/sebastianbergmann/code-unit", - "support": { - "issues": "https://github.com/sebastianbergmann/code-unit/issues", - "source": "https://github.com/sebastianbergmann/code-unit/tree/1.0.8" - }, - "funding": [ - { - "url": "https://github.com/sebastianbergmann", - "type": "github" - } - ], - "time": "2020-10-26T13:08:54+00:00" - }, - { - "name": "sebastian/code-unit-reverse-lookup", - "version": "2.0.3", - "source": { - "type": "git", - "url": "https://github.com/sebastianbergmann/code-unit-reverse-lookup.git", - "reference": "ac91f01ccec49fb77bdc6fd1e548bc70f7faa3e5" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/code-unit-reverse-lookup/zipball/ac91f01ccec49fb77bdc6fd1e548bc70f7faa3e5", - "reference": "ac91f01ccec49fb77bdc6fd1e548bc70f7faa3e5", - "shasum": "" - }, - "require": { - "php": ">=7.3" - }, - "require-dev": { - "phpunit/phpunit": "^9.3" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "2.0-dev" - } - }, - "autoload": { - "classmap": [ - "src/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause" - ], - "authors": [ - { - "name": "Sebastian Bergmann", - "email": "sebastian@phpunit.de" - } - ], - "description": "Looks up which function or method a line of code belongs to", - "homepage": "https://github.com/sebastianbergmann/code-unit-reverse-lookup/", - "support": { - "issues": "https://github.com/sebastianbergmann/code-unit-reverse-lookup/issues", - "source": "https://github.com/sebastianbergmann/code-unit-reverse-lookup/tree/2.0.3" + "security": "https://github.com/sebastianbergmann/cli-parser/security/policy", + "source": "https://github.com/sebastianbergmann/cli-parser/tree/4.0.0" }, "funding": [ { @@ -13074,34 +13728,39 @@ "type": "github" } ], - "time": "2020-09-28T05:30:19+00:00" + "time": "2025-02-07T04:53:50+00:00" }, { "name": "sebastian/comparator", - "version": "4.0.9", + "version": "7.1.3", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/comparator.git", - "reference": "67a2df3a62639eab2cc5906065e9805d4fd5dfc5" + "reference": "dc904b4bb3ab070865fa4068cd84f3da8b945148" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/comparator/zipball/67a2df3a62639eab2cc5906065e9805d4fd5dfc5", - "reference": "67a2df3a62639eab2cc5906065e9805d4fd5dfc5", + "url": "https://api.github.com/repos/sebastianbergmann/comparator/zipball/dc904b4bb3ab070865fa4068cd84f3da8b945148", + "reference": "dc904b4bb3ab070865fa4068cd84f3da8b945148", "shasum": "" }, "require": { - "php": ">=7.3", - "sebastian/diff": "^4.0", - "sebastian/exporter": "^4.0" + "ext-dom": "*", + "ext-mbstring": "*", + "php": ">=8.3", + "sebastian/diff": "^7.0", + "sebastian/exporter": "^7.0" }, "require-dev": { - "phpunit/phpunit": "^9.3" + "phpunit/phpunit": "^12.2" + }, + "suggest": { + "ext-bcmath": "For comparing BcMath\\Number objects" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "4.0-dev" + "dev-main": "7.1-dev" } }, "autoload": { @@ -13140,7 +13799,8 @@ ], "support": { "issues": "https://github.com/sebastianbergmann/comparator/issues", - "source": "https://github.com/sebastianbergmann/comparator/tree/4.0.9" + "security": "https://github.com/sebastianbergmann/comparator/security/policy", + "source": "https://github.com/sebastianbergmann/comparator/tree/7.1.3" }, "funding": [ { @@ -13160,33 +13820,33 @@ "type": "tidelift" } ], - "time": "2025-08-10T06:51:50+00:00" + "time": "2025-08-20T11:27:00+00:00" }, { "name": "sebastian/complexity", - "version": "2.0.3", + "version": "5.0.0", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/complexity.git", - "reference": "25f207c40d62b8b7aa32f5ab026c53561964053a" + "reference": "bad4316aba5303d0221f43f8cee37eb58d384bbb" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/complexity/zipball/25f207c40d62b8b7aa32f5ab026c53561964053a", - "reference": "25f207c40d62b8b7aa32f5ab026c53561964053a", + "url": "https://api.github.com/repos/sebastianbergmann/complexity/zipball/bad4316aba5303d0221f43f8cee37eb58d384bbb", + "reference": "bad4316aba5303d0221f43f8cee37eb58d384bbb", "shasum": "" }, "require": { - "nikic/php-parser": "^4.18 || ^5.0", - "php": ">=7.3" + "nikic/php-parser": "^5.0", + "php": ">=8.3" }, "require-dev": { - "phpunit/phpunit": "^9.3" + "phpunit/phpunit": "^12.0" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "2.0-dev" + "dev-main": "5.0-dev" } }, "autoload": { @@ -13209,7 +13869,8 @@ "homepage": "https://github.com/sebastianbergmann/complexity", "support": { "issues": "https://github.com/sebastianbergmann/complexity/issues", - "source": "https://github.com/sebastianbergmann/complexity/tree/2.0.3" + "security": "https://github.com/sebastianbergmann/complexity/security/policy", + "source": "https://github.com/sebastianbergmann/complexity/tree/5.0.0" }, "funding": [ { @@ -13217,33 +13878,33 @@ "type": "github" } ], - "time": "2023-12-22T06:19:30+00:00" + "time": "2025-02-07T04:55:25+00:00" }, { "name": "sebastian/diff", - "version": "4.0.6", + "version": "7.0.0", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/diff.git", - "reference": "ba01945089c3a293b01ba9badc29ad55b106b0bc" + "reference": "7ab1ea946c012266ca32390913653d844ecd085f" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/diff/zipball/ba01945089c3a293b01ba9badc29ad55b106b0bc", - "reference": "ba01945089c3a293b01ba9badc29ad55b106b0bc", + "url": "https://api.github.com/repos/sebastianbergmann/diff/zipball/7ab1ea946c012266ca32390913653d844ecd085f", + "reference": "7ab1ea946c012266ca32390913653d844ecd085f", "shasum": "" }, "require": { - "php": ">=7.3" + "php": ">=8.3" }, "require-dev": { - "phpunit/phpunit": "^9.3", - "symfony/process": "^4.2 || ^5" + "phpunit/phpunit": "^12.0", + "symfony/process": "^7.2" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "4.0-dev" + "dev-main": "7.0-dev" } }, "autoload": { @@ -13275,7 +13936,8 @@ ], "support": { "issues": "https://github.com/sebastianbergmann/diff/issues", - "source": "https://github.com/sebastianbergmann/diff/tree/4.0.6" + "security": "https://github.com/sebastianbergmann/diff/security/policy", + "source": "https://github.com/sebastianbergmann/diff/tree/7.0.0" }, "funding": [ { @@ -13283,27 +13945,27 @@ "type": "github" } ], - "time": "2024-03-02T06:30:58+00:00" + "time": "2025-02-07T04:55:46+00:00" }, { "name": "sebastian/environment", - "version": "5.1.5", + "version": "8.0.3", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/environment.git", - "reference": "830c43a844f1f8d5b7a1f6d6076b784454d8b7ed" + "reference": "24a711b5c916efc6d6e62aa65aa2ec98fef77f68" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/environment/zipball/830c43a844f1f8d5b7a1f6d6076b784454d8b7ed", - "reference": "830c43a844f1f8d5b7a1f6d6076b784454d8b7ed", + "url": "https://api.github.com/repos/sebastianbergmann/environment/zipball/24a711b5c916efc6d6e62aa65aa2ec98fef77f68", + "reference": "24a711b5c916efc6d6e62aa65aa2ec98fef77f68", "shasum": "" }, "require": { - "php": ">=7.3" + "php": ">=8.3" }, "require-dev": { - "phpunit/phpunit": "^9.3" + "phpunit/phpunit": "^12.0" }, "suggest": { "ext-posix": "*" @@ -13311,7 +13973,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "5.1-dev" + "dev-main": "8.0-dev" } }, "autoload": { @@ -13330,7 +13992,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", @@ -13338,42 +14000,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/8.0.3" }, "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": "2025-08-12T14:11:56+00:00" }, { "name": "sebastian/exporter", - "version": "4.0.6", + "version": "7.0.0", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/exporter.git", - "reference": "78c00df8f170e02473b682df15bfcdacc3d32d72" + "reference": "76432aafc58d50691a00d86d0632f1217a47b688" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/exporter/zipball/78c00df8f170e02473b682df15bfcdacc3d32d72", - "reference": "78c00df8f170e02473b682df15bfcdacc3d32d72", + "url": "https://api.github.com/repos/sebastianbergmann/exporter/zipball/76432aafc58d50691a00d86d0632f1217a47b688", + "reference": "76432aafc58d50691a00d86d0632f1217a47b688", "shasum": "" }, "require": { - "php": ">=7.3", - "sebastian/recursion-context": "^4.0" + "ext-mbstring": "*", + "php": ">=8.3", + "sebastian/recursion-context": "^7.0" }, "require-dev": { - "ext-mbstring": "*", - "phpunit/phpunit": "^9.3" + "phpunit/phpunit": "^12.0" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "4.0-dev" + "dev-main": "7.0-dev" } }, "autoload": { @@ -13415,7 +14090,8 @@ ], "support": { "issues": "https://github.com/sebastianbergmann/exporter/issues", - "source": "https://github.com/sebastianbergmann/exporter/tree/4.0.6" + "security": "https://github.com/sebastianbergmann/exporter/security/policy", + "source": "https://github.com/sebastianbergmann/exporter/tree/7.0.0" }, "funding": [ { @@ -13423,38 +14099,35 @@ "type": "github" } ], - "time": "2024-03-02T06:33:00+00:00" + "time": "2025-02-07T04:56:42+00:00" }, { "name": "sebastian/global-state", - "version": "5.0.8", + "version": "8.0.2", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/global-state.git", - "reference": "b6781316bdcd28260904e7cc18ec983d0d2ef4f6" + "reference": "ef1377171613d09edd25b7816f05be8313f9115d" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/global-state/zipball/b6781316bdcd28260904e7cc18ec983d0d2ef4f6", - "reference": "b6781316bdcd28260904e7cc18ec983d0d2ef4f6", + "url": "https://api.github.com/repos/sebastianbergmann/global-state/zipball/ef1377171613d09edd25b7816f05be8313f9115d", + "reference": "ef1377171613d09edd25b7816f05be8313f9115d", "shasum": "" }, "require": { - "php": ">=7.3", - "sebastian/object-reflector": "^2.0", - "sebastian/recursion-context": "^4.0" + "php": ">=8.3", + "sebastian/object-reflector": "^5.0", + "sebastian/recursion-context": "^7.0" }, "require-dev": { "ext-dom": "*", - "phpunit/phpunit": "^9.3" - }, - "suggest": { - "ext-uopz": "*" + "phpunit/phpunit": "^12.0" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "5.0-dev" + "dev-main": "8.0-dev" } }, "autoload": { @@ -13473,13 +14146,14 @@ } ], "description": "Snapshotting of global state", - "homepage": "http://www.github.com/sebastianbergmann/global-state", + "homepage": "https://www.github.com/sebastianbergmann/global-state", "keywords": [ "global state" ], "support": { "issues": "https://github.com/sebastianbergmann/global-state/issues", - "source": "https://github.com/sebastianbergmann/global-state/tree/5.0.8" + "security": "https://github.com/sebastianbergmann/global-state/security/policy", + "source": "https://github.com/sebastianbergmann/global-state/tree/8.0.2" }, "funding": [ { @@ -13499,33 +14173,33 @@ "type": "tidelift" } ], - "time": "2025-08-10T07:10:35+00:00" + "time": "2025-08-29T11:29:25+00:00" }, { "name": "sebastian/lines-of-code", - "version": "1.0.4", + "version": "4.0.0", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/lines-of-code.git", - "reference": "e1e4a170560925c26d424b6a03aed157e7dcc5c5" + "reference": "97ffee3bcfb5805568d6af7f0f893678fc076d2f" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/lines-of-code/zipball/e1e4a170560925c26d424b6a03aed157e7dcc5c5", - "reference": "e1e4a170560925c26d424b6a03aed157e7dcc5c5", + "url": "https://api.github.com/repos/sebastianbergmann/lines-of-code/zipball/97ffee3bcfb5805568d6af7f0f893678fc076d2f", + "reference": "97ffee3bcfb5805568d6af7f0f893678fc076d2f", "shasum": "" }, "require": { - "nikic/php-parser": "^4.18 || ^5.0", - "php": ">=7.3" + "nikic/php-parser": "^5.0", + "php": ">=8.3" }, "require-dev": { - "phpunit/phpunit": "^9.3" + "phpunit/phpunit": "^12.0" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "1.0-dev" + "dev-main": "4.0-dev" } }, "autoload": { @@ -13548,7 +14222,8 @@ "homepage": "https://github.com/sebastianbergmann/lines-of-code", "support": { "issues": "https://github.com/sebastianbergmann/lines-of-code/issues", - "source": "https://github.com/sebastianbergmann/lines-of-code/tree/1.0.4" + "security": "https://github.com/sebastianbergmann/lines-of-code/security/policy", + "source": "https://github.com/sebastianbergmann/lines-of-code/tree/4.0.0" }, "funding": [ { @@ -13556,34 +14231,34 @@ "type": "github" } ], - "time": "2023-12-22T06:20:34+00:00" + "time": "2025-02-07T04:57:28+00:00" }, { "name": "sebastian/object-enumerator", - "version": "4.0.4", + "version": "7.0.0", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/object-enumerator.git", - "reference": "5c9eeac41b290a3712d88851518825ad78f45c71" + "reference": "1effe8e9b8e068e9ae228e542d5d11b5d16db894" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/object-enumerator/zipball/5c9eeac41b290a3712d88851518825ad78f45c71", - "reference": "5c9eeac41b290a3712d88851518825ad78f45c71", + "url": "https://api.github.com/repos/sebastianbergmann/object-enumerator/zipball/1effe8e9b8e068e9ae228e542d5d11b5d16db894", + "reference": "1effe8e9b8e068e9ae228e542d5d11b5d16db894", "shasum": "" }, "require": { - "php": ">=7.3", - "sebastian/object-reflector": "^2.0", - "sebastian/recursion-context": "^4.0" + "php": ">=8.3", + "sebastian/object-reflector": "^5.0", + "sebastian/recursion-context": "^7.0" }, "require-dev": { - "phpunit/phpunit": "^9.3" + "phpunit/phpunit": "^12.0" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "4.0-dev" + "dev-main": "7.0-dev" } }, "autoload": { @@ -13605,7 +14280,8 @@ "homepage": "https://github.com/sebastianbergmann/object-enumerator/", "support": { "issues": "https://github.com/sebastianbergmann/object-enumerator/issues", - "source": "https://github.com/sebastianbergmann/object-enumerator/tree/4.0.4" + "security": "https://github.com/sebastianbergmann/object-enumerator/security/policy", + "source": "https://github.com/sebastianbergmann/object-enumerator/tree/7.0.0" }, "funding": [ { @@ -13613,32 +14289,32 @@ "type": "github" } ], - "time": "2020-10-26T13:12:34+00:00" + "time": "2025-02-07T04:57:48+00:00" }, { "name": "sebastian/object-reflector", - "version": "2.0.4", + "version": "5.0.0", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/object-reflector.git", - "reference": "b4f479ebdbf63ac605d183ece17d8d7fe49c15c7" + "reference": "4bfa827c969c98be1e527abd576533293c634f6a" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/object-reflector/zipball/b4f479ebdbf63ac605d183ece17d8d7fe49c15c7", - "reference": "b4f479ebdbf63ac605d183ece17d8d7fe49c15c7", + "url": "https://api.github.com/repos/sebastianbergmann/object-reflector/zipball/4bfa827c969c98be1e527abd576533293c634f6a", + "reference": "4bfa827c969c98be1e527abd576533293c634f6a", "shasum": "" }, "require": { - "php": ">=7.3" + "php": ">=8.3" }, "require-dev": { - "phpunit/phpunit": "^9.3" + "phpunit/phpunit": "^12.0" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "2.0-dev" + "dev-main": "5.0-dev" } }, "autoload": { @@ -13660,7 +14336,8 @@ "homepage": "https://github.com/sebastianbergmann/object-reflector/", "support": { "issues": "https://github.com/sebastianbergmann/object-reflector/issues", - "source": "https://github.com/sebastianbergmann/object-reflector/tree/2.0.4" + "security": "https://github.com/sebastianbergmann/object-reflector/security/policy", + "source": "https://github.com/sebastianbergmann/object-reflector/tree/5.0.0" }, "funding": [ { @@ -13668,32 +14345,32 @@ "type": "github" } ], - "time": "2020-10-26T13:14:26+00:00" + "time": "2025-02-07T04:58:17+00:00" }, { "name": "sebastian/recursion-context", - "version": "4.0.6", + "version": "7.0.1", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/recursion-context.git", - "reference": "539c6691e0623af6dc6f9c20384c120f963465a0" + "reference": "0b01998a7d5b1f122911a66bebcb8d46f0c82d8c" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/recursion-context/zipball/539c6691e0623af6dc6f9c20384c120f963465a0", - "reference": "539c6691e0623af6dc6f9c20384c120f963465a0", + "url": "https://api.github.com/repos/sebastianbergmann/recursion-context/zipball/0b01998a7d5b1f122911a66bebcb8d46f0c82d8c", + "reference": "0b01998a7d5b1f122911a66bebcb8d46f0c82d8c", "shasum": "" }, "require": { - "php": ">=7.3" + "php": ">=8.3" }, "require-dev": { - "phpunit/phpunit": "^9.3" + "phpunit/phpunit": "^12.0" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "4.0-dev" + "dev-main": "7.0-dev" } }, "autoload": { @@ -13723,7 +14400,8 @@ "homepage": "https://github.com/sebastianbergmann/recursion-context", "support": { "issues": "https://github.com/sebastianbergmann/recursion-context/issues", - "source": "https://github.com/sebastianbergmann/recursion-context/tree/4.0.6" + "security": "https://github.com/sebastianbergmann/recursion-context/security/policy", + "source": "https://github.com/sebastianbergmann/recursion-context/tree/7.0.1" }, "funding": [ { @@ -13743,32 +14421,32 @@ "type": "tidelift" } ], - "time": "2025-08-10T06:57:39+00:00" + "time": "2025-08-13T04:44:59+00:00" }, { - "name": "sebastian/resource-operations", - "version": "3.0.4", + "name": "sebastian/type", + "version": "6.0.3", "source": { "type": "git", - "url": "https://github.com/sebastianbergmann/resource-operations.git", - "reference": "05d5692a7993ecccd56a03e40cd7e5b09b1d404e" + "url": "https://github.com/sebastianbergmann/type.git", + "reference": "e549163b9760b8f71f191651d22acf32d56d6d4d" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/resource-operations/zipball/05d5692a7993ecccd56a03e40cd7e5b09b1d404e", - "reference": "05d5692a7993ecccd56a03e40cd7e5b09b1d404e", + "url": "https://api.github.com/repos/sebastianbergmann/type/zipball/e549163b9760b8f71f191651d22acf32d56d6d4d", + "reference": "e549163b9760b8f71f191651d22acf32d56d6d4d", "shasum": "" }, "require": { - "php": ">=7.3" + "php": ">=8.3" }, "require-dev": { - "phpunit/phpunit": "^9.0" + "phpunit/phpunit": "^12.0" }, "type": "library", "extra": { "branch-alias": { - "dev-main": "3.0-dev" + "dev-main": "6.0-dev" } }, "autoload": { @@ -13783,46 +14461,58 @@ "authors": [ { "name": "Sebastian Bergmann", - "email": "sebastian@phpunit.de" + "email": "sebastian@phpunit.de", + "role": "lead" } ], - "description": "Provides a list of PHP built-in functions that operate on resources", - "homepage": "https://www.github.com/sebastianbergmann/resource-operations", + "description": "Collection of value objects that represent the types of the PHP type system", + "homepage": "https://github.com/sebastianbergmann/type", "support": { - "source": "https://github.com/sebastianbergmann/resource-operations/tree/3.0.4" + "issues": "https://github.com/sebastianbergmann/type/issues", + "security": "https://github.com/sebastianbergmann/type/security/policy", + "source": "https://github.com/sebastianbergmann/type/tree/6.0.3" }, "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": "2024-03-14T16:00:52+00:00" + "time": "2025-08-09T06:57:12+00:00" }, { - "name": "sebastian/type", - "version": "3.2.1", + "name": "sebastian/version", + "version": "6.0.0", "source": { "type": "git", - "url": "https://github.com/sebastianbergmann/type.git", - "reference": "75e2c2a32f5e0b3aef905b9ed0b179b953b3d7c7" + "url": "https://github.com/sebastianbergmann/version.git", + "reference": "3e6ccf7657d4f0a59200564b08cead899313b53c" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/type/zipball/75e2c2a32f5e0b3aef905b9ed0b179b953b3d7c7", - "reference": "75e2c2a32f5e0b3aef905b9ed0b179b953b3d7c7", + "url": "https://api.github.com/repos/sebastianbergmann/version/zipball/3e6ccf7657d4f0a59200564b08cead899313b53c", + "reference": "3e6ccf7657d4f0a59200564b08cead899313b53c", "shasum": "" }, "require": { - "php": ">=7.3" - }, - "require-dev": { - "phpunit/phpunit": "^9.5" + "php": ">=8.3" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "3.2-dev" + "dev-main": "6.0-dev" } }, "autoload": { @@ -13841,11 +14531,12 @@ "role": "lead" } ], - "description": "Collection of value objects that represent the types of the PHP type system", - "homepage": "https://github.com/sebastianbergmann/type", + "description": "Library that helps with managing the version number of Git-hosted PHP projects", + "homepage": "https://github.com/sebastianbergmann/version", "support": { - "issues": "https://github.com/sebastianbergmann/type/issues", - "source": "https://github.com/sebastianbergmann/type/tree/3.2.1" + "issues": "https://github.com/sebastianbergmann/version/issues", + "security": "https://github.com/sebastianbergmann/version/security/policy", + "source": "https://github.com/sebastianbergmann/version/tree/6.0.0" }, "funding": [ { @@ -13853,60 +14544,59 @@ "type": "github" } ], - "time": "2023-02-03T06:13:03+00:00" + "time": "2025-02-07T05:00:38+00:00" }, { - "name": "sebastian/version", - "version": "3.0.2", + "name": "staabm/side-effects-detector", + "version": "1.0.5", "source": { "type": "git", - "url": "https://github.com/sebastianbergmann/version.git", - "reference": "c6c1022351a901512170118436c764e473f6de8c" + "url": "https://github.com/staabm/side-effects-detector.git", + "reference": "d8334211a140ce329c13726d4a715adbddd0a163" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/version/zipball/c6c1022351a901512170118436c764e473f6de8c", - "reference": "c6c1022351a901512170118436c764e473f6de8c", + "url": "https://api.github.com/repos/staabm/side-effects-detector/zipball/d8334211a140ce329c13726d4a715adbddd0a163", + "reference": "d8334211a140ce329c13726d4a715adbddd0a163", "shasum": "" }, "require": { - "php": ">=7.3" + "ext-tokenizer": "*", + "php": "^7.4 || ^8.0" }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "3.0-dev" - } + "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", "autoload": { "classmap": [ - "src/" + "lib/" ] }, "notification-url": "https://packagist.org/downloads/", "license": [ - "BSD-3-Clause" + "MIT" ], - "authors": [ - { - "name": "Sebastian Bergmann", - "email": "sebastian@phpunit.de", - "role": "lead" - } + "description": "A static analysis tool to detect side effects in PHP code", + "keywords": [ + "static analysis" ], - "description": "Library that helps with managing the version number of Git-hosted PHP projects", - "homepage": "https://github.com/sebastianbergmann/version", "support": { - "issues": "https://github.com/sebastianbergmann/version/issues", - "source": "https://github.com/sebastianbergmann/version/tree/3.0.2" + "issues": "https://github.com/staabm/side-effects-detector/issues", + "source": "https://github.com/staabm/side-effects-detector/tree/1.0.5" }, "funding": [ { - "url": "https://github.com/sebastianbergmann", + "url": "https://github.com/staabm", "type": "github" } ], - "time": "2020-09-28T06:39:44+00:00" + "time": "2024-10-20T05:08:20+00:00" }, { "name": "symfony/browser-kit", @@ -14539,6 +15229,65 @@ ], "time": "2025-07-26T16:47:03+00:00" }, + { + "name": "ta-tikoma/phpunit-architecture-test", + "version": "0.8.5", + "source": { + "type": "git", + "url": "https://github.com/ta-tikoma/phpunit-architecture-test.git", + "reference": "cf6fb197b676ba716837c886baca842e4db29005" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/ta-tikoma/phpunit-architecture-test/zipball/cf6fb197b676ba716837c886baca842e4db29005", + "reference": "cf6fb197b676ba716837c886baca842e4db29005", + "shasum": "" + }, + "require": { + "nikic/php-parser": "^4.18.0 || ^5.0.0", + "php": "^8.1.0", + "phpdocumentor/reflection-docblock": "^5.3.0", + "phpunit/phpunit": "^10.5.5 || ^11.0.0 || ^12.0.0", + "symfony/finder": "^6.4.0 || ^7.0.0" + }, + "require-dev": { + "laravel/pint": "^1.13.7", + "phpstan/phpstan": "^1.10.52" + }, + "type": "library", + "autoload": { + "psr-4": { + "PHPUnit\\Architecture\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Ni Shi", + "email": "futik0ma011@gmail.com" + }, + { + "name": "Nuno Maduro", + "email": "enunomaduro@gmail.com" + } + ], + "description": "Methods for testing application architecture", + "keywords": [ + "architecture", + "phpunit", + "stucture", + "test", + "testing" + ], + "support": { + "issues": "https://github.com/ta-tikoma/phpunit-architecture-test/issues", + "source": "https://github.com/ta-tikoma/phpunit-architecture-test/tree/0.8.5" + }, + "time": "2025-04-20T20:23:40+00:00" + }, { "name": "theseer/tokenizer", "version": "1.2.3", diff --git a/deptrac.yaml b/deptrac.yaml deleted file mode 100644 index 5552905..0000000 --- a/deptrac.yaml +++ /dev/null @@ -1,9 +0,0 @@ -# deptrac.yaml - Cross-Vertical Isolation Rules -deptrac: - paths: - - ./src - exclude_files: - - "#.*test.*#" - - "#.*Test.*#" - - "#.*tests.*#" - - '#src/Kernel\.php#' diff --git a/phpstan.dist.neon b/phpstan.dist.neon index 6856623..ecb3cc2 100644 --- a/phpstan.dist.neon +++ b/phpstan.dist.neon @@ -7,6 +7,9 @@ parameters: - src/ - tests/ - migrations/ + excludePaths: + analyse: + - tests/Architecture/* type_coverage: return: 100 param: 100 diff --git a/phpunit.xml.dist b/phpunit.xml.dist index bb076c9..e55b0dd 100644 --- a/phpunit.xml.dist +++ b/phpunit.xml.dist @@ -1,40 +1,23 @@ - - - - - - - - - - - - - - - tests - - - - - - src - - - - - - - - - - + + + + + + + + + + + + + tests + + + + + src + + diff --git a/src/Account/Facade/AccountFacade.php b/src/Account/Facade/AccountFacade.php new file mode 100644 index 0000000..495527d --- /dev/null +++ b/src/Account/Facade/AccountFacade.php @@ -0,0 +1,32 @@ +entityManager->getRepository(AccountCore::class); + $account = $repo->find($id); + if (!$account instanceof AccountCore) { + return null; + } + + return new AccountPublicInfoDto( + $account->getId() ?? '', + $account->getEmail(), + $account->getRoles(), + $account->getCreatedAt(), + ); + } +} diff --git a/src/Account/Facade/AccountFacadeInterface.php b/src/Account/Facade/AccountFacadeInterface.php new file mode 100644 index 0000000..d10f887 --- /dev/null +++ b/src/Account/Facade/AccountFacadeInterface.php @@ -0,0 +1,12 @@ + 'Bearer realm="MCP"'], - $this->buildDebugHeaders($host, $forwardedHostHeader, $xfUri, $xfMethod, $xfProto, $authHeader, null, null, false, ['X-FA-Reason' => 'missing-or-invalid-bearer']) + $this->buildDebugHeaders( + $host, + $forwardedHostHeader, + $xfUri, + $xfMethod, + $xfProto, + $authHeader, + null, + null, + false, + ['X-FA-Reason' => 'missing-or-invalid-bearer'] + ) )); } @@ -77,7 +87,22 @@ public function mcpBearerCheckAction(Request $request): Response 'ip' => $request->getClientIp() ]); - return new Response('', 403, $this->buildDebugHeaders($host, $forwardedHostHeader, $xfUri, $xfMethod, $xfProto, $authHeader, $presentedToken, null, false, ['X-FA-Reason' => 'invalid-host-format'])); + return new Response( + '', + 403, + $this->buildDebugHeaders( + $host, + $forwardedHostHeader, + $xfUri, + $xfMethod, + $xfProto, + $authHeader, + $presentedToken, + null, + false, + ['X-FA-Reason' => 'invalid-host-format'] + ) + ); } $instanceSlug = $hostMatches[1]; @@ -92,9 +117,7 @@ public function mcpBearerCheckAction(Request $request): Response $cachedValue = $cachedItem->get(); $expectedToken = is_string($cachedValue) ? $cachedValue : null; } else { - // Lookup instance by slug - $repo = $this->entityManager->getRepository(McpInstance::class); - $instance = $repo->findOneBy(['instanceSlug' => $instanceSlug]); + $instance = $this->instancesFacade->getMcpInstanceBySlug($instanceSlug); if (!$instance) { $this->logger->warning('[ForwardAuth] Instance not found', [ @@ -106,7 +129,7 @@ public function mcpBearerCheckAction(Request $request): Response return new Response('', 403, $this->buildDebugHeaders($host, $forwardedHostHeader, $xfUri, $xfMethod, $xfProto, $authHeader, $presentedToken, $instanceSlug, $cacheHit, ['X-FA-Reason' => 'instance-not-found'])); } - $expectedToken = $instance->getMcpBearer(); + $expectedToken = $instance->mcpBearer; // Cache the token for future requests $cachedItem->set($expectedToken); diff --git a/src/DockerManagement/Domain/Service/ContainerManagementDomainService.php b/src/DockerManagement/Domain/Service/ContainerManagementDomainService.php index d29fa81..cafa398 100644 --- a/src/DockerManagement/Domain/Service/ContainerManagementDomainService.php +++ b/src/DockerManagement/Domain/Service/ContainerManagementDomainService.php @@ -8,9 +8,9 @@ use App\DockerManagement\Infrastructure\Service\ProcessServiceInterface; use App\McpInstancesConfiguration\Facade\Dto\EndpointConfig; use App\McpInstancesConfiguration\Facade\Service\InstanceTypesConfigFacadeInterface; -use App\McpInstancesManagement\Domain\Entity\McpInstance; -use App\McpInstancesManagement\Domain\Enum\ContainerState; -use App\McpInstancesManagement\Domain\Enum\InstanceType; +use App\McpInstancesManagement\Facade\Dto\McpInstanceDto as McpInstance; +use App\McpInstancesManagement\Facade\Enum\ContainerState; +use App\McpInstancesManagement\Facade\Enum\InstanceType; use Psr\Log\LoggerInterface; use RuntimeException; use Symfony\Component\DependencyInjection\ParameterBag\ParameterBagInterface; @@ -118,16 +118,11 @@ public function createContainer(McpInstance $instance): bool return true; } - $containerName = $instance->getContainerName(); - $instanceSlug = $instance->getInstanceSlug(); + $containerName = $instance->containerName; + $instanceSlug = $instance->instanceSlug; // Defensive: if derived fields are missing but ID exists (common in tests), generate them now - if ((!$containerName || !$instanceSlug) && $instance->getId() !== null) { - $rootDomain = getenv('APP_ROOT_DOMAIN') ?: 'mcp-as-a-service.com'; - $instance->generateDerivedFields($rootDomain); - $containerName = $instance->getContainerName(); - $instanceSlug = $instance->getInstanceSlug(); - } + // Derived fields must be present by the time we manage containers if (!$containerName || !$instanceSlug) { $this->logger->error('[ContainerManagementDomainService] Container name or instance slug not set'); @@ -154,7 +149,7 @@ public function createContainer(McpInstance $instance): bool public function startContainer(McpInstance $instance): bool { - $containerName = $instance->getContainerName(); + $containerName = $instance->containerName; if (!$containerName) { return false; } @@ -176,7 +171,7 @@ public function startContainer(McpInstance $instance): bool public function stopContainer(McpInstance $instance): bool { - $containerName = $instance->getContainerName(); + $containerName = $instance->containerName; if (!$containerName) { return false; } @@ -198,7 +193,7 @@ public function stopContainer(McpInstance $instance): bool public function removeContainer(McpInstance $instance): bool { - $containerName = $instance->getContainerName(); + $containerName = $instance->containerName; if (!$containerName) { return false; } @@ -220,7 +215,7 @@ public function removeContainer(McpInstance $instance): bool public function restartContainer(McpInstance $instance): bool { - $containerName = $instance->getContainerName(); + $containerName = $instance->containerName; if (!$containerName) { return false; } @@ -242,7 +237,7 @@ public function restartContainer(McpInstance $instance): bool public function getContainerState(McpInstance $instance): ContainerState { - $containerName = $instance->getContainerName(); + $containerName = $instance->containerName; if (!$containerName) { return ContainerState::ERROR; } @@ -264,7 +259,7 @@ public function getContainerState(McpInstance $instance): ContainerState public function isContainerHealthy(McpInstance $instance): bool { - $containerName = $instance->getContainerName(); + $containerName = $instance->containerName; if (!$containerName) { return false; } @@ -275,7 +270,7 @@ public function isContainerHealthy(McpInstance $instance): bool } // Get all configured endpoints and check their health - $typeCfg = $this->instanceTypesConfigService->getTypeConfig($instance->getInstanceType()); + $typeCfg = $this->instanceTypesConfigService->getTypeConfig($instance->instanceType); if ($typeCfg === null) { return false; } @@ -306,7 +301,7 @@ public function isContainerHealthy(McpInstance $instance): bool public function isMcpEndpointUp(McpInstance $instance): bool { - $containerName = $instance->getContainerName(); + $containerName = $instance->containerName; if (!$containerName) { return false; } @@ -316,7 +311,7 @@ public function isMcpEndpointUp(McpInstance $instance): bool } // Get MCP endpoint configuration - $typeCfg = $this->instanceTypesConfigService->getTypeConfig($instance->getInstanceType()); + $typeCfg = $this->instanceTypesConfigService->getTypeConfig($instance->instanceType); if ($typeCfg === null || !array_key_exists('mcp', $typeCfg->endpoints)) { return false; } @@ -338,7 +333,7 @@ public function isMcpEndpointUp(McpInstance $instance): bool public function isNoVncEndpointUp(McpInstance $instance): bool { - $containerName = $instance->getContainerName(); + $containerName = $instance->containerName; if (!$containerName) { return false; } @@ -348,7 +343,7 @@ public function isNoVncEndpointUp(McpInstance $instance): bool } // Get VNC endpoint configuration - $typeCfg = $this->instanceTypesConfigService->getTypeConfig($instance->getInstanceType()); + $typeCfg = $this->instanceTypesConfigService->getTypeConfig($instance->instanceType); if ($typeCfg === null || !array_key_exists('vnc', $typeCfg->endpoints)) { return false; } @@ -373,7 +368,7 @@ public function isNoVncEndpointUp(McpInstance $instance): bool */ public function execCurlStatus(McpInstance $instance, string $url): int { - $containerName = $instance->getContainerName(); + $containerName = $instance->containerName; if (!$containerName) { return 0; } @@ -394,8 +389,8 @@ public function execCurlStatus(McpInstance $instance, string $url): int */ private function buildAndRunDockerRun(McpInstance $instance): RunProcessResultDto { - $containerName = $instance->getContainerName(); - $instanceSlug = $instance->getInstanceSlug(); + $containerName = $instance->containerName; + $instanceSlug = $instance->instanceSlug; if (is_null($containerName)) { throw new ValueError('Container name is not set'); @@ -405,19 +400,19 @@ private function buildAndRunDockerRun(McpInstance $instance): RunProcessResultDt throw new ValueError('Instance slug is not set'); } - $imageName = $this->getImageNameForInstanceType($instance->getInstanceType()); + $imageName = $this->getImageNameForInstanceType($instance->instanceType); $envVars = [ "INSTANCE_ID={$instanceSlug}", - "INSTANCE_TYPE={$instance->getInstanceType()->value}", - "SCREEN_WIDTH={$instance->getScreenWidth()}", - "SCREEN_HEIGHT={$instance->getScreenHeight()}", - "COLOR_DEPTH={$instance->getColorDepth()}", - "VNC_PASSWORD={$instance->getVncPassword()}" + "INSTANCE_TYPE={$instance->instanceType->value}", + "SCREEN_WIDTH={$instance->screenWidth}", + "SCREEN_HEIGHT={$instance->screenHeight}", + "COLOR_DEPTH={$instance->colorDepth}", + "VNC_PASSWORD={$instance->vncPassword}" ]; $labels = $this->buildTraefikLabels( - $instance->getInstanceType(), + $instance->instanceType, $instanceSlug ); diff --git a/src/DockerManagement/Facade/DockerManagementFacade.php b/src/DockerManagement/Facade/DockerManagementFacade.php index 4f72c44..995fc85 100644 --- a/src/DockerManagement/Facade/DockerManagementFacade.php +++ b/src/DockerManagement/Facade/DockerManagementFacade.php @@ -7,10 +7,10 @@ use App\DockerManagement\Domain\Service\ContainerManagementDomainService; use App\DockerManagement\Facade\Dto\ContainerStatusDto; use App\McpInstancesConfiguration\Facade\Service\InstanceTypesConfigFacadeInterface; -use App\McpInstancesManagement\Domain\Dto\EndpointStatusDto; -use App\McpInstancesManagement\Domain\Dto\InstanceStatusDto; -use App\McpInstancesManagement\Domain\Entity\McpInstance; -use App\McpInstancesManagement\Domain\Enum\ContainerState; +use App\McpInstancesManagement\Facade\Dto\EndpointStatusDto; +use App\McpInstancesManagement\Facade\Dto\InstanceStatusDto; +use App\McpInstancesManagement\Facade\Dto\McpInstanceDto; +use App\McpInstancesManagement\Facade\Enum\ContainerState; final readonly class DockerManagementFacade implements DockerManagementFacadeInterface { @@ -20,7 +20,7 @@ public function __construct( ) { } - public function createAndStartContainer(McpInstance $instance): bool + public function createAndStartContainer(McpInstanceDto $instance): bool { // Create the container if (!$this->domainService->createContainer($instance)) { @@ -38,7 +38,7 @@ public function createAndStartContainer(McpInstance $instance): bool return true; } - public function stopAndRemoveContainer(McpInstance $instance): bool + public function stopAndRemoveContainer(McpInstanceDto $instance): bool { $stopped = $this->domainService->stopContainer($instance); $removed = $this->domainService->removeContainer($instance); @@ -47,17 +47,17 @@ public function stopAndRemoveContainer(McpInstance $instance): bool return $stopped || $removed; } - public function restartContainer(McpInstance $instance): bool + public function restartContainer(McpInstanceDto $instance): bool { return $this->domainService->restartContainer($instance); } - public function isContainerHealthy(McpInstance $instance): bool + public function isContainerHealthy(McpInstanceDto $instance): bool { return $this->domainService->isContainerHealthy($instance); } - public function getContainerStatus(McpInstance $instance): ContainerStatusDto + public function getContainerStatus(McpInstanceDto $instance): ContainerStatusDto { $state = $this->domainService->getContainerState($instance); $running = $state === ContainerState::RUNNING; @@ -66,23 +66,23 @@ public function getContainerStatus(McpInstance $instance): ContainerStatusDto $healthy = $running && $mcpUp && $noVncUp; return new ContainerStatusDto( - $instance->getContainerName() ?? '', + $instance->containerName ?? '', $state->value, $healthy, - $instance->getMcpSubdomain() ? 'https://' . $instance->getMcpSubdomain() . '/mcp' : null, - $instance->getVncSubdomain() ? 'https://' . $instance->getVncSubdomain() : null, + $instance->mcpSubdomain ? 'https://' . $instance->mcpSubdomain . '/mcp' : null, + $instance->vncSubdomain ? 'https://' . $instance->vncSubdomain : null, $mcpUp, $noVncUp ); } - public function getInstanceStatus(McpInstance $instance): InstanceStatusDto + public function getInstanceStatus(McpInstanceDto $instance): InstanceStatusDto { $containerState = $this->domainService->getContainerState($instance); $running = $containerState === ContainerState::RUNNING; $rootDomain = getenv('APP_ROOT_DOMAIN') ?: 'mcp-as-a-service.com'; - $typeCfg = $this->configService->getTypeConfig($instance->getInstanceType()); + $typeCfg = $this->configService->getTypeConfig($instance->instanceType); $endpoints = []; if ($typeCfg !== null) { @@ -96,7 +96,7 @@ public function getInstanceStatus(McpInstance $instance): InstanceStatusDto } // Build external URLs from external_paths and host pattern - $host = $endpointId . '-' . ($instance->getInstanceSlug() ?? '') . '.' . $rootDomain; + $host = $endpointId . '-' . ($instance->instanceSlug ?? '') . '.' . $rootDomain; $externalUrls = []; foreach ($epCfg->externalPaths as $p) { $externalUrls[] = 'https://' . $host . $p; @@ -110,8 +110,8 @@ public function getInstanceStatus(McpInstance $instance): InstanceStatusDto } return new InstanceStatusDto( - $instance->getId() ?? '', - $instance->getContainerName() ?? '', + $instance->id ?? '', + $instance->containerName ?? '', $containerState->value, $running, $endpoints diff --git a/src/DockerManagement/Facade/DockerManagementFacadeInterface.php b/src/DockerManagement/Facade/DockerManagementFacadeInterface.php index 7e7013f..2502d1b 100644 --- a/src/DockerManagement/Facade/DockerManagementFacadeInterface.php +++ b/src/DockerManagement/Facade/DockerManagementFacadeInterface.php @@ -5,38 +5,38 @@ namespace App\DockerManagement\Facade; use App\DockerManagement\Facade\Dto\ContainerStatusDto; -use App\McpInstancesManagement\Domain\Dto\InstanceStatusDto; -use App\McpInstancesManagement\Domain\Entity\McpInstance; +use App\McpInstancesManagement\Facade\Dto\InstanceStatusDto; +use App\McpInstancesManagement\Facade\Dto\McpInstanceDto; interface DockerManagementFacadeInterface { /** * Create and start a Docker container for the given MCP instance. */ - public function createAndStartContainer(McpInstance $instance): bool; + public function createAndStartContainer(McpInstanceDto $instance): bool; /** * Stop and remove the Docker container for the given MCP instance. */ - public function stopAndRemoveContainer(McpInstance $instance): bool; + public function stopAndRemoveContainer(McpInstanceDto $instance): bool; /** * Restart the Docker container for the given MCP instance. */ - public function restartContainer(McpInstance $instance): bool; + public function restartContainer(McpInstanceDto $instance): bool; /** * Check if the container is healthy (endpoints responding). */ - public function isContainerHealthy(McpInstance $instance): bool; + public function isContainerHealthy(McpInstanceDto $instance): bool; /** * Get comprehensive status information for the container. */ - public function getContainerStatus(McpInstance $instance): ContainerStatusDto; + public function getContainerStatus(McpInstanceDto $instance): ContainerStatusDto; /** * Get generic instance status including dynamic endpoints derived from configuration. */ - public function getInstanceStatus(McpInstance $instance): InstanceStatusDto; + public function getInstanceStatus(McpInstanceDto $instance): InstanceStatusDto; } diff --git a/src/McpInstancesConfiguration/Facade/Service/InstanceTypesConfigFacade.php b/src/McpInstancesConfiguration/Facade/Service/InstanceTypesConfigFacade.php index ad82d85..8a89f26 100644 --- a/src/McpInstancesConfiguration/Facade/Service/InstanceTypesConfigFacade.php +++ b/src/McpInstancesConfiguration/Facade/Service/InstanceTypesConfigFacade.php @@ -6,7 +6,7 @@ use App\McpInstancesConfiguration\Facade\Dto\InstanceTypeConfig; use App\McpInstancesConfiguration\Infrastructure\InstanceTypesConfigProviderInterface; -use App\McpInstancesManagement\Domain\Enum\InstanceType; +use App\McpInstancesManagement\Facade\Enum\InstanceType; final readonly class InstanceTypesConfigFacade implements InstanceTypesConfigFacadeInterface { diff --git a/src/McpInstancesConfiguration/Facade/Service/InstanceTypesConfigFacadeInterface.php b/src/McpInstancesConfiguration/Facade/Service/InstanceTypesConfigFacadeInterface.php index 465d935..368f692 100644 --- a/src/McpInstancesConfiguration/Facade/Service/InstanceTypesConfigFacadeInterface.php +++ b/src/McpInstancesConfiguration/Facade/Service/InstanceTypesConfigFacadeInterface.php @@ -5,7 +5,7 @@ namespace App\McpInstancesConfiguration\Facade\Service; use App\McpInstancesConfiguration\Facade\Dto\InstanceTypeConfig; -use App\McpInstancesManagement\Domain\Enum\InstanceType; +use App\McpInstancesManagement\Facade\Enum\InstanceType; interface InstanceTypesConfigFacadeInterface { diff --git a/src/McpInstancesConfiguration/Infrastructure/YamlInstanceTypesConfigProvider.php b/src/McpInstancesConfiguration/Infrastructure/YamlInstanceTypesConfigProvider.php index 9d24c3f..8f950cd 100644 --- a/src/McpInstancesConfiguration/Infrastructure/YamlInstanceTypesConfigProvider.php +++ b/src/McpInstancesConfiguration/Infrastructure/YamlInstanceTypesConfigProvider.php @@ -11,7 +11,7 @@ use App\McpInstancesConfiguration\Facade\Dto\InstanceTypeConfig; use App\McpInstancesConfiguration\Facade\Dto\McpInstanceTypesConfig; use App\McpInstancesConfiguration\Facade\Exception\InvalidInstanceTypesConfigException; -use App\McpInstancesManagement\Domain\Enum\InstanceType; +use App\McpInstancesManagement\Facade\Enum\InstanceType; use Symfony\Component\Yaml\Yaml; use ValueError; diff --git a/src/McpInstancesManagement/Domain/Entity/McpInstance.php b/src/McpInstancesManagement/Domain/Entity/McpInstance.php index f464f75..fae488e 100644 --- a/src/McpInstancesManagement/Domain/Entity/McpInstance.php +++ b/src/McpInstancesManagement/Domain/Entity/McpInstance.php @@ -4,8 +4,9 @@ namespace App\McpInstancesManagement\Domain\Entity; -use App\McpInstancesManagement\Domain\Enum\ContainerState; -use App\McpInstancesManagement\Domain\Enum\InstanceType; +use App\McpInstancesManagement\Facade\Dto\McpInstanceDto; +use App\McpInstancesManagement\Facade\Enum\ContainerState; +use App\McpInstancesManagement\Facade\Enum\InstanceType; use DateTimeImmutable; use Doctrine\DBAL\Types\Types; use Doctrine\ORM\Mapping as ORM; @@ -211,4 +212,24 @@ public static function generateRandomBearer(int $length = 32): string return rtrim(strtr(base64_encode(random_bytes($length)), '+/', '-_'), '='); } + + public function toDto(): McpInstanceDto + { + return new McpInstanceDto( + $this->getId() ?? '', + $this->getCreatedAt(), + $this->getAccountCoreId(), + $this->getInstanceSlug(), + $this->getContainerName(), + ContainerState::from($this->getContainerState()->value), + InstanceType::from($this->getInstanceType()->value), + $this->getScreenWidth(), + $this->getScreenHeight(), + $this->getColorDepth(), + $this->getVncPassword(), + $this->getMcpBearer(), + $this->getMcpSubdomain(), + $this->getVncSubdomain(), + ); + } } diff --git a/src/McpInstancesManagement/Domain/Service/McpInstancesDomainService.php b/src/McpInstancesManagement/Domain/Service/McpInstancesDomainService.php index 248857a..7344a0b 100644 --- a/src/McpInstancesManagement/Domain/Service/McpInstancesDomainService.php +++ b/src/McpInstancesManagement/Domain/Service/McpInstancesDomainService.php @@ -6,12 +6,12 @@ use App\Account\Facade\Dto\AccountCoreInfoDto; use App\DockerManagement\Facade\DockerManagementFacadeInterface; -use App\McpInstancesManagement\Domain\Dto\ProcessStatusContainerDto; -use App\McpInstancesManagement\Domain\Dto\ProcessStatusDto; -use App\McpInstancesManagement\Domain\Dto\ServiceStatusDto; use App\McpInstancesManagement\Domain\Entity\McpInstance; -use App\McpInstancesManagement\Domain\Enum\ContainerState; -use App\McpInstancesManagement\Domain\Enum\InstanceType; +use App\McpInstancesManagement\Facade\Dto\ProcessStatusContainerDto; +use App\McpInstancesManagement\Facade\Dto\ProcessStatusDto; +use App\McpInstancesManagement\Facade\Dto\ServiceStatusDto; +use App\McpInstancesManagement\Facade\Enum\ContainerState; +use App\McpInstancesManagement\Facade\Enum\InstanceType; use Doctrine\ORM\EntityManagerInterface; use Exception; use LogicException; @@ -58,7 +58,7 @@ public function createMcpInstance( $instance = new McpInstance( $accountCoreId, - $instanceType ?? InstanceType::PLAYWRIGHT_V1, + $instanceType !== null ? InstanceType::from($instanceType->value) : InstanceType::PLAYWRIGHT_V1, $screenWidth, $screenHeight, $colorDepth, @@ -75,7 +75,7 @@ public function createMcpInstance( $this->entityManager->flush(); // Create and start Docker container - if (!$this->dockerFacade->createAndStartContainer($instance)) { + if (!$this->dockerFacade->createAndStartContainer($instance->toDto())) { // If container creation fails, remove the database entry $this->entityManager->remove($instance); $this->entityManager->flush(); @@ -98,7 +98,7 @@ public function stopAndRemoveMcpInstance(string $accountCoreId): void } // Stop and remove Docker container - $this->dockerFacade->stopAndRemoveContainer($instance); + $this->dockerFacade->stopAndRemoveContainer($instance->toDto()); // Remove database entry $this->entityManager->remove($instance); @@ -113,7 +113,7 @@ public function restartMcpInstance(string $instanceId): bool return false; } - $success = $this->dockerFacade->restartContainer($instance); + $success = $this->dockerFacade->restartContainer($instance->toDto()); if ($success) { $instance->setContainerState(ContainerState::RUNNING); @@ -139,7 +139,7 @@ public function recreateMcpInstanceContainer(string $instanceId): bool } // Stop and remove old container (ignore result; it may not exist) - $this->dockerFacade->stopAndRemoveContainer($instance); + $this->dockerFacade->stopAndRemoveContainer($instance->toDto()); // Ensure derived fields exist (container name/slug) before recreation if ($instance->getContainerName() === null || $instance->getInstanceSlug() === null) { @@ -149,7 +149,7 @@ public function recreateMcpInstanceContainer(string $instanceId): bool } // Create and start new container using the same instance data - $success = $this->dockerFacade->createAndStartContainer($instance); + $success = $this->dockerFacade->createAndStartContainer($instance->toDto()); if ($success) { $instance->setContainerState(ContainerState::RUNNING); } else { @@ -205,7 +205,7 @@ public function stopAndRemoveMcpInstanceById(string $instanceId): void throw new LogicException('MCP instance not found.'); } - $this->dockerFacade->stopAndRemoveContainer($instance); + $this->dockerFacade->stopAndRemoveContainer($instance->toDto()); $this->entityManager->remove($instance); $this->entityManager->flush(); } @@ -223,7 +223,7 @@ public function getProcessStatusForInstance(string $instanceId): ProcessStatusDt } // Get Docker container status with partial endpoint checks - $containerStatus = $this->dockerFacade->getContainerStatus($instance); + $containerStatus = $this->dockerFacade->getContainerStatus($instance->toDto()); $running = $containerStatus->state === 'running'; $xvfbUp = $running; // container running implies Xvfb supervisor started diff --git a/src/McpInstancesManagement/Domain/Service/McpInstancesDomainServiceInterface.php b/src/McpInstancesManagement/Domain/Service/McpInstancesDomainServiceInterface.php index 1056517..23c5c39 100644 --- a/src/McpInstancesManagement/Domain/Service/McpInstancesDomainServiceInterface.php +++ b/src/McpInstancesManagement/Domain/Service/McpInstancesDomainServiceInterface.php @@ -5,9 +5,9 @@ namespace App\McpInstancesManagement\Domain\Service; use App\Account\Facade\Dto\AccountCoreInfoDto; -use App\McpInstancesManagement\Domain\Dto\ProcessStatusDto; use App\McpInstancesManagement\Domain\Entity\McpInstance; -use App\McpInstancesManagement\Domain\Enum\InstanceType; +use App\McpInstancesManagement\Facade\Dto\ProcessStatusDto; +use App\McpInstancesManagement\Facade\Enum\InstanceType; use Exception; interface McpInstancesDomainServiceInterface diff --git a/src/McpInstancesManagement/Facade/Dto/EndpointStatusDto.php b/src/McpInstancesManagement/Facade/Dto/EndpointStatusDto.php new file mode 100644 index 0000000..08621e3 --- /dev/null +++ b/src/McpInstancesManagement/Facade/Dto/EndpointStatusDto.php @@ -0,0 +1,20 @@ + $externalUrls + */ + public function __construct( + public string $id, + public bool $up, + public array $externalUrls, + public bool $requiresAuthBearer, + public bool $hasHealthCheck, + ) { + } +} diff --git a/src/McpInstancesManagement/Facade/Dto/InstanceStatusDto.php b/src/McpInstancesManagement/Facade/Dto/InstanceStatusDto.php new file mode 100644 index 0000000..c38f8fe --- /dev/null +++ b/src/McpInstancesManagement/Facade/Dto/InstanceStatusDto.php @@ -0,0 +1,20 @@ + $endpoints + */ + public function __construct( + public string $instanceId, + public string $containerName, + public string $containerState, + public bool $containerRunning, + public array $endpoints, + ) { + } +} diff --git a/src/McpInstancesManagement/Facade/Dto/McpInstanceDto.php b/src/McpInstancesManagement/Facade/Dto/McpInstanceDto.php new file mode 100644 index 0000000..837c169 --- /dev/null +++ b/src/McpInstancesManagement/Facade/Dto/McpInstanceDto.php @@ -0,0 +1,30 @@ +entityManager->getRepository(McpInstanceEntity::class); + $ent = $repo->find($id); + + return $ent?->toDto(); + } + + public function getMcpInstanceBySlug(string $slug): ?McpInstanceDto + { + $repo = $this->entityManager->getRepository(McpInstance::class); + $ent = $repo->findOneBy(['instanceSlug' => $slug]); + + return $ent?->toDto(); + } +} diff --git a/src/McpInstancesManagement/Facade/McpInstancesManagementFacadeInterface.php b/src/McpInstancesManagement/Facade/McpInstancesManagementFacadeInterface.php new file mode 100644 index 0000000..d39190a --- /dev/null +++ b/src/McpInstancesManagement/Facade/McpInstancesManagementFacadeInterface.php @@ -0,0 +1,14 @@ +dockerFacade->getInstanceStatus($instance); + return $this->dockerFacade->getInstanceStatus($instance->toDto()); } /** @@ -140,17 +139,16 @@ public function getAdminOverviewData(): array $overviewData = []; foreach ($instances as $instance) { - // Get the account for this instance - $accountRepo = $this->entityManager->getRepository(AccountCore::class); - $account = $accountRepo->find($instance->getAccountCoreId()); + // Get the account info via Account Facade + $account = $this->accountFacade->getAccountById($instance->getAccountCoreId()); - if (!$account) { + if ($account === null) { continue; // Skip if account not found } // Get container status for health check try { - $containerStatus = $this->dockerFacade->getContainerStatus($instance); + $containerStatus = $this->dockerFacade->getContainerStatus($instance->toDto()); $isHealthy = $containerStatus->healthy; $mcpEndpoint = $containerStatus->mcpEndpoint; $vncEndpoint = $containerStatus->vncEndpoint; @@ -163,7 +161,12 @@ public function getAdminOverviewData(): array $overviewData[] = new AdminOverviewDto( $this->mapMcpInstanceToDto($instance), - $this->mapAccountToDto($account), + new AdminAccountDto( + $account->id, + $account->email, + $account->roles, + $account->createdAt, + ), $isHealthy, $mcpEndpoint, $vncEndpoint, @@ -198,7 +201,7 @@ public function getMcpInstanceInfoById(string $id): ?McpInstanceInfoDto */ private function mapMcpInstanceToDto(McpInstance $instance): McpInstanceInfoDto { - $typeCfg = $this->typesConfig->getTypeConfig($instance->getInstanceType()); + $typeCfg = $this->typesConfig->getTypeConfig(InstanceType::from($instance->getInstanceType()->value)); $display = ($typeCfg !== null) ? $typeCfg->displayName : $instance->getInstanceType()->value; $vncPaths = []; $mcpPaths = []; @@ -240,16 +243,5 @@ private function mapMcpInstanceToDto(McpInstance $instance): McpInstanceInfoDto ); } - /** - * Map AccountCore domain entity to presentation DTO. - */ - private function mapAccountToDto(AccountCore $account): AdminAccountDto - { - return new AdminAccountDto( - $account->getId() ?? '', - $account->getEmail(), - $account->getRoles(), - $account->getCreatedAt(), - ); - } + // Account mapping now happens via AccountFacade DTO } diff --git a/symfony.lock b/symfony.lock index 2099b53..de54114 100644 --- a/symfony.lock +++ b/symfony.lock @@ -1,13 +1,4 @@ { - "deptrac/deptrac": { - "version": "3.0", - "recipe": { - "repo": "github.com/symfony/recipes-contrib", - "branch": "main", - "version": "3.0", - "ref": "05ab8813714080c7bc915cb10c780e6cfdbdb991" - } - }, "doctrine/deprecations": { "version": "1.1", "recipe": { diff --git a/tests/Architecture/FeatureBoundariesArchTest.php b/tests/Architecture/FeatureBoundariesArchTest.php new file mode 100644 index 0000000..2e4da87 --- /dev/null +++ b/tests/Architecture/FeatureBoundariesArchTest.php @@ -0,0 +1,35 @@ + basename($path), + glob(__DIR__ . '/../../src/*', GLOB_ONLYDIR) + ), + static fn ( + string $dir + ): bool => $dir !== 'Common' +); + +foreach ($features as $from) { + foreach ($features as $to) { + if ($from === $to) { + continue; + } + + arch("{$from} must not use {$to} internals") + ->expect("App\\{$from}") + ->classes() + ->not->toUse([ + "App\\{$to}\\Api", + "App\\{$to}\\Domain", + "App\\{$to}\\Infrastructure", + "App\\{$to}\\Presentation", + "App\\{$to}\\TestHarness", + ]) + ->group('architecture'); + } +} diff --git a/tests/Pest.php b/tests/Pest.php new file mode 100644 index 0000000..11538ab --- /dev/null +++ b/tests/Pest.php @@ -0,0 +1,5 @@ +createMock(EntityManagerInterface::class); - $repo = $this->createMock(EntityRepository::class); - $cache = $this->createMock(CacheItemPoolInterface::class); - $logger = $this->createMock(LoggerInterface::class); - - $em->method('getRepository')->willReturn($repo); - $instance = $this->createConfiguredMock(McpInstance::class, ['getMcpBearer' => 'expected-token']); - $repo->method('findOneBy')->with(['instanceSlug' => 'abcd'])->willReturn($instance); + $cache = $this->createMock(CacheItemPoolInterface::class); + $logger = $this->createMock(LoggerInterface::class); + $instancesManagementFacade = $this->createMock(McpInstancesManagementFacadeInterface::class); $cacheItem = $this->createMock(CacheItemInterface::class); - $cacheItem->method('isHit')->willReturn(false); - $cache->method('getItem')->willReturn($cacheItem); + $cacheItem->method('isHit') + ->willReturn(false); + $cache->method('getItem') + ->willReturn($cacheItem); + + $instancesManagementFacade + ->method('getMcpInstanceBySlug') + ->willReturn( + new McpInstanceDto( + 'mcp-abcd-id', + DateAndTimeService::getDateTimeImmutable(), + '', + 'mcp-abcd', + '', + ContainerState::RUNNING, + InstanceType::PLAYWRIGHT_V1, + 1280, + 720, + 24, + '', + 'expected-token', + '', + '' + ) + ); - $controller = new ForwardAuthController($em, $cache, $logger); - $server = [ + $unitUnderTest = new ForwardAuthController( + $cache, + $logger, + $instancesManagementFacade + ); + $server = [ 'HTTP_HOST' => 'mcp-abcd.mcp-as-a-service.com', 'HTTP_AUTHORIZATION' => 'Bearer expected-token', ]; $request = Request::create('/', 'GET', [], [], [], $server); - $response = $controller->mcpBearerCheckAction($request); + $response = $unitUnderTest->mcpBearerCheckAction($request); $this->assertSame(204, $response->getStatusCode()); } public function testDeniesWhenTokenMissing(): void { - $em = $this->createMock(EntityManagerInterface::class); - $cache = $this->createMock(CacheItemPoolInterface::class); - $logger = $this->createMock(LoggerInterface::class); + $cache = $this->createMock(CacheItemPoolInterface::class); + $logger = $this->createMock(LoggerInterface::class); + $instancesManagementFacade = $this->createMock(McpInstancesManagementFacadeInterface::class); - $controller = new ForwardAuthController($em, $cache, $logger); - $server = [ + $unitUnderTest = new ForwardAuthController( + $cache, + $logger, + $instancesManagementFacade + ); + $server = [ 'HTTP_HOST' => 'mcp-abcd.mcp-as-a-service.com', ]; $request = Request::create('/', 'GET', [], [], [], $server); - $response = $controller->mcpBearerCheckAction($request); + $response = $unitUnderTest->mcpBearerCheckAction($request); $this->assertSame(401, $response->getStatusCode()); } } diff --git a/tests/Unit/DockerManagement/Domain/Service/ContainerManagementDomainServiceTest.php b/tests/Unit/DockerManagement/Domain/Service/ContainerManagementDomainServiceTest.php index 24a8497..75415f8 100644 --- a/tests/Unit/DockerManagement/Domain/Service/ContainerManagementDomainServiceTest.php +++ b/tests/Unit/DockerManagement/Domain/Service/ContainerManagementDomainServiceTest.php @@ -14,8 +14,9 @@ use App\McpInstancesConfiguration\Facade\Service\InstanceTypesConfigFacade; use App\McpInstancesConfiguration\Infrastructure\InstanceTypesConfigProviderInterface; use App\McpInstancesManagement\Domain\Entity\McpInstance; -use App\McpInstancesManagement\Domain\Enum\ContainerState; -use App\McpInstancesManagement\Domain\Enum\InstanceType; +use App\McpInstancesManagement\Facade\Dto\McpInstanceDto; +use App\McpInstancesManagement\Facade\Enum\ContainerState; +use App\McpInstancesManagement\Facade\Enum\InstanceType; use PHPUnit\Framework\MockObject\MockObject; use PHPUnit\Framework\TestCase; use Psr\Log\LoggerInterface; @@ -53,7 +54,7 @@ public function testCreateContainerFailsWhenNamesMissing(): void $process = $this->createMock(ProcessServiceInterface::class); $process->method('runProcess')->willReturn(new RunProcessResultDto(0, '', '')); $unitUnderTest = new ContainerManagementDomainService($this->logger, $this->params, $this->router, $configFacade, $process); - $instance = new McpInstance( + $entity = new McpInstance( 'acc', InstanceType::PLAYWRIGHT_V1, 1280, @@ -63,8 +64,10 @@ public function testCreateContainerFailsWhenNamesMissing(): void 'bearer' ); + $dto = $this->toDto($entity); + // Intentionally do not set derived fields; createContainer should log and return false - $this->assertFalse($unitUnderTest->createContainer($instance)); + $this->assertFalse($unitUnderTest->createContainer($dto)); } public function testDockerRunInvocationUsesWrapperInValidateOnlyMode(): void @@ -73,7 +76,7 @@ public function testDockerRunInvocationUsesWrapperInValidateOnlyMode(): void $process = $this->createMock(ProcessServiceInterface::class); $process->method('runProcess')->willReturn(new RunProcessResultDto(0, '', '')); $unitUnderTest = new ContainerManagementDomainService($this->logger, $this->params, $this->router, $configFacade, $process); - $instance = new McpInstance( + $entity = new McpInstance( 'acc', InstanceType::PLAYWRIGHT_V1, 1280, @@ -85,11 +88,11 @@ public function testDockerRunInvocationUsesWrapperInValidateOnlyMode(): void // Prepare derived fields so that createContainer proceeds // We simulate what generateDerivedFields() does - $r = new ReflectionClass($instance); + $r = new ReflectionClass($entity); $idProp = $r->getProperty('id'); $idProp->setAccessible(true); - $idProp->setValue($instance, '00000000-0000-0000-0000-000000000abc'); - $instance->generateDerivedFields('mcp-as-a-service.com'); + $idProp->setValue($entity, '00000000-0000-0000-0000-000000000abc'); + $entity->generateDerivedFields('mcp-as-a-service.com'); // Logger may be called multiple times; no strict parameter expectations here $this->logger->expects($this->any())->method('info'); @@ -97,8 +100,10 @@ public function testDockerRunInvocationUsesWrapperInValidateOnlyMode(): void // Enable validation-only mode so the service short-circuits safely in environments without Docker putenv('MAAS_WRAPPER_VALIDATE_ONLY=1'); + $dto = $this->toDto($entity); + // Execute; since wrapper runs in validation mode, createContainer should return true (docker run exits 0) - $this->assertTrue($unitUnderTest->createContainer($instance)); + $this->assertTrue($unitUnderTest->createContainer($dto)); // Cleanup env putenv('MAAS_WRAPPER_VALIDATE_ONLY'); @@ -114,7 +119,7 @@ public function testStartStopRestartRemoveInvokeWrapper(): void $process = $this->createMock(ProcessServiceInterface::class); $process->method('runProcess')->willReturn(new RunProcessResultDto(0, '', '')); $unitUnderTest = new ContainerManagementDomainService($logger, $this->params, $this->router, $configFacade, $process); - $instance = new McpInstance( + $entity = new McpInstance( 'acc', InstanceType::PLAYWRIGHT_V1, 1280, @@ -124,18 +129,20 @@ public function testStartStopRestartRemoveInvokeWrapper(): void 'bearer' ); - $r = new ReflectionClass($instance); + $r = new ReflectionClass($entity); $idProp = $r->getProperty('id'); $idProp->setAccessible(true); - $idProp->setValue($instance, '00000000-0000-0000-0000-000000000def'); - $instance->generateDerivedFields('mcp-as-a-service.com'); + $idProp->setValue($entity, '00000000-0000-0000-0000-000000000def'); + $entity->generateDerivedFields('mcp-as-a-service.com'); + + $dto = $this->toDto($entity); // The ProcessServiceInterface mock returns exit code 0; wrapper or docker invocation details are not required here. - $this->assertTrue($unitUnderTest->startContainer($instance)); - $this->assertTrue($unitUnderTest->stopContainer($instance)); - $this->assertTrue($unitUnderTest->restartContainer($instance)); - $this->assertTrue($unitUnderTest->removeContainer($instance)); + $this->assertTrue($unitUnderTest->startContainer($dto)); + $this->assertTrue($unitUnderTest->stopContainer($dto)); + $this->assertTrue($unitUnderTest->restartContainer($dto)); + $this->assertTrue($unitUnderTest->removeContainer($dto)); } public function testGetContainerStateInvokesInspectViaWrapper(): void @@ -149,7 +156,7 @@ public function testGetContainerStateInvokesInspectViaWrapper(): void $process = $this->createMock(ProcessServiceInterface::class); $process->method('runProcess')->willReturn(new RunProcessResultDto(0, '', '')); $unitUnderTest = new ContainerManagementDomainService($logger, $this->params, $this->router, $configFacade, $process); - $instance = new McpInstance( + $entity = new McpInstance( 'acc', InstanceType::PLAYWRIGHT_V1, 1280, @@ -158,16 +165,16 @@ public function testGetContainerStateInvokesInspectViaWrapper(): void 'vncpass', 'bearer' ); - $r = new ReflectionClass($instance); + $r = new ReflectionClass($entity); $idProp = $r->getProperty('id'); $idProp->setAccessible(true); - $idProp->setValue($instance, '00000000-0000-0000-0000-000000000abc'); - $instance->generateDerivedFields('mcp-as-a-service.com'); + $idProp->setValue($entity, '00000000-0000-0000-0000-000000000abc'); + $entity->generateDerivedFields('mcp-as-a-service.com'); // No env overrides required; the process mock returns 0 and stdout is empty. // In validate-only mode, stdout is not the status, so service returns ERROR - $this->assertSame(ContainerState::ERROR, $unitUnderTest->getContainerState($instance)); + $this->assertSame(ContainerState::ERROR, $unitUnderTest->getContainerState($this->toDto($entity))); } // Helper to construct a minimal config service with endpoints 'mcp' and 'vnc' @@ -234,6 +241,26 @@ public function testBuildsTraefikLabelsFromEndpoints(): void $this->assertTrue($this->containsSubstring($labels, 'X-MCP-Instance=abc123')); } + private function toDto(McpInstance $e): McpInstanceDto + { + return new McpInstanceDto( + $e->getId() ?? '', + $e->getCreatedAt(), + $e->getAccountCoreId(), + $e->getInstanceSlug(), + $e->getContainerName(), + ContainerState::from($e->getContainerState()->value), + InstanceType::from($e->getInstanceType()->value), + $e->getScreenWidth(), + $e->getScreenHeight(), + $e->getColorDepth(), + $e->getVncPassword(), + $e->getMcpBearer(), + $e->getMcpSubdomain(), + $e->getVncSubdomain(), + ); + } + /** * @param array $labels */ diff --git a/tests/Unit/McpInstancesManagement/Domain/Service/McpInstancesDomainServiceTest.php b/tests/Unit/McpInstancesManagement/Domain/Service/McpInstancesDomainServiceTest.php index 399ba06..e5eb2b0 100644 --- a/tests/Unit/McpInstancesManagement/Domain/Service/McpInstancesDomainServiceTest.php +++ b/tests/Unit/McpInstancesManagement/Domain/Service/McpInstancesDomainServiceTest.php @@ -7,9 +7,10 @@ use App\Account\Facade\Dto\AccountCoreInfoDto; use App\DockerManagement\Facade\DockerManagementFacadeInterface; use App\McpInstancesManagement\Domain\Entity\McpInstance; -use App\McpInstancesManagement\Domain\Enum\ContainerState; -use App\McpInstancesManagement\Domain\Enum\InstanceType; use App\McpInstancesManagement\Domain\Service\McpInstancesDomainService; +use App\McpInstancesManagement\Facade\Dto\McpInstanceDto; +use App\McpInstancesManagement\Facade\Enum\ContainerState; +use App\McpInstancesManagement\Facade\Enum\InstanceType; use Doctrine\ORM\EntityManagerInterface; use Doctrine\ORM\EntityRepository; use LogicException; @@ -38,7 +39,10 @@ protected function setUp(): void $this->em->method('getRepository') ->willReturn($this->repo); - $this->unitUnderTest = new McpInstancesDomainService($this->em, $this->dockerFacade); + $this->unitUnderTest = new McpInstancesDomainService( + $this->em, + $this->dockerFacade + ); } public function testCreateMcpInstanceSuccessCreatesContainerAndSetsRunning(): void @@ -60,7 +64,7 @@ public function testCreateMcpInstanceSuccessCreatesContainerAndSetsRunning(): vo $this->dockerFacade ->expects($this->once()) ->method('createAndStartContainer') - ->with($this->isInstanceOf(McpInstance::class)) + ->with($this->isInstanceOf(McpInstanceDto::class)) ->willReturn(true); $instance = $this->unitUnderTest->createMcpInstance($accountId); @@ -87,7 +91,7 @@ public function testCreateMcpInstanceFailureRemovesEntityAndThrows(): void $this->dockerFacade ->expects($this->once()) ->method('createAndStartContainer') - ->with($this->isInstanceOf(McpInstance::class)) + ->with($this->isInstanceOf(McpInstanceDto::class)) ->willReturn(false); $this->expectException(LogicException::class); @@ -116,7 +120,7 @@ public function testStopAndRemoveCallsDockerAndRemovesEntity(): void $this->dockerFacade ->expects($this->once()) ->method('stopAndRemoveContainer') - ->with($existing) + ->with($this->isInstanceOf(McpInstanceDto::class)) ->willReturn(true); $this->em->expects($this->once()) @@ -148,7 +152,7 @@ public function testRestartMcpInstanceUpdatesStateOnSuccess(): void $this->dockerFacade ->expects($this->once()) ->method('restartContainer') - ->with($existing) + ->with($this->isInstanceOf(McpInstanceDto::class)) ->willReturn(true); $this->em->expects($this->atLeastOnce()) @@ -180,7 +184,7 @@ public function testRestartMcpInstanceSetsErrorOnFailure(): void $this->dockerFacade ->expects($this->once()) ->method('restartContainer') - ->with($existing) + ->with($this->isInstanceOf(McpInstanceDto::class)) ->willReturn(false); $this->em->expects($this->atLeastOnce()) diff --git a/tests/Unit/McpInstancesManagement/Presentation/Controller/AdminInstancesControllerTest.php b/tests/Unit/McpInstancesManagement/Presentation/Controller/AdminInstancesControllerTest.php index e664ddb..b2981d3 100644 --- a/tests/Unit/McpInstancesManagement/Presentation/Controller/AdminInstancesControllerTest.php +++ b/tests/Unit/McpInstancesManagement/Presentation/Controller/AdminInstancesControllerTest.php @@ -4,19 +4,20 @@ namespace App\Tests\Unit\McpInstancesManagement\Presentation\Controller; +use App\Account\Facade\AccountFacadeInterface; use App\DockerManagement\Facade\DockerManagementFacadeInterface; use App\McpInstancesConfiguration\Facade\Dto\EndpointConfig; use App\McpInstancesConfiguration\Facade\Dto\InstanceDockerConfig; use App\McpInstancesConfiguration\Facade\Dto\InstanceTypeConfig; use App\McpInstancesConfiguration\Facade\Service\InstanceTypesConfigFacadeInterface; -use App\McpInstancesManagement\Domain\Entity\McpInstance as DomainMcpInstance; -use App\McpInstancesManagement\Domain\Enum\InstanceType; +use App\McpInstancesManagement\Domain\Entity\McpInstance; use App\McpInstancesManagement\Domain\Service\McpInstancesDomainServiceInterface; +use App\McpInstancesManagement\Facade\Enum\InstanceType; +use App\McpInstancesManagement\Facade\McpInstancesManagementFacadeInterface; use App\McpInstancesManagement\Presentation\Controller\AdminInstancesController; use App\McpInstancesManagement\Presentation\McpInstancesPresentationService; use App\Tests\Support\VisibilityTestHelper; use App\Tests\Support\WebUiTestHelper; -use Doctrine\ORM\EntityManagerInterface; use Exception; use PHPUnit\Framework\TestCase; use Symfony\Component\DomCrawler\Crawler; @@ -27,20 +28,21 @@ final class AdminInstancesControllerTest extends TestCase { public function testOverviewRendersExpectedHtmlStructure(): void { - $twig = WebUiTestHelper::createTwigEnvironment('McpInstancesManagement'); - $domainService = $this->createMock(McpInstancesDomainServiceInterface::class); - $entityManager = $this->createMock(EntityManagerInterface::class); - $dockerFacade = $this->createMock(DockerManagementFacadeInterface::class); - $typesConfig = $this->createMock(InstanceTypesConfigFacadeInterface::class); + $twig = WebUiTestHelper::createTwigEnvironment('McpInstancesManagement'); + $domainService = $this->createMock(McpInstancesDomainServiceInterface::class); + $accountFacade = $this->createMock(AccountFacadeInterface::class); + $dockerFacade = $this->createMock(DockerManagementFacadeInterface::class); + $typesConfig = $this->createMock(InstanceTypesConfigFacadeInterface::class); + $instancesFacade = $this->createMock(McpInstancesManagementFacadeInterface::class); // Overview uses domain to fetch instances; empty list simplifies rendering $domainService->method('getAllMcpInstances')->willReturn([]); $presentation = new McpInstancesPresentationService( $domainService, - $entityManager, + $accountFacade, $dockerFacade, - $typesConfig, + $typesConfig ); $controller = new class($domainService, $presentation, $twig) extends AdminInstancesController { @@ -81,11 +83,12 @@ protected function render(string $view, array $parameters = [], ?Response $respo public function testDetailRendersExpectedHtmlStructure(): void { - $twig = WebUiTestHelper::createTwigEnvironment('McpInstancesManagement'); - $domainService = $this->createMock(McpInstancesDomainServiceInterface::class); - $entityManager = $this->createMock(EntityManagerInterface::class); - $dockerFacade = $this->createMock(DockerManagementFacadeInterface::class); - $typesConfig = $this->createMock(InstanceTypesConfigFacadeInterface::class); + $twig = WebUiTestHelper::createTwigEnvironment('McpInstancesManagement'); + $domainService = $this->createMock(McpInstancesDomainServiceInterface::class); + $accountFacade = $this->createMock(AccountFacadeInterface::class); + $dockerFacade = $this->createMock(DockerManagementFacadeInterface::class); + $typesConfig = $this->createMock(InstanceTypesConfigFacadeInterface::class); + $instancesFacade = $this->createMock(McpInstancesManagementFacadeInterface::class); // Prepare domain instance similar to InstancesControllerTest $accountId = 'acc-999'; @@ -93,7 +96,7 @@ public function testDetailRendersExpectedHtmlStructure(): void $vncPassword = 'secret'; $mcpBearer = 'bearer-token'; - $domainInstance = new DomainMcpInstance( + $domainInstance = new McpInstance( $accountId, InstanceType::PLAYWRIGHT_V1, 1280, @@ -106,8 +109,9 @@ public function testDetailRendersExpectedHtmlStructure(): void $domainInstance->generateDerivedFields('example.test'); // Provide instance type config so mapping yields vnc external paths - $typesConfig->method('getTypeConfig')->willReturnCallback(function (InstanceType $t): ?InstanceTypeConfig { - if ($t !== InstanceType::PLAYWRIGHT_V1) { + $typesConfig->method('getTypeConfig')->willReturnCallback(function ( + InstanceType $t): ?InstanceTypeConfig { + if ($t->value !== 'playwright-v1') { return null; } @@ -128,9 +132,9 @@ public function testDetailRendersExpectedHtmlStructure(): void $presentation = new McpInstancesPresentationService( $domainService, - $entityManager, + $accountFacade, $dockerFacade, - $typesConfig, + $typesConfig ); $controller = new class($domainService, $presentation, $twig) extends AdminInstancesController { diff --git a/tests/Unit/McpInstancesManagement/Presentation/Controller/InstancesControllerTest.php b/tests/Unit/McpInstancesManagement/Presentation/Controller/InstancesControllerTest.php index 834d2a4..188359b 100644 --- a/tests/Unit/McpInstancesManagement/Presentation/Controller/InstancesControllerTest.php +++ b/tests/Unit/McpInstancesManagement/Presentation/Controller/InstancesControllerTest.php @@ -5,24 +5,25 @@ namespace App\Tests\Unit\McpInstancesManagement\Presentation\Controller; use App\Account\Domain\Entity\AccountCore; +use App\Account\Facade\AccountFacadeInterface; use App\DockerManagement\Facade\DockerManagementFacadeInterface; use App\McpInstancesConfiguration\Facade\Dto\EndpointConfig; use App\McpInstancesConfiguration\Facade\Dto\InstanceDockerConfig; use App\McpInstancesConfiguration\Facade\Dto\InstanceTypeConfig; use App\McpInstancesConfiguration\Facade\Service\InstanceTypesConfigFacadeInterface; -use App\McpInstancesManagement\Domain\Dto\EndpointStatusDto; -use App\McpInstancesManagement\Domain\Dto\InstanceStatusDto; -use App\McpInstancesManagement\Domain\Dto\ProcessStatusContainerDto; -use App\McpInstancesManagement\Domain\Dto\ProcessStatusDto; -use App\McpInstancesManagement\Domain\Dto\ServiceStatusDto; -use App\McpInstancesManagement\Domain\Entity\McpInstance as DomainMcpInstance; -use App\McpInstancesManagement\Domain\Enum\InstanceType; +use App\McpInstancesManagement\Domain\Entity\McpInstance; use App\McpInstancesManagement\Domain\Service\McpInstancesDomainServiceInterface; +use App\McpInstancesManagement\Facade\Dto\EndpointStatusDto; +use App\McpInstancesManagement\Facade\Dto\InstanceStatusDto; +use App\McpInstancesManagement\Facade\Dto\ProcessStatusContainerDto; +use App\McpInstancesManagement\Facade\Dto\ProcessStatusDto; +use App\McpInstancesManagement\Facade\Dto\ServiceStatusDto; +use App\McpInstancesManagement\Facade\Enum\InstanceType; +use App\McpInstancesManagement\Facade\McpInstancesManagementFacadeInterface; use App\McpInstancesManagement\Presentation\Controller\InstancesController; use App\McpInstancesManagement\Presentation\McpInstancesPresentationService; use App\Tests\Support\VisibilityTestHelper; use App\Tests\Support\WebUiTestHelper; -use Doctrine\ORM\EntityManagerInterface; use PHPUnit\Framework\TestCase; use ReflectionProperty; use Symfony\Component\DomCrawler\Crawler; @@ -37,10 +38,11 @@ public function testDashboardRendersExpectedHtmlStructureWithInstancePresent(): $twig = WebUiTestHelper::createTwigEnvironment('McpInstancesManagement'); // Mocks for dependencies outside Presentation layer - $domainService = $this->createMock(McpInstancesDomainServiceInterface::class); - $entityManager = $this->createMock(EntityManagerInterface::class); - $dockerFacade = $this->createMock(DockerManagementFacadeInterface::class); - $typesConfig = $this->createMock(InstanceTypesConfigFacadeInterface::class); + $domainService = $this->createMock(McpInstancesDomainServiceInterface::class); + $accountFacade = $this->createMock(AccountFacadeInterface::class); + $dockerFacade = $this->createMock(DockerManagementFacadeInterface::class); + $typesConfig = $this->createMock(InstanceTypesConfigFacadeInterface::class); + $instancesFacade = $this->createMock(McpInstancesManagementFacadeInterface::class); // Prepare a domain entity with stable values $accountId = 'acc-123'; @@ -48,7 +50,7 @@ public function testDashboardRendersExpectedHtmlStructureWithInstancePresent(): $mcpBearer = 'test-bearer'; $vncPassword = 'test-vnc-pass'; - $domainInstance = new DomainMcpInstance( + $domainInstance = new McpInstance( $accountId, InstanceType::PLAYWRIGHT_V1, 1280, @@ -63,8 +65,9 @@ public function testDashboardRendersExpectedHtmlStructureWithInstancePresent(): // Mock type config to provide display name and endpoint paths $typesConfig->method('getTypeConfig') - ->willReturnCallback(function (InstanceType $t): ?InstanceTypeConfig { - if ($t !== InstanceType::PLAYWRIGHT_V1) { + ->willReturnCallback(function ( + InstanceType $t): ?InstanceTypeConfig { + if ($t->value !== 'playwright-v1') { return null; } @@ -121,7 +124,7 @@ public function testDashboardRendersExpectedHtmlStructureWithInstancePresent(): $presentation = new McpInstancesPresentationService( $domainService, - $entityManager, + $accountFacade, $dockerFacade, $typesConfig );