diff --git a/.github/ISSUE_TEMPLATE/BUG_REPORT.yml b/.github/ISSUE_TEMPLATE/BUG_REPORT.yml index 9f5094331..76a4da7a5 100644 --- a/.github/ISSUE_TEMPLATE/BUG_REPORT.yml +++ b/.github/ISSUE_TEMPLATE/BUG_REPORT.yml @@ -21,6 +21,8 @@ body: description: What version of PHP do you have installed? multiple: true options: + - PHP 7.3 + - PHP 7.4 - PHP 8.0 - PHP 8.1 - PHP 8.2 diff --git a/.github/workflows/codecov.yml b/.github/workflows/codecov.yml index 2ffd12e38..e88b01097 100644 --- a/.github/workflows/codecov.yml +++ b/.github/workflows/codecov.yml @@ -25,8 +25,29 @@ jobs: tools: composer:v2 extensions: mongodb, redis - - name: Install locked dependencies - uses: ramsey/composer-install@v2 + - name: Get composer cache directory + id: composer-cache + run: echo "dir=$(composer config cache-files-dir)" >> $GITHUB_OUTPUT + + - name: Cache dependencies + uses: actions/cache@v3 + with: + path: ${{ steps.composer-cache.outputs.dir }} + key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.lock') }} + restore-keys: ${{ runner.os }}-composer- + + - name: Install dependencies + working-directory: ${{ github.workspace }} + run: | + composerCommand="install" + composerOptions=("--no-interaction" "--no-progress" "--ansi") + # Use `update` if there is no composer.lock file + if [ ! -f "composer.lock" ]; then + composerCommand="update" + fi + fullCommand="composer ${composerCommand} ${composerOptions[*]}" + echo "Running: ${fullCommand}" + ${fullCommand} - name: Run PHPUnit to collect coverage run: composer phpunit:coverage diff --git a/.github/workflows/psalm.yml b/.github/workflows/psalm.yml index 4f649a56c..de691215c 100644 --- a/.github/workflows/psalm.yml +++ b/.github/workflows/psalm.yml @@ -23,12 +23,33 @@ jobs: - name: Set up php uses: shivammathur/setup-php@v2 with: - php-version: 8.1 + php-version: 7.3 coverage: pcov ini-values: assert.exception=1, zend.assertions=1, error_reporting=-1, log_errors_max_len=0, display_errors=On + - name: Get composer cache directory + id: composer-cache + run: echo "dir=$(composer config cache-files-dir)" >> $GITHUB_OUTPUT + + - name: Cache dependencies + uses: actions/cache@v3 + with: + path: ${{ steps.composer-cache.outputs.dir }} + key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.lock') }} + restore-keys: ${{ runner.os }}-composer- + - name: Install dependencies - uses: ramsey/composer-install@v2 + working-directory: ${{ github.workspace }} + run: | + composerCommand="install" + composerOptions=("--no-interaction" "--no-progress" "--ansi") + # Use `update` if there is no composer.lock file + if [ ! -f "composer.lock" ]; then + composerCommand="update" + fi + fullCommand="composer ${composerCommand} ${composerOptions[*]}" + echo "Running: ${fullCommand}" + ${fullCommand} - name: Run Psalm run: composer psalm diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 25a7dee22..44e83f8fd 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -15,11 +15,11 @@ jobs: strategy: matrix: - php: ['7.4', '8.0', '8.1', '8.2', '8.3'] + php: ['7.3', '7.4', '8.0', '8.1', '8.2', '8.3'] dependencies: ['lowest','highest','locked'] dev: ['8.3'] - continue-on-error: ${{ matrix.php == matrix.dev }} + continue-on-error: ${{ matrix.php == matrix.dev || matrix.dependencies == 'lowest' }} steps: - name: Checkout Code @@ -40,10 +40,35 @@ jobs: - name: Setup Problem Matchers run: echo "::add-matcher::${{ runner.tool_cache }}/phpunit.json" - - name: Install ${{ matrix.dependencies }} Dependencies - uses: ramsey/composer-install@v2 + - name: Get composer cache directory + id: composer-cache + run: echo "dir=$(composer config cache-files-dir)" >> $GITHUB_OUTPUT + + - name: Cache dependencies + uses: actions/cache@v3 with: - dependency-versions: ${{ matrix.dependencies }} + path: ${{ steps.composer-cache.outputs.dir }} + key: ${{ runner.os }}-php-${{ matrix.php }}-composer-${{ matrix.dependencies }}-${{ hashFiles('**/composer.lock') }} + restore-keys: ${{ runner.os }}-php-${{ matrix.php }}-composer-${{ matrix.dependencies }}- + + - name: Install ${{ matrix.dependencies }} dependencies + working-directory: ${{ github.workspace }} + run: | + composerDependency="${{ matrix.dependencies }}" + composerCommand="update" + composerOptions=("--no-interaction" "--no-progress" "--ansi") + case ${composerDependency} in + highest) composerCommand="update" ;; + lowest) composerOptions+=("--prefer-lowest" "--prefer-stable") ;; + *) composerCommand="install" ;; + esac + # Use `update` if there is no composer.lock file + if [ ! -f "composer.lock" ]; then + composerCommand="update" + fi + fullCommand="composer ${composerCommand} ${composerOptions[*]}" + echo "Running: ${fullCommand}" + ${fullCommand} - name: Execute PHPUnit run: composer phpunit diff --git a/Makefile b/Makefile index 463120da0..d781635d3 100644 --- a/Makefile +++ b/Makefile @@ -20,7 +20,11 @@ docs/api/index.html: vendor/composer/installed.json $(library_files) phpDocument docker run -it --rm -v $$PWD:/opt/mockery -w /opt/mockery ghcr.io/ghostwriter/php:8.1-pcov php phpDocumentor.phar run -d src -t docs/api .PHONY: test-all -test-all: test-83 test-82 test-81 test-80 test-74 +test-all: test-83 test-82 test-81 test-80 test-74 test-73 + +.PHONY: test-73 +test-73: deps + docker run -it --rm -v $$PWD:/opt/mockery -w /opt/mockery ghcr.io/ghostwriter/php:7.3-pcov php vendor/bin/phpunit .PHONY: test-74 test-74: deps diff --git a/composer.json b/composer.json index 7ef873d08..abdf5a580 100644 --- a/composer.json +++ b/composer.json @@ -44,15 +44,15 @@ "security": "https://github.com/mockery/mockery/security/advisories" }, "require": { - "php": ">=7.4,<8.3", + "php": ">=7.3", "lib-pcre": ">=7.0", "hamcrest/hamcrest-php": "^2.0.1" }, "require-dev": { - "phpunit/phpunit": "^8.5 || ^9.3", + "phpunit/phpunit": "^8.5 || ^9.6.10", "psalm/plugin-phpunit": "^0.18.4", "symplify/easy-coding-standard": "^11.5.0", - "vimeo/psalm": "^5.13.1" + "vimeo/psalm": "^4.30" }, "conflict": { "phpunit/phpunit": "<8.0" @@ -79,7 +79,7 @@ "config": { "optimize-autoloader": true, "platform": { - "php": "7.4.999" + "php": "7.3.999" }, "preferred-install": "dist", "sort-packages": true diff --git a/composer.lock b/composer.lock index 0f03d76f9..10be0e9b9 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": "7bd77f1dc711b159671cf644501c6594", + "content-hash": "c8b16ca187738b4ab915e497ee5ae8a4", "packages": [ { "name": "hamcrest/hamcrest-php", @@ -300,20 +300,20 @@ }, { "name": "composer/pcre", - "version": "3.1.0", + "version": "2.1.0", "source": { "type": "git", "url": "https://github.com/composer/pcre.git", - "reference": "4bff79ddd77851fe3cdd11616ed3f92841ba5bd2" + "reference": "3fdb2807b31a78a40ad89570e30ec77466c98717" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/composer/pcre/zipball/4bff79ddd77851fe3cdd11616ed3f92841ba5bd2", - "reference": "4bff79ddd77851fe3cdd11616ed3f92841ba5bd2", + "url": "https://api.github.com/repos/composer/pcre/zipball/3fdb2807b31a78a40ad89570e30ec77466c98717", + "reference": "3fdb2807b31a78a40ad89570e30ec77466c98717", "shasum": "" }, "require": { - "php": "^7.4 || ^8.0" + "php": "^7.2 || ^8.0" }, "require-dev": { "phpstan/phpstan": "^1.3", @@ -323,7 +323,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-main": "3.x-dev" + "dev-main": "2.x-dev" } }, "autoload": { @@ -351,7 +351,7 @@ ], "support": { "issues": "https://github.com/composer/pcre/issues", - "source": "https://github.com/composer/pcre/tree/3.1.0" + "source": "https://github.com/composer/pcre/tree/2.1.0" }, "funding": [ { @@ -367,7 +367,7 @@ "type": "tidelift" } ], - "time": "2022-11-17T09:50:14+00:00" + "time": "2022-11-16T18:32:04+00:00" }, { "name": "composer/semver", @@ -553,53 +553,6 @@ }, "time": "2019-12-04T15:06:13+00:00" }, - { - "name": "doctrine/deprecations", - "version": "v1.1.1", - "source": { - "type": "git", - "url": "https://github.com/doctrine/deprecations.git", - "reference": "612a3ee5ab0d5dd97b7cf3874a6efe24325efac3" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/doctrine/deprecations/zipball/612a3ee5ab0d5dd97b7cf3874a6efe24325efac3", - "reference": "612a3ee5ab0d5dd97b7cf3874a6efe24325efac3", - "shasum": "" - }, - "require": { - "php": "^7.1 || ^8.0" - }, - "require-dev": { - "doctrine/coding-standard": "^9", - "phpstan/phpstan": "1.4.10 || 1.10.15", - "phpstan/phpstan-phpunit": "^1.0", - "phpunit/phpunit": "^7.5 || ^8.5 || ^9.5", - "psalm/plugin-phpunit": "0.18.4", - "psr/log": "^1 || ^2 || ^3", - "vimeo/psalm": "4.30.0 || 5.12.0" - }, - "suggest": { - "psr/log": "Allows logging deprecations via PSR-3 logger implementation" - }, - "type": "library", - "autoload": { - "psr-4": { - "Doctrine\\Deprecations\\": "lib/Doctrine/Deprecations" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "description": "A small layer on top of trigger_error(E_USER_DEPRECATED) or PSR-3 logging with options to disable all deprecations or selectively for packages.", - "homepage": "https://www.doctrine-project.org/", - "support": { - "issues": "https://github.com/doctrine/deprecations/issues", - "source": "https://github.com/doctrine/deprecations/tree/v1.1.1" - }, - "time": "2023-06-03T09:27:29+00:00" - }, { "name": "doctrine/instantiator", "version": "1.5.0", @@ -771,67 +724,6 @@ }, "time": "2022-03-02T22:36:06+00:00" }, - { - "name": "fidry/cpu-core-counter", - "version": "0.5.1", - "source": { - "type": "git", - "url": "https://github.com/theofidry/cpu-core-counter.git", - "reference": "b58e5a3933e541dc286cc91fc4f3898bbc6f1623" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/theofidry/cpu-core-counter/zipball/b58e5a3933e541dc286cc91fc4f3898bbc6f1623", - "reference": "b58e5a3933e541dc286cc91fc4f3898bbc6f1623", - "shasum": "" - }, - "require": { - "php": "^7.2 || ^8.0" - }, - "require-dev": { - "fidry/makefile": "^0.2.0", - "phpstan/extension-installer": "^1.2.0", - "phpstan/phpstan": "^1.9.2", - "phpstan/phpstan-deprecation-rules": "^1.0.0", - "phpstan/phpstan-phpunit": "^1.2.2", - "phpstan/phpstan-strict-rules": "^1.4.4", - "phpunit/phpunit": "^9.5.26 || ^8.5.31", - "theofidry/php-cs-fixer-config": "^1.0", - "webmozarts/strict-phpunit": "^7.5" - }, - "type": "library", - "autoload": { - "psr-4": { - "Fidry\\CpuCoreCounter\\": "src/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Théo FIDRY", - "email": "theo.fidry@gmail.com" - } - ], - "description": "Tiny utility to get the number of CPU cores.", - "keywords": [ - "CPU", - "core" - ], - "support": { - "issues": "https://github.com/theofidry/cpu-core-counter/issues", - "source": "https://github.com/theofidry/cpu-core-counter/tree/0.5.1" - }, - "funding": [ - { - "url": "https://github.com/theofidry", - "type": "github" - } - ], - "time": "2022-12-24T12:35:10+00:00" - }, { "name": "myclabs/deep-copy", "version": "1.11.1", @@ -998,6 +890,59 @@ }, "time": "2023-06-25T14:52:30+00:00" }, + { + "name": "openlss/lib-array2xml", + "version": "1.0.0", + "source": { + "type": "git", + "url": "https://github.com/nullivex/lib-array2xml.git", + "reference": "a91f18a8dfc69ffabe5f9b068bc39bb202c81d90" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/nullivex/lib-array2xml/zipball/a91f18a8dfc69ffabe5f9b068bc39bb202c81d90", + "reference": "a91f18a8dfc69ffabe5f9b068bc39bb202c81d90", + "shasum": "" + }, + "require": { + "php": ">=5.3.2" + }, + "type": "library", + "autoload": { + "psr-0": { + "LSS": "" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "Apache-2.0" + ], + "authors": [ + { + "name": "Bryan Tong", + "email": "bryan@nullivex.com", + "homepage": "https://www.nullivex.com" + }, + { + "name": "Tony Butler", + "email": "spudz76@gmail.com", + "homepage": "https://www.nullivex.com" + } + ], + "description": "Array2XML conversion library credit to lalit.org", + "homepage": "https://www.nullivex.com", + "keywords": [ + "array", + "array conversion", + "xml", + "xml conversion" + ], + "support": { + "issues": "https://github.com/nullivex/lib-array2xml/issues", + "source": "https://github.com/nullivex/lib-array2xml/tree/master" + }, + "time": "2019-03-29T20:06:56+00:00" + }, { "name": "phar-io/manifest", "version": "2.0.3", @@ -1221,33 +1166,25 @@ }, { "name": "phpdocumentor/type-resolver", - "version": "1.7.2", + "version": "1.6.1", "source": { "type": "git", "url": "https://github.com/phpDocumentor/TypeResolver.git", - "reference": "b2fe4d22a5426f38e014855322200b97b5362c0d" + "reference": "77a32518733312af16a44300404e945338981de3" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/phpDocumentor/TypeResolver/zipball/b2fe4d22a5426f38e014855322200b97b5362c0d", - "reference": "b2fe4d22a5426f38e014855322200b97b5362c0d", + "url": "https://api.github.com/repos/phpDocumentor/TypeResolver/zipball/77a32518733312af16a44300404e945338981de3", + "reference": "77a32518733312af16a44300404e945338981de3", "shasum": "" }, "require": { - "doctrine/deprecations": "^1.0", - "php": "^7.4 || ^8.0", - "phpdocumentor/reflection-common": "^2.0", - "phpstan/phpdoc-parser": "^1.13" + "php": "^7.2 || ^8.0", + "phpdocumentor/reflection-common": "^2.0" }, "require-dev": { "ext-tokenizer": "*", - "phpbench/phpbench": "^1.2", - "phpstan/extension-installer": "^1.1", - "phpstan/phpstan": "^1.8", - "phpstan/phpstan-phpunit": "^1.1", - "phpunit/phpunit": "^9.5", - "rector/rector": "^0.13.9", - "vimeo/psalm": "^4.25" + "psalm/phar": "^4.8" }, "type": "library", "extra": { @@ -1273,56 +1210,9 @@ "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.7.2" + "source": "https://github.com/phpDocumentor/TypeResolver/tree/1.6.1" }, - "time": "2023-05-30T18:13:47+00:00" - }, - { - "name": "phpstan/phpdoc-parser", - "version": "1.23.0", - "source": { - "type": "git", - "url": "https://github.com/phpstan/phpdoc-parser.git", - "reference": "a2b24135c35852b348894320d47b3902a94bc494" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/phpstan/phpdoc-parser/zipball/a2b24135c35852b348894320d47b3902a94bc494", - "reference": "a2b24135c35852b348894320d47b3902a94bc494", - "shasum": "" - }, - "require": { - "php": "^7.2 || ^8.0" - }, - "require-dev": { - "doctrine/annotations": "^2.0", - "nikic/php-parser": "^4.15", - "php-parallel-lint/php-parallel-lint": "^1.2", - "phpstan/extension-installer": "^1.0", - "phpstan/phpstan": "^1.5", - "phpstan/phpstan-phpunit": "^1.1", - "phpstan/phpstan-strict-rules": "^1.0", - "phpunit/phpunit": "^9.5", - "symfony/process": "^5.2" - }, - "type": "library", - "autoload": { - "psr-4": { - "PHPStan\\PhpDocParser\\": [ - "src/" - ] - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "description": "PHPDoc parser with support for nullable, intersection and generic types", - "support": { - "issues": "https://github.com/phpstan/phpdoc-parser/issues", - "source": "https://github.com/phpstan/phpdoc-parser/tree/1.23.0" - }, - "time": "2023-07-23T22:17:56+00:00" + "time": "2022-03-15T21:29:03+00:00" }, { "name": "phpunit/php-code-coverage", @@ -1808,20 +1698,20 @@ }, { "name": "psr/container", - "version": "1.1.2", + "version": "1.1.1", "source": { "type": "git", "url": "https://github.com/php-fig/container.git", - "reference": "513e0666f7216c7459170d56df27dfcefe1689ea" + "reference": "8622567409010282b7aeebe4bb841fe98b58dcaf" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/php-fig/container/zipball/513e0666f7216c7459170d56df27dfcefe1689ea", - "reference": "513e0666f7216c7459170d56df27dfcefe1689ea", + "url": "https://api.github.com/repos/php-fig/container/zipball/8622567409010282b7aeebe4bb841fe98b58dcaf", + "reference": "8622567409010282b7aeebe4bb841fe98b58dcaf", "shasum": "" }, "require": { - "php": ">=7.4.0" + "php": ">=7.2.0" }, "type": "library", "autoload": { @@ -1850,9 +1740,9 @@ ], "support": { "issues": "https://github.com/php-fig/container/issues", - "source": "https://github.com/php-fig/container/tree/1.1.2" + "source": "https://github.com/php-fig/container/tree/1.1.1" }, - "time": "2021-11-05T16:50:12+00:00" + "time": "2021-03-05T17:36:06+00:00" }, { "name": "psr/log", @@ -2868,82 +2758,18 @@ ], "time": "2020-09-28T06:39:44+00:00" }, - { - "name": "spatie/array-to-xml", - "version": "2.17.1", - "source": { - "type": "git", - "url": "https://github.com/spatie/array-to-xml.git", - "reference": "5cbec9c6ab17e320c58a259f0cebe88bde4a7c46" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/spatie/array-to-xml/zipball/5cbec9c6ab17e320c58a259f0cebe88bde4a7c46", - "reference": "5cbec9c6ab17e320c58a259f0cebe88bde4a7c46", - "shasum": "" - }, - "require": { - "ext-dom": "*", - "php": "^7.4|^8.0" - }, - "require-dev": { - "mockery/mockery": "^1.2", - "pestphp/pest": "^1.21", - "phpunit/phpunit": "^9.0", - "spatie/pest-plugin-snapshots": "^1.1" - }, - "type": "library", - "autoload": { - "psr-4": { - "Spatie\\ArrayToXml\\": "src" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Freek Van der Herten", - "email": "freek@spatie.be", - "homepage": "https://freek.dev", - "role": "Developer" - } - ], - "description": "Convert an array to xml", - "homepage": "https://github.com/spatie/array-to-xml", - "keywords": [ - "array", - "convert", - "xml" - ], - "support": { - "source": "https://github.com/spatie/array-to-xml/tree/2.17.1" - }, - "funding": [ - { - "url": "https://spatie.be/open-source/support-us", - "type": "custom" - }, - { - "url": "https://github.com/spatie", - "type": "github" - } - ], - "time": "2022-12-26T08:22:07+00:00" - }, { "name": "symfony/console", - "version": "v5.4.24", + "version": "v5.4.26", "source": { "type": "git", "url": "https://github.com/symfony/console.git", - "reference": "560fc3ed7a43e6d30ea94a07d77f9a60b8ed0fb8" + "reference": "b504a3d266ad2bb632f196c0936ef2af5ff6e273" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/console/zipball/560fc3ed7a43e6d30ea94a07d77f9a60b8ed0fb8", - "reference": "560fc3ed7a43e6d30ea94a07d77f9a60b8ed0fb8", + "url": "https://api.github.com/repos/symfony/console/zipball/b504a3d266ad2bb632f196c0936ef2af5ff6e273", + "reference": "b504a3d266ad2bb632f196c0936ef2af5ff6e273", "shasum": "" }, "require": { @@ -3013,7 +2839,7 @@ "terminal" ], "support": { - "source": "https://github.com/symfony/console/tree/v5.4.24" + "source": "https://github.com/symfony/console/tree/v5.4.26" }, "funding": [ { @@ -3029,7 +2855,7 @@ "type": "tidelift" } ], - "time": "2023-05-26T05:13:16+00:00" + "time": "2023-07-19T20:11:33+00:00" }, { "name": "symfony/deprecation-contracts", @@ -3098,70 +2924,6 @@ ], "time": "2022-01-02T09:53:40+00:00" }, - { - "name": "symfony/filesystem", - "version": "v5.4.25", - "source": { - "type": "git", - "url": "https://github.com/symfony/filesystem.git", - "reference": "0ce3a62c9579a53358d3a7eb6b3dfb79789a6364" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/symfony/filesystem/zipball/0ce3a62c9579a53358d3a7eb6b3dfb79789a6364", - "reference": "0ce3a62c9579a53358d3a7eb6b3dfb79789a6364", - "shasum": "" - }, - "require": { - "php": ">=7.2.5", - "symfony/polyfill-ctype": "~1.8", - "symfony/polyfill-mbstring": "~1.8", - "symfony/polyfill-php80": "^1.16" - }, - "type": "library", - "autoload": { - "psr-4": { - "Symfony\\Component\\Filesystem\\": "" - }, - "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": "Provides basic utilities for the filesystem", - "homepage": "https://symfony.com", - "support": { - "source": "https://github.com/symfony/filesystem/tree/v5.4.25" - }, - "funding": [ - { - "url": "https://symfony.com/sponsor", - "type": "custom" - }, - { - "url": "https://github.com/fabpot", - "type": "github" - }, - { - "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", - "type": "tidelift" - } - ], - "time": "2023-05-31T13:04:02+00:00" - }, { "name": "symfony/polyfill-ctype", "version": "v1.27.0", @@ -3739,16 +3501,16 @@ }, { "name": "symfony/string", - "version": "v5.4.22", + "version": "v5.4.26", "source": { "type": "git", "url": "https://github.com/symfony/string.git", - "reference": "8036a4c76c0dd29e60b6a7cafcacc50cf088ea62" + "reference": "1181fe9270e373537475e826873b5867b863883c" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/string/zipball/8036a4c76c0dd29e60b6a7cafcacc50cf088ea62", - "reference": "8036a4c76c0dd29e60b6a7cafcacc50cf088ea62", + "url": "https://api.github.com/repos/symfony/string/zipball/1181fe9270e373537475e826873b5867b863883c", + "reference": "1181fe9270e373537475e826873b5867b863883c", "shasum": "" }, "require": { @@ -3805,7 +3567,7 @@ "utf8" ], "support": { - "source": "https://github.com/symfony/string/tree/v5.4.22" + "source": "https://github.com/symfony/string/tree/v5.4.26" }, "funding": [ { @@ -3821,7 +3583,7 @@ "type": "tidelift" } ], - "time": "2023-03-14T06:11:53+00:00" + "time": "2023-06-28T12:46:07+00:00" }, { "name": "symplify/easy-coding-standard", @@ -3933,24 +3695,24 @@ }, { "name": "vimeo/psalm", - "version": "5.13.1", + "version": "4.30.0", "source": { "type": "git", "url": "https://github.com/vimeo/psalm.git", - "reference": "086b94371304750d1c673315321a55d15fc59015" + "reference": "d0bc6e25d89f649e4f36a534f330f8bb4643dd69" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/vimeo/psalm/zipball/086b94371304750d1c673315321a55d15fc59015", - "reference": "086b94371304750d1c673315321a55d15fc59015", + "url": "https://api.github.com/repos/vimeo/psalm/zipball/d0bc6e25d89f649e4f36a534f330f8bb4643dd69", + "reference": "d0bc6e25d89f649e4f36a534f330f8bb4643dd69", "shasum": "" }, "require": { "amphp/amp": "^2.4.2", "amphp/byte-stream": "^1.5", - "composer-runtime-api": "^2", + "composer/package-versions-deprecated": "^1.8.0", "composer/semver": "^1.4 || ^2.0 || ^3.0", - "composer/xdebug-handler": "^2.0 || ^3.0", + "composer/xdebug-handler": "^1.1 || ^2.0 || ^3.0", "dnoegel/php-xdg-base-dir": "^0.1.1", "ext-ctype": "*", "ext-dom": "*", @@ -3959,35 +3721,35 @@ "ext-mbstring": "*", "ext-simplexml": "*", "ext-tokenizer": "*", - "felixfbecker/advanced-json-rpc": "^3.1", - "felixfbecker/language-server-protocol": "^1.5.2", - "fidry/cpu-core-counter": "^0.4.1 || ^0.5.1", + "felixfbecker/advanced-json-rpc": "^3.0.3", + "felixfbecker/language-server-protocol": "^1.5", "netresearch/jsonmapper": "^1.0 || ^2.0 || ^3.0 || ^4.0", - "nikic/php-parser": "^4.14", - "php": "^7.4 || ~8.0.0 || ~8.1.0 || ~8.2.0", - "sebastian/diff": "^4.0 || ^5.0", - "spatie/array-to-xml": "^2.17.0 || ^3.0", - "symfony/console": "^4.1.6 || ^5.0 || ^6.0", - "symfony/filesystem": "^5.4 || ^6.0" + "nikic/php-parser": "^4.13", + "openlss/lib-array2xml": "^1.0", + "php": "^7.1|^8", + "sebastian/diff": "^3.0 || ^4.0", + "symfony/console": "^3.4.17 || ^4.1.6 || ^5.0 || ^6.0", + "symfony/polyfill-php80": "^1.25", + "webmozart/path-util": "^2.3" }, "provide": { "psalm/psalm": "self.version" }, "require-dev": { - "amphp/phpunit-util": "^2.0", - "bamarni/composer-bin-plugin": "^1.4", - "brianium/paratest": "^6.9", + "bamarni/composer-bin-plugin": "^1.2", + "brianium/paratest": "^4.0||^6.0", "ext-curl": "*", - "mockery/mockery": "^1.5", - "nunomaduro/mock-final-classes": "^1.1", "php-parallel-lint/php-parallel-lint": "^1.2", - "phpstan/phpdoc-parser": "^1.6", - "phpunit/phpunit": "^9.6", - "psalm/plugin-mockery": "^1.1", - "psalm/plugin-phpunit": "^0.18", - "slevomat/coding-standard": "^8.4", - "squizlabs/php_codesniffer": "^3.6", - "symfony/process": "^4.4 || ^5.0 || ^6.0" + "phpdocumentor/reflection-docblock": "^5", + "phpmyadmin/sql-parser": "5.1.0||dev-master", + "phpspec/prophecy": ">=1.9.0", + "phpstan/phpdoc-parser": "1.2.* || 1.6.4", + "phpunit/phpunit": "^9.0", + "psalm/plugin-phpunit": "^0.16", + "slevomat/coding-standard": "^7.0", + "squizlabs/php_codesniffer": "^3.5", + "symfony/process": "^4.3 || ^5.0 || ^6.0", + "weirdan/prophecy-shim": "^1.0 || ^2.0" }, "suggest": { "ext-curl": "In order to send data to shepherd", @@ -4003,14 +3765,17 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "5.x-dev", - "dev-4.x": "4.x-dev", + "dev-master": "4.x-dev", "dev-3.x": "3.x-dev", "dev-2.x": "2.x-dev", "dev-1.x": "1.x-dev" } }, "autoload": { + "files": [ + "src/functions.php", + "src/spl_object_id.php" + ], "psr-4": { "Psalm\\": "src/Psalm/" } @@ -4028,14 +3793,13 @@ "keywords": [ "code", "inspection", - "php", - "static analysis" + "php" ], "support": { "issues": "https://github.com/vimeo/psalm/issues", - "source": "https://github.com/vimeo/psalm/tree/5.13.1" + "source": "https://github.com/vimeo/psalm/tree/4.30.0" }, - "time": "2023-06-27T16:39:49+00:00" + "time": "2022-11-06T20:37:08+00:00" }, { "name": "webmozart/assert", @@ -4094,6 +3858,57 @@ "source": "https://github.com/webmozarts/assert/tree/1.11.0" }, "time": "2022-06-03T18:03:27+00:00" + }, + { + "name": "webmozart/path-util", + "version": "2.3.0", + "source": { + "type": "git", + "url": "https://github.com/webmozart/path-util.git", + "reference": "d939f7edc24c9a1bb9c0dee5cb05d8e859490725" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/webmozart/path-util/zipball/d939f7edc24c9a1bb9c0dee5cb05d8e859490725", + "reference": "d939f7edc24c9a1bb9c0dee5cb05d8e859490725", + "shasum": "" + }, + "require": { + "php": ">=5.3.3", + "webmozart/assert": "~1.0" + }, + "require-dev": { + "phpunit/phpunit": "^4.6", + "sebastian/version": "^1.0.1" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "2.3-dev" + } + }, + "autoload": { + "psr-4": { + "Webmozart\\PathUtil\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Bernhard Schussek", + "email": "bschussek@gmail.com" + } + ], + "description": "A robust cross-platform utility for normalizing, comparing and modifying file paths.", + "support": { + "issues": "https://github.com/webmozart/path-util/issues", + "source": "https://github.com/webmozart/path-util/tree/2.3.0" + }, + "abandoned": "symfony/filesystem", + "time": "2015-12-17T08:42:14+00:00" } ], "aliases": [], @@ -4102,12 +3917,12 @@ "prefer-stable": false, "prefer-lowest": false, "platform": { - "php": ">=7.4,<8.3", + "php": ">=7.3", "lib-pcre": ">=7.0" }, "platform-dev": [], "platform-overrides": { - "php": "7.4.999" + "php": "7.3.999" }, "plugin-api-version": "2.3.0" } diff --git a/library/Mockery/Generator/DefinedTargetClass.php b/library/Mockery/Generator/DefinedTargetClass.php index 6f5f444ba..39baef931 100644 --- a/library/Mockery/Generator/DefinedTargetClass.php +++ b/library/Mockery/Generator/DefinedTargetClass.php @@ -40,10 +40,17 @@ public function getAttributes() return []; } - return array_unique(['\AllowDynamicProperties', ...array_map( - static fn (ReflectionAttribute $attribute): string => '\\' . $attribute->getName(), - $this->rfc->getAttributes() - )]); + return array_unique( + array_merge( + ['\AllowDynamicProperties'], + array_map( + static function (ReflectionAttribute $attribute): string { + return '\\' . $attribute->getName(); + }, + $this->rfc->getAttributes() + ) + ) + ); } public function getName() diff --git a/library/Mockery/Reflector.php b/library/Mockery/Reflector.php index 0117cbeec..9e545f83b 100644 --- a/library/Mockery/Reflector.php +++ b/library/Mockery/Reflector.php @@ -10,6 +10,8 @@ namespace Mockery; +use ReflectionType; + /** * @internal */ @@ -64,11 +66,11 @@ public static function getReturnType(\ReflectionMethod $method, $withoutNullable { $type = $method->getReturnType(); - if (is_null($type) && method_exists($method, 'getTentativeReturnType')) { - $type = $method->getTentativeReturnType(); + if (!$type instanceof ReflectionType && method_exists($method, 'getTentativeReturnType')) { + $type = $method->getTentativeReturnType(); } - if (is_null($type)) { + if (!$type instanceof ReflectionType) { return null; } @@ -88,11 +90,11 @@ public static function getSimplestReturnType(\ReflectionMethod $method) { $type = $method->getReturnType(); - if (is_null($type) && method_exists($method, 'getTentativeReturnType')) { + if (!$type instanceof ReflectionType && method_exists($method, 'getTentativeReturnType')) { $type = $method->getTentativeReturnType(); } - if (is_null($type) || $type->allowsNull()) { + if (!$type instanceof ReflectionType || $type->allowsNull()) { return null; } @@ -235,7 +237,9 @@ private static function getTypeFromReflectionType(\ReflectionType $type, \Reflec if ($type instanceof \ReflectionIntersectionType) { $types = array_map( - fn (\ReflectionType $type) => self::getTypeFromReflectionType($type, $declaringClass), + static function (\ReflectionType $type) use ($declaringClass): string { + return self::getTypeFromReflectionType($type, $declaringClass); + }, $type->getTypes() ); @@ -247,7 +251,9 @@ private static function getTypeFromReflectionType(\ReflectionType $type, \Reflec if ($type instanceof \ReflectionUnionType) { $types = array_map( - fn (\ReflectionType $type) => self::getTypeFromReflectionType($type, $declaringClass), + static function (\ReflectionType $type) use ($declaringClass): string { + return self::getTypeFromReflectionType($type, $declaringClass); + }, $type->getTypes() ); @@ -259,7 +265,10 @@ private static function getTypeFromReflectionType(\ReflectionType $type, \Reflec return implode( '|', array_map( - fn (string $type): string => strpos($type, '&') === false ? $type : sprintf('(%s)', $type), + static function (string $type): string + { + return strpos($type, '&') === false ? $type : sprintf('(%s)', $type); + }, $types ) ); diff --git a/phpunit.xml.dist b/phpunit.xml.dist index bd4d066bf..d51c34f80 100644 --- a/phpunit.xml.dist +++ b/phpunit.xml.dist @@ -1,11 +1,11 @@ - + - + $expectation $expectation - + \Mockery\Matcher\MustBe new \Mockery\Matcher\MustBe($expected) - + \Mockery::builtInTypes() - + is_null(self::$_config) is_null(self::$_generator) is_null(self::$_loader) - + $newMockName - + $mock - + $argument $method $n $nesting $object - - + + function ($argument) use (&$reference) { function ($method) use ($add) { function ($n) use ($mock) { function ($object, $nesting) { - + $fqn $fqn $fqn $reference $type - + declareClass declareInterface declareType @@ -51,20 +51,21 @@ setGenerator setLoader - + $expectations $fileName $formatter($object, $nesting) $fqn + $fqn $n $nesting $object - + $formattedArguments $k - + $arg $argument $argument[$key] @@ -84,39 +85,37 @@ $value $value - + $formatter($object, $nesting) - - \Mockery\ExpectationInterface + \Mockery\MockInterface|\Mockery\LegacyMockInterface \Mockery\MockInterface|\Mockery\LegacyMockInterface \Mockery\MockInterface|\Mockery\LegacyMockInterface \Mockery\MockInterface|\Mockery\LegacyMockInterface - + mockery_getExpectationsFor shouldIgnoreMissing shouldReceive - - $name]]> + + $object->$name - - $expectations + $expectations - - - - shouldIgnoreMissing()]]> + call_user_func_array(array(self::getContainer(), 'mock'), $args) + call_user_func_array(array(self::getContainer(), 'mock'), $args) + call_user_func_array(array(self::getContainer(), 'mock'), $args) + call_user_func_array(array(self::getContainer(), 'mock'), $args)->shouldIgnoreMissing() - + \Mockery\Mock - + null - + andAnyOtherArgs andAnyOthers any @@ -124,6 +123,7 @@ capture contains ducktype + fetchMock globalHelpers hasKey hasValue @@ -133,6 +133,7 @@ not notAnyOf on + parseShouldReturnArgs pattern resetContainer setContainer @@ -141,31 +142,31 @@ subset type - + \Mockery\MockInterface|\Mockery\LegacyMockInterface - + $parentMock !== null - + Mockery\Container - + require $tmpfname - + $parRefMethod $parRefMethodRetType - + addToAssertionCount - + $mockeryOpen - + addMockeryExpectationsToAssertionCount checkMockeryExceptions closeMockery @@ -173,91 +174,74 @@ purgeMockeryContainer startMockery - + $e - + dismissed - + purgeMockeryContainer startMockery - + mockeryTestSetUp mockeryTestTearDown - + TestListener - + TestListenerDefaultImplementation - + $trait - + endTest startTestSuite - + TestListener - - getFileName()))]]> + + Blacklist::addDirectory(\dirname((new \ReflectionClass(\Mockery::class))->getFileName())) Blacklist::class new BlackList() - + BaseTestRunner::STATUS_PASSED - - + addFailure getTestResultObject - - + endTest startTestSuite - + endTest startTestSuite - + $result !== null - + Blacklist::$blacklistedClassNames - + Blacklist::$blacklistedClassNames - - __toString - - + $exp $expectation $first @@ -265,34 +249,34 @@ $first $first - + \Mockery\Expectation \Mockery\Expectation \Mockery\MockInterface|\Mockery\LegacyMockInterface int self - + getMock getMock getMock getOrderNumber - - getMock()]]> - getOrderNumber()]]> - - getMock(), 'shouldNotReceive'), $args)]]> - getMock(), 'shouldReceive'), $args)]]> + + $first->getMock() + $first->getOrderNumber() + call_user_func_array([$this, 'andReturn'], $args) + call_user_func_array(array($first->getMock(), 'shouldNotReceive'), $args) + call_user_func_array(array($first->getMock(), 'shouldReceive'), $args) - + mock shouldNotReceive shouldReceive - + $class $class $class @@ -301,11 +285,11 @@ $formatterCallback $method - + $_constantsMap $_reflectionCacheEnabled - + allowMockingMethodsUnnecessarily allowMockingNonExistentMethods disableReflectionCache @@ -321,35 +305,31 @@ setInternalClassMethodParamMap setObjectFormatter - + $class $class $class $class $method $method - $parentClass - $parentClass - $parentClass - $parentClass \Hamcrest_Matcher::class - - _internalClassParamMap[strtolower($class)][strtolower($method)]]]> + + $this->_internalClassParamMap[strtolower($class)][strtolower($method)] - - _internalClassParamMap[strtolower($class)][strtolower($method)]]]> + + $this->_internalClassParamMap[strtolower($class)][strtolower($method)] - - _defaultMatchers[$type]]]> - _objectFormatters[$class]]]> - _objectFormatters[$type]]]> + + $this->_defaultMatchers[$type] + $this->_objectFormatters[$class] + $this->_objectFormatters[$type] - - _defaultMatchers[$type]]]> - _objectFormatters[$type]]]> + + $this->_defaultMatchers[$type] + $this->_objectFormatters[$type] - + $classes[] $classes[] $parentClass @@ -357,62 +337,60 @@ $type $type - + array|null - - _internalClassParamMap[strtolower($class)][strtolower($method)]]]> + + $this->_internalClassParamMap[strtolower($class)][strtolower($method)] - + $classes $classes - + allowMockingMethodsUnnecessarily allowMockingNonExistentMethods disableReflectionCache enableReflectionCache getInternalClassMethodParamMap mockingMethodsUnnecessarilyAllowed + reflectionCacheEnabled resetInternalClassMethodParamMaps setConstantsMap setDefaultMatcher setInternalClassMethodParamMap setObjectFormatter - + (bool) $flag (bool) $flag - + \Hamcrest_Matcher - - + + "Mockery\LegacyMockInterface" - + $arg instanceof MockConfigurationBuilder is_object($arg) is_string($arg) - - $mocks[$index] - - + new $internalMockName() - + $mock - + $config $constructorArgs $mockName $reference - + _getInstance checkForNamedMockClashes getGenerator @@ -420,28 +398,28 @@ instanceMock mockery_setGroup - + $arg $blocks $constructorArgs - getClassName()]]> - getClassName()]]> + $def->getClassName() + $def->getClassName() $mock - mockery_thrownExceptions()]]> + $mock->mockery_thrownExceptions() $mockName - getConstantsMap()]]> - getInternalClassMethodParamMaps()]]> + \Mockery::getConfiguration()->getConstantsMap() + \Mockery::getConfiguration()->getInternalClassMethodParamMaps() - + $keys - - _groups[$group]]]> - _mocks[$reference]]]> - _namedMocks[$name]]]> - _namedMocks[$name]]]> + + $this->_groups[$group] + $this->_mocks[$reference] + $this->_namedMocks[$name] + $this->_namedMocks[$name] - + $blocks $config $count @@ -455,12 +433,12 @@ $mock $name - + \Mockery\Mock \Mockery\Mock int - + atLeast byDefault generate @@ -485,137 +463,136 @@ shouldReceive shouldReceive - - mockery_getExpectationCount()]]> + + $mock->mockery_getExpectationCount() $mockName - + $count $mocks[$index] - _mocks[$reference]]]> + $this->_mocks[$reference] - + Mock - + instanceMock mockery_allocateOrder mockery_getCurrentOrder mockery_getGroups mockery_setGroup - + \Mockery\LegacyMockInterface|\Mockery\MockInterface int - - mockingNonExistentMethodsAllowed() && (!class_exists($type, true) && !interface_exists($type, true))]]> - mockingNonExistentMethodsAllowed() && (!class_exists($type, true) && !interface_exists($type, true))]]> + + !\Mockery::getConfiguration()->mockingNonExistentMethodsAllowed() && (!class_exists($type, true) && !interface_exists($type, true)) + count($res) > 0 - - 0]]> + is_array($arg) - - + + is_callable($finalArg) && is_object($finalArg) is_object($finalArg) - + $class - + bool - + setActualCount setExpectedCount setExpectedCountComparative setMethodName - + AtLeast - + bool - + setActualCount setExpectedCount setExpectedCountComparative setMethodName - + AtMost - + null null - + __construct isEligible validate - + bool - + $because - + setActualCount setExpectedCount setExpectedCountComparative setMethodName - - _expectation->getExceptionMessage()]]> + + $this->_expectation->getExceptionMessage() - + Exact - + $dismissed - + dismiss dismissed - + dismiss dismissed - + InvalidArgumentException - + $comp $count $count $name - + $actual $expected $expectedComparative $method $mockObject - + getActualCount getExpectedCount getExpectedCountComparative @@ -628,13 +605,13 @@ setMethodName setMock - + mockery_getName - + $comp - + getActualCount getExpectedCount getExpectedCountComparative @@ -647,18 +624,18 @@ - + $count $count $name - + $actual $expected $method $mockObject - + getActualOrder getExpectedOrder getMethodName @@ -669,10 +646,10 @@ setMethodName setMock - + mockery_getName - + getActualOrder getExpectedOrder getMethodName @@ -683,16 +660,16 @@ - + $count $name - + $actual $method $mockObject - + getActualArguments getMethodName getMock @@ -701,10 +678,10 @@ setMethodName setMock - + mockery_getName - + getActualArguments getMethodName getMockName @@ -713,41 +690,38 @@ - + !is_int($index) is_int($limit) is_null($group) - + $argsOrClosure - + mixed self - + new $exception($message, $code, $previous) - _countValidatorClass($this, $limit)]]> + new $this->_countValidatorClass($this, $limit) - - __toString - - + $args $args - + function (...$args) use ($index) { static function () use ($args) { - + $code $exception $expectedArg $message $return - + andReturnFalse andReturnTrue andThrows @@ -756,23 +730,27 @@ getName isAndAnyOtherArgumentsMatcher - + $code $exception $message $values $values - - _expectedArgs, true)]]> + + array_search($lastExpectedArgument, $this->_expectedArgs, true) - + + $groups[$group] + + $arg $expectedArg $groups $lastExpectedArgument $matcher $newValidators[] + $param $result $result $result @@ -783,20 +761,20 @@ $value $values - + clone $validator - - _closureQueue), $args)]]> - _closureQueue), $args)]]> + + call_user_func_array(array_shift($this->_closureQueue), $args) + call_user_func_array(current($this->_closureQueue), $args) - + bool int self self - + isEligible mockery_allocateOrder mockery_allocateOrder @@ -805,25 +783,26 @@ new $matcher($expected) validate - + $result - - + call_user_func_array([$this, 'andReturn'], $args) + call_user_func_array(array($this, 'andSet'), func_get_args()) - - _expectedArgs, true)]]> + + array_search($lastExpectedArgument, $this->_expectedArgs, true) - + $group $group - + null null null null - + + __construct andReturnArg andReturnFalse andReturnNull @@ -848,42 +827,37 @@ withSomeOfArgs zeroOrMoreTimes - + $_returnValue - + mixed mixed self - - _expectedArgs]]> + + (array) $this->_expectedArgs - + $argsOrClosure instanceof Closure - + mockery_validateOrder - + \Hamcrest_Matcher - + mockery_callSubjectMethod mockery_returnValueForMethod - - $args - $args - $name - - + addExpectation makeExpectationDefault - + $exp $exp $exp @@ -894,7 +868,7 @@ $expectation $last - + isCallCountConstrained isEligible matchArgs @@ -905,84 +879,86 @@ verify verifyCall - + null null null - + + __construct + addExpectation call getExpectationCount verify - + $_expectedOrder - + $expectations - + andReturns getOrderNumber - + $args $method + + __construct + - + $cache - + generate - - cache[$hash]]]> + + $this->cache[$hash] - - cache[$hash]]]> + + $this->cache[$hash] - + $definition - + $name - - __toString - - + $interface $method - + $alias $alias - + $name $rfc - + $interface $method - rfc->getAttributes()]]> - rfc->getInterfaces()]]> - rfc->getMethods()]]> + $this->rfc->getAttributes() + $this->rfc->getInterfaces() + $this->rfc->getMethods() - + $child $child $parent - + getName getNamespaceName getShortName @@ -991,7 +967,7 @@ isAbstract isFinal - + getAttributes getInterfaces getMethods @@ -1005,34 +981,37 @@ isInternal isInternal - - name]]> - rfc->getNamespaceName()]]> - rfc->getShortName()]]> - rfc->implementsInterface($interface)]]> - rfc->inNamespace()]]> - rfc->isAbstract()]]> - rfc->isFinal()]]> + + $this->name + $this->rfc->getNamespaceName() + $this->rfc->getShortName() + $this->rfc->implementsInterface($interface) + $this->rfc->inNamespace() + $this->rfc->isAbstract() + $this->rfc->isFinal() + + ReflectionAttribute + - + generate - + $args $method - + $method $method $method - + $className $instanceMock $interfaces @@ -1044,7 +1023,7 @@ $targetInterface $targetTraitName - + $allMethods $blackListedMethods $constantsMap @@ -1061,7 +1040,7 @@ $targetTraits $whiteListedMethods - + addTarget addTargetInterfaceName addTargetTraitName @@ -1089,12 +1068,13 @@ setTargetClassName setTargetObject - + $alias - getMethods()]]> + $class->getMethods() $className - getName()]]> - getName()]]> + $className + $method->getName() + $method->getName() $methods $methods $methods @@ -1106,56 +1086,54 @@ $targetInterface $targetInterface $targetTrait - blackListedMethods]]> - constantsMap]]> - getBlackListedMethods()]]> - getBlackListedMethods()]]> - getBlackListedMethods()]]> - getName()]]> - getName()]]> - getTargetObject()]]> - getWhiteListedMethods()]]> - getWhiteListedMethods()]]> - getWhiteListedMethods()]]> - parameterOverrides]]> - targetClassName]]> - targetClassName]]> - targetInterfaceNames]]> - targetInterfaces]]> - targetTraitNames]]> - targetTraits]]> - whiteListedMethods]]> + $this->blackListedMethods + $this->constantsMap + $this->getBlackListedMethods() + $this->getBlackListedMethods() + $this->getName() + $this->getName() + $this->getTargetObject() + $this->getWhiteListedMethods() + $this->getWhiteListedMethods() + $this->parameterOverrides + $this->targetClassName + $this->targetClassName + $this->targetInterfaceNames + $this->targetInterfaces + $this->targetTraitNames + $this->targetTraits + $this->whiteListedMethods - + $interface $interface $interface $interface - + $methods[$key] $params[1] $params[1] $target[0] - getBlackListedMethods()]]> - getWhiteListedMethods()]]> + $this->getBlackListedMethods() + $this->getWhiteListedMethods() - + $classes[] $names[] - targetInterfaceNames[]]]> - targetInterfaces[]]]> - targetInterfaces[]]]> - targetInterfaces[]]]> - targetInterfaces[]]]> - targetInterfaces[]]]> - targetTraitNames[]]]> - targetTraits[]]]> + $this->targetInterfaceNames[] + $this->targetInterfaces[] + $this->targetInterfaces[] + $this->targetInterfaces[] + $this->targetInterfaces[] + $this->targetInterfaces[] + $this->targetTraitNames[] + $this->targetTraits[] - + $methods[$key] - + $alias $class $className @@ -1178,7 +1156,7 @@ $targets[] $trait - + addPart build getMethods @@ -1202,15 +1180,15 @@ isArray isFinal - + $target - + getParameterOverrides - + $blackListedMethod $instanceMock $mockDestructor @@ -1219,7 +1197,7 @@ $targets $whiteListedMethod - + $blackListedMethods $constantsMap $instanceMock @@ -1230,7 +1208,7 @@ $targets $whiteListedMethods - + addBlackListedMethod addBlackListedMethods addTarget @@ -1246,310 +1224,303 @@ setParameterOverrides setWhiteListedMethods - - blackListedMethods]]> - blackListedMethods]]> - constantsMap]]> - parameterOverrides]]> - php7SemiReservedKeywords]]> - targets]]> - whiteListedMethods]]> + + $this->blackListedMethods + $this->blackListedMethods + $this->constantsMap + $this->parameterOverrides + $this->php7SemiReservedKeywords + $this->targets + $this->whiteListedMethods - - blackListedMethods[]]]> - targets[]]]> - whiteListedMethods[]]]> + + $this->blackListedMethods[] + $this->targets[] + $this->whiteListedMethods[] - + $method $method $target - + addWhiteListedMethods setBlackListedMethods setWhiteListedMethods - + $code - + $code $config - + getClassName getCode getConfig - + getName - + getConfig - + $part - + $mockCounter $parts - + addPart build - + $part - + $parts - - parts[]]]> + + $this->parts[] - + $part static::$mockCounter - + static::$mockCounter - + \class_exists($typeHint) ? DefinedTargetClass::factory($typeHint, false) : null - + \ReflectionClass|null - + $method - + $typeHint - + getClass getTypeHintAsString isArray - + $method - + function ($method) { - + $code - + apply - + $code - getMethodsToMock()]]> + $config->getMethodsToMock() - + getName - + $code - + apply - + $code $code - + $code - + apply - + $code - + $class - + getAttributes - + $code - + apply - + $code $namespace - + $className $namespace - + $className - + $code - + apply - + $code - getName()]]> + $target->getName() - + $target - + getName isFinal - + $code - + apply - + $code $code $constant - - getName()]]]> + + $cm[$config->getName()] - - getName()]]]> - getName()]]]> + + $cm[$config->getName()] + $cm[$config->getName()] - + $cm $cm $constant $value - + $i - + $class $code $code - + appendToClass apply - + $class $class - + $code - + $code - + $lastBrace - + apply - + $code - + apply - + $code - getName()]]> - getName()]]> + $i->getName() + $i->getName() - + $i - + getName getName - + $code - + $code + + + string + + $code $code $code - - $code - - - string - - + + renderTypeHint - - getTargetClass()]]> + + $config->getTargetClass() $interface $method - getName()]]> - getName()]]> - getName()]]> + $method->getName() + $method->getName() + $method->getName() - + $interface $method $name - - getName()]]> + + $method->getName() $name - renderTypeHint($parameter)]]> + $this->renderTypeHint($parameter) - - $param - - - getName - isPassedByReference - - + $class $code $code @@ -1557,7 +1528,7 @@ $config $method - + appendToClass apply renderMethodBody @@ -1565,34 +1536,30 @@ renderReturnType renderTypeHint - + $class $class - getName()]]> - getName()]]> - getName()]]> + $class->getName() + $class->getName() + $class->getName() $method - getParameters()]]> - getName()]]]> - getName())][$method->getName()]]]> - __toString()]]> - - + $method->getParameters() + $overrides[$class_name][$method->getName()] + $overrides[strtolower($class->getName())][$method->getName()] $param - - + $param->__toString() + + $overrides[$class_name] - getName()]]]> - getName())]]]> - getName())][$method->getName()]]]> + $overrides[strtolower($class->getName())] - - getName()]]]> - getName()]]]> - getName())][$method->getName()]]]> - getName())][$method->getName()]]]> + + $overrides[$class_name][$method->getName()] + $overrides[$class_name][$method->getName()] + $overrides[strtolower($class->getName())][$method->getName()] + $overrides[strtolower($class->getName())][$method->getName()] - + $class $class $code @@ -1600,9 +1567,11 @@ $method $overrides $overrides + $param + $param $paramDef - + getDeclaringClass getName getName @@ -1610,190 +1579,175 @@ getName getName getName + getName getParameterOverrides getParameterOverrides getParameters getReturnType isInternal + isPassedByReference isProtected isPublic isStatic isStatic returnsReference - + $code - getName()]]> + $method->getName() $paramDef - renderMethodBody($method, $config)]]> - renderParams($method, $config)]]> - renderReturnType($method)]]> + $this->renderMethodBody($method, $config) + $this->renderParams($method, $config) + $this->renderReturnType($method) - + $lastBrace - - - + + enum_exists($prefix) + - + $code - + apply - + apply - + $code - + $methods - + apply - + $code - methods[$method->getName()]]]> + $this->methods[$method->getName()] - - methods[$method->getName()]]]> + + $this->methods[$method->getName()] - - methods[$method->getName()]]]> - methods[$method->getName()]]]> + + $this->methods[$method->getName()] + $this->methods[$method->getName()] - + $method $target - + getMethods getName getName isFinal - + apply - + $code - + apply - + $code - + $target - + apply - + $class $code $code - + appendToClass apply - + $class $class - + $code $target - + hasInternalAncestor implementsInterface - + $code - + $lastBrace - + apply - + $trait - + $code - + apply - + $code - getName()]]> + $trait->getName() $traits - + $traits - + getName - + addPass generate - + $namedConfig - + $className $code $namedConfig $pass - + apply - + addPass - - new static([ - new CallTypeHintPass(), - new MagicMethodTypeHintsPass(), - new ClassPass(), - new TraitPass(), - new ClassNamePass(), - new InstanceMockPass(), - new InterfacePass(), - new AvoidMethodClashPass(), - new MethodDefinitionPass(), - new RemoveUnserializeForInternalSerializableClassesPass(), - new RemoveBuiltinMethodsThatAreFinalPass(), - new RemoveDestructorPass(), - new ConstantsPass(), - new ClassAttributesPass(), - ]) - + - + getAttributes getShortName hasInternalAncestor @@ -1803,100 +1757,86 @@ - - __toString - - + $name - + $name - + getName - - name]]> - name]]> + + $this->name - + $args $method $method - + $method - + $expectation - + \Mockery\Expectation - + withArgs - - withArgs($args)]]> - mock->{$this->method}($method, $args)]]> + + $expectation->withArgs($args) + $this->mock->{$this->method}($method, $args) - - getName(), - $file, - $line - ); - - $error = new UnexpectedValueException($msg, 0, new \Exception($message, $code)); - }]]> - - + + function () use ($serializedString) { - + $className - + instantiate - + $className - + $instance - + hasInternalAncestors - + $error - + $method $method $method - + mockery_setCurrentOrder mockery_setGroup shouldAllowMockingMethod - + @var array $args @var string $method @var string $method @var string $method - + byDefault + makePartial mockery_allocateOrder mockery_findExpectation mockery_getCurrentOrder @@ -1904,6 +1844,8 @@ mockery_getGroups mockery_getMockableProperties mockery_init + mockery_setCurrentOrder + mockery_setExpectationsFor mockery_setGroup mockery_teardown mockery_verify @@ -1911,511 +1853,251 @@ shouldAllowMockingProtectedMethods shouldDeferMissing shouldHaveBeenCalled + shouldHaveReceived + shouldIgnoreMissing shouldNotHaveBeenCalled + shouldNotHaveReceived shouldNotReceive - - \Mockery\ExpectationDirector|null - static - - + null|array|Closure null|array|Closure - + load - - getClassName()]]> + + $definition->getClassName() - - getCode()]]> + + $definition->getCode() - + load - + load - + $path - + $path - + load - - getClassName()]]> - getCode()]]> + + $definition->getClassName() + $definition->getCode() $path - - path]]> + + $this->path - + require $tmpfname - + RequireLoader - - - __toString - - - - - __toString - - - - - __toString - - - - __toString - - - _expected]]> + + $this->_expected - - __toString - - + $closure $result - + $closure($actual) - - __toString - - + $actual - + $exp $v + $val - - __toString - - + $method - _expected]]> + $this->_expected - + $method - - __toString - - + $actual - _expected]]> + $this->_expected - - __toString - - + $actual - - __toString - - + IsEqual - - __toString - - + IsSame - - - __toString - - - - __toString - - + $closure - + call_user_func_array($closure, $actual) - - - __toString - - - - __toString - - + $actual - - - __toString - - - - __toString - - + $exp - - __toString - - - _expected]]> + + $this->_expected - - __toString - - + $strict - + $v - + loose strict - + new static($expected, false) new static($expected, true) - - __toString - - - _expected]]> - _expected]]> + + $this->_expected + $this->_expected - + bool - + $function($actual) - + function_exists($function) - + $args $method - + $args $method - + getArgs getMethod - + + __construct getArgs getMethod - - - __toString - - - $method - - - function ($method) { - function () { yield; } - - - $method - $method - $method - $method - $method - $method - $method - $method - $name - $name - - - $_mockery_allowMockingProtectedMethods - $_mockery_instanceMock - $_mockery_receivedMethodCalls - - - _mockery_constructorCalled - _mockery_findExpectedMethodHandler - _mockery_getReceivedMethodCalls - _mockery_handleMethodCall - _mockery_handleStaticMethodCall - asUndefined - hasMethodOverloadingInParentClass - mockery_getExpectations - mockery_getMethod - mockery_isInstance - mockery_setCurrentOrder - mockery_setGroup - - - _mockery_expectations[$method]]]> - _mockery_expectations[$method]]]> - _mockery_expectations[$method]]]> - _mockery_expectations[$method]]]> - _mockery_groups[$group]]]> - - - $allowMockingProtectedMethods - $count - $director - $director - $director - $director - $exp - $expectation - $exps - $handler - $method - $method - $method - $method - $prototype - $returnValue - $rm - $rm - $rm - - - \Mockery\ExpectationDirector|null - \Mockery\ExpectationInterface|\Mockery\Expectation|ExpectsHigherOrderMessage - \Mockery\ExpectationInterface|\Mockery\Expectation|\Mockery\HigherOrderMessage - \Mockery\Expectation|null - int - - - byDefault - call - findExpectation - getExpectationCount - getExpectations - getName - getName - getName - getName - getPrototype - isAbstract - isAbstract - isPrivate - isProtected - isProtected - isProtected - isPublic - isPublic - never - push - setActualOrder - setExpectedOrder - setMethodName - verify - - - $count - $method - $method - $method - $method - $method - $method - $method - - - $count - findExpectation($args)]]> - $expectation - __call('__toString', array())]]> - _mockery_expectations[$method]]]> - shouldReceive($something)->once()]]> - - - _mockery_mockableMethods]]> - string[] - - - $methodNames - $methodNames - - - @var array $args - @var string $method - @var string $method - @var string $method - - - null - null - null - - - __callStatic - _mockery_constructorCalled - asUndefined - mockery_callSubjectMethod - mockery_getExpectations - mockery_thrownExceptions - - - $_mockery_name - - - \Mockery\ExpectationDirector|null - - - getName() !== 'Stringable']]> - - - _mockery_partial)]]> - _mockery_partial)]]> - - - shouldIgnoreMissing - shouldIgnoreMissing - - - once - - - andReturn - once - - - + allows expects - + $methodCalls - + push verify - - getArgs()]]> - getArgs()]]> + + $methodCall->getArgs() + $methodCall->getArgs() - - methodCalls[]]]> + + $this->methodCalls[] - + $methodCall - + getArgs getArgs getMethod - + push - - $typeHint - - - $typeHint + + $type + $type - - $typeHint, - 'isPrimitive' => in_array($typeHint, ['array', 'bool', 'int', 'float', 'null', 'object', 'string']), - ], - ]]]> - ]]> - - + + list<array{typeHint: string, isPrimitive: bool}> + string + + $declaringClass - - - - - - getName - isBuiltin - - - $param - $param - + + getSimplestReturnType + + + \ReflectionIntersectionType + \ReflectionUnionType + + + $declaringClass + - - __toString - - + __call - - $args - $method - - + $args $args $args @@ -2426,7 +2108,7 @@ $method $minimum - + atLeast atMost between @@ -2441,7 +2123,7 @@ withArgs withNoArgs - + atLeast atMost between @@ -2455,17 +2137,17 @@ - + clearCountValidators - + $args $args $args - + andAnyOtherArgs andAnyOthers anyArgs diff --git a/psalm.xml.dist b/psalm.xml.dist index e18fc1fc2..30a7a87d2 100644 --- a/psalm.xml.dist +++ b/psalm.xml.dist @@ -4,7 +4,7 @@ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="https://getpsalm.org/schema/config" xsi:schemaLocation="https://getpsalm.org/schema/config vendor/vimeo/psalm/config.xsd" - phpVersion="8.2" + phpVersion="7.3" findUnusedBaselineEntry="true" findUnusedCode="true" errorBaseline="psalm-baseline.xml" @@ -12,22 +12,11 @@ + - - - - - - - - - - - - diff --git a/tests/Mockery/Matcher/SubsetTest.php b/tests/Mockery/Matcher/SubsetTest.php index a1ba48f30..52316ab95 100644 --- a/tests/Mockery/Matcher/SubsetTest.php +++ b/tests/Mockery/Matcher/SubsetTest.php @@ -22,9 +22,11 @@ use Mockery\Adapter\Phpunit\MockeryTestCase; use Mockery\Matcher\Subset; +use test\Mockery\RegExpCompatability; class SubsetTest extends MockeryTestCase { + use RegExpCompatability; /** @test */ public function it_matches_a_shallow_subset() { @@ -115,7 +117,7 @@ public function it_correctly_formats_nested_arrays_into_a_string() ]; foreach ($tests as $pattern) { - $this->assertMatchesRegularExpression($pattern, $actual); + self::assertMatchesRegEx($pattern, $actual); } } }