diff --git a/.phan/config.php b/.phan/config.php index bbba420..77c8555 100644 --- a/.phan/config.php +++ b/.phan/config.php @@ -31,7 +31,8 @@ $vendor_dir . '/apimatic/jsonmapper', $vendor_dir . '/phpunit/phpunit', $vendor_dir . '/php-jsonpointer/php-jsonpointer', - $vendor_dir . '/psr/log' + $vendor_dir . '/psr/log', + $vendor_dir . '/symfony/http-foundation' ], // A directory list that defines files that will be excluded diff --git a/composer.json b/composer.json index 96ec814..ad34afe 100644 --- a/composer.json +++ b/composer.json @@ -19,7 +19,8 @@ "psr/log": "^1.1.4 || ^2.0.0 || ^3.0.0", "apimatic/core-interfaces": "~0.1.5", "apimatic/jsonmapper": "^3.1.1", - "php-jsonpointer/php-jsonpointer": "^3.0.2" + "php-jsonpointer/php-jsonpointer": "^3.0.2", + "symfony/http-foundation": "^5.4" }, "require-dev": { "squizlabs/php_codesniffer": "^3.5", @@ -27,10 +28,14 @@ "phpunit/phpunit": "^7.5 || ^8.5 || ^9.5" }, "autoload": { - "psr-4": { "Core\\": "src/" } + "psr-4": { + "Core\\": "src/" + } }, "autoload-dev": { - "psr-4": { "Core\\Tests\\": "tests/" } + "psr-4": { + "Core\\Tests\\": "tests/" + } }, "scripts": { "test": "phpunit --coverage-text", @@ -41,6 +46,9 @@ "lint-fix-test": "phpcbf --standard=phpcs-ruleset.xml tests/", "lint-src": "phpcs --standard=phpcs-ruleset.xml src/", "lint-test": "phpcs --standard=phpcs-ruleset.xml tests/", - "lint": ["@lint-src", "@lint-test"] + "lint": [ + "@lint-src", + "@lint-test" + ] } -} +} \ No newline at end of file diff --git a/composer.lock b/composer.lock index ca0a4a1..08f969d 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": "d774ca521a28aa59304826a76f1a1b2e", + "content-hash": "4cb27818baa5f4e10403b353e1bf589a", "packages": [ { "name": "apimatic/core-interfaces", @@ -51,16 +51,16 @@ }, { "name": "apimatic/jsonmapper", - "version": "3.1.3", + "version": "3.1.6", "source": { "type": "git", "url": "https://github.com/apimatic/jsonmapper.git", - "reference": "5fe6ee7ed1857d6fed669dde935c6c6c70b637d2" + "reference": "c6cc21bd56bfe5d5822bbd08f514be465c0b24e7" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/apimatic/jsonmapper/zipball/5fe6ee7ed1857d6fed669dde935c6c6c70b637d2", - "reference": "5fe6ee7ed1857d6fed669dde935c6c6c70b637d2", + "url": "https://api.github.com/repos/apimatic/jsonmapper/zipball/c6cc21bd56bfe5d5822bbd08f514be465c0b24e7", + "reference": "c6cc21bd56bfe5d5822bbd08f514be465c0b24e7", "shasum": "" }, "require": { @@ -99,9 +99,9 @@ "support": { "email": "mehdi.jaffery@apimatic.io", "issues": "https://github.com/apimatic/jsonmapper/issues", - "source": "https://github.com/apimatic/jsonmapper/tree/3.1.3" + "source": "https://github.com/apimatic/jsonmapper/tree/3.1.6" }, - "time": "2024-03-15T06:02:44+00:00" + "time": "2024-11-28T09:15:32+00:00" }, { "name": "php-jsonpointer/php-jsonpointer", @@ -161,16 +161,16 @@ }, { "name": "psr/log", - "version": "3.0.0", + "version": "3.0.2", "source": { "type": "git", "url": "https://github.com/php-fig/log.git", - "reference": "fe5ea303b0887d5caefd3d431c3e61ad47037001" + "reference": "f16e1d5863e37f8d8c2a01719f5b34baa2b714d3" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/php-fig/log/zipball/fe5ea303b0887d5caefd3d431c3e61ad47037001", - "reference": "fe5ea303b0887d5caefd3d431c3e61ad47037001", + "url": "https://api.github.com/repos/php-fig/log/zipball/f16e1d5863e37f8d8c2a01719f5b34baa2b714d3", + "reference": "f16e1d5863e37f8d8c2a01719f5b34baa2b714d3", "shasum": "" }, "require": { @@ -205,36 +205,356 @@ "psr-3" ], "support": { - "source": "https://github.com/php-fig/log/tree/3.0.0" + "source": "https://github.com/php-fig/log/tree/3.0.2" + }, + "time": "2024-09-11T13:17:53+00:00" + }, + { + "name": "symfony/deprecation-contracts", + "version": "v3.6.0", + "source": { + "type": "git", + "url": "https://github.com/symfony/deprecation-contracts.git", + "reference": "63afe740e99a13ba87ec199bb07bbdee937a5b62" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/deprecation-contracts/zipball/63afe740e99a13ba87ec199bb07bbdee937a5b62", + "reference": "63afe740e99a13ba87ec199bb07bbdee937a5b62", + "shasum": "" + }, + "require": { + "php": ">=8.1" + }, + "type": "library", + "extra": { + "thanks": { + "url": "https://github.com/symfony/contracts", + "name": "symfony/contracts" + }, + "branch-alias": { + "dev-main": "3.6-dev" + } + }, + "autoload": { + "files": [ + "function.php" + ] }, - "time": "2021-07-14T16:46:02+00:00" + "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": "A generic function and convention to trigger deprecation notices", + "homepage": "https://symfony.com", + "support": { + "source": "https://github.com/symfony/deprecation-contracts/tree/v3.6.0" + }, + "funding": [ + { + "url": "https://symfony.com/sponsor", + "type": "custom" + }, + { + "url": "https://github.com/fabpot", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "type": "tidelift" + } + ], + "time": "2024-09-25T14:21:43+00:00" + }, + { + "name": "symfony/http-foundation", + "version": "v5.4.48", + "source": { + "type": "git", + "url": "https://github.com/symfony/http-foundation.git", + "reference": "3f38b8af283b830e1363acd79e5bc3412d055341" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/http-foundation/zipball/3f38b8af283b830e1363acd79e5bc3412d055341", + "reference": "3f38b8af283b830e1363acd79e5bc3412d055341", + "shasum": "" + }, + "require": { + "php": ">=7.2.5", + "symfony/deprecation-contracts": "^2.1|^3", + "symfony/polyfill-mbstring": "~1.1", + "symfony/polyfill-php80": "^1.16" + }, + "require-dev": { + "predis/predis": "^1.0|^2.0", + "symfony/cache": "^4.4|^5.0|^6.0", + "symfony/dependency-injection": "^5.4|^6.0", + "symfony/expression-language": "^4.4|^5.0|^6.0", + "symfony/http-kernel": "^5.4.12|^6.0.12|^6.1.4", + "symfony/mime": "^4.4|^5.0|^6.0", + "symfony/rate-limiter": "^5.2|^6.0" + }, + "suggest": { + "symfony/mime": "To use the file extension guesser" + }, + "type": "library", + "autoload": { + "psr-4": { + "Symfony\\Component\\HttpFoundation\\": "" + }, + "exclude-from-classmap": [ + "/Tests/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Fabien Potencier", + "email": "fabien@symfony.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Defines an object-oriented layer for the HTTP specification", + "homepage": "https://symfony.com", + "support": { + "source": "https://github.com/symfony/http-foundation/tree/v5.4.48" + }, + "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-11-13T18:58:02+00:00" + }, + { + "name": "symfony/polyfill-mbstring", + "version": "v1.33.0", + "source": { + "type": "git", + "url": "https://github.com/symfony/polyfill-mbstring.git", + "reference": "6d857f4d76bd4b343eac26d6b539585d2bc56493" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/polyfill-mbstring/zipball/6d857f4d76bd4b343eac26d6b539585d2bc56493", + "reference": "6d857f4d76bd4b343eac26d6b539585d2bc56493", + "shasum": "" + }, + "require": { + "ext-iconv": "*", + "php": ">=7.2" + }, + "provide": { + "ext-mbstring": "*" + }, + "suggest": { + "ext-mbstring": "For best performance" + }, + "type": "library", + "extra": { + "thanks": { + "url": "https://github.com/symfony/polyfill", + "name": "symfony/polyfill" + } + }, + "autoload": { + "files": [ + "bootstrap.php" + ], + "psr-4": { + "Symfony\\Polyfill\\Mbstring\\": "" + } + }, + "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 for the Mbstring extension", + "homepage": "https://symfony.com", + "keywords": [ + "compatibility", + "mbstring", + "polyfill", + "portable", + "shim" + ], + "support": { + "source": "https://github.com/symfony/polyfill-mbstring/tree/v1.33.0" + }, + "funding": [ + { + "url": "https://symfony.com/sponsor", + "type": "custom" + }, + { + "url": "https://github.com/fabpot", + "type": "github" + }, + { + "url": "https://github.com/nicolas-grekas", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "type": "tidelift" + } + ], + "time": "2024-12-23T08:48:59+00:00" + }, + { + "name": "symfony/polyfill-php80", + "version": "v1.33.0", + "source": { + "type": "git", + "url": "https://github.com/symfony/polyfill-php80.git", + "reference": "0cc9dd0f17f61d8131e7df6b84bd344899fe2608" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/polyfill-php80/zipball/0cc9dd0f17f61d8131e7df6b84bd344899fe2608", + "reference": "0cc9dd0f17f61d8131e7df6b84bd344899fe2608", + "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\\Php80\\": "" + }, + "classmap": [ + "Resources/stubs" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Ion Bazan", + "email": "ion.bazan@gmail.com" + }, + { + "name": "Nicolas Grekas", + "email": "p@tchwork.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Symfony polyfill backporting some PHP 8.0+ features to lower PHP versions", + "homepage": "https://symfony.com", + "keywords": [ + "compatibility", + "polyfill", + "portable", + "shim" + ], + "support": { + "source": "https://github.com/symfony/polyfill-php80/tree/v1.33.0" + }, + "funding": [ + { + "url": "https://symfony.com/sponsor", + "type": "custom" + }, + { + "url": "https://github.com/fabpot", + "type": "github" + }, + { + "url": "https://github.com/nicolas-grekas", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "type": "tidelift" + } + ], + "time": "2025-01-02T08:10:11+00:00" } ], "packages-dev": [ { "name": "composer/pcre", - "version": "3.1.3", + "version": "3.3.2", "source": { "type": "git", "url": "https://github.com/composer/pcre.git", - "reference": "5b16e25a5355f1f3afdfc2f954a0a80aec4826a8" + "reference": "b2bed4734f0cc156ee1fe9c0da2550420d99a21e" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/composer/pcre/zipball/5b16e25a5355f1f3afdfc2f954a0a80aec4826a8", - "reference": "5b16e25a5355f1f3afdfc2f954a0a80aec4826a8", + "url": "https://api.github.com/repos/composer/pcre/zipball/b2bed4734f0cc156ee1fe9c0da2550420d99a21e", + "reference": "b2bed4734f0cc156ee1fe9c0da2550420d99a21e", "shasum": "" }, "require": { "php": "^7.4 || ^8.0" }, + "conflict": { + "phpstan/phpstan": "<1.11.10" + }, "require-dev": { - "phpstan/phpstan": "^1.3", - "phpstan/phpstan-strict-rules": "^1.1", - "symfony/phpunit-bridge": "^5" + "phpstan/phpstan": "^1.12 || ^2", + "phpstan/phpstan-strict-rules": "^1 || ^2", + "phpunit/phpunit": "^8 || ^9" }, "type": "library", "extra": { + "phpstan": { + "includes": [ + "extension.neon" + ] + }, "branch-alias": { "dev-main": "3.x-dev" } @@ -264,7 +584,7 @@ ], "support": { "issues": "https://github.com/composer/pcre/issues", - "source": "https://github.com/composer/pcre/tree/3.1.3" + "source": "https://github.com/composer/pcre/tree/3.3.2" }, "funding": [ { @@ -280,28 +600,28 @@ "type": "tidelift" } ], - "time": "2024-03-19T10:26:25+00:00" + "time": "2024-11-12T16:29:46+00:00" }, { "name": "composer/semver", - "version": "3.4.0", + "version": "3.4.4", "source": { "type": "git", "url": "https://github.com/composer/semver.git", - "reference": "35e8d0af4486141bc745f23a29cc2091eb624a32" + "reference": "198166618906cb2de69b95d7d47e5fa8aa1b2b95" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/composer/semver/zipball/35e8d0af4486141bc745f23a29cc2091eb624a32", - "reference": "35e8d0af4486141bc745f23a29cc2091eb624a32", + "url": "https://api.github.com/repos/composer/semver/zipball/198166618906cb2de69b95d7d47e5fa8aa1b2b95", + "reference": "198166618906cb2de69b95d7d47e5fa8aa1b2b95", "shasum": "" }, "require": { "php": "^5.3.2 || ^7.0 || ^8.0" }, "require-dev": { - "phpstan/phpstan": "^1.4", - "symfony/phpunit-bridge": "^4.2 || ^5" + "phpstan/phpstan": "^1.11", + "symfony/phpunit-bridge": "^3 || ^7" }, "type": "library", "extra": { @@ -345,7 +665,7 @@ "support": { "irc": "ircs://irc.libera.chat:6697/composer", "issues": "https://github.com/composer/semver/issues", - "source": "https://github.com/composer/semver/tree/3.4.0" + "source": "https://github.com/composer/semver/tree/3.4.4" }, "funding": [ { @@ -355,13 +675,9 @@ { "url": "https://github.com/composer", "type": "github" - }, - { - "url": "https://tidelift.com/funding/github/packagist/composer/composer", - "type": "tidelift" } ], - "time": "2023-08-31T09:50:34+00:00" + "time": "2025-08-20T19:15:30+00:00" }, { "name": "composer/xdebug-handler", @@ -431,29 +747,30 @@ }, { "name": "doctrine/deprecations", - "version": "1.1.3", + "version": "1.1.5", "source": { "type": "git", "url": "https://github.com/doctrine/deprecations.git", - "reference": "dfbaa3c2d2e9a9df1118213f3b8b0c597bb99fab" + "reference": "459c2f5dd3d6a4633d3b5f46ee2b1c40f57d3f38" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/doctrine/deprecations/zipball/dfbaa3c2d2e9a9df1118213f3b8b0c597bb99fab", - "reference": "dfbaa3c2d2e9a9df1118213f3b8b0c597bb99fab", + "url": "https://api.github.com/repos/doctrine/deprecations/zipball/459c2f5dd3d6a4633d3b5f46ee2b1c40f57d3f38", + "reference": "459c2f5dd3d6a4633d3b5f46ee2b1c40f57d3f38", "shasum": "" }, "require": { "php": "^7.1 || ^8.0" }, + "conflict": { + "phpunit/phpunit": "<=7.5 || >=13" + }, "require-dev": { - "doctrine/coding-standard": "^9", - "phpstan/phpstan": "1.4.10 || 1.10.15", - "phpstan/phpstan-phpunit": "^1.0", - "phpunit/phpunit": "^7.5 || ^8.5 || ^9.5", - "psalm/plugin-phpunit": "0.18.4", - "psr/log": "^1 || ^2 || ^3", - "vimeo/psalm": "4.30.0 || 5.12.0" + "doctrine/coding-standard": "^9 || ^12 || ^13", + "phpstan/phpstan": "1.4.10 || 2.1.11", + "phpstan/phpstan-phpunit": "^1.0 || ^2", + "phpunit/phpunit": "^7.5 || ^8.5 || ^9.6 || ^10.5 || ^11.5 || ^12", + "psr/log": "^1 || ^2 || ^3" }, "suggest": { "psr/log": "Allows logging deprecations via PSR-3 logger implementation" @@ -461,7 +778,7 @@ "type": "library", "autoload": { "psr-4": { - "Doctrine\\Deprecations\\": "lib/Doctrine/Deprecations" + "Doctrine\\Deprecations\\": "src" } }, "notification-url": "https://packagist.org/downloads/", @@ -472,9 +789,9 @@ "homepage": "https://www.doctrine-project.org/", "support": { "issues": "https://github.com/doctrine/deprecations/issues", - "source": "https://github.com/doctrine/deprecations/tree/1.1.3" + "source": "https://github.com/doctrine/deprecations/tree/1.1.5" }, - "time": "2024-01-30T19:34:25+00:00" + "time": "2025-04-07T20:06:18+00:00" }, { "name": "doctrine/instantiator", @@ -638,16 +955,16 @@ }, { "name": "myclabs/deep-copy", - "version": "1.11.1", + "version": "1.13.4", "source": { "type": "git", "url": "https://github.com/myclabs/DeepCopy.git", - "reference": "7284c22080590fb39f2ffa3e9057f10a4ddd0e0c" + "reference": "07d290f0c47959fd5eed98c95ee5602db07e0b6a" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/myclabs/DeepCopy/zipball/7284c22080590fb39f2ffa3e9057f10a4ddd0e0c", - "reference": "7284c22080590fb39f2ffa3e9057f10a4ddd0e0c", + "url": "https://api.github.com/repos/myclabs/DeepCopy/zipball/07d290f0c47959fd5eed98c95ee5602db07e0b6a", + "reference": "07d290f0c47959fd5eed98c95ee5602db07e0b6a", "shasum": "" }, "require": { @@ -655,11 +972,12 @@ }, "conflict": { "doctrine/collections": "<1.6.8", - "doctrine/common": "<2.13.3 || >=3,<3.2.2" + "doctrine/common": "<2.13.3 || >=3 <3.2.2" }, "require-dev": { "doctrine/collections": "^1.6.8", "doctrine/common": "^2.13.3 || ^3.2.2", + "phpspec/prophecy": "^1.10", "phpunit/phpunit": "^7.5.20 || ^8.5.23 || ^9.5.13" }, "type": "library", @@ -685,7 +1003,7 @@ ], "support": { "issues": "https://github.com/myclabs/DeepCopy/issues", - "source": "https://github.com/myclabs/DeepCopy/tree/1.11.1" + "source": "https://github.com/myclabs/DeepCopy/tree/1.13.4" }, "funding": [ { @@ -693,20 +1011,20 @@ "type": "tidelift" } ], - "time": "2023-03-08T13:26:56+00:00" + "time": "2025-08-01T08:46:24+00:00" }, { "name": "netresearch/jsonmapper", - "version": "v4.4.1", + "version": "v4.5.0", "source": { "type": "git", "url": "https://github.com/cweiske/jsonmapper.git", - "reference": "132c75c7dd83e45353ebb9c6c9f591952995bbf0" + "reference": "8e76efb98ee8b6afc54687045e1b8dba55ac76e5" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/cweiske/jsonmapper/zipball/132c75c7dd83e45353ebb9c6c9f591952995bbf0", - "reference": "132c75c7dd83e45353ebb9c6c9f591952995bbf0", + "url": "https://api.github.com/repos/cweiske/jsonmapper/zipball/8e76efb98ee8b6afc54687045e1b8dba55ac76e5", + "reference": "8e76efb98ee8b6afc54687045e1b8dba55ac76e5", "shasum": "" }, "require": { @@ -742,22 +1060,22 @@ "support": { "email": "cweiske@cweiske.de", "issues": "https://github.com/cweiske/jsonmapper/issues", - "source": "https://github.com/cweiske/jsonmapper/tree/v4.4.1" + "source": "https://github.com/cweiske/jsonmapper/tree/v4.5.0" }, - "time": "2024-01-31T06:18:54+00:00" + "time": "2024-09-08T10:13:13+00:00" }, { "name": "nikic/php-parser", - "version": "v5.0.2", + "version": "v5.6.2", "source": { "type": "git", "url": "https://github.com/nikic/PHP-Parser.git", - "reference": "139676794dc1e9231bf7bcd123cfc0c99182cb13" + "reference": "3a454ca033b9e06b63282ce19562e892747449bb" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/nikic/PHP-Parser/zipball/139676794dc1e9231bf7bcd123cfc0c99182cb13", - "reference": "139676794dc1e9231bf7bcd123cfc0c99182cb13", + "url": "https://api.github.com/repos/nikic/PHP-Parser/zipball/3a454ca033b9e06b63282ce19562e892747449bb", + "reference": "3a454ca033b9e06b63282ce19562e892747449bb", "shasum": "" }, "require": { @@ -768,7 +1086,7 @@ }, "require-dev": { "ircmaxell/php-yacc": "^0.0.7", - "phpunit/phpunit": "^7.0 || ^8.0 || ^9.0" + "phpunit/phpunit": "^9.0" }, "bin": [ "bin/php-parse" @@ -776,7 +1094,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "5.0-dev" + "dev-master": "5.x-dev" } }, "autoload": { @@ -800,9 +1118,9 @@ ], "support": { "issues": "https://github.com/nikic/PHP-Parser/issues", - "source": "https://github.com/nikic/PHP-Parser/tree/v5.0.2" + "source": "https://github.com/nikic/PHP-Parser/tree/v5.6.2" }, - "time": "2024-03-05T20:51:40+00:00" + "time": "2025-10-21T19:32:17+00:00" }, { "name": "phan/phan", @@ -1057,16 +1375,16 @@ }, { "name": "phpdocumentor/reflection-docblock", - "version": "5.4.0", + "version": "5.6.3", "source": { "type": "git", "url": "https://github.com/phpDocumentor/ReflectionDocBlock.git", - "reference": "298d2febfe79d03fe714eb871d5538da55205b1a" + "reference": "94f8051919d1b0369a6bcc7931d679a511c03fe9" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/phpDocumentor/ReflectionDocBlock/zipball/298d2febfe79d03fe714eb871d5538da55205b1a", - "reference": "298d2febfe79d03fe714eb871d5538da55205b1a", + "url": "https://api.github.com/repos/phpDocumentor/ReflectionDocBlock/zipball/94f8051919d1b0369a6bcc7931d679a511c03fe9", + "reference": "94f8051919d1b0369a6bcc7931d679a511c03fe9", "shasum": "" }, "require": { @@ -1075,17 +1393,17 @@ "php": "^7.4 || ^8.0", "phpdocumentor/reflection-common": "^2.2", "phpdocumentor/type-resolver": "^1.7", - "phpstan/phpdoc-parser": "^1.7", + "phpstan/phpdoc-parser": "^1.7|^2.0", "webmozart/assert": "^1.9.1" }, "require-dev": { - "mockery/mockery": "~1.3.5", + "mockery/mockery": "~1.3.5 || ~1.6.0", "phpstan/extension-installer": "^1.1", "phpstan/phpstan": "^1.8", "phpstan/phpstan-mockery": "^1.1", "phpstan/phpstan-webmozart-assert": "^1.2", "phpunit/phpunit": "^9.5", - "vimeo/psalm": "^5.13" + "psalm/phar": "^5.26" }, "type": "library", "extra": { @@ -1115,29 +1433,29 @@ "description": "With this component, a library can provide support for annotations via DocBlocks or otherwise retrieve information that is embedded in a DocBlock.", "support": { "issues": "https://github.com/phpDocumentor/ReflectionDocBlock/issues", - "source": "https://github.com/phpDocumentor/ReflectionDocBlock/tree/5.4.0" + "source": "https://github.com/phpDocumentor/ReflectionDocBlock/tree/5.6.3" }, - "time": "2024-04-09T21:13:58+00:00" + "time": "2025-08-01T19:43:32+00:00" }, { "name": "phpdocumentor/type-resolver", - "version": "1.8.2", + "version": "1.10.0", "source": { "type": "git", "url": "https://github.com/phpDocumentor/TypeResolver.git", - "reference": "153ae662783729388a584b4361f2545e4d841e3c" + "reference": "679e3ce485b99e84c775d28e2e96fade9a7fb50a" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/phpDocumentor/TypeResolver/zipball/153ae662783729388a584b4361f2545e4d841e3c", - "reference": "153ae662783729388a584b4361f2545e4d841e3c", + "url": "https://api.github.com/repos/phpDocumentor/TypeResolver/zipball/679e3ce485b99e84c775d28e2e96fade9a7fb50a", + "reference": "679e3ce485b99e84c775d28e2e96fade9a7fb50a", "shasum": "" }, "require": { "doctrine/deprecations": "^1.0", "php": "^7.3 || ^8.0", "phpdocumentor/reflection-common": "^2.0", - "phpstan/phpdoc-parser": "^1.13" + "phpstan/phpdoc-parser": "^1.18|^2.0" }, "require-dev": { "ext-tokenizer": "*", @@ -1173,36 +1491,36 @@ "description": "A PSR-5 based resolver of Class names, Types and Structural Element Names", "support": { "issues": "https://github.com/phpDocumentor/TypeResolver/issues", - "source": "https://github.com/phpDocumentor/TypeResolver/tree/1.8.2" + "source": "https://github.com/phpDocumentor/TypeResolver/tree/1.10.0" }, - "time": "2024-02-23T11:10:43+00:00" + "time": "2024-11-09T15:12:26+00:00" }, { "name": "phpstan/phpdoc-parser", - "version": "1.29.0", + "version": "2.3.0", "source": { "type": "git", "url": "https://github.com/phpstan/phpdoc-parser.git", - "reference": "536889f2b340489d328f5ffb7b02bb6b183ddedc" + "reference": "1e0cd5370df5dd2e556a36b9c62f62e555870495" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/phpstan/phpdoc-parser/zipball/536889f2b340489d328f5ffb7b02bb6b183ddedc", - "reference": "536889f2b340489d328f5ffb7b02bb6b183ddedc", + "url": "https://api.github.com/repos/phpstan/phpdoc-parser/zipball/1e0cd5370df5dd2e556a36b9c62f62e555870495", + "reference": "1e0cd5370df5dd2e556a36b9c62f62e555870495", "shasum": "" }, "require": { - "php": "^7.2 || ^8.0" + "php": "^7.4 || ^8.0" }, "require-dev": { "doctrine/annotations": "^2.0", - "nikic/php-parser": "^4.15", + "nikic/php-parser": "^5.3.0", "php-parallel-lint/php-parallel-lint": "^1.2", "phpstan/extension-installer": "^1.0", - "phpstan/phpstan": "^1.5", - "phpstan/phpstan-phpunit": "^1.1", - "phpstan/phpstan-strict-rules": "^1.0", - "phpunit/phpunit": "^9.5", + "phpstan/phpstan": "^2.0", + "phpstan/phpstan-phpunit": "^2.0", + "phpstan/phpstan-strict-rules": "^2.0", + "phpunit/phpunit": "^9.6", "symfony/process": "^5.2" }, "type": "library", @@ -1220,41 +1538,41 @@ "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/1.29.0" + "source": "https://github.com/phpstan/phpdoc-parser/tree/2.3.0" }, - "time": "2024-05-06T12:04:23+00:00" + "time": "2025-08-30T15:50:23+00:00" }, { "name": "phpunit/php-code-coverage", - "version": "9.2.31", + "version": "9.2.32", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/php-code-coverage.git", - "reference": "48c34b5d8d983006bd2adc2d0de92963b9155965" + "reference": "85402a822d1ecf1db1096959413d35e1c37cf1a5" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/php-code-coverage/zipball/48c34b5d8d983006bd2adc2d0de92963b9155965", - "reference": "48c34b5d8d983006bd2adc2d0de92963b9155965", + "url": "https://api.github.com/repos/sebastianbergmann/php-code-coverage/zipball/85402a822d1ecf1db1096959413d35e1c37cf1a5", + "reference": "85402a822d1ecf1db1096959413d35e1c37cf1a5", "shasum": "" }, "require": { "ext-dom": "*", "ext-libxml": "*", "ext-xmlwriter": "*", - "nikic/php-parser": "^4.18 || ^5.0", + "nikic/php-parser": "^4.19.1 || ^5.1.0", "php": ">=7.3", - "phpunit/php-file-iterator": "^3.0.3", - "phpunit/php-text-template": "^2.0.2", - "sebastian/code-unit-reverse-lookup": "^2.0.2", - "sebastian/complexity": "^2.0", - "sebastian/environment": "^5.1.2", - "sebastian/lines-of-code": "^1.0.3", - "sebastian/version": "^3.0.1", - "theseer/tokenizer": "^1.2.0" + "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", + "theseer/tokenizer": "^1.2.3" }, "require-dev": { - "phpunit/phpunit": "^9.3" + "phpunit/phpunit": "^9.6" }, "suggest": { "ext-pcov": "PHP extension that provides line coverage", @@ -1263,7 +1581,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "9.2-dev" + "dev-main": "9.2.x-dev" } }, "autoload": { @@ -1292,7 +1610,7 @@ "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.31" + "source": "https://github.com/sebastianbergmann/php-code-coverage/tree/9.2.32" }, "funding": [ { @@ -1300,7 +1618,7 @@ "type": "github" } ], - "time": "2024-03-02T06:37:42+00:00" + "time": "2024-08-22T04:23:01+00:00" }, { "name": "phpunit/php-file-iterator", @@ -1545,45 +1863,45 @@ }, { "name": "phpunit/phpunit", - "version": "9.6.19", + "version": "9.6.29", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/phpunit.git", - "reference": "a1a54a473501ef4cdeaae4e06891674114d79db8" + "reference": "9ecfec57835a5581bc888ea7e13b51eb55ab9dd3" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/a1a54a473501ef4cdeaae4e06891674114d79db8", - "reference": "a1a54a473501ef4cdeaae4e06891674114d79db8", + "url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/9ecfec57835a5581bc888ea7e13b51eb55ab9dd3", + "reference": "9ecfec57835a5581bc888ea7e13b51eb55ab9dd3", "shasum": "" }, "require": { - "doctrine/instantiator": "^1.3.1 || ^2", + "doctrine/instantiator": "^1.5.0 || ^2", "ext-dom": "*", "ext-json": "*", "ext-libxml": "*", "ext-mbstring": "*", "ext-xml": "*", "ext-xmlwriter": "*", - "myclabs/deep-copy": "^1.10.1", - "phar-io/manifest": "^2.0.3", - "phar-io/version": "^3.0.2", + "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.28", - "phpunit/php-file-iterator": "^3.0.5", + "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.3", - "phpunit/php-timer": "^5.0.2", - "sebastian/cli-parser": "^1.0.1", - "sebastian/code-unit": "^1.0.6", - "sebastian/comparator": "^4.0.8", - "sebastian/diff": "^4.0.3", - "sebastian/environment": "^5.1.3", - "sebastian/exporter": "^4.0.5", - "sebastian/global-state": "^5.0.1", - "sebastian/object-enumerator": "^4.0.3", - "sebastian/resource-operations": "^3.0.3", - "sebastian/type": "^3.2", + "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.8", + "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": { @@ -1628,7 +1946,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.19" + "source": "https://github.com/sebastianbergmann/phpunit/tree/9.6.29" }, "funding": [ { @@ -1639,12 +1957,20 @@ "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/phpunit", "type": "tidelift" } ], - "time": "2024-04-05T04:35:58+00:00" + "time": "2025-09-24T06:29:11+00:00" }, { "name": "psr/container", @@ -1701,25 +2027,25 @@ }, { "name": "sabre/event", - "version": "5.1.4", + "version": "5.1.7", "source": { "type": "git", "url": "https://github.com/sabre-io/event.git", - "reference": "d7da22897125d34d7eddf7977758191c06a74497" + "reference": "86d57e305c272898ba3c28e9bd3d65d5464587c2" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sabre-io/event/zipball/d7da22897125d34d7eddf7977758191c06a74497", - "reference": "d7da22897125d34d7eddf7977758191c06a74497", + "url": "https://api.github.com/repos/sabre-io/event/zipball/86d57e305c272898ba3c28e9bd3d65d5464587c2", + "reference": "86d57e305c272898ba3c28e9bd3d65d5464587c2", "shasum": "" }, "require": { "php": "^7.1 || ^8.0" }, "require-dev": { - "friendsofphp/php-cs-fixer": "~2.17.1", + "friendsofphp/php-cs-fixer": "~2.17.1||^3.63", "phpstan/phpstan": "^0.12", - "phpunit/phpunit": "^7.5 || ^8.5 || ^9.0" + "phpunit/phpunit": "^7.5 || ^8.5 || ^9.6" }, "type": "library", "autoload": { @@ -1763,7 +2089,7 @@ "issues": "https://github.com/sabre-io/event/issues", "source": "https://github.com/fruux/sabre-event" }, - "time": "2021-11-04T06:51:17+00:00" + "time": "2024-08-27T11:23:05+00:00" }, { "name": "sebastian/cli-parser", @@ -1934,16 +2260,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 +2322,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://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", @@ -2194,16 +2532,16 @@ }, { "name": "sebastian/exporter", - "version": "4.0.6", + "version": "4.0.8", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/exporter.git", - "reference": "78c00df8f170e02473b682df15bfcdacc3d32d72" + "reference": "14c6ba52f95a36c3d27c835d65efc7123c446e8c" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/exporter/zipball/78c00df8f170e02473b682df15bfcdacc3d32d72", - "reference": "78c00df8f170e02473b682df15bfcdacc3d32d72", + "url": "https://api.github.com/repos/sebastianbergmann/exporter/zipball/14c6ba52f95a36c3d27c835d65efc7123c446e8c", + "reference": "14c6ba52f95a36c3d27c835d65efc7123c446e8c", "shasum": "" }, "require": { @@ -2259,28 +2597,40 @@ ], "support": { "issues": "https://github.com/sebastianbergmann/exporter/issues", - "source": "https://github.com/sebastianbergmann/exporter/tree/4.0.6" + "source": "https://github.com/sebastianbergmann/exporter/tree/4.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/exporter", + "type": "tidelift" } ], - "time": "2024-03-02T06:33:00+00:00" + "time": "2025-09-24T06:03:27+00:00" }, { "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 +2673,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 +2866,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 +2917,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", @@ -2730,16 +3104,16 @@ }, { "name": "squizlabs/php_codesniffer", - "version": "3.9.2", + "version": "3.13.5", "source": { "type": "git", "url": "https://github.com/PHPCSStandards/PHP_CodeSniffer.git", - "reference": "aac1f6f347a5c5ac6bc98ad395007df00990f480" + "reference": "0ca86845ce43291e8f5692c7356fccf3bcf02bf4" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/PHPCSStandards/PHP_CodeSniffer/zipball/aac1f6f347a5c5ac6bc98ad395007df00990f480", - "reference": "aac1f6f347a5c5ac6bc98ad395007df00990f480", + "url": "https://api.github.com/repos/PHPCSStandards/PHP_CodeSniffer/zipball/0ca86845ce43291e8f5692c7356fccf3bcf02bf4", + "reference": "0ca86845ce43291e8f5692c7356fccf3bcf02bf4", "shasum": "" }, "require": { @@ -2756,11 +3130,6 @@ "bin/phpcs" ], "type": "library", - "extra": { - "branch-alias": { - "dev-master": "3.x-dev" - } - }, "notification-url": "https://packagist.org/downloads/", "license": [ "BSD-3-Clause" @@ -2804,53 +3173,57 @@ { "url": "https://opencollective.com/php_codesniffer", "type": "open_collective" + }, + { + "url": "https://thanks.dev/u/gh/phpcsstandards", + "type": "thanks_dev" } ], - "time": "2024-04-23T20:25:34+00:00" + "time": "2025-11-04T16:30:35+00:00" }, { "name": "symfony/console", - "version": "v6.4.7", + "version": "v7.3.5", "source": { "type": "git", "url": "https://github.com/symfony/console.git", - "reference": "a170e64ae10d00ba89e2acbb590dc2e54da8ad8f" + "reference": "cdb80fa5869653c83cfe1a9084a673b6daf57ea7" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/console/zipball/a170e64ae10d00ba89e2acbb590dc2e54da8ad8f", - "reference": "a170e64ae10d00ba89e2acbb590dc2e54da8ad8f", + "url": "https://api.github.com/repos/symfony/console/zipball/cdb80fa5869653c83cfe1a9084a673b6daf57ea7", + "reference": "cdb80fa5869653c83cfe1a9084a673b6daf57ea7", "shasum": "" }, "require": { - "php": ">=8.1", + "php": ">=8.2", "symfony/deprecation-contracts": "^2.5|^3", "symfony/polyfill-mbstring": "~1.0", "symfony/service-contracts": "^2.5|^3", - "symfony/string": "^5.4|^6.0|^7.0" + "symfony/string": "^7.2" }, "conflict": { - "symfony/dependency-injection": "<5.4", - "symfony/dotenv": "<5.4", - "symfony/event-dispatcher": "<5.4", - "symfony/lock": "<5.4", - "symfony/process": "<5.4" + "symfony/dependency-injection": "<6.4", + "symfony/dotenv": "<6.4", + "symfony/event-dispatcher": "<6.4", + "symfony/lock": "<6.4", + "symfony/process": "<6.4" }, "provide": { "psr/log-implementation": "1.0|2.0|3.0" }, "require-dev": { "psr/log": "^1|^2|^3", - "symfony/config": "^5.4|^6.0|^7.0", - "symfony/dependency-injection": "^5.4|^6.0|^7.0", - "symfony/event-dispatcher": "^5.4|^6.0|^7.0", + "symfony/config": "^6.4|^7.0", + "symfony/dependency-injection": "^6.4|^7.0", + "symfony/event-dispatcher": "^6.4|^7.0", "symfony/http-foundation": "^6.4|^7.0", "symfony/http-kernel": "^6.4|^7.0", - "symfony/lock": "^5.4|^6.0|^7.0", - "symfony/messenger": "^5.4|^6.0|^7.0", - "symfony/process": "^5.4|^6.0|^7.0", - "symfony/stopwatch": "^5.4|^6.0|^7.0", - "symfony/var-dumper": "^5.4|^6.0|^7.0" + "symfony/lock": "^6.4|^7.0", + "symfony/messenger": "^6.4|^7.0", + "symfony/process": "^6.4|^7.0", + "symfony/stopwatch": "^6.4|^7.0", + "symfony/var-dumper": "^6.4|^7.0" }, "type": "library", "autoload": { @@ -2884,7 +3257,7 @@ "terminal" ], "support": { - "source": "https://github.com/symfony/console/tree/v6.4.7" + "source": "https://github.com/symfony/console/tree/v7.3.5" }, "funding": [ { @@ -2896,70 +3269,7 @@ "type": "github" }, { - "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", - "type": "tidelift" - } - ], - "time": "2024-04-18T09:22:46+00:00" - }, - { - "name": "symfony/deprecation-contracts", - "version": "v3.5.0", - "source": { - "type": "git", - "url": "https://github.com/symfony/deprecation-contracts.git", - "reference": "0e0d29ce1f20deffb4ab1b016a7257c4f1e789a1" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/symfony/deprecation-contracts/zipball/0e0d29ce1f20deffb4ab1b016a7257c4f1e789a1", - "reference": "0e0d29ce1f20deffb4ab1b016a7257c4f1e789a1", - "shasum": "" - }, - "require": { - "php": ">=8.1" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-main": "3.5-dev" - }, - "thanks": { - "name": "symfony/contracts", - "url": "https://github.com/symfony/contracts" - } - }, - "autoload": { - "files": [ - "function.php" - ] - }, - "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": "A generic function and convention to trigger deprecation notices", - "homepage": "https://symfony.com", - "support": { - "source": "https://github.com/symfony/deprecation-contracts/tree/v3.5.0" - }, - "funding": [ - { - "url": "https://symfony.com/sponsor", - "type": "custom" - }, - { - "url": "https://github.com/fabpot", + "url": "https://github.com/nicolas-grekas", "type": "github" }, { @@ -2967,24 +3277,24 @@ "type": "tidelift" } ], - "time": "2024-04-18T09:32:20+00:00" + "time": "2025-10-14T15:46:26+00:00" }, { "name": "symfony/polyfill-ctype", - "version": "v1.29.0", + "version": "v1.33.0", "source": { "type": "git", "url": "https://github.com/symfony/polyfill-ctype.git", - "reference": "ef4d7e442ca910c4764bce785146269b30cb5fc4" + "reference": "a3cc8b044a6ea513310cbd48ef7333b384945638" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-ctype/zipball/ef4d7e442ca910c4764bce785146269b30cb5fc4", - "reference": "ef4d7e442ca910c4764bce785146269b30cb5fc4", + "url": "https://api.github.com/repos/symfony/polyfill-ctype/zipball/a3cc8b044a6ea513310cbd48ef7333b384945638", + "reference": "a3cc8b044a6ea513310cbd48ef7333b384945638", "shasum": "" }, "require": { - "php": ">=7.1" + "php": ">=7.2" }, "provide": { "ext-ctype": "*" @@ -2995,8 +3305,8 @@ "type": "library", "extra": { "thanks": { - "name": "symfony/polyfill", - "url": "https://github.com/symfony/polyfill" + "url": "https://github.com/symfony/polyfill", + "name": "symfony/polyfill" } }, "autoload": { @@ -3030,7 +3340,7 @@ "portable" ], "support": { - "source": "https://github.com/symfony/polyfill-ctype/tree/v1.29.0" + "source": "https://github.com/symfony/polyfill-ctype/tree/v1.33.0" }, "funding": [ { @@ -3041,29 +3351,33 @@ "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": "2024-01-29T20:11:03+00:00" + "time": "2024-09-09T11:45:10+00:00" }, { "name": "symfony/polyfill-intl-grapheme", - "version": "v1.29.0", + "version": "v1.33.0", "source": { "type": "git", "url": "https://github.com/symfony/polyfill-intl-grapheme.git", - "reference": "32a9da87d7b3245e09ac426c83d334ae9f06f80f" + "reference": "380872130d3a5dd3ace2f4010d95125fde5d5c70" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-intl-grapheme/zipball/32a9da87d7b3245e09ac426c83d334ae9f06f80f", - "reference": "32a9da87d7b3245e09ac426c83d334ae9f06f80f", + "url": "https://api.github.com/repos/symfony/polyfill-intl-grapheme/zipball/380872130d3a5dd3ace2f4010d95125fde5d5c70", + "reference": "380872130d3a5dd3ace2f4010d95125fde5d5c70", "shasum": "" }, "require": { - "php": ">=7.1" + "php": ">=7.2" }, "suggest": { "ext-intl": "For best performance" @@ -3071,8 +3385,8 @@ "type": "library", "extra": { "thanks": { - "name": "symfony/polyfill", - "url": "https://github.com/symfony/polyfill" + "url": "https://github.com/symfony/polyfill", + "name": "symfony/polyfill" } }, "autoload": { @@ -3108,7 +3422,7 @@ "shim" ], "support": { - "source": "https://github.com/symfony/polyfill-intl-grapheme/tree/v1.29.0" + "source": "https://github.com/symfony/polyfill-intl-grapheme/tree/v1.33.0" }, "funding": [ { @@ -3119,29 +3433,33 @@ "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": "2024-01-29T20:11:03+00:00" + "time": "2025-06-27T09:58:17+00:00" }, { "name": "symfony/polyfill-intl-normalizer", - "version": "v1.29.0", + "version": "v1.33.0", "source": { "type": "git", "url": "https://github.com/symfony/polyfill-intl-normalizer.git", - "reference": "bc45c394692b948b4d383a08d7753968bed9a83d" + "reference": "3833d7255cc303546435cb650316bff708a1c75c" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-intl-normalizer/zipball/bc45c394692b948b4d383a08d7753968bed9a83d", - "reference": "bc45c394692b948b4d383a08d7753968bed9a83d", + "url": "https://api.github.com/repos/symfony/polyfill-intl-normalizer/zipball/3833d7255cc303546435cb650316bff708a1c75c", + "reference": "3833d7255cc303546435cb650316bff708a1c75c", "shasum": "" }, "require": { - "php": ">=7.1" + "php": ">=7.2" }, "suggest": { "ext-intl": "For best performance" @@ -3149,8 +3467,8 @@ "type": "library", "extra": { "thanks": { - "name": "symfony/polyfill", - "url": "https://github.com/symfony/polyfill" + "url": "https://github.com/symfony/polyfill", + "name": "symfony/polyfill" } }, "autoload": { @@ -3189,87 +3507,7 @@ "shim" ], "support": { - "source": "https://github.com/symfony/polyfill-intl-normalizer/tree/v1.29.0" - }, - "funding": [ - { - "url": "https://symfony.com/sponsor", - "type": "custom" - }, - { - "url": "https://github.com/fabpot", - "type": "github" - }, - { - "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", - "type": "tidelift" - } - ], - "time": "2024-01-29T20:11:03+00:00" - }, - { - "name": "symfony/polyfill-mbstring", - "version": "v1.29.0", - "source": { - "type": "git", - "url": "https://github.com/symfony/polyfill-mbstring.git", - "reference": "9773676c8a1bb1f8d4340a62efe641cf76eda7ec" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-mbstring/zipball/9773676c8a1bb1f8d4340a62efe641cf76eda7ec", - "reference": "9773676c8a1bb1f8d4340a62efe641cf76eda7ec", - "shasum": "" - }, - "require": { - "php": ">=7.1" - }, - "provide": { - "ext-mbstring": "*" - }, - "suggest": { - "ext-mbstring": "For best performance" - }, - "type": "library", - "extra": { - "thanks": { - "name": "symfony/polyfill", - "url": "https://github.com/symfony/polyfill" - } - }, - "autoload": { - "files": [ - "bootstrap.php" - ], - "psr-4": { - "Symfony\\Polyfill\\Mbstring\\": "" - } - }, - "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 for the Mbstring extension", - "homepage": "https://symfony.com", - "keywords": [ - "compatibility", - "mbstring", - "polyfill", - "portable", - "shim" - ], - "support": { - "source": "https://github.com/symfony/polyfill-mbstring/tree/v1.29.0" + "source": "https://github.com/symfony/polyfill-intl-normalizer/tree/v1.33.0" }, "funding": [ { @@ -3281,83 +3519,7 @@ "type": "github" }, { - "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", - "type": "tidelift" - } - ], - "time": "2024-01-29T20:11:03+00:00" - }, - { - "name": "symfony/polyfill-php80", - "version": "v1.29.0", - "source": { - "type": "git", - "url": "https://github.com/symfony/polyfill-php80.git", - "reference": "87b68208d5c1188808dd7839ee1e6c8ec3b02f1b" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-php80/zipball/87b68208d5c1188808dd7839ee1e6c8ec3b02f1b", - "reference": "87b68208d5c1188808dd7839ee1e6c8ec3b02f1b", - "shasum": "" - }, - "require": { - "php": ">=7.1" - }, - "type": "library", - "extra": { - "thanks": { - "name": "symfony/polyfill", - "url": "https://github.com/symfony/polyfill" - } - }, - "autoload": { - "files": [ - "bootstrap.php" - ], - "psr-4": { - "Symfony\\Polyfill\\Php80\\": "" - }, - "classmap": [ - "Resources/stubs" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Ion Bazan", - "email": "ion.bazan@gmail.com" - }, - { - "name": "Nicolas Grekas", - "email": "p@tchwork.com" - }, - { - "name": "Symfony Community", - "homepage": "https://symfony.com/contributors" - } - ], - "description": "Symfony polyfill backporting some PHP 8.0+ features to lower PHP versions", - "homepage": "https://symfony.com", - "keywords": [ - "compatibility", - "polyfill", - "portable", - "shim" - ], - "support": { - "source": "https://github.com/symfony/polyfill-php80/tree/v1.29.0" - }, - "funding": [ - { - "url": "https://symfony.com/sponsor", - "type": "custom" - }, - { - "url": "https://github.com/fabpot", + "url": "https://github.com/nicolas-grekas", "type": "github" }, { @@ -3365,20 +3527,20 @@ "type": "tidelift" } ], - "time": "2024-01-29T20:11:03+00:00" + "time": "2024-09-09T11:45:10+00:00" }, { "name": "symfony/service-contracts", - "version": "v3.5.0", + "version": "v3.6.0", "source": { "type": "git", "url": "https://github.com/symfony/service-contracts.git", - "reference": "bd1d9e59a81d8fa4acdcea3f617c581f7475a80f" + "reference": "f021b05a130d35510bd6b25fe9053c2a8a15d5d4" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/service-contracts/zipball/bd1d9e59a81d8fa4acdcea3f617c581f7475a80f", - "reference": "bd1d9e59a81d8fa4acdcea3f617c581f7475a80f", + "url": "https://api.github.com/repos/symfony/service-contracts/zipball/f021b05a130d35510bd6b25fe9053c2a8a15d5d4", + "reference": "f021b05a130d35510bd6b25fe9053c2a8a15d5d4", "shasum": "" }, "require": { @@ -3391,12 +3553,12 @@ }, "type": "library", "extra": { - "branch-alias": { - "dev-main": "3.5-dev" - }, "thanks": { - "name": "symfony/contracts", - "url": "https://github.com/symfony/contracts" + "url": "https://github.com/symfony/contracts", + "name": "symfony/contracts" + }, + "branch-alias": { + "dev-main": "3.6-dev" } }, "autoload": { @@ -3432,7 +3594,7 @@ "standards" ], "support": { - "source": "https://github.com/symfony/service-contracts/tree/v3.5.0" + "source": "https://github.com/symfony/service-contracts/tree/v3.6.0" }, "funding": [ { @@ -3448,20 +3610,20 @@ "type": "tidelift" } ], - "time": "2024-04-18T09:32:20+00:00" + "time": "2025-04-25T09:37:31+00:00" }, { "name": "symfony/string", - "version": "v7.0.7", + "version": "v7.3.4", "source": { "type": "git", "url": "https://github.com/symfony/string.git", - "reference": "e405b5424dc2528e02e31ba26b83a79fd4eb8f63" + "reference": "f96476035142921000338bad71e5247fbc138872" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/string/zipball/e405b5424dc2528e02e31ba26b83a79fd4eb8f63", - "reference": "e405b5424dc2528e02e31ba26b83a79fd4eb8f63", + "url": "https://api.github.com/repos/symfony/string/zipball/f96476035142921000338bad71e5247fbc138872", + "reference": "f96476035142921000338bad71e5247fbc138872", "shasum": "" }, "require": { @@ -3475,7 +3637,7 @@ "symfony/translation-contracts": "<2.5" }, "require-dev": { - "symfony/error-handler": "^6.4|^7.0", + "symfony/emoji": "^7.1", "symfony/http-client": "^6.4|^7.0", "symfony/intl": "^6.4|^7.0", "symfony/translation-contracts": "^2.5|^3.0", @@ -3518,7 +3680,7 @@ "utf8" ], "support": { - "source": "https://github.com/symfony/string/tree/v7.0.7" + "source": "https://github.com/symfony/string/tree/v7.3.4" }, "funding": [ { @@ -3529,12 +3691,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": "2024-04-18T09:29:19+00:00" + "time": "2025-09-11T14:36:48+00:00" }, { "name": "theseer/tokenizer", @@ -3650,28 +3816,28 @@ }, { "name": "webmozart/assert", - "version": "1.11.0", + "version": "1.12.1", "source": { "type": "git", "url": "https://github.com/webmozarts/assert.git", - "reference": "11cb2199493b2f8a3b53e7f19068fc6aac760991" + "reference": "9be6926d8b485f55b9229203f962b51ed377ba68" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/webmozarts/assert/zipball/11cb2199493b2f8a3b53e7f19068fc6aac760991", - "reference": "11cb2199493b2f8a3b53e7f19068fc6aac760991", + "url": "https://api.github.com/repos/webmozarts/assert/zipball/9be6926d8b485f55b9229203f962b51ed377ba68", + "reference": "9be6926d8b485f55b9229203f962b51ed377ba68", "shasum": "" }, "require": { "ext-ctype": "*", + "ext-date": "*", + "ext-filter": "*", "php": "^7.2 || ^8.0" }, - "conflict": { - "phpstan/phpstan": "<0.12.20", - "vimeo/psalm": "<4.6.1 || 4.6.2" - }, - "require-dev": { - "phpunit/phpunit": "^8.5.13" + "suggest": { + "ext-intl": "", + "ext-simplexml": "", + "ext-spl": "" }, "type": "library", "extra": { @@ -3702,9 +3868,9 @@ ], "support": { "issues": "https://github.com/webmozarts/assert/issues", - "source": "https://github.com/webmozarts/assert/tree/1.11.0" + "source": "https://github.com/webmozarts/assert/tree/1.12.1" }, - "time": "2022-06-03T18:03:27+00:00" + "time": "2025-10-29T15:56:20+00:00" } ], "aliases": [], diff --git a/src/Response/Types/ErrorType.php b/src/Response/Types/ErrorType.php index 82fb5c7..3f57669 100644 --- a/src/Response/Types/ErrorType.php +++ b/src/Response/Types/ErrorType.php @@ -5,9 +5,8 @@ namespace Core\Response\Types; use Core\Response\Context; -use Core\Utils\CoreHelper; +use Core\Utils\JsonPointerValue; use CoreInterfaces\Core\Response\ResponseInterface; -use Rs\Json\Pointer; class ErrorType { @@ -111,12 +110,13 @@ private function updateResponsePlaceholderValues( ); } - $jsonResponsePointer = $this->initializeJsonPointer($response); - $jsonPointers = $jsonPointersInTemplate[0]; for ($x = 0; $x < count($jsonPointers); $x++) { - $placeHolderValue = $this->getJsonPointerValue($jsonResponsePointer, ltrim($jsonPointers[$x], '#')); + $placeHolderValue = JsonPointerValue::getJsonPointerValue( + $response->getRawBody(), + ltrim($jsonPointers[$x], '#') + ); $errorDescription = $this->addPlaceHolderValue( $errorDescription, @@ -153,37 +153,4 @@ private function addPlaceHolderValue( return str_replace($placeHolder, $value, $template); } - - /** - * @param $jsonPointer ?Pointer - * @param $pointer string - * @return mixed Json pointer value from the JSON provided. - */ - private function getJsonPointerValue(?Pointer $jsonPointer, string $pointer) - { - if ($jsonPointer == null || trim($pointer) === '') { - return ""; - } - - try { - $pointerValue = $jsonPointer->get($pointer); - - if (is_object($pointerValue)) { - return CoreHelper::serialize($pointerValue); - } - - return $pointerValue; - } catch (\Exception $ex) { - return ""; - } - } - - private function initializeJsonPointer(ResponseInterface $response): ?Pointer - { - try { - return new Pointer($response->getRawBody()); - } catch (\Exception $ex) { - return null; - } - } } diff --git a/src/SignatureVerifier/HmacSignatureVerifier.php b/src/SignatureVerifier/HmacSignatureVerifier.php new file mode 100644 index 0000000..2e2d2a4 --- /dev/null +++ b/src/SignatureVerifier/HmacSignatureVerifier.php @@ -0,0 +1,101 @@ +secretKey = $secretKey; + $this->signatureVerificationFailureCreator = $signatureVerificationFailureCreator; + $this->signatureHeader = $signatureHeader; + $this->algorithm = strtolower($algorithm); + $this->encoding = strtolower($encoding); + $this->signatureValueTemplate = $signatureValueTemplate; + $this->templateResolver = $templateResolver; + } + + /** + * @param Request $request + * @return VerificationFailure | true + */ + public function verify(Request $request) + { + $receivedSignature = $request->headers->get($this->signatureHeader); + + if ($receivedSignature === null) { + return call_user_func($this->signatureVerificationFailureCreator, 'Missing signature header'); + } + + if ($this->templateResolver !== null) { + $signingData = call_user_func($this->templateResolver, $request); + + if ($signingData === null || $signingData === '') { + $signingData = $request->getContent(); + } + } else { + $signingData = $request->getContent(); + } + + $hash = hash_hmac($this->algorithm, $signingData, $this->secretKey, true); + $expectedSignature = $this->encodeHash($hash); + + if ($this->signatureValueTemplate !== null) { + $expectedSignature = str_replace('{digest}', $expectedSignature, $this->signatureValueTemplate); + } + + if (!hash_equals($expectedSignature, $receivedSignature)) { + return call_user_func($this->signatureVerificationFailureCreator, 'Signature mismatch'); + } + + return true; + } + + private function encodeHash(string $hash): string + { + if ($this->encoding === 'hex') { + return bin2hex($hash); + } + if ($this->encoding === 'base64') { + return base64_encode($hash); + } + return rtrim(strtr(base64_encode($hash), '+/', '-_'), '='); + } +} diff --git a/src/SignatureVerifier/SignatureVerifierInterface.php b/src/SignatureVerifier/SignatureVerifierInterface.php new file mode 100644 index 0000000..f6e884f --- /dev/null +++ b/src/SignatureVerifier/SignatureVerifierInterface.php @@ -0,0 +1,19 @@ +errorMessage = $errorMessage; + } + + public function getErrorMessage(): string + { + return $this->errorMessage; + } +} diff --git a/src/Utils/JsonPointerValue.php b/src/Utils/JsonPointerValue.php new file mode 100644 index 0000000..76243c2 --- /dev/null +++ b/src/Utils/JsonPointerValue.php @@ -0,0 +1,36 @@ +get($pointer); + + if (is_object($pointerValue)) { + $pointerValue = CoreHelper::serialize($pointerValue); + } + + return $pointerValue; + } catch (\Exception $ex) { + return ""; + } + } +} diff --git a/tests/JsonPointerValueTest.php b/tests/JsonPointerValueTest.php new file mode 100644 index 0000000..bd0e48a --- /dev/null +++ b/tests/JsonPointerValueTest.php @@ -0,0 +1,307 @@ +testData = json_encode([ + 'name' => 'John Doe', + 'age' => 30, + 'email' => 'john@example.com', + 'address' => [ + 'street' => '123 Main St', + 'city' => 'New York', + 'country' => 'USA' + ], + 'tags' => ['developer', 'php', 'testing'], + 'active' => true, + 'score' => 95.5, + 'metadata' => null + ]); + } + + /** + * Test getting a simple string value + */ + public function testGetSimpleStringValue() + { + $result = JsonPointerValue::getJsonPointerValue($this->testData, '/name'); + + $this->assertEquals('John Doe', $result); + } + + /** + * Test getting an integer value + */ + public function testGetIntegerValue() + { + $result = JsonPointerValue::getJsonPointerValue($this->testData, '/age'); + + $this->assertEquals(30, $result); + } + + /** + * Test getting a boolean value + */ + public function testGetBooleanValue() + { + $result = JsonPointerValue::getJsonPointerValue($this->testData, '/active'); + + $this->assertTrue($result); + } + + /** + * Test getting a float value + */ + public function testGetFloatValue() + { + $result = JsonPointerValue::getJsonPointerValue($this->testData, '/score'); + + $this->assertEquals(95.5, $result); + } + + /** + * Test getting a null value + */ + public function testGetNullValue() + { + $result = JsonPointerValue::getJsonPointerValue($this->testData, '/metadata'); + + $this->assertNull($result); + } + + /** + * Test getting a nested value + */ + public function testGetNestedValue() + { + $result = JsonPointerValue::getJsonPointerValue($this->testData, '/address/city'); + + $this->assertEquals('New York', $result); + } + + /** + * Test getting an array value + */ + public function testGetArrayValue() + { + $result = JsonPointerValue::getJsonPointerValue($this->testData, '/tags'); + + $this->assertIsArray($result); + $this->assertEquals(['developer', 'php', 'testing'], $result); + } + + /** + * Test getting a specific array element + */ + public function testGetArrayElement() + { + $result = JsonPointerValue::getJsonPointerValue($this->testData, '/tags/0'); + + $this->assertEquals('developer', $result); + } + + /** + * Test with empty pointer string + */ + public function testEmptyPointerString() + { + $result = JsonPointerValue::getJsonPointerValue($this->testData, ''); + + $this->assertEquals('', $result); + } + + /** + * Test with whitespace-only pointer string + */ + public function testWhitespaceOnlyPointerString() + { + $result = JsonPointerValue::getJsonPointerValue($this->testData, ' '); + + $this->assertEquals('', $result); + } + + /** + * Test with empty json string + */ + public function testEmptyJsonString() + { + $result = JsonPointerValue::getJsonPointerValue('', '/any'); + + $this->assertEquals('', $result); + } + + /** + * Test with whitespace-only json string + */ + public function testWhitespaceOnlyJsonString() + { + $result = JsonPointerValue::getJsonPointerValue(' ', '/any'); + + $this->assertEquals('', $result); + } + + /** + * Test with both empty json and empty pointer + */ + public function testEmptyJsonAndEmptyPointer() + { + $result = JsonPointerValue::getJsonPointerValue('', ''); + + $this->assertEquals('', $result); + } + + /** + * Test with invalid pointer that doesn't exist + */ + public function testInvalidPointerPath() + { + $result = JsonPointerValue::getJsonPointerValue($this->testData, '/nonexistent'); + + $this->assertEquals('', $result); + } + + /** + * Test with invalid nested pointer + */ + public function testInvalidNestedPointerPath() + { + $result = JsonPointerValue::getJsonPointerValue($this->testData, '/address/zipcode'); + + $this->assertEquals('', $result); + } + + /** + * Test with malformed pointer (missing leading slash) + */ + public function testMalformedPointer() + { + $result = JsonPointerValue::getJsonPointerValue($this->testData, 'name'); + + $this->assertEquals('', $result); + } + + /** + * Test getting an object value (should be serialized) + */ + public function testGetObjectValueSerialization() + { + $objectData = json_encode([ + 'user' => (object)[ + 'name' => 'Jane', + 'role' => 'admin' + ] + ]); + + $result = JsonPointerValue::getJsonPointerValue($objectData, '/user'); + $this->assertNotEmpty($result); + } + + /** + * Test with array index out of bounds + */ + public function testArrayIndexOutOfBounds() + { + $result = JsonPointerValue::getJsonPointerValue($this->testData, '/tags/999'); + + $this->assertEquals('', $result); + } + + /** + * Test with negative array index + */ + public function testNegativeArrayIndex() + { + $result = JsonPointerValue::getJsonPointerValue($this->testData, '/tags/-1'); + + $this->assertEquals('', $result); + } + + /** + * Test with deeply nested valid pointer + */ + public function testDeeplyNestedPointer() + { + $deepData = json_encode([ + 'level1' => [ + 'level2' => [ + 'level3' => [ + 'value' => 'deep value' + ] + ] + ] + ]); + + $result = JsonPointerValue::getJsonPointerValue($deepData, '/level1/level2/level3/value'); + + $this->assertEquals('deep value', $result); + } + + /** + * Test with special characters in pointer path + */ + public function testSpecialCharactersInPath() + { + $specialData = json_encode([ + 'key~with~tildes' => 'value1', + 'key/with/slashes' => 'value2' + ]); + + $result = JsonPointerValue::getJsonPointerValue($specialData, '/key~0with~0tildes'); + + $this->assertEquals('value1', $result); + } + + /** + * Test with zero value + */ + public function testZeroValue() + { + $zeroData = json_encode(['count' => 0]); + + $result = JsonPointerValue::getJsonPointerValue($zeroData, '/count'); + + $this->assertEquals(0, $result); + } + + /** + * Test with empty string value + */ + public function testEmptyStringValue() + { + $emptyData = json_encode(['description' => '']); + $result = JsonPointerValue::getJsonPointerValue($emptyData, '/description'); + + $this->assertEquals('', $result); + } + + /** + * Test with false boolean value + */ + public function testFalseBooleanValue() + { + $falseData = json_encode(['enabled' => false]); + $result = JsonPointerValue::getJsonPointerValue($falseData, '/enabled'); + + $this->assertFalse($result); + } + + /** + * Test that getJsonPointerValue returns empty string when Pointer throws (invalid JSON) + */ + public function testReturnsEmptyStringOnPointerException() + { + $invalidJson = '{invalid json'; + $result = JsonPointerValue::getJsonPointerValue($invalidJson, '/any'); + $this->assertSame('', $result); + } +} diff --git a/tests/Mocking/SignatureVerifier/MockVerificationFailure.php b/tests/Mocking/SignatureVerifier/MockVerificationFailure.php new file mode 100644 index 0000000..4db92f1 --- /dev/null +++ b/tests/Mocking/SignatureVerifier/MockVerificationFailure.php @@ -0,0 +1,15 @@ +getMethod(); + $body = $request->getContent(); + $cookieHeader = $request->headers->get('Cookie', ''); + $xTimestampHeader = $request->headers->get('X-Timestamp', ''); + + // Parse JSON body to get customer name + $customerName = ''; + if (!empty($body)) { + $data = json_decode($body, true); + if (isset($data['customer']['name'])) { + $customerName = $data['customer']['name']; + } + } + + return "{$cookieHeader}:{$xTimestampHeader}:{$method}:{$body}:{$customerName}"; + }; + } + + private function createBaseRequest(array $headers = [], ?string $body = '{"foo":"bar"}'): Request + { + $defaultHeaders = [ + 'Content-Type' => 'application/json', + 'X-Timestamp' => '1697051234', + 'X-Signature' => '', + ]; + + $mergedHeaders = array_merge($defaultHeaders, $headers); + + $request = Request::create( + 'https://api.example.com/resource', + 'POST', + [], + [], + [], + [], + $body + ); + + foreach ($mergedHeaders as $key => $value) { + $request->headers->set($key, $value); + } + + return $request; + } + + public function testShouldThrowErrorForEmptySecretKey(): void + { + $this->expectException(\InvalidArgumentException::class); + $this->expectExceptionMessage('secretKey must be a non-empty string'); + $verifier = new HmacSignatureVerifier( + '', + [MockVerificationFailure::class, 'init'], + self::SIGNATURE_HEADER, + $this->createTemplateResolver() + ); + } + + public function testShouldThrowErrorForEmptySignatureHeader(): void + { + $this->expectException(\InvalidArgumentException::class); + $this->expectExceptionMessage('signatureHeader must be a non-empty string'); + $verifier = new HmacSignatureVerifier( + self::SECRET_KEY, + [MockVerificationFailure::class, 'init'], + '', + $this->createTemplateResolver() + ); + } + + public function testShouldThrowErrorForInvalidAlgorithm(): void + { + $this->expectException(\InvalidArgumentException::class); + $this->expectExceptionMessage('algorithm must be one of'); + $verifier = new HmacSignatureVerifier( + self::SECRET_KEY, + [MockVerificationFailure::class, 'init'], + self::SIGNATURE_HEADER, + $this->createTemplateResolver(), + 'invalid' + ); + } + + public function testShouldThrowErrorForInvalidEncoding(): void + { + $this->expectException(\InvalidArgumentException::class); + $this->expectExceptionMessage('encoding must be one of'); + $verifier = new HmacSignatureVerifier( + self::SECRET_KEY, + [MockVerificationFailure::class, 'init'], + self::SIGNATURE_HEADER, + $this->createTemplateResolver(), + self::HMAC_ALGORITHM, + 'invalid' + ); + } + + public function testShouldFailVerificationIfSignatureHeaderIsMissing(): void + { + $verifier = new HmacSignatureVerifier( + self::SECRET_KEY, + [MockVerificationFailure::class, 'init'], + self::SIGNATURE_HEADER, + $this->createTemplateResolver() + ); + + $request = $this->createBaseRequest(['X-Signature' => null]); + $request->headers->remove('X-Signature'); + + $result = $verifier->verify($request); + + $this->assertInstanceOf(MockVerificationFailure::class, $result); + $this->assertEquals('Missing signature header', $result->getErrorMessage()); + } + + public function testShouldFailVerificationIfSignatureDoesNotMatch(): void + { + $verifier = new HmacSignatureVerifier( + self::SECRET_KEY, + [MockVerificationFailure::class, 'init'], + self::SIGNATURE_HEADER, + $this->createTemplateResolver() + ); + + $request = $this->createBaseRequest(['X-Signature' => 'sha256=invalidsignature']); + + $result = $verifier->verify($request); + + $this->assertInstanceOf(MockVerificationFailure::class, $result); + $this->assertEquals('Signature mismatch', $result->getErrorMessage()); + } + + public function testShouldPassVerificationForValidSignature(): void + { + $verifier = new HmacSignatureVerifier( + self::SECRET_KEY, + [MockVerificationFailure::class, 'init'], + self::SIGNATURE_HEADER, + $this->createTemplateResolver(), + self::HMAC_ALGORITHM, + self::ENCODING, + self::SIGNATURE_VALUE_TEMPLATE + ); + + $request = $this->createBaseRequest(); + $templateResolver = $this->createTemplateResolver(); + $signingData = $templateResolver($request); + + $hash = hash_hmac(self::HMAC_ALGORITHM, $signingData, self::SECRET_KEY, true); + $digest = bin2hex($hash); + $signature = str_replace('{digest}', $digest, self::SIGNATURE_VALUE_TEMPLATE); + + $request->headers->set('X-Signature', $signature); + + $result = $verifier->verify($request); + + $this->assertTrue($result); + } + + public function testShouldPassVerificationForValidSignatureWithoutSignatureValueTemplate(): void + { + $verifier = new HmacSignatureVerifier( + self::SECRET_KEY, + [MockVerificationFailure::class, 'init'], + self::SIGNATURE_HEADER, + $this->createTemplateResolver() + ); + + $request = $this->createBaseRequest(); + $templateResolver = $this->createTemplateResolver(); + $signingData = $templateResolver($request); + + $hash = hash_hmac(self::HMAC_ALGORITHM, $signingData, self::SECRET_KEY, true); + $digest = bin2hex($hash); + + $request->headers->set('X-Signature', $digest); + + $result = $verifier->verify($request); + + $this->assertTrue($result); + } + + public function testShouldSupportSha512AndBase64Encoding(): void + { + $verifier = new HmacSignatureVerifier( + self::SECRET_KEY, + [MockVerificationFailure::class, 'init'], + self::SIGNATURE_HEADER, + $this->createTemplateResolver(), + 'sha512', + 'base64' + ); + + $request = $this->createBaseRequest(); + $templateResolver = $this->createTemplateResolver(); + $signingData = $templateResolver($request); + + $hash = hash_hmac('sha512', $signingData, self::SECRET_KEY, true); + $digest = base64_encode($hash); + + $request->headers->set('X-Signature', $digest); + + $result = $verifier->verify($request); + + $this->assertTrue($result); + } + + public function testShouldSupportHexEncoding(): void + { + $verifier = new HmacSignatureVerifier( + self::SECRET_KEY, + [MockVerificationFailure::class, 'init'], + self::SIGNATURE_HEADER, + $this->createTemplateResolver(), + 'sha512', + 'hex' + ); + + $request = $this->createBaseRequest(); + $templateResolver = $this->createTemplateResolver(); + $signingData = $templateResolver($request); + + $hash = hash_hmac('sha512', $signingData, self::SECRET_KEY, true); + $digest = bin2hex($hash); + + $request->headers->set('X-Signature', $digest); + + $result = $verifier->verify($request); + + $this->assertTrue($result); + } + + public function testShouldSupportBase64urlEncoding(): void + { + $verifier = new HmacSignatureVerifier( + self::SECRET_KEY, + [MockVerificationFailure::class, 'init'], + self::SIGNATURE_HEADER, + $this->createTemplateResolver(), + 'sha512', + 'base64url' + ); + + $request = $this->createBaseRequest(); + $templateResolver = $this->createTemplateResolver(); + $signingData = $templateResolver($request); + + $hash = hash_hmac('sha512', $signingData, self::SECRET_KEY, true); + $base64 = base64_encode($hash); + $digest = rtrim(strtr($base64, '+/', '-_'), '='); + + $request->headers->set('X-Signature', $digest); + + $result = $verifier->verify($request); + + $this->assertTrue($result); + } + + public function testShouldUseCustomSignatureValueTemplate(): void + { + $customTemplate = 'sig:{digest}:end'; + + $verifier = new HmacSignatureVerifier( + self::SECRET_KEY, + [MockVerificationFailure::class, 'init'], + self::SIGNATURE_HEADER, + $this->createTemplateResolver(), + self::HMAC_ALGORITHM, + self::ENCODING, + $customTemplate + ); + + $request = $this->createBaseRequest(); + $templateResolver = $this->createTemplateResolver(); + $signingData = $templateResolver($request); + + $hash = hash_hmac(self::HMAC_ALGORITHM, $signingData, self::SECRET_KEY, true); + $digest = bin2hex($hash); + $signature = str_replace('{digest}', $digest, $customTemplate); + + $request->headers->set('X-Signature', $signature); + + $result = $verifier->verify($request); + + $this->assertTrue($result); + } + + public function testShouldFailIfDifferentSecretKeyIsGiven(): void + { + $verifier = new HmacSignatureVerifier( + 'different-key', + [MockVerificationFailure::class, 'init'], + self::SIGNATURE_HEADER, + $this->createTemplateResolver(), + self::HMAC_ALGORITHM, + self::ENCODING, + self::SIGNATURE_VALUE_TEMPLATE + ); + + $request = $this->createBaseRequest(); + $templateResolver = $this->createTemplateResolver(); + $signingData = $templateResolver($request); + + // Sign with original secret key + $hash = hash_hmac(self::HMAC_ALGORITHM, $signingData, self::SECRET_KEY, true); + $digest = bin2hex($hash); + $signature = str_replace('{digest}', $digest, self::SIGNATURE_VALUE_TEMPLATE); + + $request->headers->set('X-Signature', $signature); + + $result = $verifier->verify($request); + + $this->assertInstanceOf(MockVerificationFailure::class, $result); + $this->assertEquals('Signature mismatch', $result->getErrorMessage()); + } + + public function testShouldUseBodyToSignIfTemplateResolverIsNotProvided(): void + { + $verifier = new HmacSignatureVerifier( + 'different-key', + [MockVerificationFailure::class, 'init'], + self::SIGNATURE_HEADER, + null, + self::HMAC_ALGORITHM, + self::ENCODING, + self::SIGNATURE_VALUE_TEMPLATE + ); + + $request = $this->createBaseRequest(); + $body = $request->getContent(); + + // Sign with original secret key (different from verifier's key) + $hash = hash_hmac(self::HMAC_ALGORITHM, $body, self::SECRET_KEY, true); + $digest = bin2hex($hash); + $signature = str_replace('{digest}', $digest, self::SIGNATURE_VALUE_TEMPLATE); + + $request->headers->set('X-Signature', $signature); + + $result = $verifier->verify($request); + + $this->assertInstanceOf(MockVerificationFailure::class, $result); + $this->assertEquals('Signature mismatch', $result->getErrorMessage()); + } + + public function testShouldHandleVerificationWhenBothTemplateResolverAndBodyAreUndefined(): void + { + $verifier = new HmacSignatureVerifier( + self::SECRET_KEY, + [MockVerificationFailure::class, 'init'], + self::SIGNATURE_HEADER, + null, + self::HMAC_ALGORITHM, + self::ENCODING, + self::SIGNATURE_VALUE_TEMPLATE + ); + + $request = $this->createBaseRequest([], ''); + + $signingData = ''; + $hash = hash_hmac(self::HMAC_ALGORITHM, $signingData, self::SECRET_KEY, true); + $digest = bin2hex($hash); + $signature = str_replace('{digest}', $digest, self::SIGNATURE_VALUE_TEMPLATE); + + $request->headers->set('X-Signature', $signature); + + $result = $verifier->verify($request); + + $this->assertTrue($result); + } + + public function testShouldFallbackToBodyIfTemplateResolverReturnsNull(): void + { + $templateResolver = function (Request $request): ?string { + return null; + }; + $verifier = new HmacSignatureVerifier( + self::SECRET_KEY, + [MockVerificationFailure::class, 'init'], + self::SIGNATURE_HEADER, + $templateResolver, + self::HMAC_ALGORITHM, + self::ENCODING, + self::SIGNATURE_VALUE_TEMPLATE + ); + $request = $this->createBaseRequest(); + $body = $request->getContent(); + $hash = hash_hmac(self::HMAC_ALGORITHM, $body, self::SECRET_KEY, true); + $digest = bin2hex($hash); + $signature = str_replace('{digest}', $digest, self::SIGNATURE_VALUE_TEMPLATE); + $request->headers->set('X-Signature', $signature); + $result = $verifier->verify($request); + $this->assertTrue($result); + } + + public function testShouldFallbackToBodyIfTemplateResolverReturnsEmptyString(): void + { + $templateResolver = function (Request $request): string { + return ''; + }; + $verifier = new HmacSignatureVerifier( + self::SECRET_KEY, + [MockVerificationFailure::class, 'init'], + self::SIGNATURE_HEADER, + $templateResolver, + self::HMAC_ALGORITHM, + self::ENCODING, + self::SIGNATURE_VALUE_TEMPLATE + ); + $request = $this->createBaseRequest(); + $body = $request->getContent(); + $hash = hash_hmac(self::HMAC_ALGORITHM, $body, self::SECRET_KEY, true); + $digest = bin2hex($hash); + $signature = str_replace('{digest}', $digest, self::SIGNATURE_VALUE_TEMPLATE); + $request->headers->set('X-Signature', $signature); + $result = $verifier->verify($request); + $this->assertTrue($result); + } +}