diff --git a/.gitignore b/.gitignore index b242302..105b790 100644 --- a/.gitignore +++ b/.gitignore @@ -57,3 +57,6 @@ fabric.properties **/vendor/ .DS_Store + +src/Utils/data.json +logs/ diff --git a/composer.json b/composer.json index 2f37a8c..02ad8b6 100644 --- a/composer.json +++ b/composer.json @@ -28,7 +28,7 @@ } }, "require": { - "php": "^8.0", + "php": "^8.1", "qase/qase-api-client": "^1.1.0", "qase/qase-api-v2-client": "^1.1.0", "ramsey/uuid": "4.7.*" @@ -43,7 +43,7 @@ "version": "2.1.2", "config": { "platform": { - "php": "8.0" + "php": "8.1" }, "allow-plugins": { "composer/package-versions-deprecated": true, diff --git a/composer.lock b/composer.lock index 51b0a86..d701bf0 100644 --- a/composer.lock +++ b/composer.lock @@ -4,29 +4,29 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "This file is @generated automatically" ], - "content-hash": "f4af796f408d0b441de37dbf5151f83d", + "content-hash": "a4ea36a4e38f3e6dd8ad9dfc00238737", "packages": [ { "name": "brick/math", - "version": "0.11.0", + "version": "0.12.3", "source": { "type": "git", "url": "https://github.com/brick/math.git", - "reference": "0ad82ce168c82ba30d1c01ec86116ab52f589478" + "reference": "866551da34e9a618e64a819ee1e01c20d8a588ba" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/brick/math/zipball/0ad82ce168c82ba30d1c01ec86116ab52f589478", - "reference": "0ad82ce168c82ba30d1c01ec86116ab52f589478", + "url": "https://api.github.com/repos/brick/math/zipball/866551da34e9a618e64a819ee1e01c20d8a588ba", + "reference": "866551da34e9a618e64a819ee1e01c20d8a588ba", "shasum": "" }, "require": { - "php": "^8.0" + "php": "^8.1" }, "require-dev": { "php-coveralls/php-coveralls": "^2.2", - "phpunit/phpunit": "^9.0", - "vimeo/psalm": "5.0.0" + "phpunit/phpunit": "^10.1", + "vimeo/psalm": "6.8.8" }, "type": "library", "autoload": { @@ -46,12 +46,17 @@ "arithmetic", "bigdecimal", "bignum", + "bignumber", "brick", - "math" + "decimal", + "integer", + "math", + "mathematics", + "rational" ], "support": { "issues": "https://github.com/brick/math/issues", - "source": "https://github.com/brick/math/tree/0.11.0" + "source": "https://github.com/brick/math/tree/0.12.3" }, "funding": [ { @@ -59,7 +64,7 @@ "type": "github" } ], - "time": "2023-01-15T23:15:59+00:00" + "time": "2025-02-28T13:11:00+00:00" }, { "name": "guzzlehttp/guzzle", @@ -548,16 +553,16 @@ }, { "name": "qase/qase-api-client", - "version": "1.1.0", + "version": "1.1.4", "source": { "type": "git", "url": "https://github.com/qase-tms/qase-api-client.git", - "reference": "672a9dcc0301a94504f521394733c2dca256c9c1" + "reference": "148114f7fecbc8aa5bd80c9afa924594aba9aa72" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/qase-tms/qase-api-client/zipball/672a9dcc0301a94504f521394733c2dca256c9c1", - "reference": "672a9dcc0301a94504f521394733c2dca256c9c1", + "url": "https://api.github.com/repos/qase-tms/qase-api-client/zipball/148114f7fecbc8aa5bd80c9afa924594aba9aa72", + "reference": "148114f7fecbc8aa5bd80c9afa924594aba9aa72", "shasum": "" }, "require": { @@ -565,7 +570,7 @@ "ext-json": "*", "ext-mbstring": "*", "guzzlehttp/guzzle": "^7.3", - "guzzlehttp/psr7": "^2.1.1", + "guzzlehttp/psr7": "^1.7 || ^2.0", "php": "^8.0" }, "require-dev": { @@ -598,22 +603,22 @@ ], "support": { "issues": "https://github.com/qase-tms/qase-api-client/issues", - "source": "https://github.com/qase-tms/qase-api-client/tree/v1.1.0" + "source": "https://github.com/qase-tms/qase-api-client/tree/v1.1.4" }, - "time": "2025-04-07T12:28:32+00:00" + "time": "2025-08-13T10:54:39+00:00" }, { "name": "qase/qase-api-v2-client", - "version": "1.1.0", + "version": "1.1.2", "source": { "type": "git", "url": "https://github.com/qase-tms/qase-api-v2-client.git", - "reference": "8b0c67f733c5c124cca710ec71d0f3b4d5304920" + "reference": "1d70ae5efc88fdb24af60bd24e3f0352237ee86c" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/qase-tms/qase-api-v2-client/zipball/8b0c67f733c5c124cca710ec71d0f3b4d5304920", - "reference": "8b0c67f733c5c124cca710ec71d0f3b4d5304920", + "url": "https://api.github.com/repos/qase-tms/qase-api-v2-client/zipball/1d70ae5efc88fdb24af60bd24e3f0352237ee86c", + "reference": "1d70ae5efc88fdb24af60bd24e3f0352237ee86c", "shasum": "" }, "require": { @@ -621,7 +626,7 @@ "ext-json": "*", "ext-mbstring": "*", "guzzlehttp/guzzle": "^7.3", - "guzzlehttp/psr7": "^2.1.1", + "guzzlehttp/psr7": "^1.7 || ^2.0", "php": "^8.0" }, "require-dev": { @@ -654,9 +659,9 @@ ], "support": { "issues": "https://github.com/qase-tms/qase-api-v2-client/issues", - "source": "https://github.com/qase-tms/qase-api-v2-client/tree/v1.1.0" + "source": "https://github.com/qase-tms/qase-api-v2-client/tree/v1.1.2" }, - "time": "2025-04-07T12:29:16+00:00" + "time": "2025-08-13T07:36:21+00:00" }, { "name": "ralouphie/getallheaders", @@ -704,43 +709,39 @@ }, { "name": "ramsey/collection", - "version": "1.3.0", + "version": "2.1.1", "source": { "type": "git", "url": "https://github.com/ramsey/collection.git", - "reference": "ad7475d1c9e70b190ecffc58f2d989416af339b4" + "reference": "344572933ad0181accbf4ba763e85a0306a8c5e2" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/ramsey/collection/zipball/ad7475d1c9e70b190ecffc58f2d989416af339b4", - "reference": "ad7475d1c9e70b190ecffc58f2d989416af339b4", + "url": "https://api.github.com/repos/ramsey/collection/zipball/344572933ad0181accbf4ba763e85a0306a8c5e2", + "reference": "344572933ad0181accbf4ba763e85a0306a8c5e2", "shasum": "" }, "require": { - "php": "^7.4 || ^8.0", - "symfony/polyfill-php81": "^1.23" + "php": "^8.1" }, "require-dev": { "captainhook/plugin-composer": "^5.3", - "ergebnis/composer-normalize": "^2.28.3", - "fakerphp/faker": "^1.21", + "ergebnis/composer-normalize": "^2.45", + "fakerphp/faker": "^1.24", "hamcrest/hamcrest-php": "^2.0", - "jangregor/phpstan-prophecy": "^1.0", - "mockery/mockery": "^1.5", + "jangregor/phpstan-prophecy": "^2.1", + "mockery/mockery": "^1.6", "php-parallel-lint/php-console-highlighter": "^1.0", - "php-parallel-lint/php-parallel-lint": "^1.3", - "phpcsstandards/phpcsutils": "^1.0.0-rc1", - "phpspec/prophecy-phpunit": "^2.0", - "phpstan/extension-installer": "^1.2", - "phpstan/phpstan": "^1.9", - "phpstan/phpstan-mockery": "^1.1", - "phpstan/phpstan-phpunit": "^1.3", - "phpunit/phpunit": "^9.5", - "psalm/plugin-mockery": "^1.1", - "psalm/plugin-phpunit": "^0.18.4", - "ramsey/coding-standard": "^2.0.3", - "ramsey/conventional-commits": "^1.3", - "vimeo/psalm": "^5.4" + "php-parallel-lint/php-parallel-lint": "^1.4", + "phpspec/prophecy-phpunit": "^2.3", + "phpstan/extension-installer": "^1.4", + "phpstan/phpstan": "^2.1", + "phpstan/phpstan-mockery": "^2.0", + "phpstan/phpstan-phpunit": "^2.0", + "phpunit/phpunit": "^10.5", + "ramsey/coding-standard": "^2.3", + "ramsey/conventional-commits": "^1.6", + "roave/security-advisories": "dev-latest" }, "type": "library", "extra": { @@ -778,19 +779,9 @@ ], "support": { "issues": "https://github.com/ramsey/collection/issues", - "source": "https://github.com/ramsey/collection/tree/1.3.0" + "source": "https://github.com/ramsey/collection/tree/2.1.1" }, - "funding": [ - { - "url": "https://github.com/ramsey", - "type": "github" - }, - { - "url": "https://tidelift.com/funding/github/packagist/ramsey/collection", - "type": "tidelift" - } - ], - "time": "2022-12-27T19:12:24+00:00" + "time": "2025-03-22T05:38:12+00:00" }, { "name": "ramsey/uuid", @@ -886,20 +877,20 @@ }, { "name": "symfony/deprecation-contracts", - "version": "v2.5.4", + "version": "v3.6.0", "source": { "type": "git", "url": "https://github.com/symfony/deprecation-contracts.git", - "reference": "605389f2a7e5625f273b53960dc46aeaf9c62918" + "reference": "63afe740e99a13ba87ec199bb07bbdee937a5b62" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/deprecation-contracts/zipball/605389f2a7e5625f273b53960dc46aeaf9c62918", - "reference": "605389f2a7e5625f273b53960dc46aeaf9c62918", + "url": "https://api.github.com/repos/symfony/deprecation-contracts/zipball/63afe740e99a13ba87ec199bb07bbdee937a5b62", + "reference": "63afe740e99a13ba87ec199bb07bbdee937a5b62", "shasum": "" }, "require": { - "php": ">=7.1" + "php": ">=8.1" }, "type": "library", "extra": { @@ -908,7 +899,7 @@ "name": "symfony/contracts" }, "branch-alias": { - "dev-main": "2.5-dev" + "dev-main": "3.6-dev" } }, "autoload": { @@ -933,83 +924,7 @@ "description": "A generic function and convention to trigger deprecation notices", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/deprecation-contracts/tree/v2.5.4" - }, - "funding": [ - { - "url": "https://symfony.com/sponsor", - "type": "custom" - }, - { - "url": "https://github.com/fabpot", - "type": "github" - }, - { - "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", - "type": "tidelift" - } - ], - "time": "2024-09-25T14:11:13+00:00" - }, - { - "name": "symfony/polyfill-php81", - "version": "v1.32.0", - "source": { - "type": "git", - "url": "https://github.com/symfony/polyfill-php81.git", - "reference": "4a4cfc2d253c21a5ad0e53071df248ed48c6ce5c" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-php81/zipball/4a4cfc2d253c21a5ad0e53071df248ed48c6ce5c", - "reference": "4a4cfc2d253c21a5ad0e53071df248ed48c6ce5c", - "shasum": "" - }, - "require": { - "php": ">=7.2" - }, - "type": "library", - "extra": { - "thanks": { - "url": "https://github.com/symfony/polyfill", - "name": "symfony/polyfill" - } - }, - "autoload": { - "files": [ - "bootstrap.php" - ], - "psr-4": { - "Symfony\\Polyfill\\Php81\\": "" - }, - "classmap": [ - "Resources/stubs" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Nicolas Grekas", - "email": "p@tchwork.com" - }, - { - "name": "Symfony Community", - "homepage": "https://symfony.com/contributors" - } - ], - "description": "Symfony polyfill backporting some PHP 8.1+ features to lower PHP versions", - "homepage": "https://symfony.com", - "keywords": [ - "compatibility", - "polyfill", - "portable", - "shim" - ], - "support": { - "source": "https://github.com/symfony/polyfill-php81/tree/v1.32.0" + "source": "https://github.com/symfony/deprecation-contracts/tree/v3.6.0" }, "funding": [ { @@ -1025,36 +940,36 @@ "type": "tidelift" } ], - "time": "2024-09-09T11:45:10+00:00" + "time": "2024-09-25T14:21:43+00:00" } ], "packages-dev": [ { "name": "doctrine/instantiator", - "version": "1.5.0", + "version": "2.0.0", "source": { "type": "git", "url": "https://github.com/doctrine/instantiator.git", - "reference": "0a0fa9780f5d4e507415a065172d26a98d02047b" + "reference": "c6222283fa3f4ac679f8b9ced9a4e23f163e80d0" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/doctrine/instantiator/zipball/0a0fa9780f5d4e507415a065172d26a98d02047b", - "reference": "0a0fa9780f5d4e507415a065172d26a98d02047b", + "url": "https://api.github.com/repos/doctrine/instantiator/zipball/c6222283fa3f4ac679f8b9ced9a4e23f163e80d0", + "reference": "c6222283fa3f4ac679f8b9ced9a4e23f163e80d0", "shasum": "" }, "require": { - "php": "^7.1 || ^8.0" + "php": "^8.1" }, "require-dev": { - "doctrine/coding-standard": "^9 || ^11", + "doctrine/coding-standard": "^11", "ext-pdo": "*", "ext-phar": "*", - "phpbench/phpbench": "^0.16 || ^1", - "phpstan/phpstan": "^1.4", - "phpstan/phpstan-phpunit": "^1", - "phpunit/phpunit": "^7.5 || ^8.5 || ^9.5", - "vimeo/psalm": "^4.30 || ^5.4" + "phpbench/phpbench": "^1.2", + "phpstan/phpstan": "^1.9.4", + "phpstan/phpstan-phpunit": "^1.3", + "phpunit/phpunit": "^9.5.27", + "vimeo/psalm": "^5.4" }, "type": "library", "autoload": { @@ -1081,7 +996,7 @@ ], "support": { "issues": "https://github.com/doctrine/instantiator/issues", - "source": "https://github.com/doctrine/instantiator/tree/1.5.0" + "source": "https://github.com/doctrine/instantiator/tree/2.0.0" }, "funding": [ { @@ -1097,20 +1012,20 @@ "type": "tidelift" } ], - "time": "2022-12-30T00:15:36+00:00" + "time": "2022-12-30T00:23:10+00:00" }, { "name": "myclabs/deep-copy", - "version": "1.13.1", + "version": "1.13.4", "source": { "type": "git", "url": "https://github.com/myclabs/DeepCopy.git", - "reference": "1720ddd719e16cf0db4eb1c6eca108031636d46c" + "reference": "07d290f0c47959fd5eed98c95ee5602db07e0b6a" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/myclabs/DeepCopy/zipball/1720ddd719e16cf0db4eb1c6eca108031636d46c", - "reference": "1720ddd719e16cf0db4eb1c6eca108031636d46c", + "url": "https://api.github.com/repos/myclabs/DeepCopy/zipball/07d290f0c47959fd5eed98c95ee5602db07e0b6a", + "reference": "07d290f0c47959fd5eed98c95ee5602db07e0b6a", "shasum": "" }, "require": { @@ -1149,7 +1064,7 @@ ], "support": { "issues": "https://github.com/myclabs/DeepCopy/issues", - "source": "https://github.com/myclabs/DeepCopy/tree/1.13.1" + "source": "https://github.com/myclabs/DeepCopy/tree/1.13.4" }, "funding": [ { @@ -1157,20 +1072,20 @@ "type": "tidelift" } ], - "time": "2025-04-29T12:36:36+00:00" + "time": "2025-08-01T08:46:24+00:00" }, { "name": "nikic/php-parser", - "version": "v5.5.0", + "version": "v5.6.1", "source": { "type": "git", "url": "https://github.com/nikic/PHP-Parser.git", - "reference": "ae59794362fe85e051a58ad36b289443f57be7a9" + "reference": "f103601b29efebd7ff4a1ca7b3eeea9e3336a2a2" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/nikic/PHP-Parser/zipball/ae59794362fe85e051a58ad36b289443f57be7a9", - "reference": "ae59794362fe85e051a58ad36b289443f57be7a9", + "url": "https://api.github.com/repos/nikic/PHP-Parser/zipball/f103601b29efebd7ff4a1ca7b3eeea9e3336a2a2", + "reference": "f103601b29efebd7ff4a1ca7b3eeea9e3336a2a2", "shasum": "" }, "require": { @@ -1189,7 +1104,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "5.0-dev" + "dev-master": "5.x-dev" } }, "autoload": { @@ -1213,9 +1128,9 @@ ], "support": { "issues": "https://github.com/nikic/PHP-Parser/issues", - "source": "https://github.com/nikic/PHP-Parser/tree/v5.5.0" + "source": "https://github.com/nikic/PHP-Parser/tree/v5.6.1" }, - "time": "2025-05-31T08:24:38+00:00" + "time": "2025-08-13T20:13:15+00:00" }, { "name": "phar-io/manifest", @@ -1656,16 +1571,16 @@ }, { "name": "phpunit/phpunit", - "version": "9.6.23", + "version": "9.6.24", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/phpunit.git", - "reference": "43d2cb18d0675c38bd44982a5d1d88f6d53d8d95" + "reference": "ea49afa29aeea25ea7bf9de9fdd7cab163cc0701" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/43d2cb18d0675c38bd44982a5d1d88f6d53d8d95", - "reference": "43d2cb18d0675c38bd44982a5d1d88f6d53d8d95", + "url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/ea49afa29aeea25ea7bf9de9fdd7cab163cc0701", + "reference": "ea49afa29aeea25ea7bf9de9fdd7cab163cc0701", "shasum": "" }, "require": { @@ -1676,7 +1591,7 @@ "ext-mbstring": "*", "ext-xml": "*", "ext-xmlwriter": "*", - "myclabs/deep-copy": "^1.13.1", + "myclabs/deep-copy": "^1.13.4", "phar-io/manifest": "^2.0.4", "phar-io/version": "^3.2.1", "php": ">=7.3", @@ -1687,11 +1602,11 @@ "phpunit/php-timer": "^5.0.3", "sebastian/cli-parser": "^1.0.2", "sebastian/code-unit": "^1.0.8", - "sebastian/comparator": "^4.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.7", + "sebastian/global-state": "^5.0.8", "sebastian/object-enumerator": "^4.0.4", "sebastian/resource-operations": "^3.0.4", "sebastian/type": "^3.2.1", @@ -1739,7 +1654,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.23" + "source": "https://github.com/sebastianbergmann/phpunit/tree/9.6.24" }, "funding": [ { @@ -1763,7 +1678,7 @@ "type": "tidelift" } ], - "time": "2025-05-02T06:40:34+00:00" + "time": "2025-08-10T08:32:42+00:00" }, { "name": "sebastian/cli-parser", @@ -1934,16 +1849,16 @@ }, { "name": "sebastian/comparator", - "version": "4.0.8", + "version": "4.0.9", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/comparator.git", - "reference": "fa0f136dd2334583309d32b62544682ee972b51a" + "reference": "67a2df3a62639eab2cc5906065e9805d4fd5dfc5" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/comparator/zipball/fa0f136dd2334583309d32b62544682ee972b51a", - "reference": "fa0f136dd2334583309d32b62544682ee972b51a", + "url": "https://api.github.com/repos/sebastianbergmann/comparator/zipball/67a2df3a62639eab2cc5906065e9805d4fd5dfc5", + "reference": "67a2df3a62639eab2cc5906065e9805d4fd5dfc5", "shasum": "" }, "require": { @@ -1996,15 +1911,27 @@ ], "support": { "issues": "https://github.com/sebastianbergmann/comparator/issues", - "source": "https://github.com/sebastianbergmann/comparator/tree/4.0.8" + "source": "https://github.com/sebastianbergmann/comparator/tree/4.0.9" }, "funding": [ { "url": "https://github.com/sebastianbergmann", "type": "github" + }, + { + "url": "https://liberapay.com/sebastianbergmann", + "type": "liberapay" + }, + { + "url": "https://thanks.dev/u/gh/sebastianbergmann", + "type": "thanks_dev" + }, + { + "url": "https://tidelift.com/funding/github/packagist/sebastian/comparator", + "type": "tidelift" } ], - "time": "2022-09-14T12:41:17+00:00" + "time": "2025-08-10T06:51:50+00:00" }, { "name": "sebastian/complexity", @@ -2271,16 +2198,16 @@ }, { "name": "sebastian/global-state", - "version": "5.0.7", + "version": "5.0.8", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/global-state.git", - "reference": "bca7df1f32ee6fe93b4d4a9abbf69e13a4ada2c9" + "reference": "b6781316bdcd28260904e7cc18ec983d0d2ef4f6" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/global-state/zipball/bca7df1f32ee6fe93b4d4a9abbf69e13a4ada2c9", - "reference": "bca7df1f32ee6fe93b4d4a9abbf69e13a4ada2c9", + "url": "https://api.github.com/repos/sebastianbergmann/global-state/zipball/b6781316bdcd28260904e7cc18ec983d0d2ef4f6", + "reference": "b6781316bdcd28260904e7cc18ec983d0d2ef4f6", "shasum": "" }, "require": { @@ -2323,15 +2250,27 @@ ], "support": { "issues": "https://github.com/sebastianbergmann/global-state/issues", - "source": "https://github.com/sebastianbergmann/global-state/tree/5.0.7" + "source": "https://github.com/sebastianbergmann/global-state/tree/5.0.8" }, "funding": [ { "url": "https://github.com/sebastianbergmann", "type": "github" + }, + { + "url": "https://liberapay.com/sebastianbergmann", + "type": "liberapay" + }, + { + "url": "https://thanks.dev/u/gh/sebastianbergmann", + "type": "thanks_dev" + }, + { + "url": "https://tidelift.com/funding/github/packagist/sebastian/global-state", + "type": "tidelift" } ], - "time": "2024-03-02T06:35:11+00:00" + "time": "2025-08-10T07:10:35+00:00" }, { "name": "sebastian/lines-of-code", @@ -2504,16 +2443,16 @@ }, { "name": "sebastian/recursion-context", - "version": "4.0.5", + "version": "4.0.6", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/recursion-context.git", - "reference": "e75bd0f07204fec2a0af9b0f3cfe97d05f92efc1" + "reference": "539c6691e0623af6dc6f9c20384c120f963465a0" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/recursion-context/zipball/e75bd0f07204fec2a0af9b0f3cfe97d05f92efc1", - "reference": "e75bd0f07204fec2a0af9b0f3cfe97d05f92efc1", + "url": "https://api.github.com/repos/sebastianbergmann/recursion-context/zipball/539c6691e0623af6dc6f9c20384c120f963465a0", + "reference": "539c6691e0623af6dc6f9c20384c120f963465a0", "shasum": "" }, "require": { @@ -2555,15 +2494,27 @@ "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.5" + "source": "https://github.com/sebastianbergmann/recursion-context/tree/4.0.6" }, "funding": [ { "url": "https://github.com/sebastianbergmann", "type": "github" + }, + { + "url": "https://liberapay.com/sebastianbergmann", + "type": "liberapay" + }, + { + "url": "https://thanks.dev/u/gh/sebastianbergmann", + "type": "thanks_dev" + }, + { + "url": "https://tidelift.com/funding/github/packagist/sebastian/recursion-context", + "type": "tidelift" } ], - "time": "2023-02-03T06:07:39+00:00" + "time": "2025-08-10T06:57:39+00:00" }, { "name": "sebastian/resource-operations", @@ -2785,13 +2736,13 @@ "prefer-stable": false, "prefer-lowest": false, "platform": { - "php": "^8.0" + "php": "^8.1" }, "platform-dev": { "ext-json": "*" }, "platform-overrides": { - "php": "8.0" + "php": "8.1" }, "plugin-api-version": "2.6.0" } diff --git a/src/Reporters/ReporterFactory.php b/src/Reporters/ReporterFactory.php index e30dfd1..ac14072 100644 --- a/src/Reporters/ReporterFactory.php +++ b/src/Reporters/ReporterFactory.php @@ -17,39 +17,58 @@ class ReporterFactory { - public static function create(String $framework = "", String $reporterName = ""): ReporterInterface + public function __construct( + protected readonly QaseConfig $config, + protected readonly HostInfo $hostInfo = new HostInfo(), + protected readonly StateInterface $state = new StateManager(), + protected LoggerInterface $logger = new Logger(), + ) + { + } + + public function createReporter(string $framework = '', string $reporterName = ''): ReporterInterface + { + // Set the logger based on the debug mode from the config + // This is to have exactly the same behavior as before + if ($this->config->getDebug()){ + $this->logger = new Logger(true); + } + + $hostData = $this->hostInfo->getHostInfo($framework, $reporterName); + $this->logger->debug('Host data: ' . json_encode($hostData)); + $reporter = $this->createInternalReporter(); + $fallbackReporter = $this->createInternalReporter(true); + + return new CoreReporter($this->logger, $reporter, $fallbackReporter, $this->config->getRootSuite()); + } + + public static function create(string $framework = '', string $reporterName = ''): ReporterInterface { $configLoader = new ConfigLoader(new Logger(true)); $config = $configLoader->getConfig(); - $logger = new Logger($config->getDebug()); - $hostInfo = new HostInfo(); - $hostData = $hostInfo->getHostInfo($framework, $reporterName); - $logger->debug("Host data: " . json_encode($hostData)); - $state = new StateManager(); - $reporter = self::createInternalReporter($logger, $config, $state); - $fallbackReporter = self::createInternalReporter($logger, $config, $state, true); - - return new CoreReporter($logger, $reporter, $fallbackReporter, $config->getRootSuite()); + $factory = new self($config); + + return $factory->createReporter($framework, $reporterName); } - private static function createInternalReporter(LoggerInterface $logger, QaseConfig $config, StateInterface $state, bool $fallback = false): ?InternalReporterInterface + protected function createInternalReporter(bool $fallback = false): ?InternalReporterInterface { - $mode = $fallback ? $config->getFallback() : $config->getMode(); + $mode = $fallback ? $this->config->getFallback() : $this->config->getMode(); if ($mode === 'testops') { - return self::prepareTestopsReporter($logger, $config, $state); + return $this->prepareTestopsReporter(); } if ($mode === 'report') { - return new FileReporter($logger, $config->report, $state); + return new FileReporter($this->logger, $this->config->report, $this->state); } return null; } - private static function prepareTestopsReporter(LoggerInterface $logger, QaseConfig $config, StateInterface $state): InternalReporterInterface + protected function prepareTestopsReporter(): InternalReporterInterface { - $client = new ApiClientV2($logger, $config->testops); - return new TestOpsReporter($client, $config, $state); + $client = new ApiClientV2($this->logger, $this->config->testops); + return new TestOpsReporter($client, $this->config, $this->state); } } diff --git a/tests/ReporterFactoryTest.php b/tests/ReporterFactoryTest.php new file mode 100644 index 0000000..96503e0 --- /dev/null +++ b/tests/ReporterFactoryTest.php @@ -0,0 +1,155 @@ +config = $this->createMock(QaseConfig::class); + $this->hostInfo = $this->createMock(HostInfo::class); + $this->state = $this->createMock(StateInterface::class); + $this->logger = $this->createMock(LoggerInterface::class); + } + + public function testConstructorSetsProperties(): void + { + $factory = $this->createSubject(); + + $this->assertInstanceOf(ReporterFactory::class, $factory); + } + + public function testCreateReporterWithOffMode(): void + { + $this->config->expects($this->once()) + ->method('getDebug') + ->willReturn(false); + + $this->hostInfo->expects($this->once()) + ->method('getHostInfo') + ->willReturn([]); + + $this->logger->expects($this->once()) + ->method('debug'); + + $this->config->expects($this->once()) + ->method('getMode') + ->willReturn('off'); + + $this->config->expects($this->once()) + ->method('getFallback') + ->willReturn('off'); + + $this->config->expects($this->once()) + ->method('getRootSuite') + ->willReturn(null); + + $factory = $this->createSubject(); + + $reporter = $factory->createReporter(); + + $this->assertInstanceOf(CoreReporter::class, $reporter); + } + + public function testCreateReporterWithDifferentFallbackMode(): void + { + $this->config->expects($this->once()) + ->method('getDebug') + ->willReturn(false); + + $this->hostInfo->expects($this->once()) + ->method('getHostInfo') + ->willReturn([]); + + $this->logger->expects($this->once()) + ->method('debug'); + + $this->config->expects($this->once()) + ->method('getMode') + ->willReturn('off'); + + $this->config->expects($this->once()) + ->method('getFallback') + ->willReturn('off'); + + $this->config->expects($this->once()) + ->method('getRootSuite') + ->willReturn('Custom Root Suite'); + + $factory = $this->createSubject(); + + $reporter = $factory->createReporter('jest', 'custom-reporter'); + + $this->assertInstanceOf(CoreReporter::class, $reporter); + } + + public function testWithDebugEnabledItWIllUseANewLoggerInstance() + { + $this->config->expects($this->once()) + ->method('getDebug') + ->willReturn(true); + + $this->hostInfo->expects($this->once()) + ->method('getHostInfo') + ->willReturn([]); + + $this->logger->expects($this->never()) + ->method('debug'); + + $this->config->expects($this->once()) + ->method('getMode') + ->willReturn('off'); + + $this->config->expects($this->once()) + ->method('getFallback') + ->willReturn('off'); + + $this->config->expects($this->once()) + ->method('getRootSuite') + ->willReturn('Custom Root Suite'); + + $factory = $this->createSubject(); + + $reporter = $factory->createReporter('jest', 'custom-reporter'); + + $this->assertInstanceOf(CoreReporter::class, $reporter); + } + + public function testCreateStaticMethod(): void + { + $reporter = ReporterFactory::create('phpunit', 'test-reporter'); + + $this->assertInstanceOf(CoreReporter::class, $reporter); + } + + public function testCreateStaticMethodWithDefaults(): void + { + $reporter = ReporterFactory::create(); + + $this->assertInstanceOf(CoreReporter::class, $reporter); + } + + private function createSubject(): ReporterFactory + { + return new ReporterFactory( + $this->config, + $this->hostInfo, + $this->state, + $this->logger + ); + } +}