diff --git a/.gitattributes b/.gitattributes index c683cc36..14bae9fb 100644 --- a/.gitattributes +++ b/.gitattributes @@ -11,3 +11,5 @@ /README.md export-ignore /Makefile export-ignore /.roave-backward-compatibility-check.json export-ignore +/.readthedocs.yaml export-ignore +/renovate.json export-ignore diff --git a/.github/workflows/backwards-compatibility.yml b/.github/workflows/backwards-compatibility.yml index b13b1297..803a02bb 100644 --- a/.github/workflows/backwards-compatibility.yml +++ b/.github/workflows/backwards-compatibility.yml @@ -16,7 +16,7 @@ jobs: fetch-depth: 0 - name: "Install PHP" - uses: "shivammathur/setup-php@2.31.1" + uses: "shivammathur/setup-php@2.32.0" with: php-version: "8.2" ini-values: memory_limit=-1 @@ -29,7 +29,7 @@ jobs: run: echo "composer_cache_dir=$(composer global config cache-files-dir)" >> $GITHUB_OUTPUT - name: "Cache dependencies" - uses: "actions/cache@v4.1.2" + uses: "actions/cache@v4.2.0" with: path: ${{ steps.composer-cache.outputs.composer_cache_dir }} key: "php-8.2-bc-break-check-${{ hashFiles('.github/workflows/backwards-compatibility.yml') }}" diff --git a/.github/workflows/benchmarks.yml b/.github/workflows/benchmarks.yml index 6203c7b0..8d6f520a 100644 --- a/.github/workflows/benchmarks.yml +++ b/.github/workflows/benchmarks.yml @@ -24,35 +24,17 @@ jobs: uses: "actions/checkout@v4.2.2" - name: "Install PHP" - uses: "shivammathur/setup-php@2.31.1" + uses: "shivammathur/setup-php@2.32.0" with: coverage: "none" php-version: "${{ matrix.php-version }}" ini-values: memory_limit=-1 tools: composer:v2, cs2pr - - name: Get composer cache directory - id: composer-cache - run: echo "composer_cache_dir=$(composer config cache-files-dir)" >> $GITHUB_OUTPUT - - - name: "Cache dependencies" - uses: "actions/cache@v4.1.2" + - name: "Install dependencies" + uses: "ramsey/composer-install@3.0.0" with: - path: ${{ steps.composer-cache.outputs.composer_cache_dir }} - key: "php-${{ matrix.php-version }}-composer-${{ matrix.dependencies }}-${{ hashFiles('**/composer.lock') }}" - restore-keys: "php-${{ matrix.php-version }}-composer-${{ matrix.dependencies }}-" - - - name: "Install lowest dependencies" - if: ${{ matrix.dependencies == 'lowest' }} - run: "composer update --prefer-lowest --no-interaction --no-progress" - - - name: "Install highest dependencies" - if: ${{ matrix.dependencies == 'highest' }} - run: "composer update --no-interaction --no-progress" - - - name: "Install locked dependencies" - if: ${{ matrix.dependencies == 'locked' }} - run: "composer install --no-interaction --no-progress" + dependency-versions: "${{ matrix.dependencies }}" - name: "PhpBench" run: "make phpbench" diff --git a/.github/workflows/coding-standards.yml b/.github/workflows/coding-standards.yml index a6c7d2b2..e2755b41 100644 --- a/.github/workflows/coding-standards.yml +++ b/.github/workflows/coding-standards.yml @@ -24,35 +24,17 @@ jobs: uses: "actions/checkout@v4.2.2" - name: "Install PHP" - uses: "shivammathur/setup-php@2.31.1" + uses: "shivammathur/setup-php@2.32.0" with: coverage: "none" php-version: "${{ matrix.php-version }}" ini-values: memory_limit=-1 tools: composer:v2, cs2pr - - name: Get composer cache directory - id: composer-cache - run: echo "composer_cache_dir=$(composer config cache-files-dir)" >> $GITHUB_OUTPUT - - - name: "Cache dependencies" - uses: "actions/cache@v4.1.2" + - name: "Install dependencies" + uses: "ramsey/composer-install@3.0.0" with: - path: ${{ steps.composer-cache.outputs.composer_cache_dir }} - key: "php-${{ matrix.php-version }}-composer-${{ matrix.dependencies }}-${{ hashFiles('**/composer.lock') }}" - restore-keys: "php-${{ matrix.php-version }}-composer-${{ matrix.dependencies }}-" - - - name: "Install lowest dependencies" - if: ${{ matrix.dependencies == 'lowest' }} - run: "composer update --prefer-lowest --no-interaction --no-progress" - - - name: "Install highest dependencies" - if: ${{ matrix.dependencies == 'highest' }} - run: "composer update --no-interaction --no-progress" - - - name: "Install locked dependencies" - if: ${{ matrix.dependencies == 'locked' }} - run: "composer install --no-interaction --no-progress" + dependency-versions: "${{ matrix.dependencies }}" - name: "Coding Standard" run: "make phpcs PHPCS_FLAGS='-q --report=checkstyle | cs2pr'" diff --git a/.github/workflows/composer-json-lint.yml b/.github/workflows/composer-json-lint.yml index eebe93a4..273a7e3d 100644 --- a/.github/workflows/composer-json-lint.yml +++ b/.github/workflows/composer-json-lint.yml @@ -24,35 +24,17 @@ jobs: uses: "actions/checkout@v4.2.2" - name: "Install PHP" - uses: "shivammathur/setup-php@2.31.1" + uses: "shivammathur/setup-php@2.32.0" with: coverage: "none" php-version: "${{ matrix.php-version }}" ini-values: memory_limit=-1 tools: composer:v2, composer-normalize, composer-require-checker, composer-unused - - name: Get composer cache directory - id: composer-cache - run: echo "composer_cache_dir=$(composer config cache-files-dir)" >> $GITHUB_OUTPUT - - - name: "Cache dependencies" - uses: "actions/cache@v4.1.2" + - name: "Install dependencies" + uses: "ramsey/composer-install@3.0.0" with: - path: ${{ steps.composer-cache.outputs.composer_cache_dir }} - key: "php-${{ matrix.php-version }}-composer-${{ matrix.dependencies }}-${{ hashFiles('**/composer.lock') }}" - restore-keys: "php-${{ matrix.php-version }}-composer-${{ matrix.dependencies }}-" - - - name: "Install lowest dependencies" - if: ${{ matrix.dependencies == 'lowest' }} - run: "composer update --prefer-lowest --no-interaction --no-progress" - - - name: "Install highest dependencies" - if: ${{ matrix.dependencies == 'highest' }} - run: "composer update --no-interaction --no-progress" - - - name: "Install locked dependencies" - if: ${{ matrix.dependencies == 'locked' }} - run: "composer install --no-interaction --no-progress" + dependency-versions: "${{ matrix.dependencies }}" - name: "Validate composer.json" run: "composer validate --strict" diff --git a/.github/workflows/mutation-tests.yml b/.github/workflows/mutation-tests.yml index 649e7df4..682cc24c 100644 --- a/.github/workflows/mutation-tests.yml +++ b/.github/workflows/mutation-tests.yml @@ -24,38 +24,20 @@ jobs: uses: "actions/checkout@v4.2.2" - name: "Install PHP" - uses: "shivammathur/setup-php@2.31.1" + uses: "shivammathur/setup-php@2.32.0" with: coverage: "xdebug" php-version: "${{ matrix.php-version }}" ini-values: memory_limit=-1 tools: composer:v2, cs2pr - - name: Get composer cache directory - id: composer-cache - run: echo "composer_cache_dir=$(composer config cache-files-dir)" >> $GITHUB_OUTPUT - - - name: "Cache dependencies" - uses: "actions/cache@v4.1.2" + - name: "Install dependencies" + uses: "ramsey/composer-install@3.0.0" with: - path: ${{ steps.composer-cache.outputs.composer_cache_dir }} - key: "php-${{ matrix.php-version }}-composer-${{ matrix.dependencies }}-${{ hashFiles('**/composer.lock') }}" - restore-keys: "php-${{ matrix.php-version }}-composer-${{ matrix.dependencies }}-" - - - name: "Install lowest dependencies" - if: ${{ matrix.dependencies == 'lowest' }} - run: "composer update --prefer-lowest --no-interaction --no-progress" - - - name: "Install highest dependencies" - if: ${{ matrix.dependencies == 'highest' }} - run: "composer update --no-interaction --no-progress" - - - name: "Install locked dependencies" - if: ${{ matrix.dependencies == 'locked' }} - run: "composer install --no-interaction --no-progress" + dependency-versions: "${{ matrix.dependencies }}" - name: "Infection" run: "make infection PHPUNIT_FLAGS=--coverage-clover=coverage.xml INFECTION_FLAGS=--logger-github" - name: "Upload Code Coverage" - uses: "codecov/codecov-action@v5.0.7" + uses: "codecov/codecov-action@v5.3.1" diff --git a/.github/workflows/phpunit.yml b/.github/workflows/phpunit.yml index 61fe3b04..c4253371 100644 --- a/.github/workflows/phpunit.yml +++ b/.github/workflows/phpunit.yml @@ -16,7 +16,6 @@ jobs: - "lowest" - "highest" - "locked" - - "development" php-version: - "8.2" - "8.3" @@ -29,39 +28,17 @@ jobs: uses: "actions/checkout@v4.2.2" - name: "Install PHP" - uses: "shivammathur/setup-php@2.31.1" + uses: "shivammathur/setup-php@2.32.0" with: coverage: "none" php-version: "${{ matrix.php-version }}" ini-values: memory_limit=-1 tools: composer:v2, cs2pr - - name: Get composer cache directory - id: composer-cache - run: echo "composer_cache_dir=$(composer config cache-files-dir)" >> $GITHUB_OUTPUT - - - name: "Cache dependencies" - uses: "actions/cache@v4.1.2" + - name: "Install dependencies" + uses: "ramsey/composer-install@3.0.0" with: - path: ${{ steps.composer-cache.outputs.composer_cache_dir }} - key: "php-${{ matrix.php-version }}-composer-${{ matrix.dependencies }}-${{ hashFiles('**/composer.lock') }}" - restore-keys: "php-${{ matrix.php-version }}-composer-${{ matrix.dependencies }}-" - - - name: "Install lowest dependencies" - if: ${{ matrix.dependencies == 'lowest' }} - run: "composer update --prefer-lowest --no-interaction --no-progress" - - - name: "Install highest dependencies" - if: ${{ matrix.dependencies == 'highest' }} - run: "composer update --no-interaction --no-progress" - - - name: "Install locked dependencies" - if: ${{ matrix.dependencies == 'locked' }} - run: "composer install --no-interaction --no-progress" - - - name: "Install development dependencies" - if: ${{ matrix.dependencies == 'development' }} - run: "composer config minimum-stability dev && composer update --no-interaction --no-progress" + dependency-versions: "${{ matrix.dependencies }}" - name: "Tests" run: "make phpunit" @@ -76,7 +53,7 @@ jobs: dependencies: - "locked" php-version: - - "8.4" + - "8.5" operating-system: - "ubuntu-latest" @@ -85,27 +62,18 @@ jobs: uses: "actions/checkout@v4.2.2" - name: "Install PHP" - uses: "shivammathur/setup-php@2.31.1" + uses: "shivammathur/setup-php@2.32.0" with: coverage: "none" php-version: "${{ matrix.php-version }}" ini-values: memory_limit=-1 tools: composer:v2, cs2pr - - name: Get composer cache directory - id: composer-cache - run: echo "composer_cache_dir=$(composer config cache-files-dir)" >> $GITHUB_OUTPUT - - - name: "Cache dependencies" - uses: "actions/cache@v4.1.2" + - name: "Install dependencies" + uses: "ramsey/composer-install@3.0.0" with: - path: ${{ steps.composer-cache.outputs.composer_cache_dir }} - key: "php-${{ matrix.php-version }}-composer-${{ matrix.dependencies }}-${{ hashFiles('**/composer.lock') }}" - restore-keys: "php-${{ matrix.php-version }}-composer-${{ matrix.dependencies }}-" - - - name: "Install locked dependencies" - if: ${{ matrix.dependencies == 'locked' }} - run: "composer install --no-interaction --no-progress --ignore-platform-req=php" + dependency-versions: "${{ matrix.dependencies }}" + composer-options: " --ignore-platform-req=php" - name: "Tests" run: "make phpunit" diff --git a/.github/workflows/static-analysis.yml b/.github/workflows/static-analysis.yml index f81a4b68..5935a48f 100644 --- a/.github/workflows/static-analysis.yml +++ b/.github/workflows/static-analysis.yml @@ -24,35 +24,17 @@ jobs: uses: "actions/checkout@v4.2.2" - name: "Install PHP" - uses: "shivammathur/setup-php@2.31.1" + uses: "shivammathur/setup-php@2.32.0" with: coverage: "none" php-version: "${{ matrix.php-version }}" ini-values: memory_limit=-1 tools: composer:v2, cs2pr - - name: Get composer cache directory - id: composer-cache - run: echo "composer_cache_dir=$(composer config cache-files-dir)" >> $GITHUB_OUTPUT - - - name: "Cache dependencies" - uses: "actions/cache@v4.1.2" + - name: "Install dependencies" + uses: "ramsey/composer-install@3.0.0" with: - path: ${{ steps.composer-cache.outputs.composer_cache_dir }} - key: "php-${{ matrix.php-version }}-composer-${{ matrix.dependencies }}-${{ hashFiles('**/composer.lock') }}" - restore-keys: "php-${{ matrix.php-version }}-composer-${{ matrix.dependencies }}-" - - - name: "Install lowest dependencies" - if: ${{ matrix.dependencies == 'lowest' }} - run: "composer update --prefer-lowest --no-interaction --no-progress" - - - name: "Install highest dependencies" - if: ${{ matrix.dependencies == 'highest' }} - run: "composer update --no-interaction --no-progress" - - - name: "Install locked dependencies" - if: ${{ matrix.dependencies == 'locked' }} - run: "composer install --no-interaction --no-progress" + dependency-versions: "${{ matrix.dependencies }}" - name: "PHPStan" run: "make phpstan" diff --git a/composer.lock b/composer.lock index aa08576a..c36d8f57 100644 --- a/composer.lock +++ b/composer.lock @@ -146,16 +146,16 @@ }, { "name": "composer/pcre", - "version": "3.3.1", + "version": "3.3.2", "source": { "type": "git", "url": "https://github.com/composer/pcre.git", - "reference": "63aaeac21d7e775ff9bc9d45021e1745c97521c4" + "reference": "b2bed4734f0cc156ee1fe9c0da2550420d99a21e" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/composer/pcre/zipball/63aaeac21d7e775ff9bc9d45021e1745c97521c4", - "reference": "63aaeac21d7e775ff9bc9d45021e1745c97521c4", + "url": "https://api.github.com/repos/composer/pcre/zipball/b2bed4734f0cc156ee1fe9c0da2550420d99a21e", + "reference": "b2bed4734f0cc156ee1fe9c0da2550420d99a21e", "shasum": "" }, "require": { @@ -165,8 +165,8 @@ "phpstan/phpstan": "<1.11.10" }, "require-dev": { - "phpstan/phpstan": "^1.11.10", - "phpstan/phpstan-strict-rules": "^1.1", + "phpstan/phpstan": "^1.12 || ^2", + "phpstan/phpstan-strict-rules": "^1 || ^2", "phpunit/phpunit": "^8 || ^9" }, "type": "library", @@ -205,7 +205,7 @@ ], "support": { "issues": "https://github.com/composer/pcre/issues", - "source": "https://github.com/composer/pcre/tree/3.3.1" + "source": "https://github.com/composer/pcre/tree/3.3.2" }, "funding": [ { @@ -221,7 +221,7 @@ "type": "tidelift" } ], - "time": "2024-08-27T18:44:43+00:00" + "time": "2024-11-12T16:29:46+00:00" }, { "name": "composer/xdebug-handler", @@ -369,16 +369,16 @@ }, { "name": "doctrine/annotations", - "version": "2.0.1", + "version": "2.0.2", "source": { "type": "git", "url": "https://github.com/doctrine/annotations.git", - "reference": "e157ef3f3124bbf6fe7ce0ffd109e8a8ef284e7f" + "reference": "901c2ee5d26eb64ff43c47976e114bf00843acf7" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/doctrine/annotations/zipball/e157ef3f3124bbf6fe7ce0ffd109e8a8ef284e7f", - "reference": "e157ef3f3124bbf6fe7ce0ffd109e8a8ef284e7f", + "url": "https://api.github.com/repos/doctrine/annotations/zipball/901c2ee5d26eb64ff43c47976e114bf00843acf7", + "reference": "901c2ee5d26eb64ff43c47976e114bf00843acf7", "shasum": "" }, "require": { @@ -390,10 +390,10 @@ "require-dev": { "doctrine/cache": "^2.0", "doctrine/coding-standard": "^10", - "phpstan/phpstan": "^1.8.0", + "phpstan/phpstan": "^1.10.28", "phpunit/phpunit": "^7.5 || ^8.5 || ^9.5", - "symfony/cache": "^5.4 || ^6", - "vimeo/psalm": "^4.10" + "symfony/cache": "^5.4 || ^6.4 || ^7", + "vimeo/psalm": "^4.30 || ^5.14" }, "suggest": { "php": "PHP 8.0 or higher comes with attributes, a native replacement for annotations" @@ -439,9 +439,9 @@ ], "support": { "issues": "https://github.com/doctrine/annotations/issues", - "source": "https://github.com/doctrine/annotations/tree/2.0.1" + "source": "https://github.com/doctrine/annotations/tree/2.0.2" }, - "time": "2023-02-02T22:02:53+00:00" + "time": "2024-09-05T10:17:24+00:00" }, { "name": "doctrine/coding-standard", @@ -816,16 +816,16 @@ }, { "name": "infection/infection", - "version": "0.29.8", + "version": "0.29.10", "source": { "type": "git", "url": "https://github.com/infection/infection.git", - "reference": "e30db7dda2e9308f1435097b56d20e959b06db17" + "reference": "cac7d20e5d286a37488527e477f5a695a9d7a44c" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/infection/infection/zipball/e30db7dda2e9308f1435097b56d20e959b06db17", - "reference": "e30db7dda2e9308f1435097b56d20e959b06db17", + "url": "https://api.github.com/repos/infection/infection/zipball/cac7d20e5d286a37488527e477f5a695a9d7a44c", + "reference": "cac7d20e5d286a37488527e477f5a695a9d7a44c", "shasum": "" }, "require": { @@ -842,17 +842,17 @@ "infection/include-interceptor": "^0.2.5", "infection/mutator": "^0.4", "justinrainbow/json-schema": "^5.3", - "nikic/php-parser": "^5.0", + "nikic/php-parser": "^5.3", "ondram/ci-detector": "^4.1.0", - "php": "^8.1", + "php": "^8.2", "sanmai/later": "^0.1.1", "sanmai/pipeline": "^5.1 || ^6", "sebastian/diff": "^3.0.2 || ^4.0 || ^5.0 || ^6.0", + "shish/safe": "^2.6", "symfony/console": "^5.4 || ^6.0 || ^7.0", "symfony/filesystem": "^5.4 || ^6.0 || ^7.0", "symfony/finder": "^5.4 || ^6.0 || ^7.0", "symfony/process": "^5.4 || ^6.0 || ^7.0", - "thecodingmachine/safe": "^2.1.2", "webmozart/assert": "^1.11" }, "conflict": { @@ -872,8 +872,7 @@ "phpunit/phpunit": "^10.5", "rector/rector": "^1.0", "sidz/phpstan-rules": "^0.4", - "symfony/yaml": "^5.4 || ^6.0 || ^7.0", - "thecodingmachine/phpstan-safe-rule": "^1.2.0" + "symfony/yaml": "^5.4 || ^6.0 || ^7.0" }, "bin": [ "bin/infection" @@ -929,7 +928,7 @@ ], "support": { "issues": "https://github.com/infection/infection/issues", - "source": "https://github.com/infection/infection/tree/0.29.8" + "source": "https://github.com/infection/infection/tree/0.29.10" }, "funding": [ { @@ -941,7 +940,7 @@ "type": "open_collective" } ], - "time": "2024-10-29T23:29:30+00:00" + "time": "2024-12-17T19:11:10+00:00" }, { "name": "infection/mutator", @@ -1236,16 +1235,16 @@ }, { "name": "nikic/php-parser", - "version": "v5.3.1", + "version": "v5.4.0", "source": { "type": "git", "url": "https://github.com/nikic/PHP-Parser.git", - "reference": "8eea230464783aa9671db8eea6f8c6ac5285794b" + "reference": "447a020a1f875a434d62f2a401f53b82a396e494" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/nikic/PHP-Parser/zipball/8eea230464783aa9671db8eea6f8c6ac5285794b", - "reference": "8eea230464783aa9671db8eea6f8c6ac5285794b", + "url": "https://api.github.com/repos/nikic/PHP-Parser/zipball/447a020a1f875a434d62f2a401f53b82a396e494", + "reference": "447a020a1f875a434d62f2a401f53b82a396e494", "shasum": "" }, "require": { @@ -1288,9 +1287,9 @@ ], "support": { "issues": "https://github.com/nikic/PHP-Parser/issues", - "source": "https://github.com/nikic/PHP-Parser/tree/v5.3.1" + "source": "https://github.com/nikic/PHP-Parser/tree/v5.4.0" }, - "time": "2024-10-08T18:51:32+00:00" + "time": "2024-12-30T11:07:19+00:00" }, { "name": "ondram/ci-detector", @@ -1539,69 +1538,18 @@ }, "time": "2023-10-30T13:38:26+00:00" }, - { - "name": "phpbench/dom", - "version": "0.3.3", - "source": { - "type": "git", - "url": "https://github.com/phpbench/dom.git", - "reference": "786a96db538d0def931f5b19225233ec42ec7a72" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/phpbench/dom/zipball/786a96db538d0def931f5b19225233ec42ec7a72", - "reference": "786a96db538d0def931f5b19225233ec42ec7a72", - "shasum": "" - }, - "require": { - "ext-dom": "*", - "php": "^7.3||^8.0" - }, - "require-dev": { - "friendsofphp/php-cs-fixer": "^3.14", - "phpstan/phpstan": "^1.10", - "phpunit/phpunit": "^8.0||^9.0" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.0-dev" - } - }, - "autoload": { - "psr-4": { - "PhpBench\\Dom\\": "lib/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Daniel Leech", - "email": "daniel@dantleech.com" - } - ], - "description": "DOM wrapper to simplify working with the PHP DOM implementation", - "support": { - "issues": "https://github.com/phpbench/dom/issues", - "source": "https://github.com/phpbench/dom/tree/0.3.3" - }, - "time": "2023-03-06T23:46:57+00:00" - }, { "name": "phpbench/phpbench", - "version": "1.3.1", + "version": "1.4.0", "source": { "type": "git", "url": "https://github.com/phpbench/phpbench.git", - "reference": "a3e1ef08d9d7736d43a7fbd444893d6a073c0ca0" + "reference": "4248817222514421cba466bfa7adc7d8932345d4" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/phpbench/phpbench/zipball/a3e1ef08d9d7736d43a7fbd444893d6a073c0ca0", - "reference": "a3e1ef08d9d7736d43a7fbd444893d6a073c0ca0", + "url": "https://api.github.com/repos/phpbench/phpbench/zipball/4248817222514421cba466bfa7adc7d8932345d4", + "reference": "4248817222514421cba466bfa7adc7d8932345d4", "shasum": "" }, "require": { @@ -1614,7 +1562,6 @@ "ext-tokenizer": "*", "php": "^8.1", "phpbench/container": "^2.2", - "phpbench/dom": "~0.3.3", "psr/log": "^1.1 || ^2.0 || ^3.0", "seld/jsonlint": "^1.1", "symfony/console": "^6.1 || ^7.0", @@ -1633,8 +1580,8 @@ "phpstan/extension-installer": "^1.1", "phpstan/phpstan": "^1.0", "phpstan/phpstan-phpunit": "^1.0", - "phpunit/phpunit": "^10.4", - "rector/rector": "^0.18.11 || ^1.0.0", + "phpunit/phpunit": "^10.4 || ^11.0", + "rector/rector": "^1.2", "symfony/error-handler": "^6.1 || ^7.0", "symfony/var-dumper": "^6.1 || ^7.0" }, @@ -1679,7 +1626,7 @@ ], "support": { "issues": "https://github.com/phpbench/phpbench/issues", - "source": "https://github.com/phpbench/phpbench/tree/1.3.1" + "source": "https://github.com/phpbench/phpbench/tree/1.4.0" }, "funding": [ { @@ -1687,7 +1634,7 @@ "type": "github" } ], - "time": "2024-06-30T11:04:37+00:00" + "time": "2025-01-26T19:54:45+00:00" }, { "name": "phpstan/extension-installer", @@ -1786,16 +1733,16 @@ }, { "name": "phpstan/phpstan", - "version": "1.12.12", + "version": "1.12.16", "source": { "type": "git", "url": "https://github.com/phpstan/phpstan.git", - "reference": "b5ae1b88f471d3fd4ba1aa0046234b5ca3776dd0" + "reference": "e0bb5cb78545aae631220735aa706eac633a6be9" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/phpstan/phpstan/zipball/b5ae1b88f471d3fd4ba1aa0046234b5ca3776dd0", - "reference": "b5ae1b88f471d3fd4ba1aa0046234b5ca3776dd0", + "url": "https://api.github.com/repos/phpstan/phpstan/zipball/e0bb5cb78545aae631220735aa706eac633a6be9", + "reference": "e0bb5cb78545aae631220735aa706eac633a6be9", "shasum": "" }, "require": { @@ -1840,7 +1787,7 @@ "type": "github" } ], - "time": "2024-11-28T22:13:23+00:00" + "time": "2025-01-21T14:50:05+00:00" }, { "name": "phpstan/phpstan-deprecation-rules", @@ -1891,16 +1838,16 @@ }, { "name": "phpstan/phpstan-phpunit", - "version": "1.4.1", + "version": "1.4.2", "source": { "type": "git", "url": "https://github.com/phpstan/phpstan-phpunit.git", - "reference": "11d4235fbc6313ecbf93708606edfd3222e44949" + "reference": "72a6721c9b64b3e4c9db55abbc38f790b318267e" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/phpstan/phpstan-phpunit/zipball/11d4235fbc6313ecbf93708606edfd3222e44949", - "reference": "11d4235fbc6313ecbf93708606edfd3222e44949", + "url": "https://api.github.com/repos/phpstan/phpstan-phpunit/zipball/72a6721c9b64b3e4c9db55abbc38f790b318267e", + "reference": "72a6721c9b64b3e4c9db55abbc38f790b318267e", "shasum": "" }, "require": { @@ -1937,22 +1884,22 @@ "description": "PHPUnit extensions and rules for PHPStan", "support": { "issues": "https://github.com/phpstan/phpstan-phpunit/issues", - "source": "https://github.com/phpstan/phpstan-phpunit/tree/1.4.1" + "source": "https://github.com/phpstan/phpstan-phpunit/tree/1.4.2" }, - "time": "2024-11-12T12:43:59+00:00" + "time": "2024-12-17T17:20:49+00:00" }, { "name": "phpstan/phpstan-strict-rules", - "version": "1.6.1", + "version": "1.6.2", "source": { "type": "git", "url": "https://github.com/phpstan/phpstan-strict-rules.git", - "reference": "daeec748b53de80a97498462513066834ec28f8b" + "reference": "b564ca479e7e735f750aaac4935af965572a7845" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/phpstan/phpstan-strict-rules/zipball/daeec748b53de80a97498462513066834ec28f8b", - "reference": "daeec748b53de80a97498462513066834ec28f8b", + "url": "https://api.github.com/repos/phpstan/phpstan-strict-rules/zipball/b564ca479e7e735f750aaac4935af965572a7845", + "reference": "b564ca479e7e735f750aaac4935af965572a7845", "shasum": "" }, "require": { @@ -1986,22 +1933,22 @@ "description": "Extra strict and opinionated rules for PHPStan", "support": { "issues": "https://github.com/phpstan/phpstan-strict-rules/issues", - "source": "https://github.com/phpstan/phpstan-strict-rules/tree/1.6.1" + "source": "https://github.com/phpstan/phpstan-strict-rules/tree/1.6.2" }, - "time": "2024-09-20T14:04:44+00:00" + "time": "2025-01-19T13:02:24+00:00" }, { "name": "phpunit/php-code-coverage", - "version": "11.0.7", + "version": "11.0.8", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/php-code-coverage.git", - "reference": "f7f08030e8811582cc459871d28d6f5a1a4d35ca" + "reference": "418c59fd080954f8c4aa5631d9502ecda2387118" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/php-code-coverage/zipball/f7f08030e8811582cc459871d28d6f5a1a4d35ca", - "reference": "f7f08030e8811582cc459871d28d6f5a1a4d35ca", + "url": "https://api.github.com/repos/sebastianbergmann/php-code-coverage/zipball/418c59fd080954f8c4aa5631d9502ecda2387118", + "reference": "418c59fd080954f8c4aa5631d9502ecda2387118", "shasum": "" }, "require": { @@ -2020,7 +1967,7 @@ "theseer/tokenizer": "^1.2.3" }, "require-dev": { - "phpunit/phpunit": "^11.4.1" + "phpunit/phpunit": "^11.5.0" }, "suggest": { "ext-pcov": "PHP extension that provides line coverage", @@ -2058,7 +2005,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/11.0.7" + "source": "https://github.com/sebastianbergmann/php-code-coverage/tree/11.0.8" }, "funding": [ { @@ -2066,7 +2013,7 @@ "type": "github" } ], - "time": "2024-10-09T06:21:38+00:00" + "time": "2024-12-11T12:34:27+00:00" }, { "name": "phpunit/php-file-iterator", @@ -2315,16 +2262,16 @@ }, { "name": "phpunit/phpunit", - "version": "11.4.4", + "version": "11.5.3", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/phpunit.git", - "reference": "f9ba7bd3c9f3ff54ec379d7a1c2e3f13fe0bbde4" + "reference": "30e319e578a7b5da3543073e30002bf82042f701" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/f9ba7bd3c9f3ff54ec379d7a1c2e3f13fe0bbde4", - "reference": "f9ba7bd3c9f3ff54ec379d7a1c2e3f13fe0bbde4", + "url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/30e319e578a7b5da3543073e30002bf82042f701", + "reference": "30e319e578a7b5da3543073e30002bf82042f701", "shasum": "" }, "require": { @@ -2338,21 +2285,22 @@ "phar-io/manifest": "^2.0.4", "phar-io/version": "^3.2.1", "php": ">=8.2", - "phpunit/php-code-coverage": "^11.0.7", + "phpunit/php-code-coverage": "^11.0.8", "phpunit/php-file-iterator": "^5.1.0", "phpunit/php-invoker": "^5.0.1", "phpunit/php-text-template": "^4.0.1", "phpunit/php-timer": "^7.0.1", "sebastian/cli-parser": "^3.0.2", - "sebastian/code-unit": "^3.0.1", - "sebastian/comparator": "^6.2.1", + "sebastian/code-unit": "^3.0.2", + "sebastian/comparator": "^6.3.0", "sebastian/diff": "^6.0.2", "sebastian/environment": "^7.2.0", - "sebastian/exporter": "^6.1.3", + "sebastian/exporter": "^6.3.0", "sebastian/global-state": "^7.0.2", "sebastian/object-enumerator": "^6.0.1", "sebastian/type": "^5.1.0", - "sebastian/version": "^5.0.2" + "sebastian/version": "^5.0.2", + "staabm/side-effects-detector": "^1.0.5" }, "suggest": { "ext-soap": "To be able to generate mocks based on WSDL files" @@ -2363,7 +2311,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-main": "11.4-dev" + "dev-main": "11.5-dev" } }, "autoload": { @@ -2395,7 +2343,7 @@ "support": { "issues": "https://github.com/sebastianbergmann/phpunit/issues", "security": "https://github.com/sebastianbergmann/phpunit/security/policy", - "source": "https://github.com/sebastianbergmann/phpunit/tree/11.4.4" + "source": "https://github.com/sebastianbergmann/phpunit/tree/11.5.3" }, "funding": [ { @@ -2411,7 +2359,7 @@ "type": "tidelift" } ], - "time": "2024-11-27T10:44:52+00:00" + "time": "2025-01-13T09:36:00+00:00" }, { "name": "psr/cache", @@ -2631,16 +2579,16 @@ }, { "name": "sanmai/pipeline", - "version": "v6.11", + "version": "6.12", "source": { "type": "git", "url": "https://github.com/sanmai/pipeline.git", - "reference": "a5fa2a6c6ca93efa37e7c24aab72f47448a6b110" + "reference": "ad7dbc3f773eeafb90d5459522fbd8f188532e25" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sanmai/pipeline/zipball/a5fa2a6c6ca93efa37e7c24aab72f47448a6b110", - "reference": "a5fa2a6c6ca93efa37e7c24aab72f47448a6b110", + "url": "https://api.github.com/repos/sanmai/pipeline/zipball/ad7dbc3f773eeafb90d5459522fbd8f188532e25", + "reference": "ad7dbc3f773eeafb90d5459522fbd8f188532e25", "shasum": "" }, "require": { @@ -2684,7 +2632,7 @@ "description": "General-purpose collections pipeline", "support": { "issues": "https://github.com/sanmai/pipeline/issues", - "source": "https://github.com/sanmai/pipeline/tree/v6.11" + "source": "https://github.com/sanmai/pipeline/tree/6.12" }, "funding": [ { @@ -2692,7 +2640,7 @@ "type": "github" } ], - "time": "2024-06-15T03:11:19+00:00" + "time": "2024-10-17T02:22:57+00:00" }, { "name": "sebastian/cli-parser", @@ -2753,23 +2701,23 @@ }, { "name": "sebastian/code-unit", - "version": "3.0.1", + "version": "3.0.2", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/code-unit.git", - "reference": "6bb7d09d6623567178cf54126afa9c2310114268" + "reference": "ee88b0cdbe74cf8dd3b54940ff17643c0d6543ca" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/code-unit/zipball/6bb7d09d6623567178cf54126afa9c2310114268", - "reference": "6bb7d09d6623567178cf54126afa9c2310114268", + "url": "https://api.github.com/repos/sebastianbergmann/code-unit/zipball/ee88b0cdbe74cf8dd3b54940ff17643c0d6543ca", + "reference": "ee88b0cdbe74cf8dd3b54940ff17643c0d6543ca", "shasum": "" }, "require": { "php": ">=8.2" }, "require-dev": { - "phpunit/phpunit": "^11.0" + "phpunit/phpunit": "^11.5" }, "type": "library", "extra": { @@ -2798,7 +2746,7 @@ "support": { "issues": "https://github.com/sebastianbergmann/code-unit/issues", "security": "https://github.com/sebastianbergmann/code-unit/security/policy", - "source": "https://github.com/sebastianbergmann/code-unit/tree/3.0.1" + "source": "https://github.com/sebastianbergmann/code-unit/tree/3.0.2" }, "funding": [ { @@ -2806,7 +2754,7 @@ "type": "github" } ], - "time": "2024-07-03T04:44:28+00:00" + "time": "2024-12-12T09:59:06+00:00" }, { "name": "sebastian/code-unit-reverse-lookup", @@ -2866,16 +2814,16 @@ }, { "name": "sebastian/comparator", - "version": "6.2.1", + "version": "6.3.0", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/comparator.git", - "reference": "43d129d6a0f81c78bee378b46688293eb7ea3739" + "reference": "d4e47a769525c4dd38cea90e5dcd435ddbbc7115" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/comparator/zipball/43d129d6a0f81c78bee378b46688293eb7ea3739", - "reference": "43d129d6a0f81c78bee378b46688293eb7ea3739", + "url": "https://api.github.com/repos/sebastianbergmann/comparator/zipball/d4e47a769525c4dd38cea90e5dcd435ddbbc7115", + "reference": "d4e47a769525c4dd38cea90e5dcd435ddbbc7115", "shasum": "" }, "require": { @@ -2888,6 +2836,9 @@ "require-dev": { "phpunit/phpunit": "^11.4" }, + "suggest": { + "ext-bcmath": "For comparing BcMath\\Number objects" + }, "type": "library", "extra": { "branch-alias": { @@ -2931,7 +2882,7 @@ "support": { "issues": "https://github.com/sebastianbergmann/comparator/issues", "security": "https://github.com/sebastianbergmann/comparator/security/policy", - "source": "https://github.com/sebastianbergmann/comparator/tree/6.2.1" + "source": "https://github.com/sebastianbergmann/comparator/tree/6.3.0" }, "funding": [ { @@ -2939,7 +2890,7 @@ "type": "github" } ], - "time": "2024-10-31T05:30:08+00:00" + "time": "2025-01-06T10:28:19+00:00" }, { "name": "sebastian/complexity", @@ -3132,16 +3083,16 @@ }, { "name": "sebastian/exporter", - "version": "6.1.3", + "version": "6.3.0", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/exporter.git", - "reference": "c414673eee9a8f9d51bbf8d61fc9e3ef1e85b20e" + "reference": "3473f61172093b2da7de1fb5782e1f24cc036dc3" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/exporter/zipball/c414673eee9a8f9d51bbf8d61fc9e3ef1e85b20e", - "reference": "c414673eee9a8f9d51bbf8d61fc9e3ef1e85b20e", + "url": "https://api.github.com/repos/sebastianbergmann/exporter/zipball/3473f61172093b2da7de1fb5782e1f24cc036dc3", + "reference": "3473f61172093b2da7de1fb5782e1f24cc036dc3", "shasum": "" }, "require": { @@ -3150,7 +3101,7 @@ "sebastian/recursion-context": "^6.0" }, "require-dev": { - "phpunit/phpunit": "^11.2" + "phpunit/phpunit": "^11.3" }, "type": "library", "extra": { @@ -3198,7 +3149,7 @@ "support": { "issues": "https://github.com/sebastianbergmann/exporter/issues", "security": "https://github.com/sebastianbergmann/exporter/security/policy", - "source": "https://github.com/sebastianbergmann/exporter/tree/6.1.3" + "source": "https://github.com/sebastianbergmann/exporter/tree/6.3.0" }, "funding": [ { @@ -3206,7 +3157,7 @@ "type": "github" } ], - "time": "2024-07-03T04:56:19+00:00" + "time": "2024-12-05T09:17:50+00:00" }, { "name": "sebastian/global-state", @@ -3619,23 +3570,23 @@ }, { "name": "seld/jsonlint", - "version": "1.10.2", + "version": "1.11.0", "source": { "type": "git", "url": "https://github.com/Seldaek/jsonlint.git", - "reference": "9bb7db07b5d66d90f6ebf542f09fc67d800e5259" + "reference": "1748aaf847fc731cfad7725aec413ee46f0cc3a2" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/Seldaek/jsonlint/zipball/9bb7db07b5d66d90f6ebf542f09fc67d800e5259", - "reference": "9bb7db07b5d66d90f6ebf542f09fc67d800e5259", + "url": "https://api.github.com/repos/Seldaek/jsonlint/zipball/1748aaf847fc731cfad7725aec413ee46f0cc3a2", + "reference": "1748aaf847fc731cfad7725aec413ee46f0cc3a2", "shasum": "" }, "require": { "php": "^5.3 || ^7.0 || ^8.0" }, "require-dev": { - "phpstan/phpstan": "^1.5", + "phpstan/phpstan": "^1.11", "phpunit/phpunit": "^4.8.35 || ^5.7 || ^6.0 || ^8.5.13" }, "bin": [ @@ -3667,7 +3618,7 @@ ], "support": { "issues": "https://github.com/Seldaek/jsonlint/issues", - "source": "https://github.com/Seldaek/jsonlint/tree/1.10.2" + "source": "https://github.com/Seldaek/jsonlint/tree/1.11.0" }, "funding": [ { @@ -3679,7 +3630,153 @@ "type": "tidelift" } ], - "time": "2024-02-07T12:57:50+00:00" + "time": "2024-07-11T14:55:45+00:00" + }, + { + "name": "shish/safe", + "version": "v2.6.3", + "source": { + "type": "git", + "url": "https://github.com/shish/safe.git", + "reference": "88c2cf506c6b497cd2a961c5e8116a18c5c272c0" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/shish/safe/zipball/88c2cf506c6b497cd2a961c5e8116a18c5c272c0", + "reference": "88c2cf506c6b497cd2a961c5e8116a18c5c272c0", + "shasum": "" + }, + "require": { + "php": ">= 8.2" + }, + "replace": { + "thecodingmachine/safe": "2.5.0" + }, + "require-dev": { + "phpstan/phpstan": "^1", + "phpunit/phpunit": "^10.0 || ^11.0", + "squizlabs/php_codesniffer": "^3", + "thecodingmachine/phpstan-strict-rules": "^1.0" + }, + "type": "library", + "autoload": { + "files": [ + "deprecated/apc.php", + "deprecated/array.php", + "deprecated/datetime.php", + "deprecated/libevent.php", + "deprecated/misc.php", + "deprecated/password.php", + "deprecated/mssql.php", + "deprecated/stats.php", + "deprecated/strings.php", + "lib/special_cases.php", + "deprecated/mysqli.php", + "generated/apache.php", + "generated/apcu.php", + "generated/bzip2.php", + "generated/calendar.php", + "generated/classobj.php", + "generated/com.php", + "generated/cubrid.php", + "generated/curl.php", + "generated/datetime.php", + "generated/dir.php", + "generated/eio.php", + "generated/errorfunc.php", + "generated/exec.php", + "generated/fileinfo.php", + "generated/filesystem.php", + "generated/filter.php", + "generated/fpm.php", + "generated/ftp.php", + "generated/funchand.php", + "generated/gettext.php", + "generated/gnupg.php", + "generated/hash.php", + "generated/ibase.php", + "generated/ibmDb2.php", + "generated/iconv.php", + "generated/image.php", + "generated/imap.php", + "generated/info.php", + "generated/inotify.php", + "generated/json.php", + "generated/ldap.php", + "generated/libxml.php", + "generated/lzf.php", + "generated/mailparse.php", + "generated/mbstring.php", + "generated/misc.php", + "generated/mysql.php", + "generated/network.php", + "generated/oci8.php", + "generated/opcache.php", + "generated/openssl.php", + "generated/outcontrol.php", + "generated/pcntl.php", + "generated/pcre.php", + "generated/pgsql.php", + "generated/posix.php", + "generated/ps.php", + "generated/pspell.php", + "generated/readline.php", + "generated/rnp.php", + "generated/rpminfo.php", + "generated/rrd.php", + "generated/sem.php", + "generated/session.php", + "generated/shmop.php", + "generated/sockets.php", + "generated/sodium.php", + "generated/solr.php", + "generated/spl.php", + "generated/sqlsrv.php", + "generated/ssdeep.php", + "generated/ssh2.php", + "generated/stream.php", + "generated/strings.php", + "generated/swoole.php", + "generated/uodbc.php", + "generated/uopz.php", + "generated/url.php", + "generated/var.php", + "generated/xdiff.php", + "generated/xml.php", + "generated/xmlrpc.php", + "generated/yaml.php", + "generated/yaz.php", + "generated/zip.php", + "generated/zlib.php" + ], + "classmap": [ + "lib/DateTime.php", + "lib/DateTimeImmutable.php", + "lib/Exceptions/", + "deprecated/Exceptions/", + "generated/Exceptions/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "description": "PHP core functions that throw exceptions instead of returning FALSE on error (a less-abandoned fork of thecodingmachine/safe)", + "support": { + "issues": "https://github.com/shish/safe/issues", + "source": "https://github.com/shish/safe/tree/v2.6.3" + }, + "funding": [ + { + "url": "https://github.com/shish", + "type": "github" + }, + { + "url": "https://ko-fi.com/shish2k", + "type": "ko_fi" + } + ], + "time": "2024-10-08T20:21:12+00:00" }, { "name": "slevomat/coding-standard", @@ -3826,18 +3923,70 @@ ], "time": "2024-09-18T10:38:58+00:00" }, + { + "name": "staabm/side-effects-detector", + "version": "1.0.5", + "source": { + "type": "git", + "url": "https://github.com/staabm/side-effects-detector.git", + "reference": "d8334211a140ce329c13726d4a715adbddd0a163" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/staabm/side-effects-detector/zipball/d8334211a140ce329c13726d4a715adbddd0a163", + "reference": "d8334211a140ce329c13726d4a715adbddd0a163", + "shasum": "" + }, + "require": { + "ext-tokenizer": "*", + "php": "^7.4 || ^8.0" + }, + "require-dev": { + "phpstan/extension-installer": "^1.4.3", + "phpstan/phpstan": "^1.12.6", + "phpunit/phpunit": "^9.6.21", + "symfony/var-dumper": "^5.4.43", + "tomasvotruba/type-coverage": "1.0.0", + "tomasvotruba/unused-public": "1.0.0" + }, + "type": "library", + "autoload": { + "classmap": [ + "lib/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "description": "A static analysis tool to detect side effects in PHP code", + "keywords": [ + "static analysis" + ], + "support": { + "issues": "https://github.com/staabm/side-effects-detector/issues", + "source": "https://github.com/staabm/side-effects-detector/tree/1.0.5" + }, + "funding": [ + { + "url": "https://github.com/staabm", + "type": "github" + } + ], + "time": "2024-10-20T05:08:20+00:00" + }, { "name": "symfony/console", - "version": "v7.1.6", + "version": "v7.2.1", "source": { "type": "git", "url": "https://github.com/symfony/console.git", - "reference": "bb5192af6edc797cbab5c8e8ecfea2fe5f421e57" + "reference": "fefcc18c0f5d0efe3ab3152f15857298868dc2c3" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/console/zipball/bb5192af6edc797cbab5c8e8ecfea2fe5f421e57", - "reference": "bb5192af6edc797cbab5c8e8ecfea2fe5f421e57", + "url": "https://api.github.com/repos/symfony/console/zipball/fefcc18c0f5d0efe3ab3152f15857298868dc2c3", + "reference": "fefcc18c0f5d0efe3ab3152f15857298868dc2c3", "shasum": "" }, "require": { @@ -3901,7 +4050,7 @@ "terminal" ], "support": { - "source": "https://github.com/symfony/console/tree/v7.1.6" + "source": "https://github.com/symfony/console/tree/v7.2.1" }, "funding": [ { @@ -3917,20 +4066,20 @@ "type": "tidelift" } ], - "time": "2024-10-09T08:46:59+00:00" + "time": "2024-12-11T03:49:26+00:00" }, { "name": "symfony/deprecation-contracts", - "version": "v3.5.0", + "version": "v3.5.1", "source": { "type": "git", "url": "https://github.com/symfony/deprecation-contracts.git", - "reference": "0e0d29ce1f20deffb4ab1b016a7257c4f1e789a1" + "reference": "74c71c939a79f7d5bf3c1ce9f5ea37ba0114c6f6" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/deprecation-contracts/zipball/0e0d29ce1f20deffb4ab1b016a7257c4f1e789a1", - "reference": "0e0d29ce1f20deffb4ab1b016a7257c4f1e789a1", + "url": "https://api.github.com/repos/symfony/deprecation-contracts/zipball/74c71c939a79f7d5bf3c1ce9f5ea37ba0114c6f6", + "reference": "74c71c939a79f7d5bf3c1ce9f5ea37ba0114c6f6", "shasum": "" }, "require": { @@ -3938,12 +4087,12 @@ }, "type": "library", "extra": { + "thanks": { + "url": "https://github.com/symfony/contracts", + "name": "symfony/contracts" + }, "branch-alias": { "dev-main": "3.5-dev" - }, - "thanks": { - "name": "symfony/contracts", - "url": "https://github.com/symfony/contracts" } }, "autoload": { @@ -3968,7 +4117,7 @@ "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" + "source": "https://github.com/symfony/deprecation-contracts/tree/v3.5.1" }, "funding": [ { @@ -3984,20 +4133,20 @@ "type": "tidelift" } ], - "time": "2024-04-18T09:32:20+00:00" + "time": "2024-09-25T14:20:29+00:00" }, { "name": "symfony/filesystem", - "version": "v7.1.6", + "version": "v7.2.0", "source": { "type": "git", "url": "https://github.com/symfony/filesystem.git", - "reference": "c835867b3c62bb05c7fe3d637c871c7ae52024d4" + "reference": "b8dce482de9d7c9fe2891155035a7248ab5c7fdb" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/filesystem/zipball/c835867b3c62bb05c7fe3d637c871c7ae52024d4", - "reference": "c835867b3c62bb05c7fe3d637c871c7ae52024d4", + "url": "https://api.github.com/repos/symfony/filesystem/zipball/b8dce482de9d7c9fe2891155035a7248ab5c7fdb", + "reference": "b8dce482de9d7c9fe2891155035a7248ab5c7fdb", "shasum": "" }, "require": { @@ -4034,7 +4183,7 @@ "description": "Provides basic utilities for the filesystem", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/filesystem/tree/v7.1.6" + "source": "https://github.com/symfony/filesystem/tree/v7.2.0" }, "funding": [ { @@ -4050,20 +4199,20 @@ "type": "tidelift" } ], - "time": "2024-10-25T15:11:02+00:00" + "time": "2024-10-25T15:15:23+00:00" }, { "name": "symfony/finder", - "version": "v7.1.6", + "version": "v7.2.2", "source": { "type": "git", "url": "https://github.com/symfony/finder.git", - "reference": "2cb89664897be33f78c65d3d2845954c8d7a43b8" + "reference": "87a71856f2f56e4100373e92529eed3171695cfb" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/finder/zipball/2cb89664897be33f78c65d3d2845954c8d7a43b8", - "reference": "2cb89664897be33f78c65d3d2845954c8d7a43b8", + "url": "https://api.github.com/repos/symfony/finder/zipball/87a71856f2f56e4100373e92529eed3171695cfb", + "reference": "87a71856f2f56e4100373e92529eed3171695cfb", "shasum": "" }, "require": { @@ -4098,7 +4247,7 @@ "description": "Finds files and directories via an intuitive fluent interface", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/finder/tree/v7.1.6" + "source": "https://github.com/symfony/finder/tree/v7.2.2" }, "funding": [ { @@ -4114,20 +4263,20 @@ "type": "tidelift" } ], - "time": "2024-10-01T08:31:23+00:00" + "time": "2024-12-30T19:00:17+00:00" }, { "name": "symfony/options-resolver", - "version": "v7.1.1", + "version": "v7.2.0", "source": { "type": "git", "url": "https://github.com/symfony/options-resolver.git", - "reference": "47aa818121ed3950acd2b58d1d37d08a94f9bf55" + "reference": "7da8fbac9dcfef75ffc212235d76b2754ce0cf50" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/options-resolver/zipball/47aa818121ed3950acd2b58d1d37d08a94f9bf55", - "reference": "47aa818121ed3950acd2b58d1d37d08a94f9bf55", + "url": "https://api.github.com/repos/symfony/options-resolver/zipball/7da8fbac9dcfef75ffc212235d76b2754ce0cf50", + "reference": "7da8fbac9dcfef75ffc212235d76b2754ce0cf50", "shasum": "" }, "require": { @@ -4165,7 +4314,7 @@ "options" ], "support": { - "source": "https://github.com/symfony/options-resolver/tree/v7.1.1" + "source": "https://github.com/symfony/options-resolver/tree/v7.2.0" }, "funding": [ { @@ -4181,7 +4330,7 @@ "type": "tidelift" } ], - "time": "2024-05-31T14:57:53+00:00" + "time": "2024-11-20T11:17:29+00:00" }, { "name": "symfony/polyfill-ctype", @@ -4209,8 +4358,8 @@ "type": "library", "extra": { "thanks": { - "name": "symfony/polyfill", - "url": "https://github.com/symfony/polyfill" + "url": "https://github.com/symfony/polyfill", + "name": "symfony/polyfill" } }, "autoload": { @@ -4285,8 +4434,8 @@ "type": "library", "extra": { "thanks": { - "name": "symfony/polyfill", - "url": "https://github.com/symfony/polyfill" + "url": "https://github.com/symfony/polyfill", + "name": "symfony/polyfill" } }, "autoload": { @@ -4363,8 +4512,8 @@ "type": "library", "extra": { "thanks": { - "name": "symfony/polyfill", - "url": "https://github.com/symfony/polyfill" + "url": "https://github.com/symfony/polyfill", + "name": "symfony/polyfill" } }, "autoload": { @@ -4447,8 +4596,8 @@ "type": "library", "extra": { "thanks": { - "name": "symfony/polyfill", - "url": "https://github.com/symfony/polyfill" + "url": "https://github.com/symfony/polyfill", + "name": "symfony/polyfill" } }, "autoload": { @@ -4503,16 +4652,16 @@ }, { "name": "symfony/process", - "version": "v7.1.7", + "version": "v7.2.0", "source": { "type": "git", "url": "https://github.com/symfony/process.git", - "reference": "9b8a40b7289767aa7117e957573c2a535efe6585" + "reference": "d34b22ba9390ec19d2dd966c40aa9e8462f27a7e" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/process/zipball/9b8a40b7289767aa7117e957573c2a535efe6585", - "reference": "9b8a40b7289767aa7117e957573c2a535efe6585", + "url": "https://api.github.com/repos/symfony/process/zipball/d34b22ba9390ec19d2dd966c40aa9e8462f27a7e", + "reference": "d34b22ba9390ec19d2dd966c40aa9e8462f27a7e", "shasum": "" }, "require": { @@ -4544,7 +4693,7 @@ "description": "Executes commands in sub-processes", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/process/tree/v7.1.7" + "source": "https://github.com/symfony/process/tree/v7.2.0" }, "funding": [ { @@ -4560,20 +4709,20 @@ "type": "tidelift" } ], - "time": "2024-11-06T09:25:12+00:00" + "time": "2024-11-06T14:24:19+00:00" }, { "name": "symfony/service-contracts", - "version": "v3.5.0", + "version": "v3.5.1", "source": { "type": "git", "url": "https://github.com/symfony/service-contracts.git", - "reference": "bd1d9e59a81d8fa4acdcea3f617c581f7475a80f" + "reference": "e53260aabf78fb3d63f8d79d69ece59f80d5eda0" }, "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/e53260aabf78fb3d63f8d79d69ece59f80d5eda0", + "reference": "e53260aabf78fb3d63f8d79d69ece59f80d5eda0", "shasum": "" }, "require": { @@ -4586,12 +4735,12 @@ }, "type": "library", "extra": { + "thanks": { + "url": "https://github.com/symfony/contracts", + "name": "symfony/contracts" + }, "branch-alias": { "dev-main": "3.5-dev" - }, - "thanks": { - "name": "symfony/contracts", - "url": "https://github.com/symfony/contracts" } }, "autoload": { @@ -4627,7 +4776,7 @@ "standards" ], "support": { - "source": "https://github.com/symfony/service-contracts/tree/v3.5.0" + "source": "https://github.com/symfony/service-contracts/tree/v3.5.1" }, "funding": [ { @@ -4643,20 +4792,20 @@ "type": "tidelift" } ], - "time": "2024-04-18T09:32:20+00:00" + "time": "2024-09-25T14:20:29+00:00" }, { "name": "symfony/string", - "version": "v7.1.6", + "version": "v7.2.0", "source": { "type": "git", "url": "https://github.com/symfony/string.git", - "reference": "61b72d66bf96c360a727ae6232df5ac83c71f626" + "reference": "446e0d146f991dde3e73f45f2c97a9faad773c82" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/string/zipball/61b72d66bf96c360a727ae6232df5ac83c71f626", - "reference": "61b72d66bf96c360a727ae6232df5ac83c71f626", + "url": "https://api.github.com/repos/symfony/string/zipball/446e0d146f991dde3e73f45f2c97a9faad773c82", + "reference": "446e0d146f991dde3e73f45f2c97a9faad773c82", "shasum": "" }, "require": { @@ -4714,7 +4863,7 @@ "utf8" ], "support": { - "source": "https://github.com/symfony/string/tree/v7.1.6" + "source": "https://github.com/symfony/string/tree/v7.2.0" }, "funding": [ { @@ -4730,146 +4879,7 @@ "type": "tidelift" } ], - "time": "2024-09-25T14:20:29+00:00" - }, - { - "name": "thecodingmachine/safe", - "version": "v2.5.0", - "source": { - "type": "git", - "url": "https://github.com/thecodingmachine/safe.git", - "reference": "3115ecd6b4391662b4931daac4eba6b07a2ac1f0" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/thecodingmachine/safe/zipball/3115ecd6b4391662b4931daac4eba6b07a2ac1f0", - "reference": "3115ecd6b4391662b4931daac4eba6b07a2ac1f0", - "shasum": "" - }, - "require": { - "php": "^8.0" - }, - "require-dev": { - "phpstan/phpstan": "^1.5", - "phpunit/phpunit": "^9.5", - "squizlabs/php_codesniffer": "^3.2", - "thecodingmachine/phpstan-strict-rules": "^1.0" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "2.2.x-dev" - } - }, - "autoload": { - "files": [ - "deprecated/apc.php", - "deprecated/array.php", - "deprecated/datetime.php", - "deprecated/libevent.php", - "deprecated/misc.php", - "deprecated/password.php", - "deprecated/mssql.php", - "deprecated/stats.php", - "deprecated/strings.php", - "lib/special_cases.php", - "deprecated/mysqli.php", - "generated/apache.php", - "generated/apcu.php", - "generated/array.php", - "generated/bzip2.php", - "generated/calendar.php", - "generated/classobj.php", - "generated/com.php", - "generated/cubrid.php", - "generated/curl.php", - "generated/datetime.php", - "generated/dir.php", - "generated/eio.php", - "generated/errorfunc.php", - "generated/exec.php", - "generated/fileinfo.php", - "generated/filesystem.php", - "generated/filter.php", - "generated/fpm.php", - "generated/ftp.php", - "generated/funchand.php", - "generated/gettext.php", - "generated/gmp.php", - "generated/gnupg.php", - "generated/hash.php", - "generated/ibase.php", - "generated/ibmDb2.php", - "generated/iconv.php", - "generated/image.php", - "generated/imap.php", - "generated/info.php", - "generated/inotify.php", - "generated/json.php", - "generated/ldap.php", - "generated/libxml.php", - "generated/lzf.php", - "generated/mailparse.php", - "generated/mbstring.php", - "generated/misc.php", - "generated/mysql.php", - "generated/network.php", - "generated/oci8.php", - "generated/opcache.php", - "generated/openssl.php", - "generated/outcontrol.php", - "generated/pcntl.php", - "generated/pcre.php", - "generated/pgsql.php", - "generated/posix.php", - "generated/ps.php", - "generated/pspell.php", - "generated/readline.php", - "generated/rpminfo.php", - "generated/rrd.php", - "generated/sem.php", - "generated/session.php", - "generated/shmop.php", - "generated/sockets.php", - "generated/sodium.php", - "generated/solr.php", - "generated/spl.php", - "generated/sqlsrv.php", - "generated/ssdeep.php", - "generated/ssh2.php", - "generated/stream.php", - "generated/strings.php", - "generated/swoole.php", - "generated/uodbc.php", - "generated/uopz.php", - "generated/url.php", - "generated/var.php", - "generated/xdiff.php", - "generated/xml.php", - "generated/xmlrpc.php", - "generated/yaml.php", - "generated/yaz.php", - "generated/zip.php", - "generated/zlib.php" - ], - "classmap": [ - "lib/DateTime.php", - "lib/DateTimeImmutable.php", - "lib/Exceptions/", - "deprecated/Exceptions/", - "generated/Exceptions/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "description": "PHP core functions that throw exceptions instead of returning FALSE on error", - "support": { - "issues": "https://github.com/thecodingmachine/safe/issues", - "source": "https://github.com/thecodingmachine/safe/tree/v2.5.0" - }, - "time": "2023-04-05T11:54:14+00:00" + "time": "2024-11-13T13:31:26+00:00" }, { "name": "theseer/tokenizer", diff --git a/docs/configuration.md b/docs/configuration.md index 68ea2966..72942496 100644 --- a/docs/configuration.md +++ b/docs/configuration.md @@ -136,7 +136,7 @@ $configuration = Configuration::forSymmetricSigner( InMemory::base64Encoded('mBC5v1sOKVvbdEitdSBenu59nfNfhwkedkJVNabosTw=') ); -$configuration->setBuilderFactory( +$configuration = $configuration->withBuilderFactory( static function (ClaimsFormatter $formatter): Builder { // This assumes `MyCustomBuilder` is an existing class return new MyCustomBuilder(new JoseEncoder(), $formatter); @@ -165,7 +165,7 @@ $configuration = Configuration::forSymmetricSigner( ); // This assumes `MyParser` is an existing class -$configuration->setParser(new MyParser()); +$configuration = $configuration->withParser(new MyParser()); ``` ### Validator @@ -189,7 +189,7 @@ $configuration = Configuration::forSymmetricSigner( ); // This assumes `MyValidator` is an existing class -$configuration->setValidator(new MyValidator()); +$configuration = $configuration->withValidator(new MyValidator()); ``` ### Validation constraints @@ -216,7 +216,7 @@ $configuration = Configuration::forSymmetricSigner( InMemory::base64Encoded('mBC5v1sOKVvbdEitdSBenu59nfNfhwkedkJVNabosTw=') ); -$configuration->setValidationConstraints( +$configuration = $configuration->withValidationConstraints( new SignedWith($configuration->signer(), $configuration->signingKey()), new StrictValidAt(SystemClock::fromUTC()), new IssuedBy('https://api.my-awesome-company.com') diff --git a/docs/extending-the-library.md b/docs/extending-the-library.md index 52c63d5a..1820d77d 100644 --- a/docs/extending-the-library.md +++ b/docs/extending-the-library.md @@ -32,7 +32,7 @@ use Lcobucci\JWT\Configuration; $config = $container->get(Configuration::class); assert($config instanceof Configuration); -$config->setBuilderFactory( +$configuration = $configuration->withBuilderFactory( static function (ClaimsFormatter $formatter): Builder { return new MyCustomTokenBuilder($formatter); } @@ -99,7 +99,7 @@ use Lcobucci\JWT\Configuration; $config = $container->get(Configuration::class); assert($config instanceof Configuration); -$config->setParser(new MyCustomTokenParser()); +$configuration = $configuration->withParser(new MyCustomTokenParser()); ``` ## Signer @@ -157,7 +157,7 @@ use Lcobucci\JWT\Configuration; $config = $container->get(Configuration::class); assert($config instanceof Configuration); -$config->setValidator(new MyCustomTokenValidator()); +$configuration = $configuration->withValidator(new MyCustomTokenValidator()); ``` ## Validation constraints diff --git a/docs/issuing-tokens.md b/docs/issuing-tokens.md index e6700ce4..e13f9b3a 100644 --- a/docs/issuing-tokens.md +++ b/docs/issuing-tokens.md @@ -14,7 +14,7 @@ use Lcobucci\JWT\Token\Builder; require 'vendor/autoload.php'; -$tokenBuilder = (new Builder(new JoseEncoder(), ChainedFormatter::default())); +$tokenBuilder = Builder::new(new JoseEncoder(), ChainedFormatter::default()); $algorithm = new Sha256(); $signingKey = InMemory::plainText(random_bytes(32)); @@ -58,7 +58,7 @@ use Lcobucci\JWT\Token\Builder; require 'vendor/autoload.php'; -$tokenBuilder = (new Builder(new JoseEncoder(), ChainedFormatter::default())); +$tokenBuilder = Builder::new(new JoseEncoder(), ChainedFormatter::default()); $algorithm = new Sha256(); $signingKey = InMemory::plainText(random_bytes(32)); diff --git a/src/Configuration.php b/src/Configuration.php index 488ea3e2..ea05e3b9 100644 --- a/src/Configuration.php +++ b/src/Configuration.php @@ -24,21 +24,29 @@ final class Configuration private Closure $builderFactory; /** @var Constraint[] */ - private array $validationConstraints = []; + private array $validationConstraints; + /** @param Closure(ClaimsFormatter $claimFormatter): Builder|null $builderFactory */ private function __construct( private readonly Signer $signer, private readonly Key $signingKey, private readonly Key $verificationKey, - Encoder $encoder, - Decoder $decoder, + private readonly Encoder $encoder, + private readonly Decoder $decoder, + ?Parser $parser, + ?Validator $validator, + ?Closure $builderFactory, + Constraint ...$validationConstraints, ) { - $this->parser = new Token\Parser($decoder); - $this->validator = new Validation\Validator(); + $this->parser = $parser ?? new Token\Parser($decoder); + $this->validator = $validator ?? new Validation\Validator(); - $this->builderFactory = static function (ClaimsFormatter $claimFormatter) use ($encoder): Builder { - return new Token\Builder($encoder, $claimFormatter); - }; + $this->builderFactory = $builderFactory + ?? static function (ClaimsFormatter $claimFormatter) use ($encoder): Builder { + return Token\Builder::new($encoder, $claimFormatter); + }; + + $this->validationConstraints = $validationConstraints; } public static function forAsymmetricSigner( @@ -54,6 +62,9 @@ public static function forAsymmetricSigner( $verificationKey, $encoder, $decoder, + null, + null, + null, ); } @@ -69,15 +80,38 @@ public static function forSymmetricSigner( $key, $encoder, $decoder, + null, + null, + null, ); } - /** @param callable(ClaimsFormatter): Builder $builderFactory */ + /** + * @deprecated Deprecated since v5.5, please use {@see self::withBuilderFactory()} instead + * + * @param callable(ClaimsFormatter): Builder $builderFactory + */ public function setBuilderFactory(callable $builderFactory): void { $this->builderFactory = $builderFactory(...); } + /** @param callable(ClaimsFormatter): Builder $builderFactory */ + public function withBuilderFactory(callable $builderFactory): self + { + return new self( + $this->signer, + $this->signingKey, + $this->verificationKey, + $this->encoder, + $this->decoder, + $this->parser, + $this->validator, + $builderFactory(...), + ...$this->validationConstraints, + ); + } + public function builder(?ClaimsFormatter $claimFormatter = null): Builder { return ($this->builderFactory)($claimFormatter ?? ChainedFormatter::default()); @@ -88,11 +122,27 @@ public function parser(): Parser return $this->parser; } + /** @deprecated Deprecated since v5.5, please use {@see self::withParser()} instead */ public function setParser(Parser $parser): void { $this->parser = $parser; } + public function withParser(Parser $parser): self + { + return new self( + $this->signer, + $this->signingKey, + $this->verificationKey, + $this->encoder, + $this->decoder, + $parser, + $this->validator, + $this->builderFactory, + ...$this->validationConstraints, + ); + } + public function signer(): Signer { return $this->signer; @@ -113,19 +163,51 @@ public function validator(): Validator return $this->validator; } + /** @deprecated Deprecated since v5.5, please use {@see self::withValidator()} instead */ public function setValidator(Validator $validator): void { $this->validator = $validator; } + public function withValidator(Validator $validator): self + { + return new self( + $this->signer, + $this->signingKey, + $this->verificationKey, + $this->encoder, + $this->decoder, + $this->parser, + $validator, + $this->builderFactory, + ...$this->validationConstraints, + ); + } + /** @return Constraint[] */ public function validationConstraints(): array { return $this->validationConstraints; } + /** @deprecated Deprecated since v5.5, please use {@see self::withValidationConstraints()} instead */ public function setValidationConstraints(Constraint ...$validationConstraints): void { $this->validationConstraints = $validationConstraints; } + + public function withValidationConstraints(Constraint ...$validationConstraints): self + { + return new self( + $this->signer, + $this->signingKey, + $this->verificationKey, + $this->encoder, + $this->decoder, + $this->parser, + $this->validator, + $this->builderFactory, + ...$validationConstraints, + ); + } } diff --git a/src/JwtFacade.php b/src/JwtFacade.php index 90464757..41d0f7c1 100644 --- a/src/JwtFacade.php +++ b/src/JwtFacade.php @@ -38,7 +38,7 @@ public function issue( Key $signingKey, Closure $customiseBuilder, ): UnencryptedToken { - $builder = new Token\Builder(new JoseEncoder(), ChainedFormatter::withUnixTimestampDates()); + $builder = Token\Builder::new(new JoseEncoder(), ChainedFormatter::withUnixTimestampDates()); $now = $this->clock->now(); $builder = $builder diff --git a/src/Token/Builder.php b/src/Token/Builder.php index 355766b7..3ba82b59 100644 --- a/src/Token/Builder.php +++ b/src/Token/Builder.php @@ -25,10 +25,16 @@ final class Builder implements BuilderInterface /** @var array */ private array $claims = []; + /** @deprecated Deprecated since v5.5, please use {@see self::new()} instead */ public function __construct(private readonly Encoder $encoder, private readonly ClaimsFormatter $claimFormatter) { } + public static function new(Encoder $encoder, ClaimsFormatter $claimFormatter): self + { + return new self($encoder, $claimFormatter); + } + /** * @inheritDoc * @pure diff --git a/tests/ConfigurationTest.php b/tests/ConfigurationTest.php index 99a91556..807933db 100644 --- a/tests/ConfigurationTest.php +++ b/tests/ConfigurationTest.php @@ -81,8 +81,8 @@ public function builderShouldCreateABuilderWithDefaultEncoderAndClaimFactory(): $builder = $config->builder(); self::assertInstanceOf(BuilderImpl::class, $builder); - self::assertNotEquals(new BuilderImpl($this->encoder, ChainedFormatter::default()), $builder); - self::assertEquals(new BuilderImpl(new JoseEncoder(), ChainedFormatter::default()), $builder); + self::assertNotEquals(BuilderImpl::new($this->encoder, ChainedFormatter::default()), $builder); + self::assertEquals(BuilderImpl::new(new JoseEncoder(), ChainedFormatter::default()), $builder); } #[PHPUnit\Test] @@ -96,11 +96,11 @@ public function builderShouldCreateABuilderWithCustomizedEncoderAndClaimFactory( $builder = $config->builder(); self::assertInstanceOf(BuilderImpl::class, $builder); - self::assertEquals(new BuilderImpl($this->encoder, ChainedFormatter::default()), $builder); + self::assertEquals(BuilderImpl::new($this->encoder, ChainedFormatter::default()), $builder); } #[PHPUnit\Test] - public function builderShouldUseBuilderFactoryWhenThatIsConfigured(): void + public function builderShouldUseBuilderFactoryWhenThatIsConfiguredWithDeprecatedSet(): void { $builder = $this->createMock(Builder::class); @@ -108,6 +108,7 @@ public function builderShouldUseBuilderFactoryWhenThatIsConfigured(): void new KeyDumpSigner(), InMemory::plainText('private'), ); + /** @phpstan-ignore method.deprecated */ $config->setBuilderFactory( static function () use ($builder): Builder { return $builder; @@ -116,6 +117,24 @@ static function () use ($builder): Builder { self::assertSame($builder, $config->builder()); } + #[PHPUnit\Test] + public function builderShouldUseBuilderFactoryWhenThatIsConfigured(): void + { + $builder = $this->createMock(Builder::class); + + $config = Configuration::forSymmetricSigner( + new KeyDumpSigner(), + InMemory::plainText('private'), + ); + $newConfig = $config->withBuilderFactory( + static function () use ($builder): Builder { + return $builder; + }, + ); + self::assertNotSame($builder, $config->builder()); + self::assertSame($builder, $newConfig->builder()); + } + #[PHPUnit\Test] public function parserShouldReturnAParserWithDefaultDecoder(): void { @@ -142,17 +161,31 @@ public function parserShouldReturnAParserWithCustomizedDecoder(): void } #[PHPUnit\Test] - public function parserShouldNotCreateAnInstanceIfItWasConfigured(): void + public function parserShouldNotCreateAnInstanceIfItWasConfiguredWithDeprecatedSet(): void { $config = Configuration::forSymmetricSigner( new KeyDumpSigner(), InMemory::plainText('private'), ); + /** @phpstan-ignore method.deprecated */ $config->setParser($this->parser); self::assertSame($this->parser, $config->parser()); } + #[PHPUnit\Test] + public function parserShouldNotCreateAnInstanceIfItWasConfigured(): void + { + $config = Configuration::forSymmetricSigner( + new KeyDumpSigner(), + InMemory::plainText('private'), + ); + $newConfig = $config->withParser($this->parser); + + self::assertNotSame($this->parser, $config->parser()); + self::assertSame($this->parser, $newConfig->parser()); + } + #[PHPUnit\Test] public function validatorShouldReturnTheDefaultWhenItWasNotConfigured(): void { @@ -166,17 +199,31 @@ public function validatorShouldReturnTheDefaultWhenItWasNotConfigured(): void } #[PHPUnit\Test] - public function validatorShouldReturnTheConfiguredValidator(): void + public function validatorShouldReturnTheConfiguredValidatorWithDeprecatedSet(): void { $config = Configuration::forSymmetricSigner( new KeyDumpSigner(), InMemory::plainText('private'), ); + /** @phpstan-ignore method.deprecated */ $config->setValidator($this->validator); self::assertSame($this->validator, $config->validator()); } + #[PHPUnit\Test] + public function validatorShouldReturnTheConfiguredValidator(): void + { + $config = Configuration::forSymmetricSigner( + new KeyDumpSigner(), + InMemory::plainText('private'), + ); + $newConfig = $config->withValidator($this->validator); + + self::assertNotSame($this->validator, $config->validator()); + self::assertSame($this->validator, $newConfig->validator()); + } + #[PHPUnit\Test] public function validationConstraintsShouldReturnAnEmptyArrayWhenItWasNotConfigured(): void { @@ -189,17 +236,31 @@ public function validationConstraintsShouldReturnAnEmptyArrayWhenItWasNotConfigu } #[PHPUnit\Test] - public function validationConstraintsShouldReturnTheConfiguredValidator(): void + public function validationConstraintsShouldReturnTheConfiguredValidatorWithDeprecatedSet(): void { $config = Configuration::forSymmetricSigner( new KeyDumpSigner(), InMemory::plainText('private'), ); + /** @phpstan-ignore method.deprecated */ $config->setValidationConstraints($this->validationConstraints); self::assertSame([$this->validationConstraints], $config->validationConstraints()); } + #[PHPUnit\Test] + public function validationConstraintsShouldReturnTheConfiguredValidator(): void + { + $config = Configuration::forSymmetricSigner( + new KeyDumpSigner(), + InMemory::plainText('private'), + ); + $newConfig = $config->withValidationConstraints($this->validationConstraints); + + self::assertNotSame([$this->validationConstraints], $config->validationConstraints()); + self::assertSame([$this->validationConstraints], $newConfig->validationConstraints()); + } + #[PHPUnit\Test] public function customClaimFormatterCanBeUsed(): void { @@ -209,6 +270,6 @@ public function customClaimFormatterCanBeUsed(): void InMemory::plainText('private'), ); - self::assertEquals(new BuilderImpl(new JoseEncoder(), $formatter), $config->builder($formatter)); + self::assertEquals(BuilderImpl::new(new JoseEncoder(), $formatter), $config->builder($formatter)); } } diff --git a/tests/Token/BuilderTest.php b/tests/Token/BuilderTest.php index 9857a7e1..aa41c91e 100644 --- a/tests/Token/BuilderTest.php +++ b/tests/Token/BuilderTest.php @@ -42,7 +42,7 @@ public function initializeDependencies(): void #[PHPUnit\Test] public function withClaimShouldRaiseExceptionWhenTryingToConfigureARegisteredClaim(): void { - $builder = new Builder($this->encoder, new MicrosecondBasedDateConversion()); + $builder = Builder::new($this->encoder, new MicrosecondBasedDateConversion()); $this->expectException(RegisteredClaimGiven::class); $this->expectExceptionMessage( @@ -76,7 +76,7 @@ public function getTokenShouldReturnACompletelyConfigureToken(): void ->with('1.2') ->willReturn('3'); - $builder = new Builder($this->encoder, new MicrosecondBasedDateConversion()); + $builder = Builder::new($this->encoder, new MicrosecondBasedDateConversion()); $token = $builder->identifiedBy('123456') ->issuedBy('https://issuer.com') ->issuedAt($issuedAt) @@ -108,7 +108,7 @@ public function getTokenShouldReturnACompletelyConfigureToken(): void public function immutability(): void { $map = new SplObjectStorage(); - $builder = new Builder($this->encoder, new MicrosecondBasedDateConversion()); + $builder = Builder::new($this->encoder, new MicrosecondBasedDateConversion()); $map[$builder] = true; $builder = $builder->identifiedBy('123456'); $map[$builder] = true;