diff --git a/.github/workflows/continuous-integration.yml b/.github/workflows/continuous-integration.yml index 4acf1f584..26a92fdb3 100644 --- a/.github/workflows/continuous-integration.yml +++ b/.github/workflows/continuous-integration.yml @@ -22,12 +22,6 @@ jobs: strategy: matrix: php-version: - - "5.3" - - "5.4" - - "5.5" - - "5.6" - - "7.0" - - "7.1" - "7.2" - "7.3" - "7.4" @@ -37,30 +31,34 @@ jobs: os: [ubuntu-latest] experimental: [false] include: - - php-version: "5.3" + - php-version: "7.2" dependencies: highest os: ubuntu-latest experimental: false - - php-version: "5.3" + - php-version: "7.2" dependencies: lowest os: ubuntu-latest experimental: false - - php-version: "8.0" + - php-version: "8.1" + dependencies: highest + os: ubuntu-latest + experimental: false + - php-version: "8.1" os: windows-latest dependencies: locked experimental: false - - php-version: "8.0" + - php-version: "8.1" os: macos-latest dependencies: locked experimental: false - - php-version: "8.1" - dependencies: lowest + - php-version: "8.2" + dependencies: lowest-ignore os: ubuntu-latest - experimental: false - - php-version: "8.1" - dependencies: highest + experimental: true + - php-version: "8.2" + dependencies: highest-ignore os: ubuntu-latest - experimental: false + experimental: true steps: - name: "Checkout" @@ -99,24 +97,6 @@ jobs: if: "matrix.dependencies == 'locked'" run: "composer install ${{ env.COMPOSER_FLAGS }}" - - name: "Require latest PHPUnitBridge for PHP 8.x" - if: "startsWith(matrix.php-version, '8.')" - # using ~ here to avoid issues with windows CLI removing the ^ - run: 'composer require --no-update --dev "symfony/phpunit-bridge:~5.2"' - - # temporary fix until phpunit-bridge has a release supporting 8.1 - - name: "Require latest dev PHPUnitBridge for PHP 8.1" - if: "matrix.experimental" - # using ~ here to avoid issues with windows CLI removing the ^ - run: 'composer require --no-update --dev "symfony/phpunit-bridge:~5.4@dev"' - - - name: "Set ignored deprecations for php 8.1+ on lowest or locked deps" - if: "matrix.php-version >= '8.1' && !contains(matrix.dependencies, 'highest')" - run: "echo \"SYMFONY_DEPRECATIONS_HELPER=baselineFile=./tests/deprecations-8.1.json&max[direct]=0\" >> $GITHUB_ENV" - - - name: "Update dev requirements to latest available for the current PHP even on locked builds as they are not bundled dependencies" - run: "composer config platform --unset && composer update ${{ env.COMPOSER_FLAGS }} symfony/phpunit-bridge phpspec/prophecy phpdocumentor/* sebastian/* doctrine/instantiator" - - name: "Run install again using composer binary from source" run: "bin/composer install ${{ env.COMPOSER_FLAGS }}" diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml index be342746d..fe7625848 100644 --- a/.github/workflows/lint.yml +++ b/.github/workflows/lint.yml @@ -17,7 +17,7 @@ jobs: strategy: matrix: php-version: - - "5.3" + - "7.2" - "latest" steps: diff --git a/.github/workflows/phpstan.yml b/.github/workflows/phpstan.yml index 40877dc5a..7f0cfd529 100644 --- a/.github/workflows/phpstan.yml +++ b/.github/workflows/phpstan.yml @@ -17,11 +17,16 @@ jobs: name: "PHPStan" runs-on: ubuntu-latest + continue-on-error: ${{ matrix.experimental }} strategy: matrix: - php-version: - - "7.4" + include: + - php-version: "7.2" + experimental: false + - php-version: "8.1" + experimental: true + fail-fast: false steps: - name: "Checkout" @@ -46,12 +51,16 @@ jobs: key: "php-${{ matrix.php-version }}-symfony-php-unit-version-${{ env.SYMFONY_PHPUNIT_VERSION }}-${{ hashFiles('**/composer.lock') }}" restore-keys: "php-${{ matrix.php-version }}-symfony-php-unit-version-${{ env.SYMFONY_PHPUNIT_VERSION }}" - - name: "Install highest dependencies from composer.json using composer binary provided by system" + - name: "Install highest dependencies" + if: "matrix.experimental == true" run: "composer config platform --unset && composer update ${{ env.COMPOSER_FLAGS }}" - - name: "Install PHPStan" - # Locked to phpunit 7.5 here as newer ones have void return types which break inheritance - run: "bin/composer require --dev phpstan/phpstan:^1.0 phpstan/phpstan-phpunit:^1.0 phpstan/phpstan-deprecation-rules:^1 phpstan/phpstan-strict-rules:^1 phpunit/phpunit:^7.5.20 --with-all-dependencies ${{ env.COMPOSER_FLAGS }}" + - name: "Install locked dependencies" + if: "matrix.experimental == false" + run: "composer config platform --unset && composer update ${{ env.COMPOSER_FLAGS }}" + + - name: "Initialize PHPUnit sources" + run: "vendor/bin/simple-phpunit --filter NO_TEST_JUST_AUTOLOAD_THANKS" - name: "Run PHPStan" - run: "vendor/bin/phpstan analyse --configuration=phpstan/config.neon" + run: "composer phpstan" diff --git a/composer.json b/composer.json index b772f9546..92bbfdc8c 100644 --- a/composer.json +++ b/composer.json @@ -22,7 +22,7 @@ } ], "require": { - "php": "^5.3.2 || ^7.0 || ^8.0", + "php": "^7.2.5 || ^8.0", "composer/ca-bundle": "^1.0", "composer/metadata-minifier": "^1.0", "composer/semver": "^3.0", @@ -31,17 +31,20 @@ "justinrainbow/json-schema": "^5.2.11", "psr/log": "^1.0 || ^2.0", "seld/jsonlint": "^1.4", - "seld/phar-utils": "^1.0", - "symfony/console": "^2.8.52 || ^3.4.35 || ^4.4 || ^5.0", - "symfony/filesystem": "^2.8.52 || ^3.4.35 || ^4.4 || ^5.0 || ^6.0", - "symfony/finder": "^2.8.52 || ^3.4.35 || ^4.4 || ^5.0 || ^6.0", - "symfony/process": "^2.8.52 || ^3.4.35 || ^4.4 || ^5.0 || ^6.0", - "react/promise": "^1.2 || ^2.7", + "seld/phar-utils": "^1.2", + "symfony/console": "^5.4.1 || ^6.0", + "symfony/filesystem": "^5.4 || ^6.0", + "symfony/finder": "^5.4 || ^6.0", + "symfony/process": "^5.4 || ^6.0", + "react/promise": "^2.8", "composer/pcre": "^1.0" }, "require-dev": { - "symfony/phpunit-bridge": "^4.2 || ^5.0 || ^6.0", - "phpspec/prophecy": "^1.10" + "symfony/phpunit-bridge": "^6.0", + "phpstan/phpstan": "^1.0", + "phpstan/phpstan-phpunit": "^1.0", + "phpstan/phpstan-deprecation-rules": "^1", + "phpstan/phpstan-strict-rules": "^1" }, "suggest": { "ext-openssl": "Enabling the openssl extension allows you to access https URLs for repositories and packages", @@ -50,13 +53,13 @@ }, "config": { "platform": { - "php": "5.3.9" + "php": "7.2.5" }, "platform-check": false }, "extra": { "branch-alias": { - "dev-main": "2.2-dev" + "dev-main": "2.3-dev" } }, "autoload": { @@ -80,18 +83,11 @@ "scripts": { "compile": "@php -dphar.readonly=0 bin/compile", "test": "@php simple-phpunit", - "phpstan-setup": [ - "@composer config platform --unset", - "@composer update", - "@composer require --dev phpstan/phpstan:^1.0 phpstan/phpstan-phpunit:^1.0 phpstan/phpstan-deprecation-rules:^1 phpstan/phpstan-strict-rules:^1 phpunit/phpunit:^7.5.20 --with-all-dependencies", - "git checkout composer.json composer.lock" - ], "phpstan": "@php vendor/bin/phpstan analyse --configuration=phpstan/config.neon" }, "scripts-descriptions": { "compile": "Compile composer.phar", "test": "Run all tests", - "phpstan-setup": "Prepare environment to run PHPStan locally (must be run with PHP7.4)", "phpstan": "Runs PHPStan (after phpstan-setup was executed, must be run with PHP7.4)" }, "support": { diff --git a/composer.lock b/composer.lock index f0d3b0d95..e9f67c58f 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": "659a81a68363780c2e9fb35a1116808c", + "content-hash": "982b74a5ea81168a1ef177278da9cb88", "packages": [ { "name": "composer/ca-bundle", @@ -519,6 +519,54 @@ }, "time": "2021-07-22T09:24:00+00:00" }, + { + "name": "psr/container", + "version": "1.1.1", + "source": { + "type": "git", + "url": "https://github.com/php-fig/container.git", + "reference": "8622567409010282b7aeebe4bb841fe98b58dcaf" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/php-fig/container/zipball/8622567409010282b7aeebe4bb841fe98b58dcaf", + "reference": "8622567409010282b7aeebe4bb841fe98b58dcaf", + "shasum": "" + }, + "require": { + "php": ">=7.2.0" + }, + "type": "library", + "autoload": { + "psr-4": { + "Psr\\Container\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "PHP-FIG", + "homepage": "https://www.php-fig.org/" + } + ], + "description": "Common Container Interface (PHP FIG PSR-11)", + "homepage": "https://github.com/php-fig/container", + "keywords": [ + "PSR-11", + "container", + "container-interface", + "container-interop", + "psr" + ], + "support": { + "issues": "https://github.com/php-fig/container/issues", + "source": "https://github.com/php-fig/container/tree/1.1.1" + }, + "time": "2021-03-05T17:36:06+00:00" + }, { "name": "psr/log", "version": "1.1.4", @@ -571,33 +619,31 @@ }, { "name": "react/promise", - "version": "v1.2.1", + "version": "v2.8.0", "source": { "type": "git", "url": "https://github.com/reactphp/promise.git", - "reference": "eefff597e67ff66b719f8171480add3c91474a1e" + "reference": "f3cff96a19736714524ca0dd1d4130de73dbbbc4" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/reactphp/promise/zipball/eefff597e67ff66b719f8171480add3c91474a1e", - "reference": "eefff597e67ff66b719f8171480add3c91474a1e", + "url": "https://api.github.com/repos/reactphp/promise/zipball/f3cff96a19736714524ca0dd1d4130de73dbbbc4", + "reference": "f3cff96a19736714524ca0dd1d4130de73dbbbc4", "shasum": "" }, "require": { - "php": ">=5.3.3" + "php": ">=5.4.0" + }, + "require-dev": { + "phpunit/phpunit": "^7.0 || ^6.5 || ^5.7 || ^4.8.36" }, "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.1-dev" - } - }, "autoload": { - "psr-0": { - "React\\Promise": "src/" + "psr-4": { + "React\\Promise\\": "src/" }, "files": [ - "src/React/Promise/functions_include.php" + "src/functions_include.php" ] }, "notification-url": "https://packagist.org/downloads/", @@ -611,11 +657,15 @@ } ], "description": "A lightweight implementation of CommonJS Promises/A for PHP", + "keywords": [ + "promise", + "promises" + ], "support": { "issues": "https://github.com/reactphp/promise/issues", - "source": "https://github.com/reactphp/promise/tree/1.0" + "source": "https://github.com/reactphp/promise/tree/v2.8.0" }, - "time": "2016-03-07T13:46:50+00:00" + "time": "2020-05-12T15:16:56+00:00" }, { "name": "seld/jsonlint", @@ -682,16 +732,16 @@ }, { "name": "seld/phar-utils", - "version": "1.1.2", + "version": "1.2.0", "source": { "type": "git", "url": "https://github.com/Seldaek/phar-utils.git", - "reference": "749042a2315705d2dfbbc59234dd9ceb22bf3ff0" + "reference": "9f3452c93ff423469c0d56450431562ca423dcee" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/Seldaek/phar-utils/zipball/749042a2315705d2dfbbc59234dd9ceb22bf3ff0", - "reference": "749042a2315705d2dfbbc59234dd9ceb22bf3ff0", + "url": "https://api.github.com/repos/Seldaek/phar-utils/zipball/9f3452c93ff423469c0d56450431562ca423dcee", + "reference": "9f3452c93ff423469c0d56450431562ca423dcee", "shasum": "" }, "require": { @@ -724,45 +774,60 @@ ], "support": { "issues": "https://github.com/Seldaek/phar-utils/issues", - "source": "https://github.com/Seldaek/phar-utils/tree/1.1.2" + "source": "https://github.com/Seldaek/phar-utils/tree/1.2.0" }, - "time": "2021-08-19T21:01:38+00:00" + "time": "2021-12-10T11:20:11+00:00" }, { "name": "symfony/console", - "version": "v2.8.52", + "version": "v5.4.1", "source": { "type": "git", "url": "https://github.com/symfony/console.git", - "reference": "cbcf4b5e233af15cd2bbd50dee1ccc9b7927dc12" + "reference": "9130e1a0fc93cb0faadca4ee917171bd2ca9e5f4" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/console/zipball/cbcf4b5e233af15cd2bbd50dee1ccc9b7927dc12", - "reference": "cbcf4b5e233af15cd2bbd50dee1ccc9b7927dc12", + "url": "https://api.github.com/repos/symfony/console/zipball/9130e1a0fc93cb0faadca4ee917171bd2ca9e5f4", + "reference": "9130e1a0fc93cb0faadca4ee917171bd2ca9e5f4", "shasum": "" }, "require": { - "php": ">=5.3.9", - "symfony/debug": "^2.7.2|~3.0.0", - "symfony/polyfill-mbstring": "~1.0" + "php": ">=7.2.5", + "symfony/deprecation-contracts": "^2.1|^3", + "symfony/polyfill-mbstring": "~1.0", + "symfony/polyfill-php73": "^1.9", + "symfony/polyfill-php80": "^1.16", + "symfony/service-contracts": "^1.1|^2|^3", + "symfony/string": "^5.1|^6.0" + }, + "conflict": { + "psr/log": ">=3", + "symfony/dependency-injection": "<4.4", + "symfony/dotenv": "<5.1", + "symfony/event-dispatcher": "<4.4", + "symfony/lock": "<4.4", + "symfony/process": "<4.4" + }, + "provide": { + "psr/log-implementation": "1.0|2.0" }, "require-dev": { - "psr/log": "~1.0", - "symfony/event-dispatcher": "~2.1|~3.0.0", - "symfony/process": "~2.1|~3.0.0" + "psr/log": "^1|^2", + "symfony/config": "^4.4|^5.0|^6.0", + "symfony/dependency-injection": "^4.4|^5.0|^6.0", + "symfony/event-dispatcher": "^4.4|^5.0|^6.0", + "symfony/lock": "^4.4|^5.0|^6.0", + "symfony/process": "^4.4|^5.0|^6.0", + "symfony/var-dumper": "^4.4|^5.0|^6.0" }, "suggest": { - "psr/log-implementation": "For using the console logger", + "psr/log": "For using the console logger", "symfony/event-dispatcher": "", + "symfony/lock": "", "symfony/process": "" }, "type": "library", - "extra": { - "branch-alias": { - "dev-master": "2.8-dev" - } - }, "autoload": { "psr-4": { "Symfony\\Component\\Console\\": "" @@ -785,50 +850,63 @@ "homepage": "https://symfony.com/contributors" } ], - "description": "Symfony Console Component", + "description": "Eases the creation of beautiful and testable command line interfaces", "homepage": "https://symfony.com", + "keywords": [ + "cli", + "command line", + "console", + "terminal" + ], "support": { - "source": "https://github.com/symfony/console/tree/v2.8.52" + "source": "https://github.com/symfony/console/tree/v5.4.1" }, - "time": "2018-11-20T15:55:20+00:00" + "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": "2021-12-09T11:22:43+00:00" }, { - "name": "symfony/debug", - "version": "v2.8.52", + "name": "symfony/deprecation-contracts", + "version": "v2.5.0", "source": { "type": "git", - "url": "https://github.com/symfony/debug.git", - "reference": "74251c8d50dd3be7c4ce0c7b862497cdc641a5d0" + "url": "https://github.com/symfony/deprecation-contracts.git", + "reference": "6f981ee24cf69ee7ce9736146d1c57c2780598a8" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/debug/zipball/74251c8d50dd3be7c4ce0c7b862497cdc641a5d0", - "reference": "74251c8d50dd3be7c4ce0c7b862497cdc641a5d0", + "url": "https://api.github.com/repos/symfony/deprecation-contracts/zipball/6f981ee24cf69ee7ce9736146d1c57c2780598a8", + "reference": "6f981ee24cf69ee7ce9736146d1c57c2780598a8", "shasum": "" }, "require": { - "php": ">=5.3.9", - "psr/log": "~1.0" - }, - "conflict": { - "symfony/http-kernel": ">=2.3,<2.3.24|~2.4.0|>=2.5,<2.5.9|>=2.6,<2.6.2" - }, - "require-dev": { - "symfony/class-loader": "~2.2|~3.0.0", - "symfony/http-kernel": "~2.3.24|~2.5.9|^2.6.2|~3.0.0" + "php": ">=7.1" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "2.8-dev" + "dev-main": "2.5-dev" + }, + "thanks": { + "name": "symfony/contracts", + "url": "https://github.com/symfony/contracts" } }, "autoload": { - "psr-4": { - "Symfony\\Component\\Debug\\": "" - }, - "exclude-from-classmap": [ - "/Tests/" + "files": [ + "function.php" ] }, "notification-url": "https://packagist.org/downloads/", @@ -837,45 +915,56 @@ ], "authors": [ { - "name": "Fabien Potencier", - "email": "fabien@symfony.com" + "name": "Nicolas Grekas", + "email": "p@tchwork.com" }, { "name": "Symfony Community", "homepage": "https://symfony.com/contributors" } ], - "description": "Symfony Debug Component", + "description": "A generic function and convention to trigger deprecation notices", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/debug/tree/v2.8.50" + "source": "https://github.com/symfony/deprecation-contracts/tree/v2.5.0" }, - "time": "2018-11-11T11:18:13+00:00" + "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": "2021-07-12T14:48:14+00:00" }, { "name": "symfony/filesystem", - "version": "v2.8.52", + "version": "v5.4.0", "source": { "type": "git", "url": "https://github.com/symfony/filesystem.git", - "reference": "7ae46872dad09dffb7fe1e93a0937097339d0080" + "reference": "731f917dc31edcffec2c6a777f3698c33bea8f01" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/filesystem/zipball/7ae46872dad09dffb7fe1e93a0937097339d0080", - "reference": "7ae46872dad09dffb7fe1e93a0937097339d0080", + "url": "https://api.github.com/repos/symfony/filesystem/zipball/731f917dc31edcffec2c6a777f3698c33bea8f01", + "reference": "731f917dc31edcffec2c6a777f3698c33bea8f01", "shasum": "" }, "require": { - "php": ">=5.3.9", - "symfony/polyfill-ctype": "~1.8" + "php": ">=7.2.5", + "symfony/polyfill-ctype": "~1.8", + "symfony/polyfill-mbstring": "~1.8", + "symfony/polyfill-php80": "^1.16" }, "type": "library", - "extra": { - "branch-alias": { - "dev-master": "2.8-dev" - } - }, "autoload": { "psr-4": { "Symfony\\Component\\Filesystem\\": "" @@ -898,36 +987,47 @@ "homepage": "https://symfony.com/contributors" } ], - "description": "Symfony Filesystem Component", + "description": "Provides basic utilities for the filesystem", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/filesystem/tree/v2.8.52" + "source": "https://github.com/symfony/filesystem/tree/v5.4.0" }, - "time": "2018-11-11T11:18:13+00:00" + "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": "2021-10-28T13:39:27+00:00" }, { "name": "symfony/finder", - "version": "v2.8.52", + "version": "v5.4.0", "source": { "type": "git", "url": "https://github.com/symfony/finder.git", - "reference": "1444eac52273e345d9b95129bf914639305a9ba4" + "reference": "d2f29dac98e96a98be467627bd49c2efb1bc2590" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/finder/zipball/1444eac52273e345d9b95129bf914639305a9ba4", - "reference": "1444eac52273e345d9b95129bf914639305a9ba4", + "url": "https://api.github.com/repos/symfony/finder/zipball/d2f29dac98e96a98be467627bd49c2efb1bc2590", + "reference": "d2f29dac98e96a98be467627bd49c2efb1bc2590", "shasum": "" }, "require": { - "php": ">=5.3.9" + "php": ">=7.2.5", + "symfony/deprecation-contracts": "^2.1|^3", + "symfony/polyfill-php80": "^1.16" }, "type": "library", - "extra": { - "branch-alias": { - "dev-master": "2.8-dev" - } - }, "autoload": { "psr-4": { "Symfony\\Component\\Finder\\": "" @@ -950,29 +1050,43 @@ "homepage": "https://symfony.com/contributors" } ], - "description": "Symfony Finder Component", + "description": "Finds files and directories via an intuitive fluent interface", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/finder/tree/v2.8.50" + "source": "https://github.com/symfony/finder/tree/v5.4.0" }, - "time": "2018-11-11T11:18:13+00:00" + "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": "2021-11-28T15:25:38+00:00" }, { "name": "symfony/polyfill-ctype", - "version": "v1.19.0", + "version": "v1.23.0", "source": { "type": "git", "url": "https://github.com/symfony/polyfill-ctype.git", - "reference": "aed596913b70fae57be53d86faa2e9ef85a2297b" + "reference": "46cd95797e9df938fdd2b03693b5fca5e64b01ce" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-ctype/zipball/aed596913b70fae57be53d86faa2e9ef85a2297b", - "reference": "aed596913b70fae57be53d86faa2e9ef85a2297b", + "url": "https://api.github.com/repos/symfony/polyfill-ctype/zipball/46cd95797e9df938fdd2b03693b5fca5e64b01ce", + "reference": "46cd95797e9df938fdd2b03693b5fca5e64b01ce", "shasum": "" }, "require": { - "php": ">=5.3.3" + "php": ">=7.1" }, "suggest": { "ext-ctype": "For best performance" @@ -980,7 +1094,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-main": "1.19-dev" + "dev-main": "1.23-dev" }, "thanks": { "name": "symfony/polyfill", @@ -1018,7 +1132,7 @@ "portable" ], "support": { - "source": "https://github.com/symfony/polyfill-ctype/tree/v1.19.0" + "source": "https://github.com/symfony/polyfill-ctype/tree/v1.23.0" }, "funding": [ { @@ -1034,24 +1148,189 @@ "type": "tidelift" } ], - "time": "2020-10-23T09:01:57+00:00" + "time": "2021-02-19T12:13:01+00:00" }, { - "name": "symfony/polyfill-mbstring", - "version": "v1.19.0", + "name": "symfony/polyfill-intl-grapheme", + "version": "v1.23.1", "source": { "type": "git", - "url": "https://github.com/symfony/polyfill-mbstring.git", - "reference": "b5f7b932ee6fa802fc792eabd77c4c88084517ce" + "url": "https://github.com/symfony/polyfill-intl-grapheme.git", + "reference": "16880ba9c5ebe3642d1995ab866db29270b36535" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-mbstring/zipball/b5f7b932ee6fa802fc792eabd77c4c88084517ce", - "reference": "b5f7b932ee6fa802fc792eabd77c4c88084517ce", + "url": "https://api.github.com/repos/symfony/polyfill-intl-grapheme/zipball/16880ba9c5ebe3642d1995ab866db29270b36535", + "reference": "16880ba9c5ebe3642d1995ab866db29270b36535", "shasum": "" }, "require": { - "php": ">=5.3.3" + "php": ">=7.1" + }, + "suggest": { + "ext-intl": "For best performance" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-main": "1.23-dev" + }, + "thanks": { + "name": "symfony/polyfill", + "url": "https://github.com/symfony/polyfill" + } + }, + "autoload": { + "psr-4": { + "Symfony\\Polyfill\\Intl\\Grapheme\\": "" + }, + "files": [ + "bootstrap.php" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Nicolas Grekas", + "email": "p@tchwork.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Symfony polyfill for intl's grapheme_* functions", + "homepage": "https://symfony.com", + "keywords": [ + "compatibility", + "grapheme", + "intl", + "polyfill", + "portable", + "shim" + ], + "support": { + "source": "https://github.com/symfony/polyfill-intl-grapheme/tree/v1.23.1" + }, + "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": "2021-05-27T12:26:48+00:00" + }, + { + "name": "symfony/polyfill-intl-normalizer", + "version": "v1.23.0", + "source": { + "type": "git", + "url": "https://github.com/symfony/polyfill-intl-normalizer.git", + "reference": "8590a5f561694770bdcd3f9b5c69dde6945028e8" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/polyfill-intl-normalizer/zipball/8590a5f561694770bdcd3f9b5c69dde6945028e8", + "reference": "8590a5f561694770bdcd3f9b5c69dde6945028e8", + "shasum": "" + }, + "require": { + "php": ">=7.1" + }, + "suggest": { + "ext-intl": "For best performance" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-main": "1.23-dev" + }, + "thanks": { + "name": "symfony/polyfill", + "url": "https://github.com/symfony/polyfill" + } + }, + "autoload": { + "psr-4": { + "Symfony\\Polyfill\\Intl\\Normalizer\\": "" + }, + "files": [ + "bootstrap.php" + ], + "classmap": [ + "Resources/stubs" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Nicolas Grekas", + "email": "p@tchwork.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Symfony polyfill for intl's Normalizer class and related functions", + "homepage": "https://symfony.com", + "keywords": [ + "compatibility", + "intl", + "normalizer", + "polyfill", + "portable", + "shim" + ], + "support": { + "source": "https://github.com/symfony/polyfill-intl-normalizer/tree/v1.23.0" + }, + "funding": [ + { + "url": "https://symfony.com/sponsor", + "type": "custom" + }, + { + "url": "https://github.com/fabpot", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "type": "tidelift" + } + ], + "time": "2021-02-19T12:13:01+00:00" + }, + { + "name": "symfony/polyfill-mbstring", + "version": "v1.23.1", + "source": { + "type": "git", + "url": "https://github.com/symfony/polyfill-mbstring.git", + "reference": "9174a3d80210dca8daa7f31fec659150bbeabfc6" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/polyfill-mbstring/zipball/9174a3d80210dca8daa7f31fec659150bbeabfc6", + "reference": "9174a3d80210dca8daa7f31fec659150bbeabfc6", + "shasum": "" + }, + "require": { + "php": ">=7.1" }, "suggest": { "ext-mbstring": "For best performance" @@ -1059,7 +1338,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-main": "1.19-dev" + "dev-main": "1.23-dev" }, "thanks": { "name": "symfony/polyfill", @@ -1098,7 +1377,7 @@ "shim" ], "support": { - "source": "https://github.com/symfony/polyfill-mbstring/tree/v1.19.0" + "source": "https://github.com/symfony/polyfill-mbstring/tree/v1.23.1" }, "funding": [ { @@ -1114,31 +1393,189 @@ "type": "tidelift" } ], - "time": "2020-10-23T09:01:57+00:00" + "time": "2021-05-27T12:26:48+00:00" }, { - "name": "symfony/process", - "version": "v2.8.52", + "name": "symfony/polyfill-php73", + "version": "v1.23.0", "source": { "type": "git", - "url": "https://github.com/symfony/process.git", - "reference": "c3591a09c78639822b0b290d44edb69bf9f05dc8" + "url": "https://github.com/symfony/polyfill-php73.git", + "reference": "fba8933c384d6476ab14fb7b8526e5287ca7e010" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/process/zipball/c3591a09c78639822b0b290d44edb69bf9f05dc8", - "reference": "c3591a09c78639822b0b290d44edb69bf9f05dc8", + "url": "https://api.github.com/repos/symfony/polyfill-php73/zipball/fba8933c384d6476ab14fb7b8526e5287ca7e010", + "reference": "fba8933c384d6476ab14fb7b8526e5287ca7e010", "shasum": "" }, "require": { - "php": ">=5.3.9" + "php": ">=7.1" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "2.8-dev" + "dev-main": "1.23-dev" + }, + "thanks": { + "name": "symfony/polyfill", + "url": "https://github.com/symfony/polyfill" } }, + "autoload": { + "psr-4": { + "Symfony\\Polyfill\\Php73\\": "" + }, + "files": [ + "bootstrap.php" + ], + "classmap": [ + "Resources/stubs" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Nicolas Grekas", + "email": "p@tchwork.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Symfony polyfill backporting some PHP 7.3+ features to lower PHP versions", + "homepage": "https://symfony.com", + "keywords": [ + "compatibility", + "polyfill", + "portable", + "shim" + ], + "support": { + "source": "https://github.com/symfony/polyfill-php73/tree/v1.23.0" + }, + "funding": [ + { + "url": "https://symfony.com/sponsor", + "type": "custom" + }, + { + "url": "https://github.com/fabpot", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "type": "tidelift" + } + ], + "time": "2021-02-19T12:13:01+00:00" + }, + { + "name": "symfony/polyfill-php80", + "version": "v1.23.1", + "source": { + "type": "git", + "url": "https://github.com/symfony/polyfill-php80.git", + "reference": "1100343ed1a92e3a38f9ae122fc0eb21602547be" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/polyfill-php80/zipball/1100343ed1a92e3a38f9ae122fc0eb21602547be", + "reference": "1100343ed1a92e3a38f9ae122fc0eb21602547be", + "shasum": "" + }, + "require": { + "php": ">=7.1" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-main": "1.23-dev" + }, + "thanks": { + "name": "symfony/polyfill", + "url": "https://github.com/symfony/polyfill" + } + }, + "autoload": { + "psr-4": { + "Symfony\\Polyfill\\Php80\\": "" + }, + "files": [ + "bootstrap.php" + ], + "classmap": [ + "Resources/stubs" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Ion Bazan", + "email": "ion.bazan@gmail.com" + }, + { + "name": "Nicolas Grekas", + "email": "p@tchwork.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Symfony polyfill backporting some PHP 8.0+ features to lower PHP versions", + "homepage": "https://symfony.com", + "keywords": [ + "compatibility", + "polyfill", + "portable", + "shim" + ], + "support": { + "source": "https://github.com/symfony/polyfill-php80/tree/v1.23.1" + }, + "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": "2021-07-28T13:41:28+00:00" + }, + { + "name": "symfony/process", + "version": "v5.4.0", + "source": { + "type": "git", + "url": "https://github.com/symfony/process.git", + "reference": "5be20b3830f726e019162b26223110c8f47cf274" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/process/zipball/5be20b3830f726e019162b26223110c8f47cf274", + "reference": "5be20b3830f726e019162b26223110c8f47cf274", + "shasum": "" + }, + "require": { + "php": ">=7.2.5", + "symfony/polyfill-php80": "^1.16" + }, + "type": "library", "autoload": { "psr-4": { "Symfony\\Component\\Process\\": "" @@ -1161,476 +1598,450 @@ "homepage": "https://symfony.com/contributors" } ], - "description": "Symfony Process Component", + "description": "Executes commands in sub-processes", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/process/tree/v2.8.50" + "source": "https://github.com/symfony/process/tree/v5.4.0" }, - "time": "2018-11-11T11:18:13+00:00" + "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": "2021-11-28T15:25:38+00:00" + }, + { + "name": "symfony/service-contracts", + "version": "v2.5.0", + "source": { + "type": "git", + "url": "https://github.com/symfony/service-contracts.git", + "reference": "1ab11b933cd6bc5464b08e81e2c5b07dec58b0fc" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/service-contracts/zipball/1ab11b933cd6bc5464b08e81e2c5b07dec58b0fc", + "reference": "1ab11b933cd6bc5464b08e81e2c5b07dec58b0fc", + "shasum": "" + }, + "require": { + "php": ">=7.2.5", + "psr/container": "^1.1", + "symfony/deprecation-contracts": "^2.1" + }, + "conflict": { + "ext-psr": "<1.1|>=2" + }, + "suggest": { + "symfony/service-implementation": "" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-main": "2.5-dev" + }, + "thanks": { + "name": "symfony/contracts", + "url": "https://github.com/symfony/contracts" + } + }, + "autoload": { + "psr-4": { + "Symfony\\Contracts\\Service\\": "" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Nicolas Grekas", + "email": "p@tchwork.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Generic abstractions related to writing services", + "homepage": "https://symfony.com", + "keywords": [ + "abstractions", + "contracts", + "decoupling", + "interfaces", + "interoperability", + "standards" + ], + "support": { + "source": "https://github.com/symfony/service-contracts/tree/v2.5.0" + }, + "funding": [ + { + "url": "https://symfony.com/sponsor", + "type": "custom" + }, + { + "url": "https://github.com/fabpot", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "type": "tidelift" + } + ], + "time": "2021-11-04T16:48:04+00:00" + }, + { + "name": "symfony/string", + "version": "v5.4.0", + "source": { + "type": "git", + "url": "https://github.com/symfony/string.git", + "reference": "9ffaaba53c61ba75a3c7a3a779051d1e9ec4fd2d" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/string/zipball/9ffaaba53c61ba75a3c7a3a779051d1e9ec4fd2d", + "reference": "9ffaaba53c61ba75a3c7a3a779051d1e9ec4fd2d", + "shasum": "" + }, + "require": { + "php": ">=7.2.5", + "symfony/polyfill-ctype": "~1.8", + "symfony/polyfill-intl-grapheme": "~1.0", + "symfony/polyfill-intl-normalizer": "~1.0", + "symfony/polyfill-mbstring": "~1.0", + "symfony/polyfill-php80": "~1.15" + }, + "conflict": { + "symfony/translation-contracts": ">=3.0" + }, + "require-dev": { + "symfony/error-handler": "^4.4|^5.0|^6.0", + "symfony/http-client": "^4.4|^5.0|^6.0", + "symfony/translation-contracts": "^1.1|^2", + "symfony/var-exporter": "^4.4|^5.0|^6.0" + }, + "type": "library", + "autoload": { + "psr-4": { + "Symfony\\Component\\String\\": "" + }, + "files": [ + "Resources/functions.php" + ], + "exclude-from-classmap": [ + "/Tests/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Nicolas Grekas", + "email": "p@tchwork.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Provides an object-oriented API to strings and deals with bytes, UTF-8 code points and grapheme clusters in a unified way", + "homepage": "https://symfony.com", + "keywords": [ + "grapheme", + "i18n", + "string", + "unicode", + "utf-8", + "utf8" + ], + "support": { + "source": "https://github.com/symfony/string/tree/v5.4.0" + }, + "funding": [ + { + "url": "https://symfony.com/sponsor", + "type": "custom" + }, + { + "url": "https://github.com/fabpot", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "type": "tidelift" + } + ], + "time": "2021-11-24T10:02:00+00:00" } ], "packages-dev": [ { - "name": "doctrine/instantiator", - "version": "1.0.5", + "name": "phpstan/phpstan", + "version": "1.2.0", "source": { "type": "git", - "url": "https://github.com/doctrine/instantiator.git", - "reference": "8e884e78f9f0eb1329e445619e04456e64d8051d" + "url": "https://github.com/phpstan/phpstan.git", + "reference": "cbe085f9fdead5b6d62e4c022ca52dc9427a10ee" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/doctrine/instantiator/zipball/8e884e78f9f0eb1329e445619e04456e64d8051d", - "reference": "8e884e78f9f0eb1329e445619e04456e64d8051d", + "url": "https://api.github.com/repos/phpstan/phpstan/zipball/cbe085f9fdead5b6d62e4c022ca52dc9427a10ee", + "reference": "cbe085f9fdead5b6d62e4c022ca52dc9427a10ee", "shasum": "" }, "require": { - "php": ">=5.3,<8.0-DEV" + "php": "^7.1|^8.0" }, - "require-dev": { - "athletic/athletic": "~0.1.8", - "ext-pdo": "*", - "ext-phar": "*", - "phpunit/phpunit": "~4.0", - "squizlabs/php_codesniffer": "~2.0" + "conflict": { + "phpstan/phpstan-shim": "*" }, + "bin": [ + "phpstan", + "phpstan.phar" + ], "type": "library", "extra": { "branch-alias": { - "dev-master": "1.0.x-dev" + "dev-master": "1.2-dev" } }, "autoload": { - "psr-4": { - "Doctrine\\Instantiator\\": "src/Doctrine/Instantiator/" - } + "files": [ + "bootstrap.php" + ] }, "notification-url": "https://packagist.org/downloads/", "license": [ "MIT" ], - "authors": [ + "description": "PHPStan - PHP Static Analysis Tool", + "support": { + "issues": "https://github.com/phpstan/phpstan/issues", + "source": "https://github.com/phpstan/phpstan/tree/1.2.0" + }, + "funding": [ { - "name": "Marco Pivetta", - "email": "ocramius@gmail.com", - "homepage": "http://ocramius.github.com/" + "url": "https://github.com/ondrejmirtes", + "type": "github" + }, + { + "url": "https://github.com/phpstan", + "type": "github" + }, + { + "url": "https://www.patreon.com/phpstan", + "type": "patreon" + }, + { + "url": "https://tidelift.com/funding/github/packagist/phpstan/phpstan", + "type": "tidelift" } ], - "description": "A small, lightweight utility to instantiate objects in PHP without invoking their constructors", - "homepage": "https://github.com/doctrine/instantiator", - "keywords": [ - "constructor", - "instantiate" - ], - "support": { - "issues": "https://github.com/doctrine/instantiator/issues", - "source": "https://github.com/doctrine/instantiator/tree/master" - }, - "time": "2015-06-14T21:17:01+00:00" + "time": "2021-11-18T14:09:01+00:00" }, { - "name": "phpdocumentor/reflection-docblock", - "version": "2.0.5", + "name": "phpstan/phpstan-deprecation-rules", + "version": "1.0.0", "source": { "type": "git", - "url": "https://github.com/phpDocumentor/ReflectionDocBlock.git", - "reference": "e6a969a640b00d8daa3c66518b0405fb41ae0c4b" + "url": "https://github.com/phpstan/phpstan-deprecation-rules.git", + "reference": "e5ccafb0dd8d835dd65d8d7a1a0d2b1b75414682" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/phpDocumentor/ReflectionDocBlock/zipball/e6a969a640b00d8daa3c66518b0405fb41ae0c4b", - "reference": "e6a969a640b00d8daa3c66518b0405fb41ae0c4b", + "url": "https://api.github.com/repos/phpstan/phpstan-deprecation-rules/zipball/e5ccafb0dd8d835dd65d8d7a1a0d2b1b75414682", + "reference": "e5ccafb0dd8d835dd65d8d7a1a0d2b1b75414682", "shasum": "" }, "require": { - "php": ">=5.3.3" + "php": "^7.1 || ^8.0", + "phpstan/phpstan": "^1.0" }, "require-dev": { - "phpunit/phpunit": "~4.0" + "php-parallel-lint/php-parallel-lint": "^1.2", + "phpstan/phpstan-phpunit": "^1.0", + "phpunit/phpunit": "^9.5" }, - "suggest": { - "dflydev/markdown": "~1.0", - "erusev/parsedown": "~1.0" - }, - "type": "library", + "type": "phpstan-extension", "extra": { "branch-alias": { - "dev-master": "2.0.x-dev" - } - }, - "autoload": { - "psr-0": { - "phpDocumentor": [ - "src/" + "dev-master": "1.0-dev" + }, + "phpstan": { + "includes": [ + "rules.neon" ] } }, + "autoload": { + "psr-4": { + "PHPStan\\": "src/" + } + }, "notification-url": "https://packagist.org/downloads/", "license": [ "MIT" ], - "authors": [ - { - "name": "Mike van Riel", - "email": "mike.vanriel@naenius.com" - } - ], + "description": "PHPStan rules for detecting usage of deprecated classes, methods, properties, constants and traits.", "support": { - "issues": "https://github.com/phpDocumentor/ReflectionDocBlock/issues", - "source": "https://github.com/phpDocumentor/ReflectionDocBlock/tree/release/2.x" + "issues": "https://github.com/phpstan/phpstan-deprecation-rules/issues", + "source": "https://github.com/phpstan/phpstan-deprecation-rules/tree/1.0.0" }, - "time": "2016-01-25T08:17:30+00:00" + "time": "2021-09-23T11:02:21+00:00" }, { - "name": "phpspec/prophecy", - "version": "v1.10.3", + "name": "phpstan/phpstan-phpunit", + "version": "1.0.0", "source": { "type": "git", - "url": "https://github.com/phpspec/prophecy.git", - "reference": "451c3cd1418cf640de218914901e51b064abb093" + "url": "https://github.com/phpstan/phpstan-phpunit.git", + "reference": "9eb88c9f689003a8a2a5ae9e010338ee94dc39b3" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/phpspec/prophecy/zipball/451c3cd1418cf640de218914901e51b064abb093", - "reference": "451c3cd1418cf640de218914901e51b064abb093", + "url": "https://api.github.com/repos/phpstan/phpstan-phpunit/zipball/9eb88c9f689003a8a2a5ae9e010338ee94dc39b3", + "reference": "9eb88c9f689003a8a2a5ae9e010338ee94dc39b3", "shasum": "" }, "require": { - "doctrine/instantiator": "^1.0.2", - "php": "^5.3|^7.0", - "phpdocumentor/reflection-docblock": "^2.0|^3.0.2|^4.0|^5.0", - "sebastian/comparator": "^1.2.3|^2.0|^3.0|^4.0", - "sebastian/recursion-context": "^1.0|^2.0|^3.0|^4.0" + "php": "^7.1 || ^8.0", + "phpstan/phpstan": "^1.0" + }, + "conflict": { + "phpunit/phpunit": "<7.0" }, "require-dev": { - "phpspec/phpspec": "^2.5 || ^3.2", - "phpunit/phpunit": "^4.8.35 || ^5.7 || ^6.5 || ^7.1" + "nikic/php-parser": "^4.13.0", + "php-parallel-lint/php-parallel-lint": "^1.2", + "phpstan/phpstan-strict-rules": "^1.0", + "phpunit/phpunit": "^9.5" }, - "type": "library", + "type": "phpstan-extension", "extra": { "branch-alias": { - "dev-master": "1.10.x-dev" + "dev-master": "1.0-dev" + }, + "phpstan": { + "includes": [ + "extension.neon", + "rules.neon" + ] } }, "autoload": { "psr-4": { - "Prophecy\\": "src/Prophecy" + "PHPStan\\": "src/" } }, "notification-url": "https://packagist.org/downloads/", "license": [ "MIT" ], - "authors": [ - { - "name": "Konstantin Kudryashov", - "email": "ever.zet@gmail.com", - "homepage": "http://everzet.com" - }, - { - "name": "Marcello Duarte", - "email": "marcello.duarte@gmail.com" - } - ], - "description": "Highly opinionated mocking framework for PHP 5.3+", - "homepage": "https://github.com/phpspec/prophecy", - "keywords": [ - "Double", - "Dummy", - "fake", - "mock", - "spy", - "stub" - ], + "description": "PHPUnit extensions and rules for PHPStan", "support": { - "issues": "https://github.com/phpspec/prophecy/issues", - "source": "https://github.com/phpspec/prophecy/tree/v1.10.3" + "issues": "https://github.com/phpstan/phpstan-phpunit/issues", + "source": "https://github.com/phpstan/phpstan-phpunit/tree/1.0.0" }, - "time": "2020-03-05T15:02:03+00:00" + "time": "2021-10-14T08:03:54+00:00" }, { - "name": "sebastian/comparator", - "version": "1.2.4", + "name": "phpstan/phpstan-strict-rules", + "version": "1.1.0", "source": { "type": "git", - "url": "https://github.com/sebastianbergmann/comparator.git", - "reference": "2b7424b55f5047b47ac6e5ccb20b2aea4011d9be" + "url": "https://github.com/phpstan/phpstan-strict-rules.git", + "reference": "e12d55f74a8cca18c6e684c6450767e055ba7717" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/comparator/zipball/2b7424b55f5047b47ac6e5ccb20b2aea4011d9be", - "reference": "2b7424b55f5047b47ac6e5ccb20b2aea4011d9be", + "url": "https://api.github.com/repos/phpstan/phpstan-strict-rules/zipball/e12d55f74a8cca18c6e684c6450767e055ba7717", + "reference": "e12d55f74a8cca18c6e684c6450767e055ba7717", "shasum": "" }, "require": { - "php": ">=5.3.3", - "sebastian/diff": "~1.2", - "sebastian/exporter": "~1.2 || ~2.0" + "php": "^7.1 || ^8.0", + "phpstan/phpstan": "^1.2.0" }, "require-dev": { - "phpunit/phpunit": "~4.4" + "nikic/php-parser": "^4.13.0", + "php-parallel-lint/php-parallel-lint": "^1.2", + "phpstan/phpstan-phpunit": "^1.0", + "phpunit/phpunit": "^9.5" }, - "type": "library", + "type": "phpstan-extension", "extra": { "branch-alias": { - "dev-master": "1.2.x-dev" + "dev-master": "1.0-dev" + }, + "phpstan": { + "includes": [ + "rules.neon" + ] } }, "autoload": { - "classmap": [ - "src/" - ] + "psr-4": { + "PHPStan\\": "src/" + } }, "notification-url": "https://packagist.org/downloads/", "license": [ - "BSD-3-Clause" - ], - "authors": [ - { - "name": "Jeff Welch", - "email": "whatthejeff@gmail.com" - }, - { - "name": "Volker Dusch", - "email": "github@wallbash.com" - }, - { - "name": "Bernhard Schussek", - "email": "bschussek@2bepublished.at" - }, - { - "name": "Sebastian Bergmann", - "email": "sebastian@phpunit.de" - } - ], - "description": "Provides the functionality to compare PHP values for equality", - "homepage": "http://www.github.com/sebastianbergmann/comparator", - "keywords": [ - "comparator", - "compare", - "equality" + "MIT" ], + "description": "Extra strict and opinionated rules for PHPStan", "support": { - "issues": "https://github.com/sebastianbergmann/comparator/issues", - "source": "https://github.com/sebastianbergmann/comparator/tree/1.2" + "issues": "https://github.com/phpstan/phpstan-strict-rules/issues", + "source": "https://github.com/phpstan/phpstan-strict-rules/tree/1.1.0" }, - "time": "2017-01-29T09:50:25+00:00" - }, - { - "name": "sebastian/diff", - "version": "1.4.3", - "source": { - "type": "git", - "url": "https://github.com/sebastianbergmann/diff.git", - "reference": "7f066a26a962dbe58ddea9f72a4e82874a3975a4" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/diff/zipball/7f066a26a962dbe58ddea9f72a4e82874a3975a4", - "reference": "7f066a26a962dbe58ddea9f72a4e82874a3975a4", - "shasum": "" - }, - "require": { - "php": "^5.3.3 || ^7.0" - }, - "require-dev": { - "phpunit/phpunit": "^4.8.35 || ^5.7 || ^6.0" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.4-dev" - } - }, - "autoload": { - "classmap": [ - "src/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause" - ], - "authors": [ - { - "name": "Kore Nordmann", - "email": "mail@kore-nordmann.de" - }, - { - "name": "Sebastian Bergmann", - "email": "sebastian@phpunit.de" - } - ], - "description": "Diff implementation", - "homepage": "https://github.com/sebastianbergmann/diff", - "keywords": [ - "diff" - ], - "support": { - "issues": "https://github.com/sebastianbergmann/diff/issues", - "source": "https://github.com/sebastianbergmann/diff/tree/1.4" - }, - "time": "2017-05-22T07:24:03+00:00" - }, - { - "name": "sebastian/exporter", - "version": "2.0.0", - "source": { - "type": "git", - "url": "https://github.com/sebastianbergmann/exporter.git", - "reference": "ce474bdd1a34744d7ac5d6aad3a46d48d9bac4c4" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/exporter/zipball/ce474bdd1a34744d7ac5d6aad3a46d48d9bac4c4", - "reference": "ce474bdd1a34744d7ac5d6aad3a46d48d9bac4c4", - "shasum": "" - }, - "require": { - "php": ">=5.3.3", - "sebastian/recursion-context": "~2.0" - }, - "require-dev": { - "ext-mbstring": "*", - "phpunit/phpunit": "~4.4" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "2.0.x-dev" - } - }, - "autoload": { - "classmap": [ - "src/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause" - ], - "authors": [ - { - "name": "Jeff Welch", - "email": "whatthejeff@gmail.com" - }, - { - "name": "Volker Dusch", - "email": "github@wallbash.com" - }, - { - "name": "Bernhard Schussek", - "email": "bschussek@2bepublished.at" - }, - { - "name": "Sebastian Bergmann", - "email": "sebastian@phpunit.de" - }, - { - "name": "Adam Harvey", - "email": "aharvey@php.net" - } - ], - "description": "Provides the functionality to export PHP variables for visualization", - "homepage": "http://www.github.com/sebastianbergmann/exporter", - "keywords": [ - "export", - "exporter" - ], - "support": { - "issues": "https://github.com/sebastianbergmann/exporter/issues", - "source": "https://github.com/sebastianbergmann/exporter/tree/master" - }, - "time": "2016-11-19T08:54:04+00:00" - }, - { - "name": "sebastian/recursion-context", - "version": "2.0.0", - "source": { - "type": "git", - "url": "https://github.com/sebastianbergmann/recursion-context.git", - "reference": "2c3ba150cbec723aa057506e73a8d33bdb286c9a" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/recursion-context/zipball/2c3ba150cbec723aa057506e73a8d33bdb286c9a", - "reference": "2c3ba150cbec723aa057506e73a8d33bdb286c9a", - "shasum": "" - }, - "require": { - "php": ">=5.3.3" - }, - "require-dev": { - "phpunit/phpunit": "~4.4" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "2.0.x-dev" - } - }, - "autoload": { - "classmap": [ - "src/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause" - ], - "authors": [ - { - "name": "Jeff Welch", - "email": "whatthejeff@gmail.com" - }, - { - "name": "Sebastian Bergmann", - "email": "sebastian@phpunit.de" - }, - { - "name": "Adam Harvey", - "email": "aharvey@php.net" - } - ], - "description": "Provides functionality to recursively process PHP variables", - "homepage": "http://www.github.com/sebastianbergmann/recursion-context", - "support": { - "issues": "https://github.com/sebastianbergmann/recursion-context/issues", - "source": "https://github.com/sebastianbergmann/recursion-context/tree/master" - }, - "time": "2016-11-19T07:33:16+00:00" + "time": "2021-11-18T09:30:29+00:00" }, { "name": "symfony/phpunit-bridge", - "version": "v4.2.12", + "version": "v6.0.0", "source": { "type": "git", "url": "https://github.com/symfony/phpunit-bridge.git", - "reference": "80f9ffa6afcc27c7b00e8b8446b1d5d48d94bae7" + "reference": "5d6cc6720085084f504d2482fc4a2f268784006b" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/phpunit-bridge/zipball/80f9ffa6afcc27c7b00e8b8446b1d5d48d94bae7", - "reference": "80f9ffa6afcc27c7b00e8b8446b1d5d48d94bae7", + "url": "https://api.github.com/repos/symfony/phpunit-bridge/zipball/5d6cc6720085084f504d2482fc4a2f268784006b", + "reference": "5d6cc6720085084f504d2482fc4a2f268784006b", "shasum": "" }, "require": { - "php": ">=5.3.3" + "php": ">=7.1.3" }, "conflict": { - "phpunit/phpunit": "<4.8.35|<5.4.3,>=5.0" + "phpunit/phpunit": "<7.5|9.1.2" + }, + "require-dev": { + "symfony/deprecation-contracts": "^2.1|^3.0", + "symfony/error-handler": "^5.4|^6.0" }, "suggest": { - "symfony/debug": "For tracking deprecated interfaces usages at runtime with DebugClassLoader" + "symfony/error-handler": "For tracking deprecated interfaces usages at runtime with DebugClassLoader" }, "bin": [ "bin/simple-phpunit" ], "type": "symfony-bridge", "extra": { - "branch-alias": { - "dev-master": "4.2-dev" - }, "thanks": { "name": "phpunit/phpunit", "url": "https://github.com/sebastianbergmann/phpunit" @@ -1661,12 +2072,26 @@ "homepage": "https://symfony.com/contributors" } ], - "description": "Symfony PHPUnit Bridge", + "description": "Provides utilities for PHPUnit, especially user deprecation notices management", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/phpunit-bridge/tree/4.2" + "source": "https://github.com/symfony/phpunit-bridge/tree/v6.0.0" }, - "time": "2019-07-05T06:33:37+00:00" + "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": "2021-11-29T15:32:57+00:00" } ], "aliases": [], @@ -1675,11 +2100,11 @@ "prefer-stable": false, "prefer-lowest": false, "platform": { - "php": "^5.3.2 || ^7.0 || ^8.0" + "php": "^7.2.5 || ^8.0" }, "platform-dev": [], "platform-overrides": { - "php": "5.3.9" + "php": "7.2.5" }, - "plugin-api-version": "2.2.0" + "plugin-api-version": "2.3.0" } diff --git a/phpstan/baseline-8.1.neon b/phpstan/baseline-8.1.neon new file mode 100644 index 000000000..9b3c30243 --- /dev/null +++ b/phpstan/baseline-8.1.neon @@ -0,0 +1,8875 @@ +parameters: + ignoreErrors: + - + message: "#^Argument of an invalid type array\\\\|string supplied for foreach, only iterables are supported\\.$#" + count: 1 + path: ../src/Composer/Autoload/AutoloadGenerator.php + + - + message: "#^Binary operation \"\\.\" between non\\-empty\\-string and array\\|string\\|null results in an error\\.$#" + count: 1 + path: ../src/Composer/Autoload/AutoloadGenerator.php + + - + message: "#^Cannot call method writeError\\(\\) on Composer\\\\IO\\\\IOInterface\\|null\\.$#" + count: 2 + path: ../src/Composer/Autoload/AutoloadGenerator.php + + - + message: "#^Casting to bool something that's already bool\\.$#" + count: 6 + path: ../src/Composer/Autoload/AutoloadGenerator.php + + - + message: "#^Casting to string something that's already string\\.$#" + count: 1 + path: ../src/Composer/Autoload/AutoloadGenerator.php + + - + message: "#^Construct empty\\(\\) is not allowed\\. Use more strict comparison\\.$#" + count: 10 + path: ../src/Composer/Autoload/AutoloadGenerator.php + + - + message: "#^Method Composer\\\\Autoload\\\\AutoloadGenerator\\:\\:parseAutoloads\\(\\) should return array\\{psr\\-0\\: array\\\\>, psr\\-4\\: array\\\\>, classmap\\: array\\, files\\: array\\, exclude\\-from\\-classmap\\: array\\\\} but returns array\\{psr\\-0\\: array\\\\|string\\>, psr\\-4\\: array\\\\|string\\>, classmap\\: array\\\\|string\\>, files\\: array\\\\|string\\>, exclude\\-from\\-classmap\\: array\\\\|string\\>\\}\\.$#" + count: 1 + path: ../src/Composer/Autoload/AutoloadGenerator.php + + - + message: "#^Only booleans are allowed in &&, Composer\\\\IO\\\\IOInterface\\|null given on the left side\\.$#" + count: 1 + path: ../src/Composer/Autoload/AutoloadGenerator.php + + - + message: "#^Only booleans are allowed in &&, array\\\\|int\\|string\\>\\|bool\\|string\\>\\|bool\\|string\\|null given on the left side\\.$#" + count: 1 + path: ../src/Composer/Autoload/AutoloadGenerator.php + + - + message: "#^Only booleans are allowed in &&, bool\\|null given on the left side\\.$#" + count: 1 + path: ../src/Composer/Autoload/AutoloadGenerator.php + + - + message: "#^Only booleans are allowed in &&, mixed given on the left side\\.$#" + count: 1 + path: ../src/Composer/Autoload/AutoloadGenerator.php + + - + message: "#^Only booleans are allowed in &&, string\\|null given on the left side\\.$#" + count: 1 + path: ../src/Composer/Autoload/AutoloadGenerator.php + + - + message: "#^Only booleans are allowed in &&, string\\|null given on the right side\\.$#" + count: 1 + path: ../src/Composer/Autoload/AutoloadGenerator.php + + - + message: "#^Only booleans are allowed in a negated boolean, array\\ given\\.$#" + count: 1 + path: ../src/Composer/Autoload/AutoloadGenerator.php + + - + message: "#^Only booleans are allowed in a negated boolean, mixed given\\.$#" + count: 1 + path: ../src/Composer/Autoload/AutoloadGenerator.php + + - + message: "#^Only booleans are allowed in a negated boolean, string given\\.$#" + count: 4 + path: ../src/Composer/Autoload/AutoloadGenerator.php + + - + message: "#^Only booleans are allowed in a ternary operator condition, array\\ given\\.$#" + count: 1 + path: ../src/Composer/Autoload/AutoloadGenerator.php + + - + message: "#^Only booleans are allowed in a ternary operator condition, mixed given\\.$#" + count: 1 + path: ../src/Composer/Autoload/AutoloadGenerator.php + + - + message: "#^Only booleans are allowed in an if condition, array\\\\|null given\\.$#" + count: 1 + path: ../src/Composer/Autoload/AutoloadGenerator.php + + - + message: "#^Only booleans are allowed in an if condition, mixed given\\.$#" + count: 1 + path: ../src/Composer/Autoload/AutoloadGenerator.php + + - + message: "#^Only booleans are allowed in an if condition, string given\\.$#" + count: 1 + path: ../src/Composer/Autoload/AutoloadGenerator.php + + - + message: "#^Only booleans are allowed in an if condition, string\\|null given\\.$#" + count: 3 + path: ../src/Composer/Autoload/AutoloadGenerator.php + + - + message: "#^Parameter \\#1 \\$files of method Composer\\\\Autoload\\\\AutoloadGenerator\\:\\:getIncludeFilesFile\\(\\) expects array\\, array\\\\|string\\> given\\.$#" + count: 1 + path: ../src/Composer/Autoload/AutoloadGenerator.php + + - + message: "#^Parameter \\#1 \\$from of method Composer\\\\Util\\\\Filesystem\\:\\:findShortestPathCode\\(\\) expects string, string\\|false given\\.$#" + count: 5 + path: ../src/Composer/Autoload/AutoloadGenerator.php + + - + message: "#^Parameter \\#1 \\$packageMap of method Composer\\\\Autoload\\\\AutoloadGenerator\\:\\:parseAutoloadsType\\(\\) expects array\\, non\\-empty\\-array\\ given\\.$#" + count: 5 + path: ../src/Composer/Autoload/AutoloadGenerator.php + + - + message: "#^Parameter \\#1 \\$path of function realpath expects string, string\\|false given\\.$#" + count: 3 + path: ../src/Composer/Autoload/AutoloadGenerator.php + + - + message: "#^Parameter \\#1 \\$path of method Composer\\\\Util\\\\Filesystem\\:\\:normalizePath\\(\\) expects string, string\\|false given\\.$#" + count: 2 + path: ../src/Composer/Autoload/AutoloadGenerator.php + + - + message: "#^Parameter \\#1 \\$str of function strtr expects string, string\\|false given\\.$#" + count: 3 + path: ../src/Composer/Autoload/AutoloadGenerator.php + + - + message: "#^Parameter \\#2 \\$content of method Composer\\\\Util\\\\Filesystem\\:\\:filePutContentsIfModified\\(\\) expects string, string\\|null given\\.$#" + count: 1 + path: ../src/Composer/Autoload/AutoloadGenerator.php + + - + message: "#^Parameter \\#2 \\$excluded of method Composer\\\\Autoload\\\\AutoloadGenerator\\:\\:generateClassMap\\(\\) expects array\\\\|null, array\\|null given\\.$#" + count: 1 + path: ../src/Composer/Autoload/AutoloadGenerator.php + + - + message: "#^Parameter \\#2 \\$excluded of static method Composer\\\\Autoload\\\\ClassMapGenerator\\:\\:createMap\\(\\) expects string\\|null, array\\|string\\|null given\\.$#" + count: 1 + path: ../src/Composer/Autoload/AutoloadGenerator.php + + - + message: "#^Parameter \\#2 \\$subject of static method Composer\\\\Pcre\\\\Preg\\:\\:isMatch\\(\\) expects string, string\\|false given\\.$#" + count: 1 + path: ../src/Composer/Autoload/AutoloadGenerator.php + + - + message: "#^Parameter \\#2 \\$to of method Composer\\\\Util\\\\Filesystem\\:\\:findShortestPathCode\\(\\) expects string, string\\|false given\\.$#" + count: 1 + path: ../src/Composer/Autoload/AutoloadGenerator.php + + - + message: "#^Parameter \\#6 \\$namespaceFilter of method Composer\\\\Autoload\\\\AutoloadGenerator\\:\\:addClassMapCode\\(\\) expects string\\|null, int\\|string given\\.$#" + count: 1 + path: ../src/Composer/Autoload/AutoloadGenerator.php + + - + message: "#^Short ternary operator is not allowed\\. Use null coalesce operator if applicable or consider using long ternary\\.$#" + count: 2 + path: ../src/Composer/Autoload/AutoloadGenerator.php + + - + message: "#^Strict comparison using \\!\\=\\= between string and false will always evaluate to true\\.$#" + count: 1 + path: ../src/Composer/Autoload/AutoloadGenerator.php + + - + message: "#^Construct empty\\(\\) is not allowed\\. Use more strict comparison\\.$#" + count: 1 + path: ../src/Composer/Autoload/ClassLoader.php + + - + message: "#^Only booleans are allowed in &&, string\\|false given on the right side\\.$#" + count: 1 + path: ../src/Composer/Autoload/ClassLoader.php + + - + message: "#^Only booleans are allowed in a negated boolean, string given\\.$#" + count: 4 + path: ../src/Composer/Autoload/ClassLoader.php + + - + message: "#^Only booleans are allowed in an if condition, array\\ given\\.$#" + count: 1 + path: ../src/Composer/Autoload/ClassLoader.php + + - + message: "#^Only booleans are allowed in an if condition, string\\|false given\\.$#" + count: 1 + path: ../src/Composer/Autoload/ClassLoader.php + + - + message: "#^Parameter \\#1 \\$callback of function spl_autoload_register expects \\(callable\\(string\\)\\: void\\)\\|null, array\\{\\$this\\(Composer\\\\Autoload\\\\ClassLoader\\), 'loadClass'\\} given\\.$#" + count: 1 + path: ../src/Composer/Autoload/ClassLoader.php + + - + message: "#^Call to function in_array\\(\\) requires parameter \\#3 to be set\\.$#" + count: 1 + path: ../src/Composer/Autoload/ClassMapGenerator.php + + - + message: "#^Cannot call method getPathname\\(\\) on SplFileInfo\\|string\\.$#" + count: 1 + path: ../src/Composer/Autoload/ClassMapGenerator.php + + - + message: "#^Construct empty\\(\\) is not allowed\\. Use more strict comparison\\.$#" + count: 2 + path: ../src/Composer/Autoload/ClassMapGenerator.php + + - + message: "#^Method Composer\\\\Autoload\\\\ClassMapGenerator\\:\\:findClasses\\(\\) should return array\\ but returns array\\\\.$#" + count: 1 + path: ../src/Composer/Autoload/ClassMapGenerator.php + + - + message: "#^Only booleans are allowed in &&, Composer\\\\IO\\\\IOInterface\\|null given on the left side\\.$#" + count: 1 + path: ../src/Composer/Autoload/ClassMapGenerator.php + + - + message: "#^Only booleans are allowed in &&, string\\|null given on the left side\\.$#" + count: 2 + path: ../src/Composer/Autoload/ClassMapGenerator.php + + - + message: "#^Only booleans are allowed in a negated boolean, string given\\.$#" + count: 1 + path: ../src/Composer/Autoload/ClassMapGenerator.php + + - + message: "#^Only booleans are allowed in an if condition, Composer\\\\IO\\\\IOInterface\\|null given\\.$#" + count: 1 + path: ../src/Composer/Autoload/ClassMapGenerator.php + + - + message: "#^Only booleans are allowed in an if condition, array\\ given\\.$#" + count: 1 + path: ../src/Composer/Autoload/ClassMapGenerator.php + + - + message: "#^Parameter \\#1 \\$path of function realpath expects string, string\\|false given\\.$#" + count: 1 + path: ../src/Composer/Autoload/ClassMapGenerator.php + + - + message: "#^Parameter \\#1 \\$str of function preg_quote expects string, string\\|false given\\.$#" + count: 1 + path: ../src/Composer/Autoload/ClassMapGenerator.php + + - + message: "#^Parameter \\#1 \\$str of function strtr expects string, string\\|false given\\.$#" + count: 1 + path: ../src/Composer/Autoload/ClassMapGenerator.php + + - + message: "#^Parameter \\#3 \\$baseNamespace of static method Composer\\\\Autoload\\\\ClassMapGenerator\\:\\:filterByNamespace\\(\\) expects string, string\\|null given\\.$#" + count: 1 + path: ../src/Composer/Autoload/ClassMapGenerator.php + + - + message: "#^Parameter \\#5 \\$basePath of static method Composer\\\\Autoload\\\\ClassMapGenerator\\:\\:filterByNamespace\\(\\) expects string, array\\\\|string\\|Traversable\\ given\\.$#" + count: 1 + path: ../src/Composer/Autoload/ClassMapGenerator.php + + - + message: "#^Casting to bool something that's already bool\\.$#" + count: 2 + path: ../src/Composer/Cache.php + + - + message: "#^Only booleans are allowed in a negated boolean, int given\\.$#" + count: 1 + path: ../src/Composer/Cache.php + + - + message: "#^Only booleans are allowed in a negated boolean, int\\<0, 50\\> given\\.$#" + count: 1 + path: ../src/Composer/Cache.php + + - + message: "#^Only booleans are allowed in a negated boolean, mixed given\\.$#" + count: 1 + path: ../src/Composer/Cache.php + + - + message: "#^Only booleans are allowed in an if condition, bool\\|null given\\.$#" + count: 1 + path: ../src/Composer/Cache.php + + - + message: "#^Only booleans are allowed in an if condition, string\\|false given\\.$#" + count: 1 + path: ../src/Composer/Cache.php + + - + message: "#^Short ternary operator is not allowed\\. Use null coalesce operator if applicable or consider using long ternary\\.$#" + count: 1 + path: ../src/Composer/Cache.php + + - + message: "#^Cannot call method getPackage\\(\\) on Composer\\\\Composer\\|null\\.$#" + count: 1 + path: ../src/Composer/Command/ArchiveCommand.php + + - + message: "#^Only booleans are allowed in &&, Composer\\\\Composer\\|null given on the right side\\.$#" + count: 1 + path: ../src/Composer/Command/ArchiveCommand.php + + - + message: "#^Only booleans are allowed in a negated boolean, \\(Composer\\\\Package\\\\BasePackage&Composer\\\\Package\\\\CompletePackageInterface\\)\\|false given\\.$#" + count: 1 + path: ../src/Composer/Command/ArchiveCommand.php + + - + message: "#^Only booleans are allowed in a negated boolean, Composer\\\\Config\\|null given\\.$#" + count: 1 + path: ../src/Composer/Command/ArchiveCommand.php + + - + message: "#^Only booleans are allowed in an elseif condition, array\\ given\\.$#" + count: 1 + path: ../src/Composer/Command/ArchiveCommand.php + + - + message: "#^Only booleans are allowed in an if condition, Composer\\\\Composer\\|null given\\.$#" + count: 3 + path: ../src/Composer/Command/ArchiveCommand.php + + - + message: "#^Only booleans are allowed in an if condition, string\\|null given\\.$#" + count: 1 + path: ../src/Composer/Command/ArchiveCommand.php + + - + message: "#^Parameter \\#1 \\$from of method Composer\\\\Util\\\\Filesystem\\:\\:findShortestPath\\(\\) expects string, string\\|false given\\.$#" + count: 1 + path: ../src/Composer/Command/ArchiveCommand.php + + - + message: "#^Call to function method_exists\\(\\) with Symfony\\\\Component\\\\Console\\\\Helper\\\\TableStyle and 'setVerticalBorderCh…' will always evaluate to true\\.$#" + count: 1 + path: ../src/Composer/Command/BaseCommand.php + + - + message: "#^Instanceof between Composer\\\\Console\\\\Application and Composer\\\\Console\\\\Application will always evaluate to true\\.$#" + count: 2 + path: ../src/Composer/Command/BaseCommand.php + + - + message: "#^Only booleans are allowed in &&, mixed given on the right side\\.$#" + count: 3 + path: ../src/Composer/Command/BaseCommand.php + + - + message: "#^Only booleans are allowed in a negated boolean, mixed given\\.$#" + count: 1 + path: ../src/Composer/Command/BaseCommand.php + + - + message: "#^Only booleans are allowed in an if condition, Composer\\\\Composer\\|null given\\.$#" + count: 1 + path: ../src/Composer/Command/BaseCommand.php + + - + message: "#^Only booleans are allowed in an if condition, mixed given\\.$#" + count: 2 + path: ../src/Composer/Command/BaseCommand.php + + - + message: "#^Only booleans are allowed in \\|\\|, mixed given on the left side\\.$#" + count: 2 + path: ../src/Composer/Command/BaseCommand.php + + - + message: "#^Only booleans are allowed in \\|\\|, mixed given on the right side\\.$#" + count: 1 + path: ../src/Composer/Command/BaseCommand.php + + - + message: "#^Parameter \\#3 \\$command of class Composer\\\\Plugin\\\\PreCommandRunEvent constructor expects string, string\\|null given\\.$#" + count: 1 + path: ../src/Composer/Command/BaseCommand.php + + - + message: "#^Cannot call method getConfig\\(\\) on Composer\\\\Composer\\|null\\.$#" + count: 1 + path: ../src/Composer/Command/BaseDependencyCommand.php + + - + message: "#^Cannot call method getEventDispatcher\\(\\) on Composer\\\\Composer\\|null\\.$#" + count: 1 + path: ../src/Composer/Command/BaseDependencyCommand.php + + - + message: "#^Cannot call method getPackage\\(\\) on Composer\\\\Composer\\|null\\.$#" + count: 1 + path: ../src/Composer/Command/BaseDependencyCommand.php + + - + message: "#^Cannot call method getRepositoryManager\\(\\) on Composer\\\\Composer\\|null\\.$#" + count: 1 + path: ../src/Composer/Command/BaseDependencyCommand.php + + - + message: "#^Construct empty\\(\\) is not allowed\\. Use more strict comparison\\.$#" + count: 3 + path: ../src/Composer/Command/BaseDependencyCommand.php + + - + message: "#^Offset int does not exist on array\\\\|null\\.$#" + count: 2 + path: ../src/Composer/Command/BaseDependencyCommand.php + + - + message: "#^Only booleans are allowed in a negated boolean, Composer\\\\Package\\\\BasePackage\\|null given\\.$#" + count: 1 + path: ../src/Composer/Command/BaseDependencyCommand.php + + - + message: "#^Only booleans are allowed in an elseif condition, mixed given\\.$#" + count: 1 + path: ../src/Composer/Command/BaseDependencyCommand.php + + - + message: "#^Only booleans are allowed in an if condition, Composer\\\\Package\\\\BasePackage\\|null given\\.$#" + count: 1 + path: ../src/Composer/Command/BaseDependencyCommand.php + + - + message: "#^Only booleans are allowed in an if condition, array\\|bool given\\.$#" + count: 1 + path: ../src/Composer/Command/BaseDependencyCommand.php + + - + message: "#^Only booleans are allowed in an if condition, mixed given\\.$#" + count: 1 + path: ../src/Composer/Command/BaseDependencyCommand.php + + - + message: "#^Only booleans are allowed in \\|\\|, mixed given on the left side\\.$#" + count: 1 + path: ../src/Composer/Command/BaseDependencyCommand.php + + - + message: "#^Only booleans are allowed in \\|\\|, mixed given on the right side\\.$#" + count: 1 + path: ../src/Composer/Command/BaseDependencyCommand.php + + - + message: "#^Parameter \\#1 \\$results of method Composer\\\\Command\\\\BaseDependencyCommand\\:\\:printTree\\(\\) expects array\\, non\\-empty\\-array\\|true given\\.$#" + count: 1 + path: ../src/Composer/Command/BaseDependencyCommand.php + + - + message: "#^Parameter \\#1 \\$value of function count expects array\\|Countable, array\\\\|null given\\.$#" + count: 2 + path: ../src/Composer/Command/BaseDependencyCommand.php + + - + message: "#^Parameter \\#2 \\$commandName of class Composer\\\\Plugin\\\\CommandEvent constructor expects string, string\\|null given\\.$#" + count: 1 + path: ../src/Composer/Command/BaseDependencyCommand.php + + - + message: "#^Short ternary operator is not allowed\\. Use null coalesce operator if applicable or consider using long ternary\\.$#" + count: 1 + path: ../src/Composer/Command/BaseDependencyCommand.php + + - + message: "#^Cannot access an offset on array\\\\|Composer\\\\Package\\\\Link\\>\\|Composer\\\\Package\\\\Link\\>\\|Composer\\\\Package\\\\Link\\>\\|Composer\\\\Package\\\\Link\\.$#" + count: 1 + path: ../src/Composer/Command/CheckPlatformReqsCommand.php + + - + message: "#^Cannot call method getLockedRepository\\(\\) on Composer\\\\Package\\\\Locker\\|null\\.$#" + count: 2 + path: ../src/Composer/Command/CheckPlatformReqsCommand.php + + - + message: "#^Cannot call method getLocker\\(\\) on Composer\\\\Composer\\|null\\.$#" + count: 2 + path: ../src/Composer/Command/CheckPlatformReqsCommand.php + + - + message: "#^Cannot call method getPackage\\(\\) on Composer\\\\Composer\\|null\\.$#" + count: 2 + path: ../src/Composer/Command/CheckPlatformReqsCommand.php + + - + message: "#^Cannot call method getRepositoryManager\\(\\) on Composer\\\\Composer\\|null\\.$#" + count: 1 + path: ../src/Composer/Command/CheckPlatformReqsCommand.php + + - + message: "#^Only booleans are allowed in a negated boolean, Composer\\\\Semver\\\\Constraint\\\\ConstraintInterface\\|null given\\.$#" + count: 1 + path: ../src/Composer/Command/CheckPlatformReqsCommand.php + + - + message: "#^Only booleans are allowed in a negated boolean, array\\ given\\.$#" + count: 1 + path: ../src/Composer/Command/CheckPlatformReqsCommand.php + + - + message: "#^Only booleans are allowed in a negated boolean, mixed given\\.$#" + count: 3 + path: ../src/Composer/Command/CheckPlatformReqsCommand.php + + - + message: "#^Only booleans are allowed in a ternary operator condition, Composer\\\\Package\\\\Link\\|null given\\.$#" + count: 1 + path: ../src/Composer/Command/CheckPlatformReqsCommand.php + + - + message: "#^Only booleans are allowed in a ternary operator condition, mixed given\\.$#" + count: 3 + path: ../src/Composer/Command/CheckPlatformReqsCommand.php + + - + message: "#^Only booleans are allowed in an if condition, array\\ given\\.$#" + count: 1 + path: ../src/Composer/Command/CheckPlatformReqsCommand.php + + - + message: "#^Only booleans are allowed in an if condition, mixed given\\.$#" + count: 2 + path: ../src/Composer/Command/CheckPlatformReqsCommand.php + + - + message: "#^Only booleans are allowed in a negated boolean, string\\|false given\\.$#" + count: 1 + path: ../src/Composer/Command/ClearCacheCommand.php + + - + message: "#^Call to function in_array\\(\\) requires parameter \\#3 to be set\\.$#" + count: 3 + path: ../src/Composer/Command/ConfigCommand.php + + - + message: "#^Only booleans are allowed in &&, mixed given on the left side\\.$#" + count: 6 + path: ../src/Composer/Command/ConfigCommand.php + + - + message: "#^Only booleans are allowed in &&, mixed given on the right side\\.$#" + count: 5 + path: ../src/Composer/Command/ConfigCommand.php + + - + message: "#^Only booleans are allowed in a negated boolean, mixed given\\.$#" + count: 2 + path: ../src/Composer/Command/ConfigCommand.php + + - + message: "#^Only booleans are allowed in a negated boolean, string given\\.$#" + count: 1 + path: ../src/Composer/Command/ConfigCommand.php + + - + message: "#^Only booleans are allowed in a ternary operator condition, mixed given\\.$#" + count: 4 + path: ../src/Composer/Command/ConfigCommand.php + + - + message: "#^Only booleans are allowed in an elseif condition, int\\<0, max\\>\\|false given\\.$#" + count: 1 + path: ../src/Composer/Command/ConfigCommand.php + + - + message: "#^Only booleans are allowed in an if condition, mixed given\\.$#" + count: 11 + path: ../src/Composer/Command/ConfigCommand.php + + - + message: "#^Only booleans are allowed in an if condition, string\\|false given\\.$#" + count: 1 + path: ../src/Composer/Command/ConfigCommand.php + + - + message: "#^Parameter \\#1 \\$callback of function call_user_func expects callable\\(\\)\\: mixed, array\\{Composer\\\\Config\\\\JsonConfigSource, string\\} given\\.$#" + count: 2 + path: ../src/Composer/Command/ConfigCommand.php + + - + message: "#^Parameter \\#1 \\$command of function escapeshellcmd expects string, string\\|false given\\.$#" + count: 1 + path: ../src/Composer/Command/ConfigCommand.php + + - + message: "#^Parameter \\#1 \\$path of function dirname expects string, string\\|false given\\.$#" + count: 1 + path: ../src/Composer/Command/ConfigCommand.php + + - + message: "#^Parameter \\#1 \\$path of function realpath expects string, string\\|false given\\.$#" + count: 1 + path: ../src/Composer/Command/ConfigCommand.php + + - + message: "#^Parameter \\#2 \\$rawContents of method Composer\\\\Command\\\\ConfigCommand\\:\\:listConfiguration\\(\\) expects array\\, array\\|string\\|null given\\.$#" + count: 1 + path: ../src/Composer/Command/ConfigCommand.php + + - + message: "#^Short ternary operator is not allowed\\. Use null coalesce operator if applicable or consider using long ternary\\.$#" + count: 1 + path: ../src/Composer/Command/ConfigCommand.php + + - + message: "#^Cannot call method isLocked\\(\\) on Composer\\\\Package\\\\Locker\\|null\\.$#" + count: 1 + path: ../src/Composer/Command/CreateProjectCommand.php + + - + message: "#^Only booleans are allowed in &&, Composer\\\\Package\\\\PackageInterface\\|false given on the right side\\.$#" + count: 1 + path: ../src/Composer/Command/CreateProjectCommand.php + + - + message: "#^Only booleans are allowed in &&, mixed given on the right side\\.$#" + count: 1 + path: ../src/Composer/Command/CreateProjectCommand.php + + - + message: "#^Only booleans are allowed in a negated boolean, Composer\\\\Package\\\\PackageInterface\\|false given\\.$#" + count: 1 + path: ../src/Composer/Command/CreateProjectCommand.php + + - + message: "#^Only booleans are allowed in a negated boolean, mixed given\\.$#" + count: 3 + path: ../src/Composer/Command/CreateProjectCommand.php + + - + message: "#^Only booleans are allowed in a negated boolean, string\\|null given\\.$#" + count: 1 + path: ../src/Composer/Command/CreateProjectCommand.php + + - + message: "#^Only booleans are allowed in a ternary operator condition, string\\|null given\\.$#" + count: 1 + path: ../src/Composer/Command/CreateProjectCommand.php + + - + message: "#^Only booleans are allowed in an if condition, mixed given\\.$#" + count: 2 + path: ../src/Composer/Command/CreateProjectCommand.php + + - + message: "#^Only booleans are allowed in an if condition, string\\|false given\\.$#" + count: 2 + path: ../src/Composer/Command/CreateProjectCommand.php + + - + message: "#^Only booleans are allowed in \\|\\|, mixed given on the left side\\.$#" + count: 1 + path: ../src/Composer/Command/CreateProjectCommand.php + + - + message: "#^Parameter \\#1 \\$directory of function chdir expects string, string\\|false given\\.$#" + count: 1 + path: ../src/Composer/Command/CreateProjectCommand.php + + - + message: "#^Parameter \\#1 \\$dirs of method Symfony\\\\Component\\\\Finder\\\\Finder\\:\\:in\\(\\) expects array\\\\|string, string\\|false given\\.$#" + count: 1 + path: ../src/Composer/Command/CreateProjectCommand.php + + - + message: "#^Parameter \\#1 \\$from of method Composer\\\\Util\\\\Filesystem\\:\\:findShortestPath\\(\\) expects string, string\\|false given\\.$#" + count: 1 + path: ../src/Composer/Command/CreateProjectCommand.php + + - + message: "#^Parameter \\#3 \\$existingRepos of static method Composer\\\\Repository\\\\RepositoryFactory\\:\\:generateRepositoryName\\(\\) expects array\\, array\\ given\\.$#" + count: 1 + path: ../src/Composer/Command/CreateProjectCommand.php + + - + message: "#^Short ternary operator is not allowed\\. Use null coalesce operator if applicable or consider using long ternary\\.$#" + count: 5 + path: ../src/Composer/Command/CreateProjectCommand.php + + - + message: "#^Variable method call on Composer\\\\Package\\\\RootPackageInterface\\.$#" + count: 1 + path: ../src/Composer/Command/CreateProjectCommand.php + + - + message: "#^Cannot access offset 'libz_version' on array\\|false\\.$#" + count: 1 + path: ../src/Composer/Command/DiagnoseCommand.php + + - + message: "#^Cannot access offset 'ssl_version' on array\\|false\\.$#" + count: 1 + path: ../src/Composer/Command/DiagnoseCommand.php + + - + message: "#^Cannot access offset 'version' on array\\|false\\.$#" + count: 1 + path: ../src/Composer/Command/DiagnoseCommand.php + + - + message: "#^Cannot call method getPrettyVersion\\(\\) on Composer\\\\Package\\\\BasePackage\\|null\\.$#" + count: 1 + path: ../src/Composer/Command/DiagnoseCommand.php + + - + message: "#^Construct empty\\(\\) is not allowed\\. Use more strict comparison\\.$#" + count: 4 + path: ../src/Composer/Command/DiagnoseCommand.php + + - + message: "#^Only booleans are allowed in a negated boolean, array\\ given\\.$#" + count: 1 + path: ../src/Composer/Command/DiagnoseCommand.php + + - + message: "#^Only booleans are allowed in a negated boolean, array\\ given\\.$#" + count: 1 + path: ../src/Composer/Command/DiagnoseCommand.php + + - + message: "#^Only booleans are allowed in a negated boolean, array\\\\|string\\|false given\\.$#" + count: 1 + path: ../src/Composer/Command/DiagnoseCommand.php + + - + message: "#^Only booleans are allowed in a negated boolean, string\\|false given\\.$#" + count: 1 + path: ../src/Composer/Command/DiagnoseCommand.php + + - + message: "#^Only booleans are allowed in an if condition, Composer\\\\Composer\\|null given\\.$#" + count: 2 + path: ../src/Composer/Command/DiagnoseCommand.php + + - + message: "#^Only booleans are allowed in an if condition, array\\ given\\.$#" + count: 1 + path: ../src/Composer/Command/DiagnoseCommand.php + + - + message: "#^Only booleans are allowed in an if condition, array\\\\|null given\\.$#" + count: 1 + path: ../src/Composer/Command/DiagnoseCommand.php + + - + message: "#^Only booleans are allowed in an if condition, array\\\\|string\\|false given\\.$#" + count: 1 + path: ../src/Composer/Command/DiagnoseCommand.php + + - + message: "#^Only booleans are allowed in an if condition, mixed given\\.$#" + count: 1 + path: ../src/Composer/Command/DiagnoseCommand.php + + - + message: "#^Only booleans are allowed in an if condition, string\\|null given\\.$#" + count: 1 + path: ../src/Composer/Command/DiagnoseCommand.php + + - + message: "#^Only booleans are allowed in \\|\\|, array\\ given on the left side\\.$#" + count: 1 + path: ../src/Composer/Command/DiagnoseCommand.php + + - + message: "#^Only booleans are allowed in \\|\\|, array\\ given on the right side\\.$#" + count: 1 + path: ../src/Composer/Command/DiagnoseCommand.php + + - + message: "#^Parameter \\#1 \\$haystack of function strpos expects string, string\\|null given\\.$#" + count: 1 + path: ../src/Composer/Command/DiagnoseCommand.php + + - + message: "#^Parameter \\#1 \\$string of function trim expects string, string\\|false given\\.$#" + count: 1 + path: ../src/Composer/Command/DiagnoseCommand.php + + - + message: "#^Parameter \\#2 \\$data of function hash expects string, string\\|null given\\.$#" + count: 1 + path: ../src/Composer/Command/DiagnoseCommand.php + + - + message: "#^Parameter \\#2 \\$subject of static method Composer\\\\Pcre\\\\Preg\\:\\:isMatch\\(\\) expects string, string\\|false given\\.$#" + count: 1 + path: ../src/Composer/Command/DiagnoseCommand.php + + - + message: "#^Short ternary operator is not allowed\\. Use null coalesce operator if applicable or consider using long ternary\\.$#" + count: 3 + path: ../src/Composer/Command/DiagnoseCommand.php + + - + message: "#^Cannot call method getAutoloadGenerator\\(\\) on Composer\\\\Composer\\|null\\.$#" + count: 1 + path: ../src/Composer/Command/DumpAutoloadCommand.php + + - + message: "#^Cannot call method getConfig\\(\\) on Composer\\\\Composer\\|null\\.$#" + count: 1 + path: ../src/Composer/Command/DumpAutoloadCommand.php + + - + message: "#^Cannot call method getEventDispatcher\\(\\) on Composer\\\\Composer\\|null\\.$#" + count: 1 + path: ../src/Composer/Command/DumpAutoloadCommand.php + + - + message: "#^Cannot call method getInstallationManager\\(\\) on Composer\\\\Composer\\|null\\.$#" + count: 1 + path: ../src/Composer/Command/DumpAutoloadCommand.php + + - + message: "#^Cannot call method getPackage\\(\\) on Composer\\\\Composer\\|null\\.$#" + count: 1 + path: ../src/Composer/Command/DumpAutoloadCommand.php + + - + message: "#^Cannot call method getRepositoryManager\\(\\) on Composer\\\\Composer\\|null\\.$#" + count: 1 + path: ../src/Composer/Command/DumpAutoloadCommand.php + + - + message: "#^Only booleans are allowed in an if condition, mixed given\\.$#" + count: 3 + path: ../src/Composer/Command/DumpAutoloadCommand.php + + - + message: "#^Only booleans are allowed in \\|\\|, mixed given on the left side\\.$#" + count: 2 + path: ../src/Composer/Command/DumpAutoloadCommand.php + + - + message: "#^Only booleans are allowed in \\|\\|, mixed given on the right side\\.$#" + count: 4 + path: ../src/Composer/Command/DumpAutoloadCommand.php + + - + message: "#^Short ternary operator is not allowed\\. Use null coalesce operator if applicable or consider using long ternary\\.$#" + count: 2 + path: ../src/Composer/Command/DumpAutoloadCommand.php + + - + message: "#^Cannot call method getConfig\\(\\) on Composer\\\\Composer\\|null\\.$#" + count: 1 + path: ../src/Composer/Command/ExecCommand.php + + - + message: "#^Cannot call method getEventDispatcher\\(\\) on Composer\\\\Composer\\|null\\.$#" + count: 1 + path: ../src/Composer/Command/ExecCommand.php + + - + message: "#^Cannot call method getPackage\\(\\) on Composer\\\\Composer\\|null\\.$#" + count: 1 + path: ../src/Composer/Command/ExecCommand.php + + - + message: "#^Only booleans are allowed in a negated boolean, array\\ given\\.$#" + count: 1 + path: ../src/Composer/Command/ExecCommand.php + + - + message: "#^Only booleans are allowed in a negated boolean, mixed given\\.$#" + count: 1 + path: ../src/Composer/Command/ExecCommand.php + + - + message: "#^Only booleans are allowed in \\|\\|, mixed given on the left side\\.$#" + count: 1 + path: ../src/Composer/Command/ExecCommand.php + + - + message: "#^Parameter \\#1 \\.\\.\\.\\$arrays of function array_merge expects array, array\\\\|false given\\.$#" + count: 1 + path: ../src/Composer/Command/ExecCommand.php + + - + message: "#^Call to function in_array\\(\\) requires parameter \\#3 to be set\\.$#" + count: 1 + path: ../src/Composer/Command/FundCommand.php + + - + message: "#^Cannot call method getRepositoryManager\\(\\) on Composer\\\\Composer\\|null\\.$#" + count: 2 + path: ../src/Composer/Command/FundCommand.php + + - + message: "#^Construct empty\\(\\) is not allowed\\. Use more strict comparison\\.$#" + count: 2 + path: ../src/Composer/Command/FundCommand.php + + - + message: "#^Only booleans are allowed in &&, array given on the left side\\.$#" + count: 1 + path: ../src/Composer/Command/FundCommand.php + + - + message: "#^Only booleans are allowed in &&, array\\\\> given on the right side\\.$#" + count: 2 + path: ../src/Composer/Command/FundCommand.php + + - + message: "#^Only booleans are allowed in &&, string given on the left side\\.$#" + count: 1 + path: ../src/Composer/Command/GlobalCommand.php + + - + message: "#^Only booleans are allowed in an if condition, string\\|false given\\.$#" + count: 1 + path: ../src/Composer/Command/GlobalCommand.php + + - + message: "#^Cannot call method getPackage\\(\\) on Composer\\\\Composer\\|null\\.$#" + count: 1 + path: ../src/Composer/Command/HomeCommand.php + + - + message: "#^Only booleans are allowed in a negated boolean, mixed given\\.$#" + count: 1 + path: ../src/Composer/Command/HomeCommand.php + + - + message: "#^Only booleans are allowed in a negated boolean, string\\|false given\\.$#" + count: 1 + path: ../src/Composer/Command/HomeCommand.php + + - + message: "#^Only booleans are allowed in a negated boolean, string\\|null given\\.$#" + count: 2 + path: ../src/Composer/Command/HomeCommand.php + + - + message: "#^Only booleans are allowed in a ternary operator condition, mixed given\\.$#" + count: 1 + path: ../src/Composer/Command/HomeCommand.php + + - + message: "#^Only booleans are allowed in an if condition, Composer\\\\Composer\\|null given\\.$#" + count: 1 + path: ../src/Composer/Command/HomeCommand.php + + - + message: "#^Anonymous function uses \\$this assigned to variable \\$self\\. Use \\$this directly in the function body\\.$#" + count: 1 + path: ../src/Composer/Command/InitCommand.php + + - + message: "#^Argument of an invalid type array\\\\|false supplied for foreach, only iterables are supported\\.$#" + count: 1 + path: ../src/Composer/Command/InitCommand.php + + - + message: "#^Binary operation \"\\.\" between 'The package name ' and non\\-empty\\-array\\|float\\|int\\\\|int\\<1, max\\>\\|non\\-empty\\-string\\|true results in an error\\.$#" + count: 1 + path: ../src/Composer/Command/InitCommand.php + + - + message: "#^Call to function method_exists\\(\\) with 'Symfony\\\\\\\\Component…' and 'fromShellCommandline' will always evaluate to true\\.$#" + count: 1 + path: ../src/Composer/Command/InitCommand.php + + - + message: "#^Cannot call method get\\(\\) on Symfony\\\\Component\\\\Console\\\\Helper\\\\HelperSet\\|null\\.$#" + count: 1 + path: ../src/Composer/Command/InitCommand.php + + - + message: "#^Cannot call method getRepoName\\(\\) on Composer\\\\Repository\\\\RepositoryInterface\\|null\\.$#" + count: 4 + path: ../src/Composer/Command/InitCommand.php + + - + message: "#^Cannot call method getRepositoryManager\\(\\) on Composer\\\\Composer\\|null\\.$#" + count: 1 + path: ../src/Composer/Command/InitCommand.php + + - + message: "#^Cannot call method search\\(\\) on Composer\\\\Repository\\\\CompositeRepository\\|null\\.$#" + count: 1 + path: ../src/Composer/Command/InitCommand.php + + - + message: "#^Construct empty\\(\\) is not allowed\\. Use more strict comparison\\.$#" + count: 9 + path: ../src/Composer/Command/InitCommand.php + + - + message: "#^Instanceof between Composer\\\\Repository\\\\CompositeRepository and Composer\\\\Repository\\\\CompositeRepository will always evaluate to true\\.$#" + count: 1 + path: ../src/Composer/Command/InitCommand.php + + - + message: "#^Method Composer\\\\Command\\\\InitCommand\\:\\:getGitConfig\\(\\) should return array\\ but returns array\\\\.$#" + count: 1 + path: ../src/Composer/Command/InitCommand.php + + - + message: "#^Only booleans are allowed in &&, Composer\\\\Package\\\\PackageInterface\\|false given on the right side\\.$#" + count: 3 + path: ../src/Composer/Command/InitCommand.php + + - + message: "#^Only booleans are allowed in &&, string\\|null given on the left side\\.$#" + count: 1 + path: ../src/Composer/Command/InitCommand.php + + - + message: "#^Only booleans are allowed in a negated boolean, Composer\\\\Package\\\\BasePackage\\|null given\\.$#" + count: 1 + path: ../src/Composer/Command/InitCommand.php + + - + message: "#^Only booleans are allowed in a negated boolean, Composer\\\\Package\\\\PackageInterface\\|false given\\.$#" + count: 1 + path: ../src/Composer/Command/InitCommand.php + + - + message: "#^Only booleans are allowed in a negated boolean, Composer\\\\Repository\\\\CompositeRepository\\|null given\\.$#" + count: 1 + path: ../src/Composer/Command/InitCommand.php + + - + message: "#^Only booleans are allowed in a negated boolean, Composer\\\\Repository\\\\PlatformRepository\\|null given\\.$#" + count: 1 + path: ../src/Composer/Command/InitCommand.php + + - + message: "#^Only booleans are allowed in a negated boolean, array\\ given\\.$#" + count: 1 + path: ../src/Composer/Command/InitCommand.php + + - + message: "#^Only booleans are allowed in a negated boolean, mixed given\\.$#" + count: 1 + path: ../src/Composer/Command/InitCommand.php + + - + message: "#^Only booleans are allowed in a negated boolean, string given\\.$#" + count: 1 + path: ../src/Composer/Command/InitCommand.php + + - + message: "#^Only booleans are allowed in a negated boolean, true\\|null given\\.$#" + count: 1 + path: ../src/Composer/Command/InitCommand.php + + - + message: "#^Only booleans are allowed in a ternary operator condition, Composer\\\\Composer\\|null given\\.$#" + count: 1 + path: ../src/Composer/Command/InitCommand.php + + - + message: "#^Only booleans are allowed in a ternary operator condition, bool\\|null given\\.$#" + count: 1 + path: ../src/Composer/Command/InitCommand.php + + - + message: "#^Only booleans are allowed in a ternary operator condition, string\\|null given\\.$#" + count: 1 + path: ../src/Composer/Command/InitCommand.php + + - + message: "#^Only booleans are allowed in an elseif condition, string given\\.$#" + count: 1 + path: ../src/Composer/Command/InitCommand.php + + - + message: "#^Only booleans are allowed in an if condition, Composer\\\\Package\\\\BasePackage\\|null given\\.$#" + count: 1 + path: ../src/Composer/Command/InitCommand.php + + - + message: "#^Only booleans are allowed in an if condition, Composer\\\\Package\\\\PackageInterface\\|false given\\.$#" + count: 3 + path: ../src/Composer/Command/InitCommand.php + + - + message: "#^Only booleans are allowed in an if condition, Composer\\\\Repository\\\\InstalledRepositoryInterface\\|null given\\.$#" + count: 1 + path: ../src/Composer/Command/InitCommand.php + + - + message: "#^Only booleans are allowed in an if condition, array\\ given\\.$#" + count: 2 + path: ../src/Composer/Command/InitCommand.php + + - + message: "#^Only booleans are allowed in an if condition, int\\<0, max\\> given\\.$#" + count: 1 + path: ../src/Composer/Command/InitCommand.php + + - + message: "#^Only booleans are allowed in an if condition, mixed given\\.$#" + count: 2 + path: ../src/Composer/Command/InitCommand.php + + - + message: "#^Only booleans are allowed in \\|\\|, mixed given on the left side\\.$#" + count: 2 + path: ../src/Composer/Command/InitCommand.php + + - + message: "#^Parameter \\#1 \\$author of method Composer\\\\Command\\\\InitCommand\\:\\:formatAuthors\\(\\) expects string, array\\|float\\|int\\\\|int\\<1, max\\>\\|string\\|true given\\.$#" + count: 1 + path: ../src/Composer/Command/InitCommand.php + + - + message: "#^Parameter \\#1 \\$haystack of function strpos expects string, string\\|false given\\.$#" + count: 1 + path: ../src/Composer/Command/InitCommand.php + + - + message: "#^Parameter \\#1 \\$json of function json_decode expects string, string\\|false given\\.$#" + count: 1 + path: ../src/Composer/Command/InitCommand.php + + - + message: "#^Parameter \\#1 \\$path of function basename expects string, string\\|false given\\.$#" + count: 1 + path: ../src/Composer/Command/InitCommand.php + + - + message: "#^Parameter \\#2 \\$subject of static method Composer\\\\Pcre\\\\Preg\\:\\:isMatch\\(\\) expects string, array\\|float\\|int\\\\|int\\<1, max\\>\\|string\\|true given\\.$#" + count: 1 + path: ../src/Composer/Command/InitCommand.php + + - + message: "#^Parameter \\#3 \\$length of function substr expects int\\|null, int\\<0, max\\>\\|false given\\.$#" + count: 1 + path: ../src/Composer/Command/InitCommand.php + + - + message: "#^Short ternary operator is not allowed\\. Use null coalesce operator if applicable or consider using long ternary\\.$#" + count: 15 + path: ../src/Composer/Command/InitCommand.php + + - + message: "#^Cannot call method getConfig\\(\\) on Composer\\\\Composer\\|null\\.$#" + count: 1 + path: ../src/Composer/Command/InstallCommand.php + + - + message: "#^Cannot call method getEventDispatcher\\(\\) on Composer\\\\Composer\\|null\\.$#" + count: 1 + path: ../src/Composer/Command/InstallCommand.php + + - + message: "#^Cannot call method getInstallationManager\\(\\) on Composer\\\\Composer\\|null\\.$#" + count: 1 + path: ../src/Composer/Command/InstallCommand.php + + - + message: "#^Cannot call method getLocker\\(\\) on Composer\\\\Composer\\|null\\.$#" + count: 2 + path: ../src/Composer/Command/InstallCommand.php + + - + message: "#^Only booleans are allowed in a negated boolean, Composer\\\\Package\\\\Locker\\|null given\\.$#" + count: 1 + path: ../src/Composer/Command/InstallCommand.php + + - + message: "#^Only booleans are allowed in a negated boolean, mixed given\\.$#" + count: 3 + path: ../src/Composer/Command/InstallCommand.php + + - + message: "#^Only booleans are allowed in an if condition, mixed given\\.$#" + count: 5 + path: ../src/Composer/Command/InstallCommand.php + + - + message: "#^Only booleans are allowed in \\|\\|, mixed given on the left side\\.$#" + count: 2 + path: ../src/Composer/Command/InstallCommand.php + + - + message: "#^Only booleans are allowed in \\|\\|, mixed given on the right side\\.$#" + count: 4 + path: ../src/Composer/Command/InstallCommand.php + + - + message: "#^Parameter \\#2 \\$composer of static method Composer\\\\Installer\\:\\:create\\(\\) expects Composer\\\\Composer, Composer\\\\Composer\\|null given\\.$#" + count: 1 + path: ../src/Composer/Command/InstallCommand.php + + - + message: "#^Short ternary operator is not allowed\\. Use null coalesce operator if applicable or consider using long ternary\\.$#" + count: 2 + path: ../src/Composer/Command/InstallCommand.php + + - + message: "#^Call to function in_array\\(\\) requires parameter \\#3 to be set\\.$#" + count: 2 + path: ../src/Composer/Command/LicensesCommand.php + + - + message: "#^Call to function method_exists\\(\\) with Symfony\\\\Component\\\\Console\\\\Helper\\\\TableStyle and 'setVerticalBorderCh…' will always evaluate to true\\.$#" + count: 1 + path: ../src/Composer/Command/LicensesCommand.php + + - + message: "#^Cannot call method getEventDispatcher\\(\\) on Composer\\\\Composer\\|null\\.$#" + count: 1 + path: ../src/Composer/Command/LicensesCommand.php + + - + message: "#^Cannot call method getPackage\\(\\) on Composer\\\\Composer\\|null\\.$#" + count: 1 + path: ../src/Composer/Command/LicensesCommand.php + + - + message: "#^Cannot call method getRepositoryManager\\(\\) on Composer\\\\Composer\\|null\\.$#" + count: 1 + path: ../src/Composer/Command/LicensesCommand.php + + - + message: "#^Foreach overwrites \\$package with its value variable\\.$#" + count: 1 + path: ../src/Composer/Command/LicensesCommand.php + + - + message: "#^Only booleans are allowed in an if condition, mixed given\\.$#" + count: 1 + path: ../src/Composer/Command/LicensesCommand.php + + - + message: "#^Short ternary operator is not allowed\\. Use null coalesce operator if applicable or consider using long ternary\\.$#" + count: 2 + path: ../src/Composer/Command/LicensesCommand.php + + - + message: "#^Only booleans are allowed in a negated boolean, mixed given\\.$#" + count: 1 + path: ../src/Composer/Command/OutdatedCommand.php + + - + message: "#^Only booleans are allowed in an if condition, mixed given\\.$#" + count: 8 + path: ../src/Composer/Command/OutdatedCommand.php + + - + message: "#^Cannot call method getAutoloadGenerator\\(\\) on Composer\\\\Composer\\|null\\.$#" + count: 1 + path: ../src/Composer/Command/ReinstallCommand.php + + - + message: "#^Cannot call method getConfig\\(\\) on Composer\\\\Composer\\|null\\.$#" + count: 1 + path: ../src/Composer/Command/ReinstallCommand.php + + - + message: "#^Cannot call method getDownloadManager\\(\\) on Composer\\\\Composer\\|null\\.$#" + count: 1 + path: ../src/Composer/Command/ReinstallCommand.php + + - + message: "#^Cannot call method getEventDispatcher\\(\\) on Composer\\\\Composer\\|null\\.$#" + count: 1 + path: ../src/Composer/Command/ReinstallCommand.php + + - + message: "#^Cannot call method getInstallationManager\\(\\) on Composer\\\\Composer\\|null\\.$#" + count: 1 + path: ../src/Composer/Command/ReinstallCommand.php + + - + message: "#^Cannot call method getPackage\\(\\) on Composer\\\\Composer\\|null\\.$#" + count: 1 + path: ../src/Composer/Command/ReinstallCommand.php + + - + message: "#^Cannot call method getRepositoryManager\\(\\) on Composer\\\\Composer\\|null\\.$#" + count: 1 + path: ../src/Composer/Command/ReinstallCommand.php + + - + message: "#^Only booleans are allowed in a negated boolean, array\\ given\\.$#" + count: 1 + path: ../src/Composer/Command/ReinstallCommand.php + + - + message: "#^Only booleans are allowed in a negated boolean, mixed given\\.$#" + count: 2 + path: ../src/Composer/Command/ReinstallCommand.php + + - + message: "#^Only booleans are allowed in an if condition, mixed given\\.$#" + count: 1 + path: ../src/Composer/Command/ReinstallCommand.php + + - + message: "#^Only booleans are allowed in \\|\\|, mixed given on the left side\\.$#" + count: 2 + path: ../src/Composer/Command/ReinstallCommand.php + + - + message: "#^Only booleans are allowed in \\|\\|, mixed given on the right side\\.$#" + count: 4 + path: ../src/Composer/Command/ReinstallCommand.php + + - + message: "#^Short ternary operator is not allowed\\. Use null coalesce operator if applicable or consider using long ternary\\.$#" + count: 2 + path: ../src/Composer/Command/ReinstallCommand.php + + - + message: "#^Cannot call method getConfig\\(\\) on Composer\\\\Composer\\|null\\.$#" + count: 3 + path: ../src/Composer/Command/RemoveCommand.php + + - + message: "#^Cannot call method getEventDispatcher\\(\\) on Composer\\\\Composer\\|null\\.$#" + count: 1 + path: ../src/Composer/Command/RemoveCommand.php + + - + message: "#^Cannot call method getInstallationManager\\(\\) on Composer\\\\Composer\\|null\\.$#" + count: 1 + path: ../src/Composer/Command/RemoveCommand.php + + - + message: "#^Cannot call method getLockedRepository\\(\\) on Composer\\\\Package\\\\Locker\\|null\\.$#" + count: 1 + path: ../src/Composer/Command/RemoveCommand.php + + - + message: "#^Cannot call method getLocker\\(\\) on Composer\\\\Composer\\|null\\.$#" + count: 2 + path: ../src/Composer/Command/RemoveCommand.php + + - + message: "#^Cannot call method getPackage\\(\\) on Composer\\\\Composer\\|null\\.$#" + count: 3 + path: ../src/Composer/Command/RemoveCommand.php + + - + message: "#^Cannot call method getRepositoryManager\\(\\) on Composer\\\\Composer\\|null\\.$#" + count: 1 + path: ../src/Composer/Command/RemoveCommand.php + + - + message: "#^Cannot call method isLocked\\(\\) on Composer\\\\Package\\\\Locker\\|null\\.$#" + count: 2 + path: ../src/Composer/Command/RemoveCommand.php + + - + message: "#^Foreach overwrites \\$type with its key variable\\.$#" + count: 1 + path: ../src/Composer/Command/RemoveCommand.php + + - + message: "#^Only booleans are allowed in &&, array\\ given on the right side\\.$#" + count: 2 + path: ../src/Composer/Command/RemoveCommand.php + + - + message: "#^Only booleans are allowed in a negated boolean, mixed given\\.$#" + count: 6 + path: ../src/Composer/Command/RemoveCommand.php + + - + message: "#^Only booleans are allowed in a ternary operator condition, mixed given\\.$#" + count: 1 + path: ../src/Composer/Command/RemoveCommand.php + + - + message: "#^Only booleans are allowed in an elseif condition, mixed given\\.$#" + count: 1 + path: ../src/Composer/Command/RemoveCommand.php + + - + message: "#^Only booleans are allowed in an if condition, Composer\\\\Composer\\|null given\\.$#" + count: 1 + path: ../src/Composer/Command/RemoveCommand.php + + - + message: "#^Only booleans are allowed in an if condition, array\\ given\\.$#" + count: 1 + path: ../src/Composer/Command/RemoveCommand.php + + - + message: "#^Only booleans are allowed in an if condition, mixed given\\.$#" + count: 8 + path: ../src/Composer/Command/RemoveCommand.php + + - + message: "#^Only booleans are allowed in \\|\\|, mixed given on the left side\\.$#" + count: 3 + path: ../src/Composer/Command/RemoveCommand.php + + - + message: "#^Only booleans are allowed in \\|\\|, mixed given on the right side\\.$#" + count: 5 + path: ../src/Composer/Command/RemoveCommand.php + + - + message: "#^Parameter \\#2 \\$array of static method Composer\\\\Pcre\\\\Preg\\:\\:grep\\(\\) expects array\\, array\\ given\\.$#" + count: 2 + path: ../src/Composer/Command/RemoveCommand.php + + - + message: "#^Parameter \\#2 \\$composer of static method Composer\\\\Installer\\:\\:create\\(\\) expects Composer\\\\Composer, Composer\\\\Composer\\|null given\\.$#" + count: 1 + path: ../src/Composer/Command/RemoveCommand.php + + - + message: "#^Short ternary operator is not allowed\\. Use null coalesce operator if applicable or consider using long ternary\\.$#" + count: 2 + path: ../src/Composer/Command/RemoveCommand.php + + - + message: "#^Cannot call method getConfig\\(\\) on Composer\\\\Composer\\|null\\.$#" + count: 6 + path: ../src/Composer/Command/RequireCommand.php + + - + message: "#^Cannot call method getEventDispatcher\\(\\) on Composer\\\\Composer\\|null\\.$#" + count: 2 + path: ../src/Composer/Command/RequireCommand.php + + - + message: "#^Cannot call method getInstallationManager\\(\\) on Composer\\\\Composer\\|null\\.$#" + count: 1 + path: ../src/Composer/Command/RequireCommand.php + + - + message: "#^Cannot call method getLocker\\(\\) on Composer\\\\Composer\\|null\\.$#" + count: 1 + path: ../src/Composer/Command/RequireCommand.php + + - + message: "#^Cannot call method getPackage\\(\\) on Composer\\\\Composer\\|null\\.$#" + count: 4 + path: ../src/Composer/Command/RequireCommand.php + + - + message: "#^Cannot call method getPluginManager\\(\\) on Composer\\\\Composer\\|null\\.$#" + count: 1 + path: ../src/Composer/Command/RequireCommand.php + + - + message: "#^Cannot call method getRepositoryManager\\(\\) on Composer\\\\Composer\\|null\\.$#" + count: 1 + path: ../src/Composer/Command/RequireCommand.php + + - + message: "#^Cannot call method isLocked\\(\\) on Composer\\\\Package\\\\Locker\\|null\\.$#" + count: 1 + path: ../src/Composer/Command/RequireCommand.php + + - + message: "#^Construct empty\\(\\) is not allowed\\. Use more strict comparison\\.$#" + count: 4 + path: ../src/Composer/Command/RequireCommand.php + + - + message: "#^Method Composer\\\\Command\\\\RequireCommand\\:\\:getPackagesByRequireKey\\(\\) should return array\\ but returns array\\\\.$#" + count: 1 + path: ../src/Composer/Command/RequireCommand.php + + - + message: "#^Only booleans are allowed in a negated boolean, int\\<0, max\\>\\|false given\\.$#" + count: 1 + path: ../src/Composer/Command/RequireCommand.php + + - + message: "#^Only booleans are allowed in a negated boolean, mixed given\\.$#" + count: 6 + path: ../src/Composer/Command/RequireCommand.php + + - + message: "#^Only booleans are allowed in a ternary operator condition, mixed given\\.$#" + count: 4 + path: ../src/Composer/Command/RequireCommand.php + + - + message: "#^Only booleans are allowed in an if condition, mixed given\\.$#" + count: 3 + path: ../src/Composer/Command/RequireCommand.php + + - + message: "#^Only booleans are allowed in an if condition, string\\|null given\\.$#" + count: 2 + path: ../src/Composer/Command/RequireCommand.php + + - + message: "#^Only booleans are allowed in \\|\\|, mixed given on the left side\\.$#" + count: 5 + path: ../src/Composer/Command/RequireCommand.php + + - + message: "#^Only booleans are allowed in \\|\\|, mixed given on the right side\\.$#" + count: 7 + path: ../src/Composer/Command/RequireCommand.php + + - + message: "#^Parameter \\#1 \\$contents of class Composer\\\\Json\\\\JsonManipulator constructor expects string, string\\|false given\\.$#" + count: 1 + path: ../src/Composer/Command/RequireCommand.php + + - + message: "#^Parameter \\#2 \\$composer of static method Composer\\\\Installer\\:\\:create\\(\\) expects Composer\\\\Composer, Composer\\\\Composer\\|null given\\.$#" + count: 1 + path: ../src/Composer/Command/RequireCommand.php + + - + message: "#^Property Composer\\\\Command\\\\RequireCommand\\:\\:\\$composerBackup \\(string\\) does not accept string\\|false\\.$#" + count: 1 + path: ../src/Composer/Command/RequireCommand.php + + - + message: "#^Property Composer\\\\Command\\\\RequireCommand\\:\\:\\$lockBackup \\(string\\|null\\) does not accept string\\|false\\|null\\.$#" + count: 1 + path: ../src/Composer/Command/RequireCommand.php + + - + message: "#^Short ternary operator is not allowed\\. Use null coalesce operator if applicable or consider using long ternary\\.$#" + count: 3 + path: ../src/Composer/Command/RequireCommand.php + + - + message: "#^Call to function in_array\\(\\) requires parameter \\#3 to be set\\.$#" + count: 1 + path: ../src/Composer/Command/RunScriptCommand.php + + - + message: "#^Cannot call method getEventDispatcher\\(\\) on Composer\\\\Composer\\|null\\.$#" + count: 2 + path: ../src/Composer/Command/RunScriptCommand.php + + - + message: "#^Cannot call method getPackage\\(\\) on Composer\\\\Composer\\|null\\.$#" + count: 1 + path: ../src/Composer/Command/RunScriptCommand.php + + - + message: "#^Only booleans are allowed in a negated boolean, int\\<0, max\\> given\\.$#" + count: 1 + path: ../src/Composer/Command/RunScriptCommand.php + + - + message: "#^Only booleans are allowed in a negated boolean, mixed given\\.$#" + count: 2 + path: ../src/Composer/Command/RunScriptCommand.php + + - + message: "#^Only booleans are allowed in an if condition, mixed given\\.$#" + count: 1 + path: ../src/Composer/Command/RunScriptCommand.php + + - + message: "#^Only booleans are allowed in \\|\\|, mixed given on the left side\\.$#" + count: 1 + path: ../src/Composer/Command/RunScriptCommand.php + + - + message: "#^Parameter \\#2 \\$composer of class Composer\\\\Script\\\\Event constructor expects Composer\\\\Composer, Composer\\\\Composer\\|null given\\.$#" + count: 1 + path: ../src/Composer/Command/RunScriptCommand.php + + - + message: "#^Cannot call method getEventDispatcher\\(\\) on Composer\\\\Composer\\|null\\.$#" + count: 1 + path: ../src/Composer/Command/ScriptAliasCommand.php + + - + message: "#^Construct empty\\(\\) is not allowed\\. Use more strict comparison\\.$#" + count: 1 + path: ../src/Composer/Command/ScriptAliasCommand.php + + - + message: "#^Only booleans are allowed in a negated boolean, mixed given\\.$#" + count: 1 + path: ../src/Composer/Command/ScriptAliasCommand.php + + - + message: "#^Only booleans are allowed in \\|\\|, mixed given on the left side\\.$#" + count: 1 + path: ../src/Composer/Command/ScriptAliasCommand.php + + - + message: "#^Parameter \\#3 \\$additionalArgs of method Composer\\\\EventDispatcher\\\\EventDispatcher\\:\\:dispatchScript\\(\\) expects array\\, array\\|bool\\|float\\|int\\|string\\|null given\\.$#" + count: 1 + path: ../src/Composer/Command/ScriptAliasCommand.php + + - + message: "#^Call to function in_array\\(\\) requires parameter \\#3 to be set\\.$#" + count: 1 + path: ../src/Composer/Command/SearchCommand.php + + - + message: "#^Construct empty\\(\\) is not allowed\\. Use more strict comparison\\.$#" + count: 1 + path: ../src/Composer/Command/SearchCommand.php + + - + message: "#^Only booleans are allowed in &&, array\\\\> given on the left side\\.$#" + count: 1 + path: ../src/Composer/Command/SearchCommand.php + + - + message: "#^Only booleans are allowed in a negated boolean, Composer\\\\Composer\\|null given\\.$#" + count: 1 + path: ../src/Composer/Command/SearchCommand.php + + - + message: "#^Call to function base64_decode\\(\\) requires parameter \\#2 to be set\\.$#" + count: 1 + path: ../src/Composer/Command/SelfUpdateCommand.php + + - + message: "#^Call to function in_array\\(\\) requires parameter \\#3 to be set\\.$#" + count: 1 + path: ../src/Composer/Command/SelfUpdateCommand.php + + - + message: "#^Cannot access offset 'name' on array\\|false\\.$#" + count: 2 + path: ../src/Composer/Command/SelfUpdateCommand.php + + - + message: "#^Only booleans are allowed in &&, mixed given on the right side\\.$#" + count: 1 + path: ../src/Composer/Command/SelfUpdateCommand.php + + - + message: "#^Only booleans are allowed in &&, string\\|null given on the left side\\.$#" + count: 2 + path: ../src/Composer/Command/SelfUpdateCommand.php + + - + message: "#^Only booleans are allowed in a negated boolean, mixed given\\.$#" + count: 1 + path: ../src/Composer/Command/SelfUpdateCommand.php + + - + message: "#^Only booleans are allowed in a negated boolean, string\\|false given\\.$#" + count: 1 + path: ../src/Composer/Command/SelfUpdateCommand.php + + - + message: "#^Only booleans are allowed in a negated boolean, string\\|null given\\.$#" + count: 1 + path: ../src/Composer/Command/SelfUpdateCommand.php + + - + message: "#^Only booleans are allowed in a ternary operator condition, string\\|null given\\.$#" + count: 2 + path: ../src/Composer/Command/SelfUpdateCommand.php + + - + message: "#^Only booleans are allowed in an if condition, int\\<0, max\\> given\\.$#" + count: 1 + path: ../src/Composer/Command/SelfUpdateCommand.php + + - + message: "#^Only booleans are allowed in an if condition, mixed given\\.$#" + count: 6 + path: ../src/Composer/Command/SelfUpdateCommand.php + + - + message: "#^Only booleans are allowed in an if condition, string\\|false given\\.$#" + count: 1 + path: ../src/Composer/Command/SelfUpdateCommand.php + + - + message: "#^Only booleans are allowed in an if condition, string\\|null given\\.$#" + count: 2 + path: ../src/Composer/Command/SelfUpdateCommand.php + + - + message: "#^Parameter \\#1 \\$data of function openssl_verify expects string, string\\|false given\\.$#" + count: 1 + path: ../src/Composer/Command/SelfUpdateCommand.php + + - + message: "#^Parameter \\#1 \\$from of function rename expects string, string\\|false given\\.$#" + count: 1 + path: ../src/Composer/Command/SelfUpdateCommand.php + + - + message: "#^Parameter \\#1 \\$user_id of function posix_getpwuid expects int, int\\|false given\\.$#" + count: 1 + path: ../src/Composer/Command/SelfUpdateCommand.php + + - + message: "#^Parameter \\#2 \\$except of method Composer\\\\Command\\\\SelfUpdateCommand\\:\\:cleanBackups\\(\\) expects string\\|null, string\\|false given\\.$#" + count: 1 + path: ../src/Composer/Command/SelfUpdateCommand.php + + - + message: "#^Parameter \\#2 \\$permissions of function chmod expects int, int\\|false given\\.$#" + count: 1 + path: ../src/Composer/Command/SelfUpdateCommand.php + + - + message: "#^Short ternary operator is not allowed\\. Use null coalesce operator if applicable or consider using long ternary\\.$#" + count: 2 + path: ../src/Composer/Command/SelfUpdateCommand.php + + - + message: "#^Variable \\$match might not be defined\\.$#" + count: 2 + path: ../src/Composer/Command/SelfUpdateCommand.php + + - + message: "#^Argument of an invalid type array\\\\>\\|string supplied for foreach, only iterables are supported\\.$#" + count: 1 + path: ../src/Composer/Command/ShowCommand.php + + - + message: "#^Argument of an invalid type array\\|string supplied for foreach, only iterables are supported\\.$#" + count: 1 + path: ../src/Composer/Command/ShowCommand.php + + - + message: "#^Binary operation \"\\.\" between ' ' and array\\|string results in an error\\.$#" + count: 1 + path: ../src/Composer/Command/ShowCommand.php + + - + message: "#^Binary operation \"\\.\" between '\\latest\\…' and array\\\\|string results in an error\\.$#" + count: 1 + path: ../src/Composer/Command/ShowCommand.php + + - + message: "#^Binary operation \"\\.\" between non\\-empty\\-string and array\\\\|string results in an error\\.$#" + count: 1 + path: ../src/Composer/Command/ShowCommand.php + + - + message: "#^Binary operation \"\\.\" between non\\-empty\\-string and array\\|bool\\|float\\|int\\|string results in an error\\.$#" + count: 1 + path: ../src/Composer/Command/ShowCommand.php + + - + message: "#^Call to function array_search\\(\\) requires parameter \\#3 to be set\\.$#" + count: 1 + path: ../src/Composer/Command/ShowCommand.php + + - + message: "#^Call to function in_array\\(\\) requires parameter \\#3 to be set\\.$#" + count: 1 + path: ../src/Composer/Command/ShowCommand.php + + - + message: "#^Cannot call method getId\\(\\) on Composer\\\\Package\\\\BasePackage\\|int\\.$#" + count: 1 + path: ../src/Composer/Command/ShowCommand.php + + - + message: "#^Cannot call method getInstallationManager\\(\\) on Composer\\\\Composer\\|null\\.$#" + count: 4 + path: ../src/Composer/Command/ShowCommand.php + + - + message: "#^Cannot call method getLockedRepository\\(\\) on Composer\\\\Package\\\\Locker\\|null\\.$#" + count: 2 + path: ../src/Composer/Command/ShowCommand.php + + - + message: "#^Cannot call method getPackage\\(\\) on Composer\\\\Composer\\|null\\.$#" + count: 3 + path: ../src/Composer/Command/ShowCommand.php + + - + message: "#^Cannot call method getPrettyVersion\\(\\) on Composer\\\\Package\\\\BasePackage\\|int\\.$#" + count: 1 + path: ../src/Composer/Command/ShowCommand.php + + - + message: "#^Cannot call method getRepositoryManager\\(\\) on Composer\\\\Composer\\|null\\.$#" + count: 1 + path: ../src/Composer/Command/ShowCommand.php + + - + message: "#^Cannot call method getVersion\\(\\) on Composer\\\\Package\\\\BasePackage\\|int\\.$#" + count: 1 + path: ../src/Composer/Command/ShowCommand.php + + - + message: "#^Cannot call method isLocked\\(\\) on Composer\\\\Package\\\\Locker\\|null\\.$#" + count: 2 + path: ../src/Composer/Command/ShowCommand.php + + - + message: "#^Construct empty\\(\\) is not allowed\\. Use more strict comparison\\.$#" + count: 3 + path: ../src/Composer/Command/ShowCommand.php + + - + message: "#^Foreach overwrites \\$packages with its value variable\\.$#" + count: 1 + path: ../src/Composer/Command/ShowCommand.php + + - + message: "#^Method Composer\\\\Command\\\\ShowCommand\\:\\:addTree\\(\\) should return array\\\\>\\|string\\>\\> but returns array\\\\>\\|string\\>\\>\\|string\\>\\>\\.$#" + count: 1 + path: ../src/Composer/Command/ShowCommand.php + + - + message: "#^Method Composer\\\\Command\\\\ShowCommand\\:\\:appendAutoload\\(\\) should return array\\\\|string\\|null\\> but returns array\\\\|string\\>\\|string\\>\\|string\\|null\\>\\.$#" + count: 1 + path: ../src/Composer/Command/ShowCommand.php + + - + message: "#^Method Composer\\\\Command\\\\ShowCommand\\:\\:appendLicenses\\(\\) should return array\\\\|string\\|null\\> but returns array\\\\|string\\>\\|string\\|null\\>\\.$#" + count: 1 + path: ../src/Composer/Command/ShowCommand.php + + - + message: "#^Method Composer\\\\Command\\\\ShowCommand\\:\\:getPackage\\(\\) should return array\\{Composer\\\\Package\\\\CompletePackageInterface\\|null, array\\\\} but returns array\\{Composer\\\\Package\\\\BasePackage\\|int\\|null, array\\\\}\\.$#" + count: 1 + path: ../src/Composer/Command/ShowCommand.php + + - + message: "#^Offset 'latest\\-status' does not exist on array\\{name\\: string, version\\?\\: string, latest\\: string, latest\\-status\\?\\: string, description\\?\\: string\\|null, path\\?\\: string\\|false, warning\\?\\: non\\-empty\\-string\\}\\.$#" + count: 1 + path: ../src/Composer/Command/ShowCommand.php + + - + message: "#^Only booleans are allowed in &&, Composer\\\\Composer\\|null given on the right side\\.$#" + count: 1 + path: ../src/Composer/Command/ShowCommand.php + + - + message: "#^Only booleans are allowed in &&, Composer\\\\Package\\\\PackageInterface\\|false\\|null given on the right side\\.$#" + count: 1 + path: ../src/Composer/Command/ShowCommand.php + + - + message: "#^Only booleans are allowed in &&, Composer\\\\Package\\\\PackageInterface\\|null given on the left side\\.$#" + count: 1 + path: ../src/Composer/Command/ShowCommand.php + + - + message: "#^Only booleans are allowed in &&, Composer\\\\Package\\\\PackageInterface\\|null given on the right side\\.$#" + count: 1 + path: ../src/Composer/Command/ShowCommand.php + + - + message: "#^Only booleans are allowed in &&, array\\ given on the right side\\.$#" + count: 1 + path: ../src/Composer/Command/ShowCommand.php + + - + message: "#^Only booleans are allowed in &&, array\\ given on the right side\\.$#" + count: 1 + path: ../src/Composer/Command/ShowCommand.php + + - + message: "#^Only booleans are allowed in &&, array\\\\>\\> given on the right side\\.$#" + count: 1 + path: ../src/Composer/Command/ShowCommand.php + + - + message: "#^Only booleans are allowed in &&, mixed given on the left side\\.$#" + count: 14 + path: ../src/Composer/Command/ShowCommand.php + + - + message: "#^Only booleans are allowed in &&, mixed given on the right side\\.$#" + count: 5 + path: ../src/Composer/Command/ShowCommand.php + + - + message: "#^Only booleans are allowed in &&, string given on the left side\\.$#" + count: 1 + path: ../src/Composer/Command/ShowCommand.php + + - + message: "#^Only booleans are allowed in a negated boolean, Composer\\\\Composer\\|null given\\.$#" + count: 2 + path: ../src/Composer/Command/ShowCommand.php + + - + message: "#^Only booleans are allowed in a negated boolean, Composer\\\\Package\\\\BasePackage\\|int\\|null given\\.$#" + count: 1 + path: ../src/Composer/Command/ShowCommand.php + + - + message: "#^Only booleans are allowed in a negated boolean, Composer\\\\Repository\\\\RepositorySet\\|null given\\.$#" + count: 1 + path: ../src/Composer/Command/ShowCommand.php + + - + message: "#^Only booleans are allowed in a negated boolean, array\\ given\\.$#" + count: 1 + path: ../src/Composer/Command/ShowCommand.php + + - + message: "#^Only booleans are allowed in a negated boolean, array\\\\|null given\\.$#" + count: 2 + path: ../src/Composer/Command/ShowCommand.php + + - + message: "#^Only booleans are allowed in a negated boolean, array\\ given\\.$#" + count: 1 + path: ../src/Composer/Command/ShowCommand.php + + - + message: "#^Only booleans are allowed in a negated boolean, array\\\\|string given\\.$#" + count: 1 + path: ../src/Composer/Command/ShowCommand.php + + - + message: "#^Only booleans are allowed in a negated boolean, mixed given\\.$#" + count: 9 + path: ../src/Composer/Command/ShowCommand.php + + - + message: "#^Only booleans are allowed in a negated boolean, string\\|null given\\.$#" + count: 1 + path: ../src/Composer/Command/ShowCommand.php + + - + message: "#^Only booleans are allowed in a ternary operator condition, mixed given\\.$#" + count: 1 + path: ../src/Composer/Command/ShowCommand.php + + - + message: "#^Only booleans are allowed in an elseif condition, mixed given\\.$#" + count: 5 + path: ../src/Composer/Command/ShowCommand.php + + - + message: "#^Only booleans are allowed in an if condition, Composer\\\\Composer\\|null given\\.$#" + count: 3 + path: ../src/Composer/Command/ShowCommand.php + + - + message: "#^Only booleans are allowed in an if condition, Composer\\\\Package\\\\PackageInterface\\|null given\\.$#" + count: 2 + path: ../src/Composer/Command/ShowCommand.php + + - + message: "#^Only booleans are allowed in an if condition, array\\ given\\.$#" + count: 1 + path: ../src/Composer/Command/ShowCommand.php + + - + message: "#^Only booleans are allowed in an if condition, array\\\\>\\|string\\>\\>\\|string\\>\\> given\\.$#" + count: 1 + path: ../src/Composer/Command/ShowCommand.php + + - + message: "#^Only booleans are allowed in an if condition, array\\\\>\\|string\\>\\> given\\.$#" + count: 2 + path: ../src/Composer/Command/ShowCommand.php + + - + message: "#^Only booleans are allowed in an if condition, array\\\\|string\\>\\> given\\.$#" + count: 2 + path: ../src/Composer/Command/ShowCommand.php + + - + message: "#^Only booleans are allowed in an if condition, array\\ given\\.$#" + count: 4 + path: ../src/Composer/Command/ShowCommand.php + + - + message: "#^Only booleans are allowed in an if condition, array\\ given\\.$#" + count: 3 + path: ../src/Composer/Command/ShowCommand.php + + - + message: "#^Only booleans are allowed in an if condition, mixed given\\.$#" + count: 13 + path: ../src/Composer/Command/ShowCommand.php + + - + message: "#^Only booleans are allowed in an if condition, string\\|null given\\.$#" + count: 2 + path: ../src/Composer/Command/ShowCommand.php + + - + message: "#^Only booleans are allowed in \\|\\|, array\\ given on the left side\\.$#" + count: 1 + path: ../src/Composer/Command/ShowCommand.php + + - + message: "#^Only booleans are allowed in \\|\\|, array\\ given on the right side\\.$#" + count: 1 + path: ../src/Composer/Command/ShowCommand.php + + - + message: "#^Only booleans are allowed in \\|\\|, mixed given on the left side\\.$#" + count: 3 + path: ../src/Composer/Command/ShowCommand.php + + - + message: "#^Only booleans are allowed in \\|\\|, mixed given on the right side\\.$#" + count: 4 + path: ../src/Composer/Command/ShowCommand.php + + - + message: "#^Parameter \\#1 \\$arrayTree of method Composer\\\\Command\\\\ShowCommand\\:\\:displayPackageTree\\(\\) expects array\\\\>, array\\\\>\\|string\\|null\\>\\> given\\.$#" + count: 2 + path: ../src/Composer/Command/ShowCommand.php + + - + message: "#^Parameter \\#1 \\$json of method Composer\\\\Command\\\\ShowCommand\\:\\:appendAutoload\\(\\) expects array\\\\|string\\|null\\>, array\\\\|string\\|false\\|null\\> given\\.$#" + count: 1 + path: ../src/Composer/Command/ShowCommand.php + + - + message: "#^Parameter \\#1 \\$package of method Composer\\\\Repository\\\\CompositeRepository\\:\\:hasPackage\\(\\) expects Composer\\\\Package\\\\PackageInterface, Composer\\\\Package\\\\BasePackage\\|int given\\.$#" + count: 1 + path: ../src/Composer/Command/ShowCommand.php + + - + message: "#^Parameter \\#1 \\$str of function strtok expects string, array\\|string given\\.$#" + count: 1 + path: ../src/Composer/Command/ShowCommand.php + + - + message: "#^Parameter \\#1 \\$str of function strtok expects string, string\\|false given\\.$#" + count: 2 + path: ../src/Composer/Command/ShowCommand.php + + - + message: "#^Parameter \\#1 \\$string of function strlen expects string, string\\|false given\\.$#" + count: 1 + path: ../src/Composer/Command/ShowCommand.php + + - + message: "#^Parameter \\#1 \\$string of function substr expects string, string\\|false given\\.$#" + count: 1 + path: ../src/Composer/Command/ShowCommand.php + + - + message: "#^Parameter \\#1 \\$value of function count expects array\\|Countable, array\\\\>\\|string given\\.$#" + count: 1 + path: ../src/Composer/Command/ShowCommand.php + + - + message: "#^Parameter \\#1 \\$value of function count expects array\\|Countable, array\\|string given\\.$#" + count: 1 + path: ../src/Composer/Command/ShowCommand.php + + - + message: "#^Parameter \\#2 \\$callback of function uasort expects callable\\(string, string\\)\\: int, 'version_compare' given\\.$#" + count: 1 + path: ../src/Composer/Command/ShowCommand.php + + - + message: "#^Parameter \\#2 \\$composer of method Composer\\\\Command\\\\ShowCommand\\:\\:findLatestPackage\\(\\) expects Composer\\\\Composer, Composer\\\\Composer\\|null given\\.$#" + count: 2 + path: ../src/Composer/Command/ShowCommand.php + + - + message: "#^Parameter \\#2 \\$literals of method Composer\\\\DependencyResolver\\\\DefaultPolicy\\:\\:selectPreferredPackages\\(\\) expects array\\, array\\ given\\.$#" + count: 1 + path: ../src/Composer/Command/ShowCommand.php + + - + message: "#^Parameter \\#2 \\.\\.\\.\\$values of function sprintf expects bool\\|float\\|int\\|string\\|null, array\\|string given\\.$#" + count: 1 + path: ../src/Composer/Command/ShowCommand.php + + - + message: "#^Parameter \\#3 \\$preferredStability of method Composer\\\\Package\\\\Version\\\\VersionSelector\\:\\:findBestCandidate\\(\\) expects string, string\\|false given\\.$#" + count: 1 + path: ../src/Composer/Command/ShowCommand.php + + - + message: "#^Short ternary operator is not allowed\\. Use null coalesce operator if applicable or consider using long ternary\\.$#" + count: 12 + path: ../src/Composer/Command/ShowCommand.php + + - + message: "#^Variable method call on Composer\\\\Package\\\\CompletePackageInterface\\.$#" + count: 2 + path: ../src/Composer/Command/ShowCommand.php + + - + message: "#^Cannot call method getConfig\\(\\) on Composer\\\\Composer\\|null\\.$#" + count: 1 + path: ../src/Composer/Command/StatusCommand.php + + - + message: "#^Cannot call method getDownloadManager\\(\\) on Composer\\\\Composer\\|null\\.$#" + count: 1 + path: ../src/Composer/Command/StatusCommand.php + + - + message: "#^Cannot call method getEventDispatcher\\(\\) on Composer\\\\Composer\\|null\\.$#" + count: 3 + path: ../src/Composer/Command/StatusCommand.php + + - + message: "#^Cannot call method getInstallationManager\\(\\) on Composer\\\\Composer\\|null\\.$#" + count: 1 + path: ../src/Composer/Command/StatusCommand.php + + - + message: "#^Cannot call method getRepositoryManager\\(\\) on Composer\\\\Composer\\|null\\.$#" + count: 1 + path: ../src/Composer/Command/StatusCommand.php + + - + message: "#^Only booleans are allowed in &&, array\\\\|null given on the right side\\.$#" + count: 1 + path: ../src/Composer/Command/StatusCommand.php + + - + message: "#^Only booleans are allowed in &&, string\\|null given on the left side\\.$#" + count: 1 + path: ../src/Composer/Command/StatusCommand.php + + - + message: "#^Only booleans are allowed in a negated boolean, array\\\\>\\> given\\.$#" + count: 1 + path: ../src/Composer/Command/StatusCommand.php + + - + message: "#^Only booleans are allowed in a negated boolean, array\\ given\\.$#" + count: 2 + path: ../src/Composer/Command/StatusCommand.php + + - + message: "#^Only booleans are allowed in a negated boolean, mixed given\\.$#" + count: 1 + path: ../src/Composer/Command/StatusCommand.php + + - + message: "#^Only booleans are allowed in a ternary operator condition, array\\\\>\\> given\\.$#" + count: 1 + path: ../src/Composer/Command/StatusCommand.php + + - + message: "#^Only booleans are allowed in a ternary operator condition, array\\ given\\.$#" + count: 2 + path: ../src/Composer/Command/StatusCommand.php + + - + message: "#^Only booleans are allowed in an if condition, array\\\\>\\> given\\.$#" + count: 1 + path: ../src/Composer/Command/StatusCommand.php + + - + message: "#^Only booleans are allowed in an if condition, array\\ given\\.$#" + count: 2 + path: ../src/Composer/Command/StatusCommand.php + + - + message: "#^Only booleans are allowed in an if condition, mixed given\\.$#" + count: 3 + path: ../src/Composer/Command/StatusCommand.php + + - + message: "#^Only booleans are allowed in an if condition, string\\|null given\\.$#" + count: 3 + path: ../src/Composer/Command/StatusCommand.php + + - + message: "#^Only booleans are allowed in \\|\\|, array\\\\>\\> given on the right side\\.$#" + count: 1 + path: ../src/Composer/Command/StatusCommand.php + + - + message: "#^Only booleans are allowed in \\|\\|, array\\ given on the left side\\.$#" + count: 1 + path: ../src/Composer/Command/StatusCommand.php + + - + message: "#^Only booleans are allowed in \\|\\|, array\\ given on the right side\\.$#" + count: 1 + path: ../src/Composer/Command/StatusCommand.php + + - + message: "#^Short ternary operator is not allowed\\. Use null coalesce operator if applicable or consider using long ternary\\.$#" + count: 2 + path: ../src/Composer/Command/StatusCommand.php + + - + message: "#^Call to function in_array\\(\\) requires parameter \\#3 to be set\\.$#" + count: 1 + path: ../src/Composer/Command/SuggestsCommand.php + + - + message: "#^Cannot call method getConfig\\(\\) on Composer\\\\Composer\\|null\\.$#" + count: 1 + path: ../src/Composer/Command/SuggestsCommand.php + + - + message: "#^Cannot call method getLockedRepository\\(\\) on Composer\\\\Package\\\\Locker\\|null\\.$#" + count: 1 + path: ../src/Composer/Command/SuggestsCommand.php + + - + message: "#^Cannot call method getLocker\\(\\) on Composer\\\\Composer\\|null\\.$#" + count: 1 + path: ../src/Composer/Command/SuggestsCommand.php + + - + message: "#^Cannot call method getPackage\\(\\) on Composer\\\\Composer\\|null\\.$#" + count: 3 + path: ../src/Composer/Command/SuggestsCommand.php + + - + message: "#^Cannot call method getPlatformOverrides\\(\\) on Composer\\\\Package\\\\Locker\\|null\\.$#" + count: 1 + path: ../src/Composer/Command/SuggestsCommand.php + + - + message: "#^Cannot call method getRepositoryManager\\(\\) on Composer\\\\Composer\\|null\\.$#" + count: 1 + path: ../src/Composer/Command/SuggestsCommand.php + + - + message: "#^Cannot call method isLocked\\(\\) on Composer\\\\Package\\\\Locker\\|null\\.$#" + count: 1 + path: ../src/Composer/Command/SuggestsCommand.php + + - + message: "#^Construct empty\\(\\) is not allowed\\. Use more strict comparison\\.$#" + count: 2 + path: ../src/Composer/Command/SuggestsCommand.php + + - + message: "#^Only booleans are allowed in a negated boolean, mixed given\\.$#" + count: 2 + path: ../src/Composer/Command/SuggestsCommand.php + + - + message: "#^Only booleans are allowed in an if condition, mixed given\\.$#" + count: 3 + path: ../src/Composer/Command/SuggestsCommand.php + + - + message: "#^Short ternary operator is not allowed\\. Use null coalesce operator if applicable or consider using long ternary\\.$#" + count: 1 + path: ../src/Composer/Command/SuggestsCommand.php + + - + message: "#^Call to function array_search\\(\\) requires parameter \\#3 to be set\\.$#" + count: 1 + path: ../src/Composer/Command/UpdateCommand.php + + - + message: "#^Call to function in_array\\(\\) requires parameter \\#3 to be set\\.$#" + count: 1 + path: ../src/Composer/Command/UpdateCommand.php + + - + message: "#^Cannot call method getConfig\\(\\) on Composer\\\\Composer\\|null\\.$#" + count: 1 + path: ../src/Composer/Command/UpdateCommand.php + + - + message: "#^Cannot call method getEventDispatcher\\(\\) on Composer\\\\Composer\\|null\\.$#" + count: 1 + path: ../src/Composer/Command/UpdateCommand.php + + - + message: "#^Cannot call method getInstallationManager\\(\\) on Composer\\\\Composer\\|null\\.$#" + count: 1 + path: ../src/Composer/Command/UpdateCommand.php + + - + message: "#^Cannot call method getPackage\\(\\) on Composer\\\\Composer\\|null\\.$#" + count: 1 + path: ../src/Composer/Command/UpdateCommand.php + + - + message: "#^Construct empty\\(\\) is not allowed\\. Use more strict comparison\\.$#" + count: 3 + path: ../src/Composer/Command/UpdateCommand.php + + - + message: "#^Only booleans are allowed in a negated boolean, array\\ given\\.$#" + count: 1 + path: ../src/Composer/Command/UpdateCommand.php + + - + message: "#^Only booleans are allowed in a negated boolean, mixed given\\.$#" + count: 5 + path: ../src/Composer/Command/UpdateCommand.php + + - + message: "#^Only booleans are allowed in an elseif condition, mixed given\\.$#" + count: 1 + path: ../src/Composer/Command/UpdateCommand.php + + - + message: "#^Only booleans are allowed in an if condition, mixed given\\.$#" + count: 7 + path: ../src/Composer/Command/UpdateCommand.php + + - + message: "#^Only booleans are allowed in \\|\\|, mixed given on the left side\\.$#" + count: 3 + path: ../src/Composer/Command/UpdateCommand.php + + - + message: "#^Only booleans are allowed in \\|\\|, mixed given on the right side\\.$#" + count: 4 + path: ../src/Composer/Command/UpdateCommand.php + + - + message: "#^Parameter \\#2 \\$composer of static method Composer\\\\Installer\\:\\:create\\(\\) expects Composer\\\\Composer, Composer\\\\Composer\\|null given\\.$#" + count: 1 + path: ../src/Composer/Command/UpdateCommand.php + + - + message: "#^Parameter \\#4 \\$composer of method Composer\\\\Command\\\\UpdateCommand\\:\\:getPackagesInteractively\\(\\) expects Composer\\\\Composer, Composer\\\\Composer\\|null given\\.$#" + count: 1 + path: ../src/Composer/Command/UpdateCommand.php + + - + message: "#^Short ternary operator is not allowed\\. Use null coalesce operator if applicable or consider using long ternary\\.$#" + count: 2 + path: ../src/Composer/Command/UpdateCommand.php + + - + message: "#^Cannot call method getLockedRepository\\(\\) on Composer\\\\Package\\\\Locker\\|null\\.$#" + count: 2 + path: ../src/Composer/Command/ValidateCommand.php + + - + message: "#^Cannot call method isFresh\\(\\) on Composer\\\\Package\\\\Locker\\|null\\.$#" + count: 1 + path: ../src/Composer/Command/ValidateCommand.php + + - + message: "#^Cannot call method isLocked\\(\\) on Composer\\\\Package\\\\Locker\\|null\\.$#" + count: 2 + path: ../src/Composer/Command/ValidateCommand.php + + - + message: "#^Only booleans are allowed in &&, mixed given on the left side\\.$#" + count: 2 + path: ../src/Composer/Command/ValidateCommand.php + + - + message: "#^Only booleans are allowed in a negated boolean, array\\ given\\.$#" + count: 1 + path: ../src/Composer/Command/ValidateCommand.php + + - + message: "#^Only booleans are allowed in a negated boolean, mixed given\\.$#" + count: 2 + path: ../src/Composer/Command/ValidateCommand.php + + - + message: "#^Only booleans are allowed in a ternary operator condition, mixed given\\.$#" + count: 2 + path: ../src/Composer/Command/ValidateCommand.php + + - + message: "#^Only booleans are allowed in an elseif condition, array\\ given\\.$#" + count: 3 + path: ../src/Composer/Command/ValidateCommand.php + + - + message: "#^Only booleans are allowed in an if condition, array\\ given\\.$#" + count: 1 + path: ../src/Composer/Command/ValidateCommand.php + + - + message: "#^Only booleans are allowed in an if condition, array\\ given\\.$#" + count: 5 + path: ../src/Composer/Command/ValidateCommand.php + + - + message: "#^Only booleans are allowed in an if condition, mixed given\\.$#" + count: 1 + path: ../src/Composer/Command/ValidateCommand.php + + - + message: "#^Parameter \\#1 \\$callback of function call_user_func expects callable\\(\\)\\: mixed, array\\{Composer\\\\Package\\\\RootPackageInterface, 'getDevRequires'\\|'getRequires'\\} given\\.$#" + count: 1 + path: ../src/Composer/Command/ValidateCommand.php + + - + message: "#^Short ternary operator is not allowed\\. Use null coalesce operator if applicable or consider using long ternary\\.$#" + count: 1 + path: ../src/Composer/Command/ValidateCommand.php + + - + message: "#^Call to function in_array\\(\\) requires parameter \\#3 to be set\\.$#" + count: 1 + path: ../src/Composer/Compiler.php + + - + message: "#^Call to function method_exists\\(\\) with 'Symfony\\\\\\\\Component…' and 'fromShellCommandline' will always evaluate to true\\.$#" + count: 1 + path: ../src/Composer/Compiler.php + + - + message: "#^Parameter \\#1 \\$haystack of function strpos expects string, string\\|false given\\.$#" + count: 1 + path: ../src/Composer/Compiler.php + + - + message: "#^Parameter \\#1 \\$source of method Composer\\\\Compiler\\:\\:stripWhitespace\\(\\) expects string, string\\|false given\\.$#" + count: 1 + path: ../src/Composer/Compiler.php + + - + message: "#^Parameter \\#1 \\$str of function strtr expects string, string\\|false given\\.$#" + count: 2 + path: ../src/Composer/Compiler.php + + - + message: "#^Parameter \\#1 \\$string of function substr_replace expects array\\|string, string\\|false given\\.$#" + count: 1 + path: ../src/Composer/Compiler.php + + - + message: "#^Parameter \\#2 \\$contents of method Phar\\:\\:addFromString\\(\\) expects string, string\\|false given\\.$#" + count: 1 + path: ../src/Composer/Compiler.php + + - + message: "#^Parameter \\#3 \\$subject of static method Composer\\\\Pcre\\\\Preg\\:\\:replace\\(\\) expects string, string\\|false given\\.$#" + count: 1 + path: ../src/Composer/Compiler.php + + - + message: "#^Anonymous function uses \\$this assigned to variable \\$config\\. Use \\$this directly in the function body\\.$#" + count: 1 + path: ../src/Composer/Config.php + + - + message: "#^Array \\(array\\\\) does not accept key 0\\|string\\.$#" + count: 1 + path: ../src/Composer/Config.php + + - + message: "#^Call to function array_search\\(\\) requires parameter \\#3 to be set\\.$#" + count: 1 + path: ../src/Composer/Config.php + + - + message: "#^Call to function in_array\\(\\) requires parameter \\#3 to be set\\.$#" + count: 2 + path: ../src/Composer/Config.php + + - + message: "#^Casting to bool something that's already bool\\.$#" + count: 1 + path: ../src/Composer/Config.php + + - + message: "#^Construct empty\\(\\) is not allowed\\. Use more strict comparison\\.$#" + count: 2 + path: ../src/Composer/Config.php + + - + message: "#^Only booleans are allowed in &&, mixed given on the left side\\.$#" + count: 1 + path: ../src/Composer/Config.php + + - + message: "#^Only booleans are allowed in a ternary operator condition, string\\|null given\\.$#" + count: 1 + path: ../src/Composer/Config.php + + - + message: "#^Only booleans are allowed in an if condition, Composer\\\\IO\\\\IOInterface\\|null given\\.$#" + count: 1 + path: ../src/Composer/Config.php + + - + message: "#^Only booleans are allowed in an if condition, bool\\|string given\\.$#" + count: 1 + path: ../src/Composer/Config.php + + - + message: "#^Only booleans are allowed in an if condition, mixed given\\.$#" + count: 1 + path: ../src/Composer/Config.php + + - + message: "#^Parameter \\#1 \\$string of function rtrim expects string, int\\|string\\|null given\\.$#" + count: 1 + path: ../src/Composer/Config.php + + - + message: "#^Parameter \\#1 \\$string of function rtrim expects string, string\\|false given\\.$#" + count: 1 + path: ../src/Composer/Config.php + + - + message: "#^Short ternary operator is not allowed\\. Use null coalesce operator if applicable or consider using long ternary\\.$#" + count: 2 + path: ../src/Composer/Config.php + + - + message: "#^Only booleans are allowed in an if condition, mixed given\\.$#" + count: 1 + path: ../src/Composer/Config/JsonConfigSource.php + + - + message: "#^Parameter \\#1 \\$callback of function call_user_func_array expects callable\\(\\)\\: mixed, array\\{Composer\\\\Json\\\\JsonManipulator, string\\} given\\.$#" + count: 1 + path: ../src/Composer/Config/JsonConfigSource.php + + - + message: "#^Parameter \\#1 \\$contents of class Composer\\\\Json\\\\JsonManipulator constructor expects string, string\\|false given\\.$#" + count: 1 + path: ../src/Composer/Config/JsonConfigSource.php + + - + message: "#^Parameter \\#3 \\$fallback of method Composer\\\\Config\\\\JsonConfigSource\\:\\:manipulateJson\\(\\) expects callable\\(\\)\\: mixed, array\\|false given\\.$#" + count: 1 + path: ../src/Composer/Config/JsonConfigSource.php + + - + message: "#^Parameter \\#3 \\$fallback of method Composer\\\\Config\\\\JsonConfigSource\\:\\:manipulateJson\\(\\) expects callable\\(\\)\\: mixed, string given\\.$#" + count: 3 + path: ../src/Composer/Config/JsonConfigSource.php + + - + message: "#^Call to function is_array\\(\\) with array\\ will always evaluate to true\\.$#" + count: 1 + path: ../src/Composer/Console/Application.php + + - + message: "#^Call to function method_exists\\(\\) with \\$this\\(Composer\\\\Console\\\\Application\\) and 'areExceptionsCaught' will always evaluate to true\\.$#" + count: 1 + path: ../src/Composer/Console/Application.php + + - + message: "#^Instanceof between Composer\\\\Command\\\\BaseCommand and Composer\\\\Command\\\\BaseCommand will always evaluate to true\\.$#" + count: 1 + path: ../src/Composer/Console/Application.php + + - + message: "#^Only booleans are allowed in &&, array\\\\|int\\|string\\> given on the left side\\.$#" + count: 1 + path: ../src/Composer/Console/Application.php + + - + message: "#^Only booleans are allowed in &&, array\\\\|null given on the left side\\.$#" + count: 1 + path: ../src/Composer/Console/Application.php + + - + message: "#^Only booleans are allowed in &&, int\\<0, max\\>\\|false given on the left side\\.$#" + count: 1 + path: ../src/Composer/Console/Application.php + + - + message: "#^Only booleans are allowed in &&, string given on the left side\\.$#" + count: 1 + path: ../src/Composer/Console/Application.php + + - + message: "#^Only booleans are allowed in &&, string given on the right side\\.$#" + count: 1 + path: ../src/Composer/Console/Application.php + + - + message: "#^Only booleans are allowed in a negated boolean, string given\\.$#" + count: 1 + path: ../src/Composer/Console/Application.php + + - + message: "#^Only booleans are allowed in a negated boolean, string\\|false given\\.$#" + count: 2 + path: ../src/Composer/Console/Application.php + + - + message: "#^Only booleans are allowed in an if condition, Composer\\\\Composer\\|null given\\.$#" + count: 1 + path: ../src/Composer/Console/Application.php + + - + message: "#^Only booleans are allowed in an if condition, array\\\\|null given\\.$#" + count: 1 + path: ../src/Composer/Console/Application.php + + - + message: "#^Only booleans are allowed in an if condition, int given\\.$#" + count: 1 + path: ../src/Composer/Console/Application.php + + - + message: "#^Only booleans are allowed in an if condition, string given\\.$#" + count: 1 + path: ../src/Composer/Console/Application.php + + - + message: "#^Only booleans are allowed in an if condition, string\\|null given\\.$#" + count: 2 + path: ../src/Composer/Console/Application.php + + - + message: "#^Only booleans are allowed in \\|\\|, string\\|false given on the left side\\.$#" + count: 2 + path: ../src/Composer/Console/Application.php + + - + message: "#^Parameter \\#1 \\$json of function json_decode expects string, string\\|false given\\.$#" + count: 1 + path: ../src/Composer/Console/Application.php + + - + message: "#^Parameter \\#1 \\$name of method Symfony\\\\Component\\\\Console\\\\Application\\:\\:has\\(\\) expects string, string\\|null given\\.$#" + count: 1 + path: ../src/Composer/Console/Application.php + + - + message: "#^Parameter \\#1 \\$path of function dirname expects string, string\\|false given\\.$#" + count: 1 + path: ../src/Composer/Console/Application.php + + - + message: "#^Parameter \\#2 \\$file of method Composer\\\\Console\\\\GithubActionError\\:\\:emit\\(\\) expects string\\|null, string\\|false given\\.$#" + count: 1 + path: ../src/Composer/Console/Application.php + + - + message: "#^Property Composer\\\\Console\\\\Application\\:\\:\\$initialWorkingDirectory \\(string\\) does not accept string\\|false\\.$#" + count: 1 + path: ../src/Composer/Console/Application.php + + - + message: "#^Short ternary operator is not allowed\\. Use null coalesce operator if applicable or consider using long ternary\\.$#" + count: 2 + path: ../src/Composer/Console/Application.php + + - + message: "#^Only booleans are allowed in &&, int\\|null given on the right side\\.$#" + count: 1 + path: ../src/Composer/Console/GithubActionError.php + + - + message: "#^Only booleans are allowed in &&, string\\|false given on the left side\\.$#" + count: 1 + path: ../src/Composer/Console/GithubActionError.php + + - + message: "#^Only booleans are allowed in &&, string\\|null given on the left side\\.$#" + count: 1 + path: ../src/Composer/Console/GithubActionError.php + + - + message: "#^Only booleans are allowed in a negated boolean, string\\|false given\\.$#" + count: 1 + path: ../src/Composer/Console/GithubActionError.php + + - + message: "#^Only booleans are allowed in an elseif condition, string\\|null given\\.$#" + count: 1 + path: ../src/Composer/Console/GithubActionError.php + + - + message: "#^Construct empty\\(\\) is not allowed\\. Use more strict comparison\\.$#" + count: 2 + path: ../src/Composer/DependencyResolver/Decisions.php + + - + message: "#^Method Composer\\\\DependencyResolver\\\\Decisions\\:\\:key\\(\\) should return int\\|null but returns int\\|string\\|null\\.$#" + count: 1 + path: ../src/Composer/DependencyResolver/Decisions.php + + - + message: "#^Offset 0 does not exist on array\\{int, Composer\\\\DependencyResolver\\\\Rule\\}\\|null\\.$#" + count: 1 + path: ../src/Composer/DependencyResolver/Decisions.php + + - + message: "#^Only booleans are allowed in a ternary operator condition, Composer\\\\DependencyResolver\\\\Pool\\|null given\\.$#" + count: 1 + path: ../src/Composer/DependencyResolver/Decisions.php + + - + message: "#^Return type \\(array\\{int, Composer\\\\DependencyResolver\\\\Rule\\}\\|false\\) of method Composer\\\\DependencyResolver\\\\Decisions\\:\\:current\\(\\) should be covariant with return type \\(array\\{int, Composer\\\\DependencyResolver\\\\Rule\\}\\) of method Iterator\\\\>\\:\\:current\\(\\)$#" + count: 1 + path: ../src/Composer/DependencyResolver/Decisions.php + + - + message: "#^Anonymous function uses \\$this assigned to variable \\$policy\\. Use \\$this directly in the function body\\.$#" + count: 2 + path: ../src/Composer/DependencyResolver/DefaultPolicy.php + + - + message: "#^Only booleans are allowed in &&, string\\|null given on the left side\\.$#" + count: 1 + path: ../src/Composer/DependencyResolver/DefaultPolicy.php + + - + message: "#^Parameter \\#3 \\$requiredPackage \\(string\\) of method Composer\\\\DependencyResolver\\\\DefaultPolicy\\:\\:selectPreferredPackages\\(\\) should be contravariant with parameter \\$requiredPackage \\(string\\|null\\) of method Composer\\\\DependencyResolver\\\\PolicyInterface\\:\\:selectPreferredPackages\\(\\)$#" + count: 1 + path: ../src/Composer/DependencyResolver/DefaultPolicy.php + + - + message: "#^Cannot access offset 'hash' on array\\|false\\.$#" + count: 1 + path: ../src/Composer/DependencyResolver/GenericRule.php + + - + message: "#^Cannot access offset 0 on array\\{int, Composer\\\\DependencyResolver\\\\Rule\\}\\|false\\.$#" + count: 1 + path: ../src/Composer/DependencyResolver/LockTransaction.php + + - + message: "#^Only booleans are allowed in &&, DateTime\\|null given on the left side\\.$#" + count: 1 + path: ../src/Composer/DependencyResolver/LockTransaction.php + + - + message: "#^Only booleans are allowed in &&, string\\|null given on the left side\\.$#" + count: 1 + path: ../src/Composer/DependencyResolver/LockTransaction.php + + - + message: "#^Cannot access offset 'hash' on array\\|false\\.$#" + count: 1 + path: ../src/Composer/DependencyResolver/MultiConflictRule.php + + - + message: "#^Only booleans are allowed in \\|\\|, mixed given on the right side\\.$#" + count: 1 + path: ../src/Composer/DependencyResolver/Pool.php + + - + message: "#^Cannot call method getPackages\\(\\) on Composer\\\\Repository\\\\LockArrayRepository\\|null\\.$#" + count: 2 + path: ../src/Composer/DependencyResolver/PoolBuilder.php + + - + message: "#^Construct empty\\(\\) is not allowed\\. Use more strict comparison\\.$#" + count: 2 + path: ../src/Composer/DependencyResolver/PoolBuilder.php + + - + message: "#^Only booleans are allowed in a negated boolean, array\\ given\\.$#" + count: 2 + path: ../src/Composer/DependencyResolver/PoolBuilder.php + + - + message: "#^Only booleans are allowed in an if condition, Composer\\\\EventDispatcher\\\\EventDispatcher\\|null given\\.$#" + count: 1 + path: ../src/Composer/DependencyResolver/PoolBuilder.php + + - + message: "#^Only booleans are allowed in an if condition, array\\ given\\.$#" + count: 1 + path: ../src/Composer/DependencyResolver/PoolBuilder.php + + - + message: "#^Only booleans are allowed in an if condition, mixed given\\.$#" + count: 1 + path: ../src/Composer/DependencyResolver/PoolBuilder.php + + - + message: "#^Parameter \\#4 \\$index of method Composer\\\\DependencyResolver\\\\PoolBuilder\\:\\:removeLoadedPackage\\(\\) expects int, int\\|string given\\.$#" + count: 1 + path: ../src/Composer/DependencyResolver/PoolBuilder.php + + - + message: "#^Only booleans are allowed in a negated boolean, array\\ given\\.$#" + count: 1 + path: ../src/Composer/DependencyResolver/PoolOptimizer.php + + - + message: "#^Only booleans are allowed in an if condition, array\\ given\\.$#" + count: 1 + path: ../src/Composer/DependencyResolver/PoolOptimizer.php + + - + message: "#^Only booleans are allowed in an if condition, mixed given\\.$#" + count: 4 + path: ../src/Composer/DependencyResolver/PoolOptimizer.php + + - + message: "#^Cannot call method getRepoName\\(\\) on Composer\\\\Repository\\\\RepositoryInterface\\|null\\.$#" + count: 4 + path: ../src/Composer/DependencyResolver/Problem.php + + - + message: "#^Cannot call method getRepository\\(\\) on Composer\\\\Package\\\\PackageInterface\\|false\\.$#" + count: 2 + path: ../src/Composer/DependencyResolver/Problem.php + + - + message: "#^Construct empty\\(\\) is not allowed\\. Use more strict comparison\\.$#" + count: 1 + path: ../src/Composer/DependencyResolver/Problem.php + + - + message: "#^Only booleans are allowed in &&, Composer\\\\DependencyResolver\\\\Pool\\|null given on the left side\\.$#" + count: 2 + path: ../src/Composer/DependencyResolver/Problem.php + + - + message: "#^Only booleans are allowed in &&, Composer\\\\Semver\\\\Constraint\\\\ConstraintInterface\\|null given on the right side\\.$#" + count: 1 + path: ../src/Composer/DependencyResolver/Problem.php + + - + message: "#^Only booleans are allowed in a negated boolean, array\\ given\\.$#" + count: 1 + path: ../src/Composer/DependencyResolver/Problem.php + + - + message: "#^Only booleans are allowed in a ternary operator condition, Composer\\\\Semver\\\\Constraint\\\\ConstraintInterface\\|null given\\.$#" + count: 1 + path: ../src/Composer/DependencyResolver/Problem.php + + - + message: "#^Only booleans are allowed in a ternary operator condition, string given\\.$#" + count: 1 + path: ../src/Composer/DependencyResolver/Problem.php + + - + message: "#^Only booleans are allowed in an if condition, Composer\\\\Package\\\\BasePackage\\|null given\\.$#" + count: 1 + path: ../src/Composer/DependencyResolver/Problem.php + + - + message: "#^Only booleans are allowed in an if condition, array\\ given\\.$#" + count: 5 + path: ../src/Composer/DependencyResolver/Problem.php + + - + message: "#^Only booleans are allowed in an if condition, array\\ given\\.$#" + count: 1 + path: ../src/Composer/DependencyResolver/Problem.php + + - + message: "#^Only booleans are allowed in an if condition, array\\\\> given\\.$#" + count: 1 + path: ../src/Composer/DependencyResolver/Problem.php + + - + message: "#^Only booleans are allowed in an if condition, int\\<0, max\\> given\\.$#" + count: 1 + path: ../src/Composer/DependencyResolver/Problem.php + + - + message: "#^Parameter \\#2 \\$callback of function uksort expects callable\\(string, string\\)\\: int, 'version_compare' given\\.$#" + count: 2 + path: ../src/Composer/DependencyResolver/Problem.php + + - + message: "#^Parameter \\#3 \\$subject of function str_replace expects array\\|string, string\\|null given\\.$#" + count: 1 + path: ../src/Composer/DependencyResolver/Problem.php + + - + message: "#^Short ternary operator is not allowed\\. Use null coalesce operator if applicable or consider using long ternary\\.$#" + count: 1 + path: ../src/Composer/DependencyResolver/Problem.php + + - + message: "#^Only booleans are allowed in an if condition, Composer\\\\Repository\\\\LockArrayRepository\\|null given\\.$#" + count: 1 + path: ../src/Composer/DependencyResolver/Request.php + + - + message: "#^Binary operation \"\\.\" between array\\{package\\: Composer\\\\Package\\\\BasePackage\\}\\|array\\{packageName\\: string, constraint\\: Composer\\\\Semver\\\\Constraint\\\\ConstraintInterface\\}\\|Composer\\\\Package\\\\BasePackage\\|Composer\\\\Package\\\\Link\\|int\\|string and ' and thus cannot…' results in an error\\.$#" + count: 1 + path: ../src/Composer/DependencyResolver/Rule.php + + - + message: "#^Binary operation \"\\.\" between literal\\-string&non\\-empty\\-string and array\\{package\\: Composer\\\\Package\\\\BasePackage\\}\\|array\\{packageName\\: string, constraint\\: Composer\\\\Semver\\\\Constraint\\\\ConstraintInterface\\}\\|Composer\\\\Package\\\\BasePackage\\|Composer\\\\Package\\\\Link\\|int\\|string results in an error\\.$#" + count: 1 + path: ../src/Composer/DependencyResolver/Rule.php + + - + message: "#^Cannot access offset 'constraint' on array\\{package\\: Composer\\\\Package\\\\BasePackage\\}\\|array\\{packageName\\: string, constraint\\: Composer\\\\Semver\\\\Constraint\\\\ConstraintInterface\\}\\|Composer\\\\Package\\\\BasePackage\\|Composer\\\\Package\\\\Link\\|int\\|string\\.$#" + count: 2 + path: ../src/Composer/DependencyResolver/Rule.php + + - + message: "#^Cannot access offset 'package' on array\\{package\\: Composer\\\\Package\\\\BasePackage\\}\\|array\\{packageName\\: string, constraint\\: Composer\\\\Semver\\\\Constraint\\\\ConstraintInterface\\}\\|Composer\\\\Package\\\\BasePackage\\|Composer\\\\Package\\\\Link\\|int\\|string\\.$#" + count: 2 + path: ../src/Composer/DependencyResolver/Rule.php + + - + message: "#^Cannot access offset 'packageName' on array\\{package\\: Composer\\\\Package\\\\BasePackage\\}\\|array\\{packageName\\: string, constraint\\: Composer\\\\Semver\\\\Constraint\\\\ConstraintInterface\\}\\|Composer\\\\Package\\\\BasePackage\\|Composer\\\\Package\\\\Link\\|int\\|string\\.$#" + count: 4 + path: ../src/Composer/DependencyResolver/Rule.php + + - + message: "#^Cannot call method getConstraint\\(\\) on array\\\\|Composer\\\\Package\\\\BasePackage\\|Composer\\\\Package\\\\Link\\|int\\|string\\.$#" + count: 3 + path: ../src/Composer/DependencyResolver/Rule.php + + - + message: "#^Cannot call method getSource\\(\\) on array\\\\|Composer\\\\Package\\\\BasePackage\\|Composer\\\\Package\\\\Link\\|int\\\\|int\\<1, max\\>\\|string\\.$#" + count: 1 + path: ../src/Composer/DependencyResolver/Rule.php + + - + message: "#^Cannot call method getTarget\\(\\) on array\\\\|Composer\\\\Package\\\\BasePackage\\|Composer\\\\Package\\\\Link\\|int\\|string\\.$#" + count: 3 + path: ../src/Composer/DependencyResolver/Rule.php + + - + message: "#^Foreach overwrites \\$literal with its value variable\\.$#" + count: 1 + path: ../src/Composer/DependencyResolver/Rule.php + + - + message: "#^Only booleans are allowed in &&, array\\ given on the left side\\.$#" + count: 1 + path: ../src/Composer/DependencyResolver/Rule.php + + - + message: "#^Only booleans are allowed in &&, array\\ given on the right side\\.$#" + count: 1 + path: ../src/Composer/DependencyResolver/Rule.php + + - + message: "#^Only booleans are allowed in a negated boolean, array\\ given\\.$#" + count: 1 + path: ../src/Composer/DependencyResolver/Rule.php + + - + message: "#^Only booleans are allowed in a negated boolean, int given\\.$#" + count: 1 + path: ../src/Composer/DependencyResolver/Rule.php + + - + message: "#^Only booleans are allowed in an if condition, Composer\\\\Repository\\\\LockArrayRepository\\|null given\\.$#" + count: 2 + path: ../src/Composer/DependencyResolver/Rule.php + + - + message: "#^Only booleans are allowed in an if condition, array\\ given\\.$#" + count: 1 + path: ../src/Composer/DependencyResolver/Rule.php + + - + message: "#^Only booleans are allowed in an if condition, array\\\\|Composer\\\\Package\\\\BasePackage\\|Composer\\\\Package\\\\Link\\|int\\|string given\\.$#" + count: 2 + path: ../src/Composer/DependencyResolver/Rule.php + + - + message: "#^Parameter \\#1 \\$literal of method Composer\\\\DependencyResolver\\\\Pool\\:\\:literalToPackage\\(\\) expects int, int\\|null given\\.$#" + count: 2 + path: ../src/Composer/DependencyResolver/Rule.php + + - + message: "#^Parameter \\#1 \\$packages of static method Composer\\\\DependencyResolver\\\\Problem\\:\\:getPackageList\\(\\) expects array\\, array\\ given\\.$#" + count: 1 + path: ../src/Composer/DependencyResolver/Rule.php + + - + message: "#^Possibly invalid array key type array\\\\|Composer\\\\Package\\\\BasePackage\\|Composer\\\\Package\\\\Link\\|int\\|string\\.$#" + count: 2 + path: ../src/Composer/DependencyResolver/Rule.php + + - + message: "#^Array \\(array\\\\|Composer\\\\DependencyResolver\\\\Rule\\>\\) does not accept key int\\|string\\.$#" + count: 2 + path: ../src/Composer/DependencyResolver/RuleSet.php + + - + message: "#^Method Composer\\\\DependencyResolver\\\\RuleSet\\:\\:getTypes\\(\\) should return array\\{0, 1, 4\\} but returns array\\\\.$#" + count: 1 + path: ../src/Composer/DependencyResolver/RuleSet.php + + - + message: "#^Only booleans are allowed in &&, Composer\\\\DependencyResolver\\\\Pool\\|null given on the right side\\.$#" + count: 1 + path: ../src/Composer/DependencyResolver/RuleSet.php + + - + message: "#^Only booleans are allowed in &&, Composer\\\\DependencyResolver\\\\Request\\|null given on the right side\\.$#" + count: 1 + path: ../src/Composer/DependencyResolver/RuleSet.php + + - + message: "#^Only booleans are allowed in &&, Composer\\\\Repository\\\\RepositorySet\\|null given on the left side\\.$#" + count: 1 + path: ../src/Composer/DependencyResolver/RuleSet.php + + - + message: "#^Only booleans are allowed in a negated boolean, Composer\\\\DependencyResolver\\\\Rule\\|null given\\.$#" + count: 1 + path: ../src/Composer/DependencyResolver/RuleSetGenerator.php + + - + message: "#^Only booleans are allowed in an if condition, array\\ given\\.$#" + count: 1 + path: ../src/Composer/DependencyResolver/RuleSetGenerator.php + + - + message: "#^Parameter \\#3 \\$reasonData of class Composer\\\\DependencyResolver\\\\GenericRule constructor expects array\\{package\\: Composer\\\\Package\\\\BasePackage\\}\\|array\\{packageName\\: string, constraint\\: Composer\\\\Semver\\\\Constraint\\\\ConstraintInterface\\}\\|Composer\\\\Package\\\\BasePackage\\|Composer\\\\Package\\\\Link\\|int\\|string, array\\{package\\: Composer\\\\Package\\\\BasePackage\\}\\|array\\{packageName\\: string, constraint\\: Composer\\\\Semver\\\\Constraint\\\\ConstraintInterface\\}\\|Composer\\\\Package\\\\BasePackage\\|Composer\\\\Package\\\\Link\\|int\\|string\\|null given\\.$#" + count: 1 + path: ../src/Composer/DependencyResolver/RuleSetGenerator.php + + - + message: "#^Parameter \\#4 \\$reasonData of class Composer\\\\DependencyResolver\\\\Rule2Literals constructor expects array\\{package\\: Composer\\\\Package\\\\BasePackage\\}\\|array\\{packageName\\: string, constraint\\: Composer\\\\Semver\\\\Constraint\\\\ConstraintInterface\\}\\|Composer\\\\Package\\\\BasePackage\\|Composer\\\\Package\\\\Link\\|int\\|string, array\\{package\\: Composer\\\\Package\\\\BasePackage\\}\\|array\\{packageName\\: string, constraint\\: Composer\\\\Semver\\\\Constraint\\\\ConstraintInterface\\}\\|Composer\\\\Package\\\\BasePackage\\|Composer\\\\Package\\\\Link\\|int\\|string\\|null given\\.$#" + count: 1 + path: ../src/Composer/DependencyResolver/RuleSetGenerator.php + + - + message: "#^Short ternary operator is not allowed\\. Use null coalesce operator if applicable or consider using long ternary\\.$#" + count: 1 + path: ../src/Composer/DependencyResolver/RuleSetGenerator.php + + - + message: "#^Only booleans are allowed in a negated boolean, int\\<0, max\\> given\\.$#" + count: 2 + path: ../src/Composer/DependencyResolver/RuleSetIterator.php + + - + message: "#^Return type \\(\\-1\\|0\\|1\\|4\\) of method Composer\\\\DependencyResolver\\\\RuleSetIterator\\:\\:key\\(\\) should be covariant with return type \\(0\\|1\\|4\\) of method Iterator\\\\:\\:key\\(\\)$#" + count: 1 + path: ../src/Composer/DependencyResolver/RuleSetIterator.php + + - + message: "#^Only booleans are allowed in an if condition, array\\ given\\.$#" + count: 1 + path: ../src/Composer/DependencyResolver/RuleWatchGraph.php + + - + message: "#^Cannot access offset 0 on array\\{int, Composer\\\\DependencyResolver\\\\Rule\\}\\|false\\.$#" + count: 1 + path: ../src/Composer/DependencyResolver/Solver.php + + - + message: "#^Cannot access offset 1 on array\\{int, Composer\\\\DependencyResolver\\\\Rule\\}\\|false\\.$#" + count: 1 + path: ../src/Composer/DependencyResolver/Solver.php + + - + message: "#^Casting to int something that's already int\\.$#" + count: 2 + path: ../src/Composer/DependencyResolver/Solver.php + + - + message: "#^Construct empty\\(\\) is not allowed\\. Use more strict comparison\\.$#" + count: 2 + path: ../src/Composer/DependencyResolver/Solver.php + + - + message: "#^Foreach overwrites \\$literal with its value variable\\.$#" + count: 2 + path: ../src/Composer/DependencyResolver/Solver.php + + - + message: "#^Only booleans are allowed in &&, Composer\\\\DependencyResolver\\\\Rule\\|null given on the left side\\.$#" + count: 1 + path: ../src/Composer/DependencyResolver/Solver.php + + - + message: "#^Only booleans are allowed in &&, int given on the left side\\.$#" + count: 1 + path: ../src/Composer/DependencyResolver/Solver.php + + - + message: "#^Only booleans are allowed in &&, int\\<0, max\\> given on the right side\\.$#" + count: 2 + path: ../src/Composer/DependencyResolver/Solver.php + + - + message: "#^Only booleans are allowed in &&, mixed given on the left side\\.$#" + count: 1 + path: ../src/Composer/DependencyResolver/Solver.php + + - + message: "#^Only booleans are allowed in a negated boolean, Composer\\\\DependencyResolver\\\\Rule\\|null given\\.$#" + count: 1 + path: ../src/Composer/DependencyResolver/Solver.php + + - + message: "#^Only booleans are allowed in a negated boolean, array\\ given\\.$#" + count: 1 + path: ../src/Composer/DependencyResolver/Solver.php + + - + message: "#^Only booleans are allowed in a negated boolean, int given\\.$#" + count: 3 + path: ../src/Composer/DependencyResolver/Solver.php + + - + message: "#^Only booleans are allowed in a negated boolean, int\\|null given\\.$#" + count: 1 + path: ../src/Composer/DependencyResolver/Solver.php + + - + message: "#^Only booleans are allowed in an if condition, Composer\\\\DependencyResolver\\\\Rule\\|null given\\.$#" + count: 1 + path: ../src/Composer/DependencyResolver/Solver.php + + - + message: "#^Only booleans are allowed in an if condition, array\\ given\\.$#" + count: 1 + path: ../src/Composer/DependencyResolver/Solver.php + + - + message: "#^Only booleans are allowed in an if condition, int given\\.$#" + count: 1 + path: ../src/Composer/DependencyResolver/Solver.php + + - + message: "#^Only booleans are allowed in an if condition, int\\<0, max\\> given\\.$#" + count: 2 + path: ../src/Composer/DependencyResolver/Solver.php + + - + message: "#^Only booleans are allowed in an if condition, mixed given\\.$#" + count: 1 + path: ../src/Composer/DependencyResolver/Solver.php + + - + message: "#^Parameter \\#1 \\$literal of method Composer\\\\DependencyResolver\\\\Decisions\\:\\:decide\\(\\) expects int, int\\|string given\\.$#" + count: 1 + path: ../src/Composer/DependencyResolver/Solver.php + + - + message: "#^Parameter \\#1 \\$literals of class Composer\\\\DependencyResolver\\\\GenericRule constructor expects array\\, array\\ given\\.$#" + count: 1 + path: ../src/Composer/DependencyResolver/Solver.php + + - + message: "#^Parameter \\#1 \\$number of function abs expects int, int\\|null given\\.$#" + count: 1 + path: ../src/Composer/DependencyResolver/Solver.php + + - + message: "#^Parameter \\#1 \\$rule of method Composer\\\\DependencyResolver\\\\Problem\\:\\:addRule\\(\\) expects Composer\\\\DependencyResolver\\\\Rule, Composer\\\\DependencyResolver\\\\Rule\\|null given\\.$#" + count: 1 + path: ../src/Composer/DependencyResolver/Solver.php + + - + message: "#^Parameter \\#2 \\$literal of method Composer\\\\DependencyResolver\\\\Solver\\:\\:setPropagateLearn\\(\\) expects int\\|string, int\\|null given\\.$#" + count: 1 + path: ../src/Composer/DependencyResolver/Solver.php + + - + message: "#^Parameter \\#2 \\$presentMap of class Composer\\\\DependencyResolver\\\\LockTransaction constructor expects array\\, array\\ given\\.$#" + count: 1 + path: ../src/Composer/DependencyResolver/Solver.php + + - + message: "#^Short ternary operator is not allowed\\. Use null coalesce operator if applicable or consider using long ternary\\.$#" + count: 1 + path: ../src/Composer/DependencyResolver/Solver.php + + - + message: "#^Construct empty\\(\\) is not allowed\\. Use more strict comparison\\.$#" + count: 2 + path: ../src/Composer/DependencyResolver/SolverProblemsException.php + + - + message: "#^Only booleans are allowed in &&, int\\<0, max\\>\\|false given on the left side\\.$#" + count: 1 + path: ../src/Composer/DependencyResolver/SolverProblemsException.php + + - + message: "#^Only booleans are allowed in &&, int\\<0, max\\>\\|false given on the right side\\.$#" + count: 1 + path: ../src/Composer/DependencyResolver/SolverProblemsException.php + + - + message: "#^Only booleans are allowed in an if condition, array\\ given\\.$#" + count: 1 + path: ../src/Composer/DependencyResolver/SolverProblemsException.php + + - + message: "#^Only booleans are allowed in an if condition, int\\<0, max\\>\\|false given\\.$#" + count: 1 + path: ../src/Composer/DependencyResolver/SolverProblemsException.php + + - + message: "#^Only booleans are allowed in \\|\\|, int\\<0, max\\>\\|false given on the left side\\.$#" + count: 1 + path: ../src/Composer/DependencyResolver/SolverProblemsException.php + + - + message: "#^Only booleans are allowed in \\|\\|, int\\<0, max\\>\\|false given on the right side\\.$#" + count: 1 + path: ../src/Composer/DependencyResolver/SolverProblemsException.php + + - + message: "#^Construct empty\\(\\) is not allowed\\. Use more strict comparison\\.$#" + count: 1 + path: ../src/Composer/DependencyResolver/Transaction.php + + - + message: "#^Only booleans are allowed in &&, array given on the right side\\.$#" + count: 1 + path: ../src/Composer/DependencyResolver/Transaction.php + + - + message: "#^Only booleans are allowed in a negated boolean, int\\<0, max\\> given\\.$#" + count: 2 + path: ../src/Composer/DependencyResolver/Transaction.php + + - + message: "#^Only booleans are allowed in \\|\\|, int\\<0, max\\> given on the right side\\.$#" + count: 2 + path: ../src/Composer/DependencyResolver/Transaction.php + + - + message: "#^Anonymous function uses \\$this assigned to variable \\$self\\. Use \\$this directly in the function body\\.$#" + count: 3 + path: ../src/Composer/Downloader/ArchiveDownloader.php + + - + message: "#^Parameter \\#2 \\$path of method Composer\\\\Downloader\\\\FileDownloader\\:\\:removeCleanupPath\\(\\) expects string, string\\|false given\\.$#" + count: 1 + path: ../src/Composer/Downloader/ArchiveDownloader.php + + - + message: "#^Anonymous function uses \\$this assigned to variable \\$self\\. Use \\$this directly in the function body\\.$#" + count: 2 + path: ../src/Composer/Downloader/DownloadManager.php + + - + message: "#^Call to function array_search\\(\\) requires parameter \\#3 to be set\\.$#" + count: 1 + path: ../src/Composer/Downloader/DownloadManager.php + + - + message: "#^Cannot call method remove\\(\\) on Composer\\\\Downloader\\\\DownloaderInterface\\|null\\.$#" + count: 1 + path: ../src/Composer/Downloader/DownloadManager.php + + - + message: "#^Construct empty\\(\\) is not allowed\\. Use more strict comparison\\.$#" + count: 1 + path: ../src/Composer/Downloader/DownloadManager.php + + - + message: "#^Method Composer\\\\Downloader\\\\DownloadManager\\:\\:getDownloaderType\\(\\) should return string but returns string\\|false\\.$#" + count: 1 + path: ../src/Composer/Downloader/DownloadManager.php + + - + message: "#^Only booleans are allowed in &&, Composer\\\\Package\\\\PackageInterface\\|null given on the left side\\.$#" + count: 1 + path: ../src/Composer/Downloader/DownloadManager.php + + - + message: "#^Only booleans are allowed in a negated boolean, Composer\\\\Downloader\\\\DownloaderInterface\\|null given\\.$#" + count: 4 + path: ../src/Composer/Downloader/DownloadManager.php + + - + message: "#^Only booleans are allowed in a negated boolean, array\\ given\\.$#" + count: 1 + path: ../src/Composer/Downloader/DownloadManager.php + + - + message: "#^Only booleans are allowed in an if condition, Composer\\\\Downloader\\\\DownloaderInterface\\|null given\\.$#" + count: 4 + path: ../src/Composer/Downloader/DownloadManager.php + + - + message: "#^Only booleans are allowed in an if condition, React\\\\Promise\\\\PromiseInterface\\|null given\\.$#" + count: 1 + path: ../src/Composer/Downloader/DownloadManager.php + + - + message: "#^Only booleans are allowed in an if condition, string\\|null given\\.$#" + count: 2 + path: ../src/Composer/Downloader/DownloadManager.php + + - + message: "#^Parameter \\#1 \\$downloader of method Composer\\\\Downloader\\\\DownloadManager\\:\\:getDownloaderType\\(\\) expects Composer\\\\Downloader\\\\DownloaderInterface, Composer\\\\Downloader\\\\DownloaderInterface\\|null given\\.$#" + count: 1 + path: ../src/Composer/Downloader/DownloadManager.php + + - + message: "#^Parameter \\#1 \\$type of method Composer\\\\Downloader\\\\DownloadManager\\:\\:getDownloader\\(\\) expects string, string\\|null given\\.$#" + count: 2 + path: ../src/Composer/Downloader/DownloadManager.php + + - + message: "#^Short ternary operator is not allowed\\. Use null coalesce operator if applicable or consider using long ternary\\.$#" + count: 1 + path: ../src/Composer/Downloader/DownloadManager.php + + - + message: "#^Anonymous function uses \\$this assigned to variable \\$self\\. Use \\$this directly in the function body\\.$#" + count: 4 + path: ../src/Composer/Downloader/FileDownloader.php + + - + message: "#^Call to function array_search\\(\\) requires parameter \\#3 to be set\\.$#" + count: 1 + path: ../src/Composer/Downloader/FileDownloader.php + + - + message: "#^Call to function in_array\\(\\) requires parameter \\#3 to be set\\.$#" + count: 1 + path: ../src/Composer/Downloader/FileDownloader.php + + - + message: "#^Cannot access offset 'cacheKey' on array\\{base\\: string, processed\\: string, cacheKey\\: string\\}\\|false\\.$#" + count: 1 + path: ../src/Composer/Downloader/FileDownloader.php + + - + message: "#^Foreach overwrites \\$path with its value variable\\.$#" + count: 1 + path: ../src/Composer/Downloader/FileDownloader.php + + - + message: "#^Only booleans are allowed in &&, Composer\\\\Cache\\|null given on the left side\\.$#" + count: 4 + path: ../src/Composer/Downloader/FileDownloader.php + + - + message: "#^Only booleans are allowed in &&, string\\|null given on the left side\\.$#" + count: 1 + path: ../src/Composer/Downloader/FileDownloader.php + + - + message: "#^Only booleans are allowed in a negated boolean, int given\\.$#" + count: 1 + path: ../src/Composer/Downloader/FileDownloader.php + + - + message: "#^Only booleans are allowed in a negated boolean, string\\|null given\\.$#" + count: 2 + path: ../src/Composer/Downloader/FileDownloader.php + + - + message: "#^Only booleans are allowed in an if condition, Composer\\\\EventDispatcher\\\\EventDispatcher\\|null given\\.$#" + count: 2 + path: ../src/Composer/Downloader/FileDownloader.php + + - + message: "#^Only booleans are allowed in an if condition, Exception\\|null given\\.$#" + count: 1 + path: ../src/Composer/Downloader/FileDownloader.php + + - + message: "#^Only booleans are allowed in an if condition, array\\\\> given\\.$#" + count: 1 + path: ../src/Composer/Downloader/FileDownloader.php + + - + message: "#^Only booleans are allowed in an if condition, array\\ given\\.$#" + count: 1 + path: ../src/Composer/Downloader/FileDownloader.php + + - + message: "#^Only booleans are allowed in an if condition, int given\\.$#" + count: 1 + path: ../src/Composer/Downloader/FileDownloader.php + + - + message: "#^Only booleans are allowed in an if condition, string\\|null given\\.$#" + count: 1 + path: ../src/Composer/Downloader/FileDownloader.php + + - + message: "#^Parameter \\#1 \\$path of function pathinfo expects string, string\\|false\\|null given\\.$#" + count: 2 + path: ../src/Composer/Downloader/FileDownloader.php + + - + message: "#^Parameter \\#1 \\$string of function trim expects string, array\\\\>\\|string\\|false given\\.$#" + count: 1 + path: ../src/Composer/Downloader/FileDownloader.php + + - + message: "#^Parameter \\#1 \\$url of function parse_url expects string, string\\|null given\\.$#" + count: 2 + path: ../src/Composer/Downloader/FileDownloader.php + + - + message: "#^Short ternary operator is not allowed\\. Use null coalesce operator if applicable or consider using long ternary\\.$#" + count: 4 + path: ../src/Composer/Downloader/FileDownloader.php + + - + message: "#^Parameter \\#3 \\$cwd of method Composer\\\\Util\\\\ProcessExecutor\\:\\:execute\\(\\) expects string\\|null, string\\|false given\\.$#" + count: 5 + path: ../src/Composer/Downloader/FossilDownloader.php + + - + message: "#^Short ternary operator is not allowed\\. Use null coalesce operator if applicable or consider using long ternary\\.$#" + count: 1 + path: ../src/Composer/Downloader/FossilDownloader.php + + - + message: "#^Construct empty\\(\\) is not allowed\\. Use more strict comparison\\.$#" + count: 5 + path: ../src/Composer/Downloader/GitDownloader.php + + - + message: "#^Foreach overwrites \\$match with its value variable\\.$#" + count: 1 + path: ../src/Composer/Downloader/GitDownloader.php + + - + message: "#^Only booleans are allowed in &&, mixed given on the right side\\.$#" + count: 1 + path: ../src/Composer/Downloader/GitDownloader.php + + - + message: "#^Only booleans are allowed in &&, string given on the left side\\.$#" + count: 1 + path: ../src/Composer/Downloader/GitDownloader.php + + - + message: "#^Only booleans are allowed in &&, string\\|null given on the left side\\.$#" + count: 2 + path: ../src/Composer/Downloader/GitDownloader.php + + - + message: "#^Only booleans are allowed in a negated boolean, array\\ given\\.$#" + count: 1 + path: ../src/Composer/Downloader/GitDownloader.php + + - + message: "#^Only booleans are allowed in a negated boolean, string given\\.$#" + count: 1 + path: ../src/Composer/Downloader/GitDownloader.php + + - + message: "#^Only booleans are allowed in a negated boolean, string\\|null given\\.$#" + count: 1 + path: ../src/Composer/Downloader/GitDownloader.php + + - + message: "#^Only booleans are allowed in an if condition, string\\|false given\\.$#" + count: 2 + path: ../src/Composer/Downloader/GitDownloader.php + + - + message: "#^Only booleans are allowed in an if condition, string\\|null given\\.$#" + count: 2 + path: ../src/Composer/Downloader/GitDownloader.php + + - + message: "#^Parameter \\#1 \\$reference of method Composer\\\\Downloader\\\\GitDownloader\\:\\:getShortHash\\(\\) expects string, string\\|null given\\.$#" + count: 4 + path: ../src/Composer/Downloader/GitDownloader.php + + - + message: "#^Parameter \\#2 \\$reference of method Composer\\\\Downloader\\\\GitDownloader\\:\\:updateToCommit\\(\\) expects string, string\\|null given\\.$#" + count: 2 + path: ../src/Composer/Downloader/GitDownloader.php + + - + message: "#^Parameter \\#3 \\$ref of method Composer\\\\Util\\\\Git\\:\\:fetchRefOrSyncMirror\\(\\) expects string, string\\|null given\\.$#" + count: 1 + path: ../src/Composer/Downloader/GitDownloader.php + + - + message: "#^Parameter \\#4 \\$date of method Composer\\\\Downloader\\\\GitDownloader\\:\\:updateToCommit\\(\\) expects DateTime, DateTime\\|null given\\.$#" + count: 2 + path: ../src/Composer/Downloader/GitDownloader.php + + - + message: "#^Short ternary operator is not allowed\\. Use null coalesce operator if applicable or consider using long ternary\\.$#" + count: 1 + path: ../src/Composer/Downloader/GitDownloader.php + + - + message: "#^Parameter \\#1 \\$path of function pathinfo expects string, string\\|false\\|null given\\.$#" + count: 1 + path: ../src/Composer/Downloader/GzipDownloader.php + + - + message: "#^Parameter \\#1 \\$stream of function fclose expects resource, resource\\|false given\\.$#" + count: 1 + path: ../src/Composer/Downloader/GzipDownloader.php + + - + message: "#^Parameter \\#1 \\$stream of function fwrite expects resource, resource\\|false given\\.$#" + count: 1 + path: ../src/Composer/Downloader/GzipDownloader.php + + - + message: "#^Parameter \\#1 \\$stream of function gzclose expects resource, resource\\|false given\\.$#" + count: 1 + path: ../src/Composer/Downloader/GzipDownloader.php + + - + message: "#^Parameter \\#1 \\$stream of function gzread expects resource, resource\\|false given\\.$#" + count: 1 + path: ../src/Composer/Downloader/GzipDownloader.php + + - + message: "#^Parameter \\#1 \\$url of function parse_url expects string, string\\|null given\\.$#" + count: 1 + path: ../src/Composer/Downloader/GzipDownloader.php + + - + message: "#^Parameter \\#3 \\$length of function fwrite expects int\\<0, max\\>\\|null, int given\\.$#" + count: 1 + path: ../src/Composer/Downloader/GzipDownloader.php + + - + message: "#^Parameter \\#3 \\$cwd of method Composer\\\\Util\\\\ProcessExecutor\\:\\:execute\\(\\) expects string\\|null, string\\|false given\\.$#" + count: 3 + path: ../src/Composer/Downloader/HgDownloader.php + + - + message: "#^Short ternary operator is not allowed\\. Use null coalesce operator if applicable or consider using long ternary\\.$#" + count: 1 + path: ../src/Composer/Downloader/HgDownloader.php + + - + message: "#^Call to function in_array\\(\\) requires parameter \\#3 to be set\\.$#" + count: 1 + path: ../src/Composer/Downloader/PathDownloader.php + + - + message: "#^Only booleans are allowed in an if condition, array\\\\|null given\\.$#" + count: 1 + path: ../src/Composer/Downloader/PathDownloader.php + + - + message: "#^Only booleans are allowed in an if condition, mixed given\\.$#" + count: 1 + path: ../src/Composer/Downloader/PathDownloader.php + + - + message: "#^Only booleans are allowed in an if condition, string\\|false given\\.$#" + count: 1 + path: ../src/Composer/Downloader/PathDownloader.php + + - + message: "#^Parameter \\#1 \\$originDir of method Symfony\\\\Component\\\\Filesystem\\\\Filesystem\\:\\:symlink\\(\\) expects string, string\\|false given\\.$#" + count: 1 + path: ../src/Composer/Downloader/PathDownloader.php + + - + message: "#^Parameter \\#1 \\$path of function realpath expects string, string\\|null given\\.$#" + count: 3 + path: ../src/Composer/Downloader/PathDownloader.php + + - + message: "#^Parameter \\#1 \\$path of method Composer\\\\Util\\\\Filesystem\\:\\:isAbsolutePath\\(\\) expects string, string\\|null given\\.$#" + count: 1 + path: ../src/Composer/Downloader/PathDownloader.php + + - + message: "#^Parameter \\#1 \\$path of method Composer\\\\Util\\\\Filesystem\\:\\:normalizePath\\(\\) expects string, string\\|false given\\.$#" + count: 1 + path: ../src/Composer/Downloader/PathDownloader.php + + - + message: "#^Parameter \\#1 \\$path of method Composer\\\\Util\\\\Filesystem\\:\\:normalizePath\\(\\) expects string, string\\|null given\\.$#" + count: 1 + path: ../src/Composer/Downloader/PathDownloader.php + + - + message: "#^Parameter \\#1 \\$target of method Composer\\\\Util\\\\Filesystem\\:\\:junction\\(\\) expects string, string\\|false given\\.$#" + count: 1 + path: ../src/Composer/Downloader/PathDownloader.php + + - + message: "#^Parameter \\#2 \\$to of method Composer\\\\Util\\\\Filesystem\\:\\:findShortestPath\\(\\) expects string, string\\|false given\\.$#" + count: 1 + path: ../src/Composer/Downloader/PathDownloader.php + + - + message: "#^Cannot call method cleanupClientSpec\\(\\) on Composer\\\\Util\\\\Perforce\\|null\\.$#" + count: 1 + path: ../src/Composer/Downloader/PerforceDownloader.php + + - + message: "#^Cannot call method connectClient\\(\\) on Composer\\\\Util\\\\Perforce\\|null\\.$#" + count: 1 + path: ../src/Composer/Downloader/PerforceDownloader.php + + - + message: "#^Cannot call method getCommitLogs\\(\\) on Composer\\\\Util\\\\Perforce\\|null\\.$#" + count: 1 + path: ../src/Composer/Downloader/PerforceDownloader.php + + - + message: "#^Cannot call method p4Login\\(\\) on Composer\\\\Util\\\\Perforce\\|null\\.$#" + count: 1 + path: ../src/Composer/Downloader/PerforceDownloader.php + + - + message: "#^Cannot call method setStream\\(\\) on Composer\\\\Util\\\\Perforce\\|null\\.$#" + count: 1 + path: ../src/Composer/Downloader/PerforceDownloader.php + + - + message: "#^Cannot call method syncCodeBase\\(\\) on Composer\\\\Util\\\\Perforce\\|null\\.$#" + count: 1 + path: ../src/Composer/Downloader/PerforceDownloader.php + + - + message: "#^Cannot call method writeP4ClientSpec\\(\\) on Composer\\\\Util\\\\Perforce\\|null\\.$#" + count: 1 + path: ../src/Composer/Downloader/PerforceDownloader.php + + - + message: "#^Construct empty\\(\\) is not allowed\\. Use more strict comparison\\.$#" + count: 1 + path: ../src/Composer/Downloader/PerforceDownloader.php + + - + message: "#^Parameter \\#1 \\$repoConfig of static method Composer\\\\Util\\\\Perforce\\:\\:create\\(\\) expects array\\{unique_perforce_client_name\\?\\: string, depot\\?\\: string, branch\\?\\: string, p4user\\?\\: string, p4password\\?\\: string\\}, array\\\\|null given\\.$#" + count: 1 + path: ../src/Composer/Downloader/PerforceDownloader.php + + - + message: "#^Only booleans are allowed in a negated boolean, string\\|null given\\.$#" + count: 1 + path: ../src/Composer/Downloader/SvnDownloader.php + + - + message: "#^Parameter \\#1 \\$version1 of function version_compare expects string, string\\|null given\\.$#" + count: 1 + path: ../src/Composer/Downloader/SvnDownloader.php + + - + message: "#^Cannot call method getUniqueName\\(\\) on Composer\\\\Package\\\\PackageInterface\\|null\\.$#" + count: 3 + path: ../src/Composer/Downloader/VcsDownloader.php + + - + message: "#^Method Composer\\\\Downloader\\\\VcsDownloader\\:\\:prepareUrls\\(\\) should return array\\ but returns array\\\\.$#" + count: 1 + path: ../src/Composer/Downloader/VcsDownloader.php + + - + message: "#^Only booleans are allowed in &&, Exception\\|null given on the right side\\.$#" + count: 1 + path: ../src/Composer/Downloader/VcsDownloader.php + + - + message: "#^Only booleans are allowed in a negated boolean, Exception\\|null given\\.$#" + count: 1 + path: ../src/Composer/Downloader/VcsDownloader.php + + - + message: "#^Only booleans are allowed in a negated boolean, array\\ given\\.$#" + count: 1 + path: ../src/Composer/Downloader/VcsDownloader.php + + - + message: "#^Only booleans are allowed in a negated boolean, int\\<0, max\\> given\\.$#" + count: 2 + path: ../src/Composer/Downloader/VcsDownloader.php + + - + message: "#^Only booleans are allowed in a negated boolean, string given\\.$#" + count: 1 + path: ../src/Composer/Downloader/VcsDownloader.php + + - + message: "#^Only booleans are allowed in a negated boolean, string\\|null given\\.$#" + count: 3 + path: ../src/Composer/Downloader/VcsDownloader.php + + - + message: "#^Only booleans are allowed in an elseif condition, int\\<0, max\\> given\\.$#" + count: 3 + path: ../src/Composer/Downloader/VcsDownloader.php + + - + message: "#^Only booleans are allowed in an if condition, array\\\\|null given\\.$#" + count: 1 + path: ../src/Composer/Downloader/VcsDownloader.php + + - + message: "#^Only booleans are allowed in an if condition, string given\\.$#" + count: 1 + path: ../src/Composer/Downloader/VcsDownloader.php + + - + message: "#^Parameter \\#1 \\$fromReference of method Composer\\\\Downloader\\\\VcsDownloader\\:\\:getCommitLogs\\(\\) expects string, string\\|null given\\.$#" + count: 1 + path: ../src/Composer/Downloader/VcsDownloader.php + + - + message: "#^Parameter \\#1 \\$haystack of function strpos expects string, string\\|false given\\.$#" + count: 2 + path: ../src/Composer/Downloader/VcsDownloader.php + + - + message: "#^Parameter \\#1 \\$package of method Composer\\\\Downloader\\\\VcsDownloader\\:\\:cleanChanges\\(\\) expects Composer\\\\Package\\\\PackageInterface, Composer\\\\Package\\\\PackageInterface\\|null given\\.$#" + count: 1 + path: ../src/Composer/Downloader/VcsDownloader.php + + - + message: "#^Parameter \\#1 \\$path of function realpath expects string, string\\|false given\\.$#" + count: 1 + path: ../src/Composer/Downloader/VcsDownloader.php + + - + message: "#^Parameter \\#1 \\$path of static method Composer\\\\Util\\\\Filesystem\\:\\:isLocalPath\\(\\) expects string, string\\|false given\\.$#" + count: 1 + path: ../src/Composer/Downloader/VcsDownloader.php + + - + message: "#^Parameter \\#1 \\$string of function rawurldecode expects string, string\\|false given\\.$#" + count: 1 + path: ../src/Composer/Downloader/VcsDownloader.php + + - + message: "#^Parameter \\#1 \\$string of function substr expects string, string\\|false given\\.$#" + count: 1 + path: ../src/Composer/Downloader/VcsDownloader.php + + - + message: "#^Parameter \\#2 \\$toReference of method Composer\\\\Downloader\\\\VcsDownloader\\:\\:getCommitLogs\\(\\) expects string, string\\|null given\\.$#" + count: 1 + path: ../src/Composer/Downloader/VcsDownloader.php + + - + message: "#^Short ternary operator is not allowed\\. Use null coalesce operator if applicable or consider using long ternary\\.$#" + count: 2 + path: ../src/Composer/Downloader/VcsDownloader.php + + - + message: "#^Anonymous function uses \\$this assigned to variable \\$self\\. Use \\$this directly in the function body\\.$#" + count: 2 + path: ../src/Composer/Downloader/ZipDownloader.php + + - + message: "#^Only booleans are allowed in &&, string\\|null given on the right side\\.$#" + count: 3 + path: ../src/Composer/Downloader/ZipDownloader.php + + - + message: "#^Only booleans are allowed in a negated boolean, array\\\\> given\\.$#" + count: 3 + path: ../src/Composer/Downloader/ZipDownloader.php + + - + message: "#^Only booleans are allowed in an if condition, string\\|null given\\.$#" + count: 1 + path: ../src/Composer/Downloader/ZipDownloader.php + + - + message: "#^Short ternary operator is not allowed\\. Use null coalesce operator if applicable or consider using long ternary\\.$#" + count: 1 + path: ../src/Composer/Downloader/ZipDownloader.php + + - + message: "#^Call to function in_array\\(\\) requires parameter \\#3 to be set\\.$#" + count: 1 + path: ../src/Composer/EventDispatcher/EventDispatcher.php + + - + message: "#^Call to function is_callable\\(\\) with callable\\(\\)\\: mixed will always evaluate to true\\.$#" + count: 1 + path: ../src/Composer/EventDispatcher/EventDispatcher.php + + - + message: "#^Cannot access offset 0 on array\\{0\\: string, 1\\?\\: int\\}\\|int\\|string\\.$#" + count: 1 + path: ../src/Composer/EventDispatcher/EventDispatcher.php + + - + message: "#^Cannot access offset 1 on array\\{0\\: string, 1\\?\\: int\\}\\|int\\|string\\.$#" + count: 1 + path: ../src/Composer/EventDispatcher/EventDispatcher.php + + - + message: "#^Casting to bool something that's already bool\\.$#" + count: 1 + path: ../src/Composer/EventDispatcher/EventDispatcher.php + + - + message: "#^Construct empty\\(\\) is not allowed\\. Use more strict comparison\\.$#" + count: 1 + path: ../src/Composer/EventDispatcher/EventDispatcher.php + + - + message: "#^Dynamic call to static method Composer\\\\EventDispatcher\\\\EventSubscriberInterface\\:\\:getSubscribedEvents\\(\\)\\.$#" + count: 1 + path: ../src/Composer/EventDispatcher/EventDispatcher.php + + - + message: "#^Only booleans are allowed in a negated boolean, array\\<\\(callable\\)\\|string\\> given\\.$#" + count: 1 + path: ../src/Composer/EventDispatcher/EventDispatcher.php + + - + message: "#^Only booleans are allowed in a negated boolean, string\\|false given\\.$#" + count: 1 + path: ../src/Composer/EventDispatcher/EventDispatcher.php + + - + message: "#^Only booleans are allowed in a ternary operator condition, array given\\.$#" + count: 1 + path: ../src/Composer/EventDispatcher/EventDispatcher.php + + - + message: "#^Only booleans are allowed in a ternary operator condition, string\\|null given\\.$#" + count: 1 + path: ../src/Composer/EventDispatcher/EventDispatcher.php + + - + message: "#^Only booleans are allowed in an if condition, Composer\\\\Autoload\\\\ClassLoader\\|null given\\.$#" + count: 1 + path: ../src/Composer/EventDispatcher/EventDispatcher.php + + - + message: "#^Only booleans are allowed in an if condition, array\\ given\\.$#" + count: 1 + path: ../src/Composer/EventDispatcher/EventDispatcher.php + + - + message: "#^Only booleans are allowed in an if condition, string\\|false given\\.$#" + count: 2 + path: ../src/Composer/EventDispatcher/EventDispatcher.php + + - + message: "#^Only booleans are allowed in an if condition, string\\|null given\\.$#" + count: 1 + path: ../src/Composer/EventDispatcher/EventDispatcher.php + + - + message: "#^Only numeric types are allowed in \\+, int\\<0, max\\>\\|false given on the left side\\.$#" + count: 1 + path: ../src/Composer/EventDispatcher/EventDispatcher.php + + - + message: "#^Parameter \\#1 \\$str of function preg_quote expects string, string\\|false given\\.$#" + count: 1 + path: ../src/Composer/EventDispatcher/EventDispatcher.php + + - + message: "#^Parameter \\#2 \\$listener of method Composer\\\\EventDispatcher\\\\EventDispatcher\\:\\:addListener\\(\\) expects callable\\(\\)\\: mixed, array\\{Composer\\\\EventDispatcher\\\\EventSubscriberInterface, string\\} given\\.$#" + count: 3 + path: ../src/Composer/EventDispatcher/EventDispatcher.php + + - + message: "#^Parameter \\#2 \\$subject of static method Composer\\\\Pcre\\\\Preg\\:\\:isMatch\\(\\) expects string, string\\|false given\\.$#" + count: 1 + path: ../src/Composer/EventDispatcher/EventDispatcher.php + + - + message: "#^Parameter \\#3 \\$length of function substr expects int\\|null, int\\<0, max\\>\\|false given\\.$#" + count: 1 + path: ../src/Composer/EventDispatcher/EventDispatcher.php + + - + message: "#^Parameter \\#3 \\$priority of method Composer\\\\EventDispatcher\\\\EventDispatcher\\:\\:addListener\\(\\) expects int, array\\\\|int\\|string given\\.$#" + count: 1 + path: ../src/Composer/EventDispatcher/EventDispatcher.php + + - + message: "#^Parameter \\#3 \\$priority of method Composer\\\\EventDispatcher\\\\EventDispatcher\\:\\:addListener\\(\\) expects int, int\\|string given\\.$#" + count: 1 + path: ../src/Composer/EventDispatcher/EventDispatcher.php + + - + message: "#^Short ternary operator is not allowed\\. Use null coalesce operator if applicable or consider using long ternary\\.$#" + count: 1 + path: ../src/Composer/EventDispatcher/EventDispatcher.php + + - + message: "#^Variable static method call on string\\.$#" + count: 1 + path: ../src/Composer/EventDispatcher/EventDispatcher.php + + - + message: "#^Call to function in_array\\(\\) requires parameter \\#3 to be set\\.$#" + count: 3 + path: ../src/Composer/Factory.php + + - + message: "#^Offset 'line' does not exist on array\\{text\\?\\: string, token\\?\\: string, line\\?\\: int, loc\\?\\: array\\{first_line\\: int, first_column\\: int, last_line\\: int, last_column\\: int\\}, expected\\?\\: array\\, key\\: string\\}\\.$#" + count: 1 + path: ../src/Composer/Factory.php + + - + message: "#^Only booleans are allowed in &&, Composer\\\\IO\\\\IOInterface\\|null given on the left side\\.$#" + count: 3 + path: ../src/Composer/Factory.php + + - + message: "#^Only booleans are allowed in a negated boolean, string\\|false given\\.$#" + count: 3 + path: ../src/Composer/Factory.php + + - + message: "#^Only booleans are allowed in an if condition, Composer\\\\IO\\\\IOInterface\\|null given\\.$#" + count: 1 + path: ../src/Composer/Factory.php + + - + message: "#^Only booleans are allowed in an if condition, Composer\\\\Util\\\\ProcessExecutor\\|null given\\.$#" + count: 1 + path: ../src/Composer/Factory.php + + - + message: "#^Only booleans are allowed in an if condition, mixed given\\.$#" + count: 4 + path: ../src/Composer/Factory.php + + - + message: "#^Only booleans are allowed in an if condition, string\\|false given\\.$#" + count: 6 + path: ../src/Composer/Factory.php + + - + message: "#^Parameter \\#1 \\$input of method Seld\\\\JsonLint\\\\JsonParser\\:\\:parse\\(\\) expects string, string\\|false given\\.$#" + count: 1 + path: ../src/Composer/Factory.php + + - + message: "#^Parameter \\#1 \\$path of class Composer\\\\Json\\\\JsonFile constructor expects string, string\\|false given\\.$#" + count: 1 + path: ../src/Composer/Factory.php + + - + message: "#^Parameter \\#1 \\$path of function dirname expects string, string\\|false given\\.$#" + count: 1 + path: ../src/Composer/Factory.php + + - + message: "#^Parameter \\#1 \\$string of function trim expects string, string\\|false given\\.$#" + count: 1 + path: ../src/Composer/Factory.php + + - + message: "#^Parameter \\#4 \\$composerFileContents of class Composer\\\\Package\\\\Locker constructor expects string, string\\|false given\\.$#" + count: 1 + path: ../src/Composer/Factory.php + + - + message: "#^Short ternary operator is not allowed\\. Use null coalesce operator if applicable or consider using long ternary\\.$#" + count: 5 + path: ../src/Composer/Factory.php + + - + message: "#^Array \\(array\\\\) does not accept array\\{username\\: string, password\\: string\\|null\\}\\.$#" + count: 1 + path: ../src/Composer/IO/BaseIO.php + + - + message: "#^Call to function in_array\\(\\) requires parameter \\#3 to be set\\.$#" + count: 1 + path: ../src/Composer/IO/BaseIO.php + + - + message: "#^Short ternary operator is not allowed\\. Use null coalesce operator if applicable or consider using long ternary\\.$#" + count: 6 + path: ../src/Composer/IO/BaseIO.php + + - + message: "#^Instanceof between Symfony\\\\Component\\\\Console\\\\Input\\\\StringInput and Symfony\\\\Component\\\\Console\\\\Input\\\\StreamableInputInterface will always evaluate to true\\.$#" + count: 1 + path: ../src/Composer/IO/BufferIO.php + + - + message: "#^Only booleans are allowed in a ternary operator condition, Symfony\\\\Component\\\\Console\\\\Formatter\\\\OutputFormatterInterface\\|null given\\.$#" + count: 1 + path: ../src/Composer/IO/BufferIO.php + + - + message: "#^PHPDoc type Symfony\\\\Component\\\\Console\\\\Input\\\\StringInput of property Composer\\\\IO\\\\BufferIO\\:\\:\\$input is not the same as PHPDoc type Symfony\\\\Component\\\\Console\\\\Input\\\\InputInterface of overridden property Composer\\\\IO\\\\ConsoleIO\\:\\:\\$input\\.$#" + count: 1 + path: ../src/Composer/IO/BufferIO.php + + - + message: "#^PHPDoc type Symfony\\\\Component\\\\Console\\\\Output\\\\StreamOutput of property Composer\\\\IO\\\\BufferIO\\:\\:\\$output is not the same as PHPDoc type Symfony\\\\Component\\\\Console\\\\Output\\\\OutputInterface of overridden property Composer\\\\IO\\\\ConsoleIO\\:\\:\\$output\\.$#" + count: 1 + path: ../src/Composer/IO/BufferIO.php + + - + message: "#^Parameter \\#1 \\$stream of class Symfony\\\\Component\\\\Console\\\\Output\\\\StreamOutput constructor expects resource, resource\\|false given\\.$#" + count: 1 + path: ../src/Composer/IO/BufferIO.php + + - + message: "#^Parameter \\#1 \\$stream of function fwrite expects resource, resource\\|false given\\.$#" + count: 1 + path: ../src/Composer/IO/BufferIO.php + + - + message: "#^Parameter \\#1 \\$stream of function rewind expects resource, resource\\|false given\\.$#" + count: 1 + path: ../src/Composer/IO/BufferIO.php + + - + message: "#^Parameter \\#1 \\$stream of method Symfony\\\\Component\\\\Console\\\\Input\\\\Input\\:\\:setStream\\(\\) expects resource, resource\\|false given\\.$#" + count: 1 + path: ../src/Composer/IO/BufferIO.php + + - + message: "#^Parameter \\#3 \\$subject of static method Composer\\\\Pcre\\\\Preg\\:\\:replaceCallback\\(\\) expects string, string\\|false given\\.$#" + count: 1 + path: ../src/Composer/IO/BufferIO.php + + - + message: "#^Parameter \\#1 \\$attempts of method Symfony\\\\Component\\\\Console\\\\Question\\\\Question\\:\\:setMaxAttempts\\(\\) expects int\\|null, int\\\\|int\\<1, max\\>\\|true\\|null given\\.$#" + count: 1 + path: ../src/Composer/IO/ConsoleIO.php + + - + message: "#^Short ternary operator is not allowed\\. Use null coalesce operator if applicable or consider using long ternary\\.$#" + count: 1 + path: ../src/Composer/IO/ConsoleIO.php + + - + message: "#^Array \\(array\\\\|bool\\|string\\>\\|bool\\|string\\>\\>\\>\\) does not accept key \\(int\\|string\\)\\.$#" + count: 1 + path: ../src/Composer/InstalledVersions.php + + - + message: "#^Call to function method_exists\\(\\) with 'Composer\\\\\\\\Autoload…' and 'getRegisteredLoaders' will always evaluate to true\\.$#" + count: 1 + path: ../src/Composer/InstalledVersions.php + + - + message: "#^Construct empty\\(\\) is not allowed\\. Use more strict comparison\\.$#" + count: 1 + path: ../src/Composer/InstalledVersions.php + + - + message: "#^Parameter \\#1 \\$constraints of method Composer\\\\Semver\\\\VersionParser\\:\\:parseConstraints\\(\\) expects string, string\\|null given\\.$#" + count: 1 + path: ../src/Composer/InstalledVersions.php + + - + message: "#^Cannot call method getPackages\\(\\) on Composer\\\\Repository\\\\LockArrayRepository\\|null\\.$#" + count: 1 + path: ../src/Composer/Installer.php + + - + message: "#^Cannot call method getPackages\\(\\) on Composer\\\\Repository\\\\RepositoryInterface\\|null\\.$#" + count: 1 + path: ../src/Composer/Installer.php + + - + message: "#^Casting to bool something that's already bool\\.$#" + count: 15 + path: ../src/Composer/Installer.php + + - + message: "#^Method Composer\\\\Installer\\:\\:run\\(\\) should return 0\\|1\\|2\\|3\\|4 but returns int\\\\|int\\<1, max\\>\\.$#" + count: 1 + path: ../src/Composer/Installer.php + + - + message: "#^Only booleans are allowed in &&, array\\\\> given on the right side\\.$#" + count: 1 + path: ../src/Composer/Installer.php + + - + message: "#^Only booleans are allowed in &&, array\\\\|null given on the left side\\.$#" + count: 1 + path: ../src/Composer/Installer.php + + - + message: "#^Only booleans are allowed in &&, mixed given on the right side\\.$#" + count: 2 + path: ../src/Composer/Installer.php + + - + message: "#^Only booleans are allowed in a negated boolean, Composer\\\\Repository\\\\LockArrayRepository\\|null given\\.$#" + count: 1 + path: ../src/Composer/Installer.php + + - + message: "#^Only booleans are allowed in a negated boolean, array\\ given\\.$#" + count: 2 + path: ../src/Composer/Installer.php + + - + message: "#^Only booleans are allowed in a negated boolean, array\\ given\\.$#" + count: 1 + path: ../src/Composer/Installer.php + + - + message: "#^Only booleans are allowed in an if condition, Composer\\\\Repository\\\\LockArrayRepository\\|null given\\.$#" + count: 1 + path: ../src/Composer/Installer.php + + - + message: "#^Only booleans are allowed in an if condition, Composer\\\\Repository\\\\RepositoryInterface\\|null given\\.$#" + count: 2 + path: ../src/Composer/Installer.php + + - + message: "#^Only booleans are allowed in an if condition, array\\ given\\.$#" + count: 2 + path: ../src/Composer/Installer.php + + - + message: "#^Only booleans are allowed in an if condition, array\\ given\\.$#" + count: 1 + path: ../src/Composer/Installer.php + + - + message: "#^Only booleans are allowed in an if condition, array\\ given\\.$#" + count: 5 + path: ../src/Composer/Installer.php + + - + message: "#^Only booleans are allowed in an if condition, array\\\\|null given\\.$#" + count: 1 + path: ../src/Composer/Installer.php + + - + message: "#^Only booleans are allowed in an if condition, int given\\.$#" + count: 1 + path: ../src/Composer/Installer.php + + - + message: "#^Only booleans are allowed in \\|\\|, array\\\\|null given on the left side\\.$#" + count: 2 + path: ../src/Composer/Installer.php + + - + message: "#^Parameter \\#2 \\$stabilityFlags of class Composer\\\\Repository\\\\RepositorySet constructor expects array\\, non\\-empty\\-array\\ given\\.$#" + count: 1 + path: ../src/Composer/Installer.php + + - + message: "#^Short ternary operator is not allowed\\. Use null coalesce operator if applicable or consider using long ternary\\.$#" + count: 2 + path: ../src/Composer/Installer.php + + - + message: "#^Construct empty\\(\\) is not allowed\\. Use more strict comparison\\.$#" + count: 1 + path: ../src/Composer/Installer/BinaryInstaller.php + + - + message: "#^Only booleans are allowed in a negated boolean, array\\ given\\.$#" + count: 2 + path: ../src/Composer/Installer/BinaryInstaller.php + + - + message: "#^Only booleans are allowed in an if condition, string\\|null given\\.$#" + count: 1 + path: ../src/Composer/Installer/BinaryInstaller.php + + - + message: "#^Parameter \\#1 \\$binPath of method Composer\\\\Installer\\\\BinaryInstaller\\:\\:installFullBinaries\\(\\) expects string, string\\|false given\\.$#" + count: 1 + path: ../src/Composer/Installer/BinaryInstaller.php + + - + message: "#^Parameter \\#1 \\$binPath of method Composer\\\\Installer\\\\BinaryInstaller\\:\\:installUnixyProxyBinaries\\(\\) expects string, string\\|false given\\.$#" + count: 1 + path: ../src/Composer/Installer/BinaryInstaller.php + + - + message: "#^Parameter \\#1 \\$path of function realpath expects string, string\\|false given\\.$#" + count: 1 + path: ../src/Composer/Installer/BinaryInstaller.php + + - + message: "#^Parameter \\#1 \\$stream of function fclose expects resource, resource\\|false given\\.$#" + count: 1 + path: ../src/Composer/Installer/BinaryInstaller.php + + - + message: "#^Parameter \\#1 \\$stream of function fgets expects resource, resource\\|false given\\.$#" + count: 1 + path: ../src/Composer/Installer/BinaryInstaller.php + + - + message: "#^Parameter \\#2 \\$subject of static method Composer\\\\Pcre\\\\Preg\\:\\:isMatch\\(\\) expects string, string\\|false given\\.$#" + count: 2 + path: ../src/Composer/Installer/BinaryInstaller.php + + - + message: "#^Property Composer\\\\Installer\\\\BinaryInstaller\\:\\:\\$binDir \\(string\\) does not accept string\\|false\\.$#" + count: 1 + path: ../src/Composer/Installer/BinaryInstaller.php + + - + message: "#^Short ternary operator is not allowed\\. Use null coalesce operator if applicable or consider using long ternary\\.$#" + count: 1 + path: ../src/Composer/Installer/BinaryInstaller.php + + - + message: "#^Anonymous function uses \\$this assigned to variable \\$installManager\\. Use \\$this directly in the function body\\.$#" + count: 2 + path: ../src/Composer/Installer/InstallationManager.php + + - + message: "#^Call to function in_array\\(\\) requires parameter \\#3 to be set\\.$#" + count: 2 + path: ../src/Composer/Installer/InstallationManager.php + + - + message: "#^Construct empty\\(\\) is not allowed\\. Use more strict comparison\\.$#" + count: 1 + path: ../src/Composer/Installer/InstallationManager.php + + - + message: "#^Foreach overwrites \\$batch with its value variable\\.$#" + count: 2 + path: ../src/Composer/Installer/InstallationManager.php + + - + message: "#^Only booleans are allowed in &&, Composer\\\\EventDispatcher\\\\EventDispatcher\\|null given on the right side\\.$#" + count: 2 + path: ../src/Composer/Installer/InstallationManager.php + + - + message: "#^Only booleans are allowed in &&, array given on the right side\\.$#" + count: 1 + path: ../src/Composer/Installer/InstallationManager.php + + - + message: "#^Only booleans are allowed in a negated boolean, string\\|false given\\.$#" + count: 1 + path: ../src/Composer/Installer/InstallationManager.php + + - + message: "#^Only booleans are allowed in a negated boolean, string\\|null given\\.$#" + count: 1 + path: ../src/Composer/Installer/InstallationManager.php + + - + message: "#^Only booleans are allowed in an if condition, React\\\\Promise\\\\PromiseInterface\\|null given\\.$#" + count: 1 + path: ../src/Composer/Installer/InstallationManager.php + + - + message: "#^Only booleans are allowed in an if condition, Symfony\\\\Component\\\\Console\\\\Helper\\\\ProgressBar\\|null given\\.$#" + count: 1 + path: ../src/Composer/Installer/InstallationManager.php + + - + message: "#^Only booleans are allowed in an if condition, array\\ given\\.$#" + count: 4 + path: ../src/Composer/Installer/InstallationManager.php + + - + message: "#^Only booleans are allowed in an if condition, int\\<0, max\\> given\\.$#" + count: 2 + path: ../src/Composer/Installer/InstallationManager.php + + - + message: "#^Only booleans are allowed in an if condition, int\\<0, max\\>\\|false given\\.$#" + count: 1 + path: ../src/Composer/Installer/InstallationManager.php + + - + message: "#^Only booleans are allowed in an if condition, string\\|null given\\.$#" + count: 1 + path: ../src/Composer/Installer/InstallationManager.php + + - + message: "#^Parameter \\#1 \\$callback of function call_user_func expects callable\\(\\)\\: mixed, int\\\\|int\\<2, max\\>\\|string given\\.$#" + count: 1 + path: ../src/Composer/Installer/InstallationManager.php + + - + message: "#^Parameter \\#1 \\$onFulfilled of method React\\\\Promise\\\\PromiseInterface\\:\\:then\\(\\) expects \\(callable\\(\\)\\: mixed\\)\\|null, React\\\\Promise\\\\PromiseInterface given\\.$#" + count: 1 + path: ../src/Composer/Installer/InstallationManager.php + + - + message: "#^Parameter \\#2 \\$handler of function pcntl_signal expects \\(callable\\(\\)\\: mixed\\)\\|int, int\\|string given\\.$#" + count: 2 + path: ../src/Composer/Installer/InstallationManager.php + + - + message: "#^Parameter \\#2 \\$offset of function array_splice expects int, int\\|string given\\.$#" + count: 1 + path: ../src/Composer/Installer/InstallationManager.php + + - + message: "#^Parameter \\#3 \\$cleanupPromises of method Composer\\\\Installer\\\\InstallationManager\\:\\:executeBatch\\(\\) expects array\\, array\\<\\(Closure\\)\\|React\\\\Promise\\\\PromiseInterface\\> given\\.$#" + count: 1 + path: ../src/Composer/Installer/InstallationManager.php + + - + message: "#^Trying to invoke React\\\\Promise\\\\PromiseInterface but it might not be a callable\\.$#" + count: 1 + path: ../src/Composer/Installer/InstallationManager.php + + - + message: "#^Variable method call on \\$this\\(Composer\\\\Installer\\\\InstallationManager\\)\\.$#" + count: 2 + path: ../src/Composer/Installer/InstallationManager.php + + - + message: "#^Anonymous function uses \\$this assigned to variable \\$self\\. Use \\$this directly in the function body\\.$#" + count: 1 + path: ../src/Composer/Installer/LibraryInstaller.php + + - + message: "#^Only booleans are allowed in a ternary operator condition, string given\\.$#" + count: 1 + path: ../src/Composer/Installer/LibraryInstaller.php + + - + message: "#^Only booleans are allowed in a ternary operator condition, string\\|null given\\.$#" + count: 1 + path: ../src/Composer/Installer/LibraryInstaller.php + + - + message: "#^Only booleans are allowed in an if condition, int\\<0, max\\>\\|false given\\.$#" + count: 1 + path: ../src/Composer/Installer/LibraryInstaller.php + + - + message: "#^Only booleans are allowed in an if condition, string\\|null given\\.$#" + count: 1 + path: ../src/Composer/Installer/LibraryInstaller.php + + - + message: "#^Property Composer\\\\Installer\\\\LibraryInstaller\\:\\:\\$type \\(string\\) does not accept string\\|null\\.$#" + count: 1 + path: ../src/Composer/Installer/LibraryInstaller.php + + - + message: "#^Property Composer\\\\Installer\\\\LibraryInstaller\\:\\:\\$vendorDir \\(string\\) does not accept string\\|false\\.$#" + count: 1 + path: ../src/Composer/Installer/LibraryInstaller.php + + - + message: "#^Short ternary operator is not allowed\\. Use null coalesce operator if applicable or consider using long ternary\\.$#" + count: 2 + path: ../src/Composer/Installer/LibraryInstaller.php + + - + message: "#^Only booleans are allowed in a ternary operator condition, string\\|null given\\.$#" + count: 1 + path: ../src/Composer/Installer/NoopInstaller.php + + - + message: "#^Anonymous function uses \\$this assigned to variable \\$self\\. Use \\$this directly in the function body\\.$#" + count: 2 + path: ../src/Composer/Installer/PluginInstaller.php + + - + message: "#^Construct empty\\(\\) is not allowed\\. Use more strict comparison\\.$#" + count: 1 + path: ../src/Composer/Installer/PluginInstaller.php + + - + message: "#^Call to function in_array\\(\\) requires parameter \\#3 to be set\\.$#" + count: 2 + path: ../src/Composer/Installer/SuggestedPackagesReporter.php + + - + message: "#^Construct empty\\(\\) is not allowed\\. Use more strict comparison\\.$#" + count: 1 + path: ../src/Composer/Installer/SuggestedPackagesReporter.php + + - + message: "#^Foreach overwrites \\$suggesters with its value variable\\.$#" + count: 1 + path: ../src/Composer/Installer/SuggestedPackagesReporter.php + + - + message: "#^Only booleans are allowed in &&, array\\ given on the left side\\.$#" + count: 1 + path: ../src/Composer/Installer/SuggestedPackagesReporter.php + + - + message: "#^Only booleans are allowed in a ternary operator condition, mixed given\\.$#" + count: 2 + path: ../src/Composer/Installer/SuggestedPackagesReporter.php + + - + message: "#^Only booleans are allowed in an if condition, Composer\\\\Package\\\\PackageInterface\\|null given\\.$#" + count: 2 + path: ../src/Composer/Installer/SuggestedPackagesReporter.php + + - + message: "#^Only booleans are allowed in an if condition, array given\\.$#" + count: 1 + path: ../src/Composer/Installer/SuggestedPackagesReporter.php + + - + message: "#^Only booleans are allowed in an if condition, int given\\.$#" + count: 5 + path: ../src/Composer/Installer/SuggestedPackagesReporter.php + + - + message: "#^Method Composer\\\\Json\\\\JsonFile\\:\\:encode\\(\\) should return string but returns string\\|false\\.$#" + count: 2 + path: ../src/Composer/Json/JsonFile.php + + - + message: "#^Only booleans are allowed in &&, Composer\\\\IO\\\\IOInterface\\|null given on the left side\\.$#" + count: 1 + path: ../src/Composer/Json/JsonFile.php + + - + message: "#^Only booleans are allowed in a negated boolean, string\\|false given\\.$#" + count: 1 + path: ../src/Composer/Json/JsonFile.php + + - + message: "#^Only booleans are allowed in a ternary operator condition, int given\\.$#" + count: 1 + path: ../src/Composer/Json/JsonFile.php + + - + message: "#^Only booleans are allowed in an if condition, Composer\\\\Util\\\\HttpDownloader\\|null given\\.$#" + count: 1 + path: ../src/Composer/Json/JsonFile.php + + - + message: "#^Only booleans are allowed in an if condition, int given\\.$#" + count: 1 + path: ../src/Composer/Json/JsonFile.php + + - + message: "#^Parameter \\#1 \\$json of function json_decode expects string, string\\|false given\\.$#" + count: 1 + path: ../src/Composer/Json/JsonFile.php + + - + message: "#^Parameter \\#1 \\$json of static method Composer\\\\Json\\\\JsonFile\\:\\:parseJson\\(\\) expects string\\|null, string\\|false\\|null given\\.$#" + count: 1 + path: ../src/Composer/Json/JsonFile.php + + - + message: "#^Parameter \\#1 \\$json of static method Composer\\\\Json\\\\JsonFile\\:\\:validateSyntax\\(\\) expects string, string\\|false given\\.$#" + count: 1 + path: ../src/Composer/Json/JsonFile.php + + - + message: "#^Parameter \\#1 \\$json of static method Composer\\\\Json\\\\JsonFormatter\\:\\:format\\(\\) expects string, string\\|false given\\.$#" + count: 1 + path: ../src/Composer/Json/JsonFile.php + + - + message: "#^Parameter \\#1 \\$version1 of function version_compare expects string, string\\|false given\\.$#" + count: 1 + path: ../src/Composer/Json/JsonFile.php + + - + message: "#^Parameter \\#3 \\$subject of static method Composer\\\\Pcre\\\\Preg\\:\\:replace\\(\\) expects string, string\\|false given\\.$#" + count: 1 + path: ../src/Composer/Json/JsonFile.php + + - + message: "#^Only booleans are allowed in an if condition, int\\<0, 1\\> given\\.$#" + count: 1 + path: ../src/Composer/Json/JsonFormatter.php + + - + message: "#^Anonymous function uses \\$this assigned to variable \\$that\\. Use \\$this directly in the function body\\.$#" + count: 2 + path: ../src/Composer/Json/JsonManipulator.php + + - + message: "#^Call to function in_array\\(\\) requires parameter \\#3 to be set\\.$#" + count: 2 + path: ../src/Composer/Json/JsonManipulator.php + + - + message: "#^Construct empty\\(\\) is not allowed\\. Use more strict comparison\\.$#" + count: 5 + path: ../src/Composer/Json/JsonManipulator.php + + - + message: "#^Foreach overwrites \\$match with its value variable\\.$#" + count: 1 + path: ../src/Composer/Json/JsonManipulator.php + + - + message: "#^Only booleans are allowed in &&, string\\|null given on the left side\\.$#" + count: 1 + path: ../src/Composer/Json/JsonManipulator.php + + - + message: "#^Only booleans are allowed in a negated boolean, mixed given\\.$#" + count: 4 + path: ../src/Composer/Json/JsonManipulator.php + + - + message: "#^Casting to string something that's already string\\.$#" + count: 1 + path: ../src/Composer/Json/JsonValidationException.php + + - + message: "#^Variable method call on Composer\\\\Package\\\\BasePackage\\.$#" + count: 1 + path: ../src/Composer/Package/AliasPackage.php + + - + message: "#^Variable property access on \\$this\\(Composer\\\\Package\\\\AliasPackage\\)\\.$#" + count: 1 + path: ../src/Composer/Package/AliasPackage.php + + - + message: "#^Call to function method_exists\\(\\) with Closure\\(SplFileInfo\\)\\: bool and 'bindTo' will always evaluate to true\\.$#" + count: 1 + path: ../src/Composer/Package/Archiver/ArchivableFilesFinder.php + + - + message: "#^Parameter \\#1 \\$haystack of function strpos expects string, string\\|false given\\.$#" + count: 1 + path: ../src/Composer/Package/Archiver/ArchivableFilesFinder.php + + - + message: "#^Parameter \\#1 \\$path of method Composer\\\\Util\\\\Filesystem\\:\\:normalizePath\\(\\) expects string, string\\|false given\\.$#" + count: 2 + path: ../src/Composer/Package/Archiver/ArchivableFilesFinder.php + + - + message: "#^Construct empty\\(\\) is not allowed\\. Use more strict comparison\\.$#" + count: 4 + path: ../src/Composer/Package/Archiver/ArchiveManager.php + + - + message: "#^Only booleans are allowed in an if condition, string\\|null given\\.$#" + count: 2 + path: ../src/Composer/Package/Archiver/ArchiveManager.php + + - + message: "#^Parameter \\#1 \\$directory of method Composer\\\\Util\\\\Filesystem\\:\\:removeDirectory\\(\\) expects string, string\\|false given\\.$#" + count: 1 + path: ../src/Composer/Package/Archiver/ArchiveManager.php + + - + message: "#^Parameter \\#1 \\$sources of method Composer\\\\Package\\\\Archiver\\\\ArchiverInterface\\:\\:archive\\(\\) expects string, string\\|false given\\.$#" + count: 1 + path: ../src/Composer/Package/Archiver/ArchiveManager.php + + - + message: "#^Parameter \\#2 \\$sourceType of method Composer\\\\Package\\\\Archiver\\\\ArchiverInterface\\:\\:supports\\(\\) expects string, string\\|null given\\.$#" + count: 1 + path: ../src/Composer/Package/Archiver/ArchiveManager.php + + - + message: "#^Only booleans are allowed in a negated boolean, string given\\.$#" + count: 1 + path: ../src/Composer/Package/Archiver/BaseExcludeFilter.php + + - + message: "#^Parameter \\#1 \\$lines of method Composer\\\\Package\\\\Archiver\\\\BaseExcludeFilter\\:\\:parseLines\\(\\) expects array\\, array\\\\|false given\\.$#" + count: 1 + path: ../src/Composer/Package/Archiver/GitExcludeFilter.php + + - + message: "#^Dynamic call to static method Phar\\:\\:canCompress\\(\\)\\.$#" + count: 1 + path: ../src/Composer/Package/Archiver/PharArchiver.php + + - + message: "#^Only numeric types are allowed in \\-, int\\|false given on the left side\\.$#" + count: 1 + path: ../src/Composer/Package/Archiver/PharArchiver.php + + - + message: "#^Parameter \\#1 \\$sources of class Composer\\\\Package\\\\Archiver\\\\ArchivableFilesFinder constructor expects string, string\\|false given\\.$#" + count: 1 + path: ../src/Composer/Package/Archiver/PharArchiver.php + + - + message: "#^Parameter \\#2 \\$baseDirectory of method Phar\\:\\:buildFromIterator\\(\\) expects string\\|null, string\\|false given\\.$#" + count: 1 + path: ../src/Composer/Package/Archiver/PharArchiver.php + + - + message: "#^Parameter \\#2 \\$sources of method Composer\\\\Package\\\\Archiver\\\\ArchivableFilesFilter\\:\\:addEmptyDir\\(\\) expects string, string\\|false given\\.$#" + count: 1 + path: ../src/Composer/Package/Archiver/PharArchiver.php + + - + message: "#^Call to function method_exists\\(\\) with ZipArchive and 'setExternalAttribut…' will always evaluate to true\\.$#" + count: 1 + path: ../src/Composer/Package/Archiver/ZipArchiver.php + + - + message: "#^Call to function in_array\\(\\) requires parameter \\#3 to be set\\.$#" + count: 1 + path: ../src/Composer/Package/BasePackage.php + + - + message: "#^Only booleans are allowed in &&, Composer\\\\Repository\\\\RepositoryInterface\\|null given on the left side\\.$#" + count: 1 + path: ../src/Composer/Package/BasePackage.php + + - + message: "#^Method Composer\\\\Package\\\\Comparer\\\\Comparer\\:\\:getChanged\\(\\) should return array\\{changed\\?\\: array\\, removed\\?\\: array\\, added\\?\\: array\\\\}\\|string\\|false but returns \\(non\\-empty\\-array\\\\>\\)\\|string\\.$#" + count: 1 + path: ../src/Composer/Package/Comparer/Comparer.php + + - + message: "#^Only booleans are allowed in &&, int\\<0, max\\>\\|false given on the right side\\.$#" + count: 1 + path: ../src/Composer/Package/Comparer/Comparer.php + + - + message: "#^Only booleans are allowed in a negated boolean, array\\\\>\\|false given\\.$#" + count: 1 + path: ../src/Composer/Package/Comparer/Comparer.php + + - + message: "#^Only booleans are allowed in a negated boolean, int given\\.$#" + count: 1 + path: ../src/Composer/Package/Comparer/Comparer.php + + - + message: "#^Only booleans are allowed in a negated boolean, int\\<0, max\\> given\\.$#" + count: 1 + path: ../src/Composer/Package/Comparer/Comparer.php + + - + message: "#^Only booleans are allowed in an if condition, resource\\|false given\\.$#" + count: 1 + path: ../src/Composer/Package/Comparer/Comparer.php + + - + message: "#^Parameter \\#1 \\$directory of function chdir expects string, string\\|false given\\.$#" + count: 2 + path: ../src/Composer/Package/Comparer/Comparer.php + + - + message: "#^PHPDoc type Composer\\\\Package\\\\CompletePackage of property Composer\\\\Package\\\\CompleteAliasPackage\\:\\:\\$aliasOf is not the same as PHPDoc type Composer\\\\Package\\\\BasePackage of overridden property Composer\\\\Package\\\\AliasPackage\\:\\:\\$aliasOf\\.$#" + count: 1 + path: ../src/Composer/Package/CompleteAliasPackage.php + + - + message: "#^Only booleans are allowed in an if condition, DateTime\\|null given\\.$#" + count: 1 + path: ../src/Composer/Package/Dumper/ArrayDumper.php + + - + message: "#^Only booleans are allowed in an if condition, array\\\\>\\|null given\\.$#" + count: 2 + path: ../src/Composer/Package/Dumper/ArrayDumper.php + + - + message: "#^Only booleans are allowed in an if condition, array\\ given\\.$#" + count: 1 + path: ../src/Composer/Package/Dumper/ArrayDumper.php + + - + message: "#^Only booleans are allowed in an if condition, array\\ given\\.$#" + count: 1 + path: ../src/Composer/Package/Dumper/ArrayDumper.php + + - + message: "#^Only booleans are allowed in an if condition, string given\\.$#" + count: 1 + path: ../src/Composer/Package/Dumper/ArrayDumper.php + + - + message: "#^Only booleans are allowed in an if condition, string\\|null given\\.$#" + count: 4 + path: ../src/Composer/Package/Dumper/ArrayDumper.php + + - + message: "#^Parameter \\#1 \\$array of function ksort expects array, array\\\\|string given\\.$#" + count: 1 + path: ../src/Composer/Package/Dumper/ArrayDumper.php + + - + message: "#^Short ternary operator is not allowed\\. Use null coalesce operator if applicable or consider using long ternary\\.$#" + count: 1 + path: ../src/Composer/Package/Dumper/ArrayDumper.php + + - + message: "#^Variable method call on Composer\\\\Package\\\\PackageInterface\\.$#" + count: 2 + path: ../src/Composer/Package/Dumper/ArrayDumper.php + + - + message: "#^Call to function is_string\\(\\) with string will always evaluate to true\\.$#" + count: 1 + path: ../src/Composer/Package/Loader/ArrayLoader.php + + - + message: "#^Construct empty\\(\\) is not allowed\\. Use more strict comparison\\.$#" + count: 10 + path: ../src/Composer/Package/Loader/ArrayLoader.php + + - + message: "#^Instanceof between Composer\\\\Package\\\\CompletePackage and Composer\\\\Package\\\\CompletePackage will always evaluate to true\\.$#" + count: 1 + path: ../src/Composer/Package/Loader/ArrayLoader.php + + - + message: "#^Instanceof between Composer\\\\Package\\\\CompletePackage and Composer\\\\Package\\\\CompletePackageInterface will always evaluate to true\\.$#" + count: 1 + path: ../src/Composer/Package/Loader/ArrayLoader.php + + - + message: "#^Method Composer\\\\Package\\\\Loader\\\\ArrayLoader\\:\\:createObject\\(\\) should return Composer\\\\Package\\\\CompletePackage but returns PackageClass of Composer\\\\Package\\\\CompletePackageInterface\\.$#" + count: 1 + path: ../src/Composer/Package/Loader/ArrayLoader.php + + - + message: "#^Only booleans are allowed in &&, string\\|false given on the left side\\.$#" + count: 1 + path: ../src/Composer/Package/Loader/ArrayLoader.php + + - + message: "#^Only booleans are allowed in &&, string\\|false given on the right side\\.$#" + count: 1 + path: ../src/Composer/Package/Loader/ArrayLoader.php + + - + message: "#^Only booleans are allowed in a negated boolean, Composer\\\\Package\\\\Version\\\\VersionParser\\|null given\\.$#" + count: 1 + path: ../src/Composer/Package/Loader/ArrayLoader.php + + - + message: "#^Only booleans are allowed in an if condition, string\\|null given\\.$#" + count: 1 + path: ../src/Composer/Package/Loader/ArrayLoader.php + + - + message: "#^Variable method call on Composer\\\\Package\\\\CompletePackage\\.$#" + count: 1 + path: ../src/Composer/Package/Loader/ArrayLoader.php + + - + message: "#^Variable method call on Composer\\\\Package\\\\PackageInterface\\.$#" + count: 1 + path: ../src/Composer/Package/Loader/ArrayLoader.php + + - + message: "#^Call to function is_string\\(\\) with string will always evaluate to true\\.$#" + count: 1 + path: ../src/Composer/Package/Loader/JsonLoader.php + + - + message: "#^Parameter \\#1 \\$json of static method Composer\\\\Json\\\\JsonFile\\:\\:parseJson\\(\\) expects string\\|null, string\\|false given\\.$#" + count: 1 + path: ../src/Composer/Package/Loader/JsonLoader.php + + - + message: "#^Instanceof between Composer\\\\Package\\\\RootPackage and Composer\\\\Package\\\\RootPackage will always evaluate to true\\.$#" + count: 1 + path: ../src/Composer/Package/Loader/RootPackageLoader.php + + - + message: "#^Only booleans are allowed in an elseif condition, string\\|null given\\.$#" + count: 1 + path: ../src/Composer/Package/Loader/RootPackageLoader.php + + - + message: "#^Only booleans are allowed in an if condition, array\\\\|null given\\.$#" + count: 1 + path: ../src/Composer/Package/Loader/RootPackageLoader.php + + - + message: "#^Only booleans are allowed in an if condition, string\\|false given\\.$#" + count: 1 + path: ../src/Composer/Package/Loader/RootPackageLoader.php + + - + message: "#^Only booleans are allowed in an if condition, string\\|null given\\.$#" + count: 2 + path: ../src/Composer/Package/Loader/RootPackageLoader.php + + - + message: "#^Parameter \\#1 \\$requires of method Composer\\\\Package\\\\Loader\\\\RootPackageLoader\\:\\:extractAliases\\(\\) expects array\\, array\\ given\\.$#" + count: 1 + path: ../src/Composer/Package/Loader/RootPackageLoader.php + + - + message: "#^Parameter \\#1 \\$requires of static method Composer\\\\Package\\\\Loader\\\\RootPackageLoader\\:\\:extractReferences\\(\\) expects array\\, array\\ given\\.$#" + count: 1 + path: ../src/Composer/Package/Loader/RootPackageLoader.php + + - + message: "#^Parameter \\#1 \\$requires of static method Composer\\\\Package\\\\Loader\\\\RootPackageLoader\\:\\:extractStabilityFlags\\(\\) expects array\\, array\\ given\\.$#" + count: 1 + path: ../src/Composer/Package/Loader/RootPackageLoader.php + + - + message: "#^Parameter \\#2 \\$class \\(class\\-string\\\\) of method Composer\\\\Package\\\\Loader\\\\RootPackageLoader\\:\\:load\\(\\) should be contravariant with parameter \\$class \\(class\\-string\\\\) of method Composer\\\\Package\\\\Loader\\\\ArrayLoader\\:\\:load\\(\\)$#" + count: 1 + path: ../src/Composer/Package/Loader/RootPackageLoader.php + + - + message: "#^Parameter \\#2 \\$class \\(class\\-string\\\\) of method Composer\\\\Package\\\\Loader\\\\RootPackageLoader\\:\\:load\\(\\) should be contravariant with parameter \\$class \\(class\\-string\\\\) of method Composer\\\\Package\\\\Loader\\\\LoaderInterface\\:\\:load\\(\\)$#" + count: 1 + path: ../src/Composer/Package/Loader/RootPackageLoader.php + + - + message: "#^Parameter \\#2 \\$path of method Composer\\\\Package\\\\Version\\\\VersionGuesser\\:\\:guessVersion\\(\\) expects string, string\\|false given\\.$#" + count: 1 + path: ../src/Composer/Package/Loader/RootPackageLoader.php + + - + message: "#^Short ternary operator is not allowed\\. Use null coalesce operator if applicable or consider using long ternary\\.$#" + count: 2 + path: ../src/Composer/Package/Loader/RootPackageLoader.php + + - + message: "#^Variable method call on Composer\\\\Package\\\\RootPackage\\.$#" + count: 1 + path: ../src/Composer/Package/Loader/RootPackageLoader.php + + - + message: "#^Call to function in_array\\(\\) requires parameter \\#3 to be set\\.$#" + count: 1 + path: ../src/Composer/Package/Loader/ValidatingArrayLoader.php + + - + message: "#^Cannot access offset 'scheme' on array\\{scheme\\?\\: string, host\\?\\: string, port\\?\\: int, user\\?\\: string, pass\\?\\: string, path\\?\\: string, query\\?\\: string, fragment\\?\\: string\\}\\|false\\.$#" + count: 1 + path: ../src/Composer/Package/Loader/ValidatingArrayLoader.php + + - + message: "#^Construct empty\\(\\) is not allowed\\. Use more strict comparison\\.$#" + count: 19 + path: ../src/Composer/Package/Loader/ValidatingArrayLoader.php + + - + message: "#^Only booleans are allowed in &&, array given on the right side\\.$#" + count: 1 + path: ../src/Composer/Package/Loader/ValidatingArrayLoader.php + + - + message: "#^Only booleans are allowed in &&, int given on the left side\\.$#" + count: 2 + path: ../src/Composer/Package/Loader/ValidatingArrayLoader.php + + - + message: "#^Only booleans are allowed in &&, string\\|false given on the left side\\.$#" + count: 1 + path: ../src/Composer/Package/Loader/ValidatingArrayLoader.php + + - + message: "#^Only booleans are allowed in &&, string\\|false given on the right side\\.$#" + count: 1 + path: ../src/Composer/Package/Loader/ValidatingArrayLoader.php + + - + message: "#^Only booleans are allowed in &&, string\\|null given on the left side\\.$#" + count: 1 + path: ../src/Composer/Package/Loader/ValidatingArrayLoader.php + + - + message: "#^Only booleans are allowed in a negated boolean, DateTime\\|null given\\.$#" + count: 1 + path: ../src/Composer/Package/Loader/ValidatingArrayLoader.php + + - + message: "#^Only booleans are allowed in a negated boolean, int\\<0, max\\> given\\.$#" + count: 1 + path: ../src/Composer/Package/Loader/ValidatingArrayLoader.php + + - + message: "#^Only booleans are allowed in a negated boolean, string\\|false given\\.$#" + count: 2 + path: ../src/Composer/Package/Loader/ValidatingArrayLoader.php + + - + message: "#^Only booleans are allowed in an if condition, array\\ given\\.$#" + count: 1 + path: ../src/Composer/Package/Loader/ValidatingArrayLoader.php + + - + message: "#^Only booleans are allowed in an if condition, string\\|null given\\.$#" + count: 2 + path: ../src/Composer/Package/Loader/ValidatingArrayLoader.php + + - + message: "#^Parameter \\#2 \\$subject of static method Composer\\\\Pcre\\\\Preg\\:\\:isMatch\\(\\) expects string, float\\|int\\|string given\\.$#" + count: 1 + path: ../src/Composer/Package/Loader/ValidatingArrayLoader.php + + - + message: "#^Short ternary operator is not allowed\\. Use null coalesce operator if applicable or consider using long ternary\\.$#" + count: 1 + path: ../src/Composer/Package/Loader/ValidatingArrayLoader.php + + - + message: "#^Call to function in_array\\(\\) requires parameter \\#3 to be set\\.$#" + count: 1 + path: ../src/Composer/Package/Locker.php + + - + message: "#^Construct empty\\(\\) is not allowed\\. Use more strict comparison\\.$#" + count: 5 + path: ../src/Composer/Package/Locker.php + + - + message: "#^Only booleans are allowed in &&, string\\|false given on the left side\\.$#" + count: 1 + path: ../src/Composer/Package/Locker.php + + - + message: "#^Only booleans are allowed in a negated boolean, string given\\.$#" + count: 2 + path: ../src/Composer/Package/Locker.php + + - + message: "#^Only booleans are allowed in a ternary operator condition, DateTime\\|null given\\.$#" + count: 1 + path: ../src/Composer/Package/Locker.php + + - + message: "#^Only booleans are allowed in an if condition, array\\ given\\.$#" + count: 1 + path: ../src/Composer/Package/Locker.php + + - + message: "#^Parameter \\#1 \\$aliasOf of class Composer\\\\Package\\\\CompleteAliasPackage constructor expects Composer\\\\Package\\\\CompletePackage, Composer\\\\Package\\\\CompleteAliasPackage\\|Composer\\\\Package\\\\CompletePackage given\\.$#" + count: 1 + path: ../src/Composer/Package/Locker.php + + - + message: "#^Short ternary operator is not allowed\\. Use null coalesce operator if applicable or consider using long ternary\\.$#" + count: 3 + path: ../src/Composer/Package/Locker.php + + - + message: "#^Call to function in_array\\(\\) requires parameter \\#3 to be set\\.$#" + count: 1 + path: ../src/Composer/Package/Package.php + + - + message: "#^Only booleans are allowed in a negated boolean, string\\|null given\\.$#" + count: 1 + path: ../src/Composer/Package/Package.php + + - + message: "#^Only booleans are allowed in an elseif condition, string\\|null given\\.$#" + count: 1 + path: ../src/Composer/Package/Package.php + + - + message: "#^Only booleans are allowed in an if condition, array\\\\>\\|null given\\.$#" + count: 1 + path: ../src/Composer/Package/Package.php + + - + message: "#^Parameter \\#3 \\$subject of static method Composer\\\\Pcre\\\\Preg\\:\\:replace\\(\\) expects string, string\\|null given\\.$#" + count: 1 + path: ../src/Composer/Package/Package.php + + - + message: "#^Short ternary operator is not allowed\\. Use null coalesce operator if applicable or consider using long ternary\\.$#" + count: 1 + path: ../src/Composer/Package/Package.php + + - + message: "#^PHPDoc type Composer\\\\Package\\\\RootPackage of property Composer\\\\Package\\\\RootAliasPackage\\:\\:\\$aliasOf is not the same as PHPDoc type Composer\\\\Package\\\\CompletePackage of overridden property Composer\\\\Package\\\\CompleteAliasPackage\\:\\:\\$aliasOf\\.$#" + count: 1 + path: ../src/Composer/Package/RootAliasPackage.php + + - + message: "#^Construct empty\\(\\) is not allowed\\. Use more strict comparison\\.$#" + count: 3 + path: ../src/Composer/Package/Version/VersionGuesser.php + + - + message: "#^Offset 'feature_pretty…' does not exist on array\\{version\\: non\\-empty\\-string, commit\\: string\\|null, pretty_version\\: string\\|null, feature_version\\: non\\-empty\\-string, feature_pretty_version\\?\\: string\\|null\\}\\.$#" + count: 1 + path: ../src/Composer/Package/Version/VersionGuesser.php + + - + message: "#^Only booleans are allowed in &&, string given on the left side\\.$#" + count: 2 + path: ../src/Composer/Package/Version/VersionGuesser.php + + - + message: "#^Only booleans are allowed in a negated boolean, string\\|null given\\.$#" + count: 1 + path: ../src/Composer/Package/Version/VersionGuesser.php + + - + message: "#^Only booleans are allowed in an if condition, array\\\\|null given\\.$#" + count: 1 + path: ../src/Composer/Package/Version/VersionGuesser.php + + - + message: "#^Only booleans are allowed in an if condition, string\\|null given\\.$#" + count: 1 + path: ../src/Composer/Package/Version/VersionGuesser.php + + - + message: "#^Only booleans are allowed in \\|\\|, int\\<0, max\\>\\|false given on the right side\\.$#" + count: 1 + path: ../src/Composer/Package/Version/VersionGuesser.php + + - + message: "#^Parameter \\#1 \\$haystack of function strpos expects string, string\\|false given\\.$#" + count: 1 + path: ../src/Composer/Package/Version/VersionGuesser.php + + - + message: "#^Parameter \\#2 \\$subject of static method Composer\\\\Pcre\\\\Preg\\:\\:isMatch\\(\\) expects string, string\\|null given\\.$#" + count: 1 + path: ../src/Composer/Package/Version/VersionGuesser.php + + - + message: "#^Parameter \\#3 \\$subject of static method Composer\\\\Pcre\\\\Preg\\:\\:replace\\(\\) expects string, string\\|null given\\.$#" + count: 1 + path: ../src/Composer/Package/Version/VersionGuesser.php + + - + message: "#^Short ternary operator is not allowed\\. Use null coalesce operator if applicable or consider using long ternary\\.$#" + count: 1 + path: ../src/Composer/Package/Version/VersionGuesser.php + + - + message: "#^Strict comparison using \\!\\=\\= between null and array\\{version\\: string\\|null, commit\\: '', pretty_version\\: string\\|null\\} will always evaluate to true\\.$#" + count: 1 + path: ../src/Composer/Package/Version/VersionGuesser.php + + - + message: "#^Strict comparison using \\!\\=\\= between null and array\\{version\\: string\\|null, commit\\: string\\|null, pretty_version\\: string\\|null, feature_version\\?\\: string\\|null, feature_pretty_version\\?\\: string\\|null\\} will always evaluate to true\\.$#" + count: 1 + path: ../src/Composer/Package/Version/VersionGuesser.php + + - + message: "#^Strict comparison using \\!\\=\\= between null and string will always evaluate to true\\.$#" + count: 1 + path: ../src/Composer/Package/Version/VersionGuesser.php + + - + message: "#^Only booleans are allowed in an if condition, int\\<0, max\\>\\|false given\\.$#" + count: 1 + path: ../src/Composer/Package/Version/VersionParser.php + + - + message: "#^Only booleans are allowed in &&, array\\\\> given on the left side\\.$#" + count: 1 + path: ../src/Composer/Package/Version/VersionSelector.php + + - + message: "#^Only booleans are allowed in &&, string\\|null given on the left side\\.$#" + count: 1 + path: ../src/Composer/Package/Version/VersionSelector.php + + - + message: "#^Only booleans are allowed in a negated boolean, array\\ given\\.$#" + count: 1 + path: ../src/Composer/Package/Version/VersionSelector.php + + - + message: "#^Only booleans are allowed in a ternary operator condition, string\\|null given\\.$#" + count: 1 + path: ../src/Composer/Package/Version/VersionSelector.php + + - + message: "#^Only booleans are allowed in an if condition, Composer\\\\Repository\\\\PlatformRepository\\|null given\\.$#" + count: 1 + path: ../src/Composer/Package/Version/VersionSelector.php + + - + message: "#^Short ternary operator is not allowed\\. Use null coalesce operator if applicable or consider using long ternary\\.$#" + count: 4 + path: ../src/Composer/Platform/HhvmDetector.php + + - + message: "#^Construct empty\\(\\) is not allowed\\. Use more strict comparison\\.$#" + count: 1 + path: ../src/Composer/Platform/Runtime.php + + - + message: "#^Method Composer\\\\Platform\\\\Runtime\\:\\:getExtensionInfo\\(\\) should return string but returns string\\|false\\.$#" + count: 1 + path: ../src/Composer/Platform/Runtime.php + + - + message: "#^Method Composer\\\\Platform\\\\Runtime\\:\\:getExtensionVersion\\(\\) should return string but returns string\\|false\\.$#" + count: 1 + path: ../src/Composer/Platform/Runtime.php + + - + message: "#^Array \\(array\\\\) does not accept object\\.$#" + count: 2 + path: ../src/Composer/Plugin/PluginManager.php + + - + message: "#^Cannot call method getInstallationManager\\(\\) on Composer\\\\Composer\\|null\\.$#" + count: 1 + path: ../src/Composer/Plugin/PluginManager.php + + - + message: "#^Casting to array\\ something that's already array\\\\.$#" + count: 1 + path: ../src/Composer/Plugin/PluginManager.php + + - + message: "#^Construct empty\\(\\) is not allowed\\. Use more strict comparison\\.$#" + count: 3 + path: ../src/Composer/Plugin/PluginManager.php + + - + message: "#^Only booleans are allowed in &&, Composer\\\\Repository\\\\InstalledRepositoryInterface\\|null given on the left side\\.$#" + count: 1 + path: ../src/Composer/Plugin/PluginManager.php + + - + message: "#^Only booleans are allowed in &&, string given on the right side\\.$#" + count: 1 + path: ../src/Composer/Plugin/PluginManager.php + + - + message: "#^Only booleans are allowed in a negated boolean, Composer\\\\Semver\\\\Constraint\\\\ConstraintInterface\\|null given\\.$#" + count: 1 + path: ../src/Composer/Plugin/PluginManager.php + + - + message: "#^Only booleans are allowed in a negated boolean, string given\\.$#" + count: 1 + path: ../src/Composer/Plugin/PluginManager.php + + - + message: "#^Only booleans are allowed in a ternary operator condition, Composer\\\\Composer\\|null given\\.$#" + count: 1 + path: ../src/Composer/Plugin/PluginManager.php + + - + message: "#^Only booleans are allowed in a ternary operator condition, array\\ given\\.$#" + count: 1 + path: ../src/Composer/Plugin/PluginManager.php + + - + message: "#^Only booleans are allowed in an if condition, CapabilityClass of Composer\\\\Plugin\\\\Capability\\\\Capability\\|null given\\.$#" + count: 1 + path: ../src/Composer/Plugin/PluginManager.php + + - + message: "#^Only booleans are allowed in an if condition, Composer\\\\Package\\\\PackageInterface\\|null given\\.$#" + count: 1 + path: ../src/Composer/Plugin/PluginManager.php + + - + message: "#^Only booleans are allowed in an if condition, Composer\\\\Repository\\\\InstalledRepositoryInterface\\|null given\\.$#" + count: 3 + path: ../src/Composer/Plugin/PluginManager.php + + - + message: "#^Only booleans are allowed in an if condition, int\\|false given\\.$#" + count: 1 + path: ../src/Composer/Plugin/PluginManager.php + + - + message: "#^Only booleans are allowed in an if condition, string\\|null given\\.$#" + count: 1 + path: ../src/Composer/Plugin/PluginManager.php + + - + message: "#^Parameter \\#1 \\$filename of function file_get_contents expects string, string\\|false given\\.$#" + count: 1 + path: ../src/Composer/Plugin/PluginManager.php + + - + message: "#^Parameter \\#1 \\$installer of method Composer\\\\Installer\\\\InstallationManager\\:\\:addInstaller\\(\\) expects Composer\\\\Installer\\\\InstallerInterface, object given\\.$#" + count: 1 + path: ../src/Composer/Plugin/PluginManager.php + + - + message: "#^Parameter \\#1 \\$path of function dirname expects string, string\\|false given\\.$#" + count: 1 + path: ../src/Composer/Plugin/PluginManager.php + + - + message: "#^Parameter \\#1 \\$plugin of method Composer\\\\Plugin\\\\PluginManager\\:\\:addPlugin\\(\\) expects Composer\\\\Plugin\\\\PluginInterface, object given\\.$#" + count: 1 + path: ../src/Composer/Plugin/PluginManager.php + + - + message: "#^Parameter \\#3 \\$subject of static method Composer\\\\Pcre\\\\Preg\\:\\:replace\\(\\) expects string, string\\|false given\\.$#" + count: 1 + path: ../src/Composer/Plugin/PluginManager.php + + - + message: "#^Property Composer\\\\Plugin\\\\PostFileDownloadEvent\\:\\:\\$fileName \\(string\\) does not accept string\\|null\\.$#" + count: 1 + path: ../src/Composer/Plugin/PostFileDownloadEvent.php + + - + message: "#^Casting to bool something that's already bool\\.$#" + count: 1 + path: ../src/Composer/Question/StrictConfirmationQuestion.php + + - + message: "#^Construct empty\\(\\) is not allowed\\. Use more strict comparison\\.$#" + count: 2 + path: ../src/Composer/Question/StrictConfirmationQuestion.php + + - + message: "#^Casting to array\\ something that's already array\\\\.$#" + count: 1 + path: ../src/Composer/Repository/ArrayRepository.php + + - + message: "#^Method Composer\\\\Repository\\\\ArrayRepository\\:\\:getProviders\\(\\) should return array\\ but returns array\\\\.$#" + count: 1 + path: ../src/Composer/Repository/ArrayRepository.php + + - + message: "#^Only booleans are allowed in a negated boolean, Composer\\\\Semver\\\\Constraint\\\\ConstraintInterface\\|null given\\.$#" + count: 1 + path: ../src/Composer/Repository/ArrayRepository.php + + - + message: "#^Parameter \\#1 \\$array of function array_splice expects array, array\\\\|null given\\.$#" + count: 1 + path: ../src/Composer/Repository/ArrayRepository.php + + - + message: "#^Parameter \\#1 \\$value of function count expects array\\|Countable, array\\\\|null given\\.$#" + count: 1 + path: ../src/Composer/Repository/ArrayRepository.php + + - + message: "#^Short ternary operator is not allowed\\. Use null coalesce operator if applicable or consider using long ternary\\.$#" + count: 1 + path: ../src/Composer/Repository/ArrayRepository.php + + - + message: "#^Only booleans are allowed in a negated boolean, Composer\\\\Package\\\\BasePackage\\|null given\\.$#" + count: 1 + path: ../src/Composer/Repository/ArtifactRepository.php + + - + message: "#^Parameter \\#1 \\$filename of function sha1_file expects string, string\\|false given\\.$#" + count: 1 + path: ../src/Composer/Repository/ArtifactRepository.php + + - + message: "#^Anonymous function uses \\$this assigned to variable \\$repo\\. Use \\$this directly in the function body\\.$#" + count: 3 + path: ../src/Composer/Repository/ComposerRepository.php + + - + message: "#^Argument of an invalid type array\\\\|null supplied for foreach, only iterables are supported\\.$#" + count: 1 + path: ../src/Composer/Repository/ComposerRepository.php + + - + message: "#^Cannot access offset 'path' on array\\{scheme\\?\\: string, host\\?\\: string, port\\?\\: int, user\\?\\: string, pass\\?\\: string, path\\?\\: string, query\\?\\: string, fragment\\?\\: string\\}\\|false\\.$#" + count: 1 + path: ../src/Composer/Repository/ComposerRepository.php + + - + message: "#^Construct empty\\(\\) is not allowed\\. Use more strict comparison\\.$#" + count: 24 + path: ../src/Composer/Repository/ComposerRepository.php + + - + message: "#^Method Composer\\\\Repository\\\\ComposerRepository\\:\\:filterPackages\\(\\) should return array\\\\|Composer\\\\Package\\\\BasePackage\\|null but returns Composer\\\\Package\\\\BasePackage\\|false\\.$#" + count: 1 + path: ../src/Composer/Repository/ComposerRepository.php + + - + message: "#^Method Composer\\\\Repository\\\\ComposerRepository\\:\\:findPackage\\(\\) should return Composer\\\\Package\\\\BasePackage\\|null but returns Composer\\\\Package\\\\BasePackage\\|false\\.$#" + count: 1 + path: ../src/Composer/Repository/ComposerRepository.php + + - + message: "#^Method Composer\\\\Repository\\\\ComposerRepository\\:\\:findPackage\\(\\) should return Composer\\\\Package\\\\BasePackage\\|null but returns array\\\\|Composer\\\\Package\\\\BasePackage\\|null\\.$#" + count: 2 + path: ../src/Composer/Repository/ComposerRepository.php + + - + message: "#^Method Composer\\\\Repository\\\\ComposerRepository\\:\\:findPackages\\(\\) should return array\\ but returns array\\\\|Composer\\\\Package\\\\BasePackage\\|null\\.$#" + count: 2 + path: ../src/Composer/Repository/ComposerRepository.php + + - + message: "#^Method Composer\\\\Repository\\\\ComposerRepository\\:\\:getProviderNames\\(\\) should return array\\ but returns array\\\\.$#" + count: 1 + path: ../src/Composer/Repository/ComposerRepository.php + + - + message: "#^Method Composer\\\\Repository\\\\ComposerRepository\\:\\:getProviders\\(\\) should return array\\ but returns array\\\\.$#" + count: 1 + path: ../src/Composer/Repository/ComposerRepository.php + + - + message: "#^Method Composer\\\\Repository\\\\ComposerRepository\\:\\:getProviders\\(\\) should return array\\ but returns array\\\\.$#" + count: 1 + path: ../src/Composer/Repository/ComposerRepository.php + + - + message: "#^Method Composer\\\\Repository\\\\ComposerRepository\\:\\:loadRootServerFile\\(\\) should return array\\ but returns array\\|true\\.$#" + count: 1 + path: ../src/Composer/Repository/ComposerRepository.php + + - + message: "#^Method Composer\\\\Repository\\\\ComposerRepository\\:\\:whatProvides\\(\\) should return array\\ but returns array\\\\.$#" + count: 1 + path: ../src/Composer/Repository/ComposerRepository.php + + - + message: "#^Only booleans are allowed in &&, Composer\\\\Semver\\\\Constraint\\\\ConstraintInterface\\|null given on the left side\\.$#" + count: 1 + path: ../src/Composer/Repository/ComposerRepository.php + + - + message: "#^Only booleans are allowed in &&, int\\<0, max\\> given on the right side\\.$#" + count: 1 + path: ../src/Composer/Repository/ComposerRepository.php + + - + message: "#^Only booleans are allowed in &&, int\\<0, max\\>\\|false given on the left side\\.$#" + count: 1 + path: ../src/Composer/Repository/ComposerRepository.php + + - + message: "#^Only booleans are allowed in &&, string given on the left side\\.$#" + count: 2 + path: ../src/Composer/Repository/ComposerRepository.php + + - + message: "#^Only booleans are allowed in &&, string given on the right side\\.$#" + count: 1 + path: ../src/Composer/Repository/ComposerRepository.php + + - + message: "#^Only booleans are allowed in &&, string\\|false given on the right side\\.$#" + count: 1 + path: ../src/Composer/Repository/ComposerRepository.php + + - + message: "#^Only booleans are allowed in &&, string\\|null given on the left side\\.$#" + count: 6 + path: ../src/Composer/Repository/ComposerRepository.php + + - + message: "#^Only booleans are allowed in &&, string\\|null given on the right side\\.$#" + count: 1 + path: ../src/Composer/Repository/ComposerRepository.php + + - + message: "#^Only booleans are allowed in a negated boolean, Composer\\\\Semver\\\\Constraint\\\\ConstraintInterface\\|null given\\.$#" + count: 1 + path: ../src/Composer/Repository/ComposerRepository.php + + - + message: "#^Only booleans are allowed in a negated boolean, array given\\.$#" + count: 1 + path: ../src/Composer/Repository/ComposerRepository.php + + - + message: "#^Only booleans are allowed in a negated boolean, array\\\\|null given\\.$#" + count: 1 + path: ../src/Composer/Repository/ComposerRepository.php + + - + message: "#^Only booleans are allowed in a negated boolean, mixed given\\.$#" + count: 2 + path: ../src/Composer/Repository/ComposerRepository.php + + - + message: "#^Only booleans are allowed in a negated boolean, string\\|null given\\.$#" + count: 2 + path: ../src/Composer/Repository/ComposerRepository.php + + - + message: "#^Only booleans are allowed in a ternary operator condition, string\\|null given\\.$#" + count: 1 + path: ../src/Composer/Repository/ComposerRepository.php + + - + message: "#^Only booleans are allowed in an elseif condition, string\\|null given\\.$#" + count: 1 + path: ../src/Composer/Repository/ComposerRepository.php + + - + message: "#^Only booleans are allowed in an if condition, Composer\\\\EventDispatcher\\\\EventDispatcher\\|null given\\.$#" + count: 6 + path: ../src/Composer/Repository/ComposerRepository.php + + - + message: "#^Only booleans are allowed in an if condition, array\\\\|null given\\.$#" + count: 1 + path: ../src/Composer/Repository/ComposerRepository.php + + - + message: "#^Only booleans are allowed in an if condition, int given\\.$#" + count: 1 + path: ../src/Composer/Repository/ComposerRepository.php + + - + message: "#^Only booleans are allowed in an if condition, string\\|false given\\.$#" + count: 3 + path: ../src/Composer/Repository/ComposerRepository.php + + - + message: "#^Only booleans are allowed in an if condition, string\\|null given\\.$#" + count: 13 + path: ../src/Composer/Repository/ComposerRepository.php + + - + message: "#^Only booleans are allowed in \\|\\|, string\\|null given on the right side\\.$#" + count: 1 + path: ../src/Composer/Repository/ComposerRepository.php + + - + message: "#^Parameter \\#1 \\$array of function array_keys expects array, array\\\\>\\|null given\\.$#" + count: 1 + path: ../src/Composer/Repository/ComposerRepository.php + + - + message: "#^Parameter \\#1 \\$array of function array_values expects array, array\\\\|null given\\.$#" + count: 1 + path: ../src/Composer/Repository/ComposerRepository.php + + - + message: "#^Parameter \\#1 \\$json of function json_decode expects string, string\\|false given\\.$#" + count: 3 + path: ../src/Composer/Repository/ComposerRepository.php + + - + message: "#^Parameter \\#1 \\$value of function count expects array\\|Countable, array\\\\|null given\\.$#" + count: 1 + path: ../src/Composer/Repository/ComposerRepository.php + + - + message: "#^Only booleans are allowed in a ternary operator condition, array\\\\> given\\.$#" + count: 3 + path: ../src/Composer/Repository/CompositeRepository.php + + - + message: "#^Only booleans are allowed in a ternary operator condition, array\\\\>\\> given\\.$#" + count: 1 + path: ../src/Composer/Repository/CompositeRepository.php + + - + message: "#^Only booleans are allowed in a ternary operator condition, array\\\\>\\> given\\.$#" + count: 1 + path: ../src/Composer/Repository/CompositeRepository.php + + - + message: "#^Only booleans are allowed in a ternary operator condition, array\\\\> given\\.$#" + count: 1 + path: ../src/Composer/Repository/CompositeRepository.php + + - + message: "#^Cannot call method getDistReference\\(\\) on Composer\\\\Package\\\\BasePackage\\|Composer\\\\Package\\\\RootPackageInterface\\|null\\.$#" + count: 2 + path: ../src/Composer/Repository/FilesystemRepository.php + + - + message: "#^Cannot call method getInstallationSource\\(\\) on Composer\\\\Package\\\\BasePackage\\|Composer\\\\Package\\\\RootPackageInterface\\|null\\.$#" + count: 2 + path: ../src/Composer/Repository/FilesystemRepository.php + + - + message: "#^Cannot call method getName\\(\\) on Composer\\\\Package\\\\BasePackage\\|Composer\\\\Package\\\\RootPackageInterface\\|null\\.$#" + count: 3 + path: ../src/Composer/Repository/FilesystemRepository.php + + - + message: "#^Cannot call method getName\\(\\) on Composer\\\\Package\\\\BasePackage\\|null\\.$#" + count: 1 + path: ../src/Composer/Repository/FilesystemRepository.php + + - + message: "#^Cannot call method getPrettyVersion\\(\\) on Composer\\\\Package\\\\BasePackage\\|Composer\\\\Package\\\\RootPackageInterface\\|null\\.$#" + count: 3 + path: ../src/Composer/Repository/FilesystemRepository.php + + - + message: "#^Cannot call method getProvides\\(\\) on Composer\\\\Package\\\\BasePackage\\|Composer\\\\Package\\\\RootPackageInterface\\|null\\.$#" + count: 1 + path: ../src/Composer/Repository/FilesystemRepository.php + + - + message: "#^Cannot call method getReplaces\\(\\) on Composer\\\\Package\\\\BasePackage\\|Composer\\\\Package\\\\RootPackageInterface\\|null\\.$#" + count: 1 + path: ../src/Composer/Repository/FilesystemRepository.php + + - + message: "#^Cannot call method getSourceReference\\(\\) on Composer\\\\Package\\\\BasePackage\\|Composer\\\\Package\\\\RootPackageInterface\\|null\\.$#" + count: 2 + path: ../src/Composer/Repository/FilesystemRepository.php + + - + message: "#^Cannot call method getType\\(\\) on Composer\\\\Package\\\\BasePackage\\|Composer\\\\Package\\\\RootPackageInterface\\|null\\.$#" + count: 1 + path: ../src/Composer/Repository/FilesystemRepository.php + + - + message: "#^Cannot call method getVersion\\(\\) on Composer\\\\Package\\\\BasePackage\\|Composer\\\\Package\\\\RootPackageInterface\\|null\\.$#" + count: 1 + path: ../src/Composer/Repository/FilesystemRepository.php + + - + message: "#^Construct empty\\(\\) is not allowed\\. Use more strict comparison\\.$#" + count: 1 + path: ../src/Composer/Repository/FilesystemRepository.php + + - + message: "#^Only booleans are allowed in a negated boolean, Composer\\\\Package\\\\RootPackageInterface\\|null given\\.$#" + count: 1 + path: ../src/Composer/Repository/FilesystemRepository.php + + - + message: "#^Only booleans are allowed in an if condition, string\\|null given\\.$#" + count: 1 + path: ../src/Composer/Repository/FilesystemRepository.php + + - + message: "#^Parameter \\#1 \\$array of method Composer\\\\Repository\\\\FilesystemRepository\\:\\:dumpToPhpCode\\(\\) expects array, array\\|null given\\.$#" + count: 1 + path: ../src/Composer/Repository/FilesystemRepository.php + + - + message: "#^Parameter \\#1 \\$data of static method Composer\\\\InstalledVersions\\:\\:reload\\(\\) expects array\\{root\\: array\\{name\\: string, version\\: string, reference\\: string, pretty_version\\: string, aliases\\: array\\, dev\\: bool, install_path\\: string, type\\: string\\}, versions\\: array\\, reference\\?\\: string, replaced\\?\\: array\\, provided\\?\\: array\\, install_path\\?\\: string, \\.\\.\\.\\}\\>\\}, array\\|null given\\.$#" + count: 1 + path: ../src/Composer/Repository/FilesystemRepository.php + + - + message: "#^Parameter \\#1 \\$path of function realpath expects string, string\\|false given\\.$#" + count: 1 + path: ../src/Composer/Repository/FilesystemRepository.php + + - + message: "#^Parameter \\#1 \\$path of method Composer\\\\Util\\\\Filesystem\\:\\:normalizePath\\(\\) expects string, string\\|false given\\.$#" + count: 2 + path: ../src/Composer/Repository/FilesystemRepository.php + + - + message: "#^Parameter \\#2 \\$content of method Composer\\\\Util\\\\Filesystem\\:\\:filePutContentsIfModified\\(\\) expects string, string\\|false given\\.$#" + count: 1 + path: ../src/Composer/Repository/FilesystemRepository.php + + - + message: "#^Parameter \\#2 \\$installPaths of method Composer\\\\Repository\\\\FilesystemRepository\\:\\:generateInstalledVersions\\(\\) expects array\\, array\\ given\\.$#" + count: 1 + path: ../src/Composer/Repository/FilesystemRepository.php + + - + message: "#^Short ternary operator is not allowed\\. Use null coalesce operator if applicable or consider using long ternary\\.$#" + count: 3 + path: ../src/Composer/Repository/FilesystemRepository.php + + - + message: "#^Strict comparison using \\!\\=\\= between null and non\\-empty\\-string will always evaluate to true\\.$#" + count: 1 + path: ../src/Composer/Repository/FilesystemRepository.php + + - + message: "#^Call to function is_array\\(\\) with array\\ will always evaluate to true\\.$#" + count: 2 + path: ../src/Composer/Repository/FilterRepository.php + + - + message: "#^Call to function is_bool\\(\\) with bool will always evaluate to true\\.$#" + count: 1 + path: ../src/Composer/Repository/FilterRepository.php + + - + message: "#^Only booleans are allowed in &&, string\\|null given on the left side\\.$#" + count: 1 + path: ../src/Composer/Repository/FilterRepository.php + + - + message: "#^Only booleans are allowed in &&, string\\|null given on the right side\\.$#" + count: 1 + path: ../src/Composer/Repository/FilterRepository.php + + - + message: "#^Only booleans are allowed in a negated boolean, array\\ given\\.$#" + count: 1 + path: ../src/Composer/Repository/FilterRepository.php + + - + message: "#^Only booleans are allowed in a negated boolean, string\\|null given\\.$#" + count: 2 + path: ../src/Composer/Repository/FilterRepository.php + + - + message: "#^Only booleans are allowed in an if condition, string\\|null given\\.$#" + count: 1 + path: ../src/Composer/Repository/FilterRepository.php + + - + message: "#^Parameter \\#1 \\$pattern of static method Composer\\\\Pcre\\\\Preg\\:\\:isMatch\\(\\) expects string, string\\|null given\\.$#" + count: 1 + path: ../src/Composer/Repository/FilterRepository.php + + - + message: "#^Call to function in_array\\(\\) requires parameter \\#3 to be set\\.$#" + count: 7 + path: ../src/Composer/Repository/InstalledRepository.php + + - + message: "#^Foreach overwrites \\$needle with its value variable\\.$#" + count: 2 + path: ../src/Composer/Repository/InstalledRepository.php + + - + message: "#^Only booleans are allowed in &&, Composer\\\\Semver\\\\Constraint\\\\ConstraintInterface\\|null given on the right side\\.$#" + count: 1 + path: ../src/Composer/Repository/InstalledRepository.php + + - + message: "#^Only booleans are allowed in a ternary operator condition, Composer\\\\Package\\\\BasePackage\\|null given\\.$#" + count: 1 + path: ../src/Composer/Repository/InstalledRepository.php + + - + message: "#^Only booleans are allowed in an if condition, \\(Composer\\\\Package\\\\BasePackage&Composer\\\\Package\\\\RootPackageInterface\\)\\|null given\\.$#" + count: 1 + path: ../src/Composer/Repository/InstalledRepository.php + + - + message: "#^Only booleans are allowed in an if condition, Composer\\\\Package\\\\BasePackage\\|null given\\.$#" + count: 1 + path: ../src/Composer/Repository/InstalledRepository.php + + - + message: "#^Construct empty\\(\\) is not allowed\\. Use more strict comparison\\.$#" + count: 2 + path: ../src/Composer/Repository/PathRepository.php + + - + message: "#^Offset 'versions' does not exist on array\\{symlink\\?\\: bool, relative\\?\\: bool, versions\\?\\: array\\\\}\\.$#" + count: 1 + path: ../src/Composer/Repository/PathRepository.php + + - + message: "#^Only booleans are allowed in &&, string\\|false given on the right side\\.$#" + count: 1 + path: ../src/Composer/Repository/PathRepository.php + + - + message: "#^Only booleans are allowed in &&, string\\|null given on the right side\\.$#" + count: 1 + path: ../src/Composer/Repository/PathRepository.php + + - + message: "#^Parameter \\#1 \\$json of static method Composer\\\\Json\\\\JsonFile\\:\\:parseJson\\(\\) expects string\\|null, string\\|false given\\.$#" + count: 1 + path: ../src/Composer/Repository/PathRepository.php + + - + message: "#^Parameter \\#2 \\$array of function array_map expects array, array\\\\|false given\\.$#" + count: 1 + path: ../src/Composer/Repository/PathRepository.php + + - + message: "#^Composer\\\\Repository\\\\PearRepository\\:\\:__construct\\(\\) does not call parent constructor from Composer\\\\Repository\\\\ArrayRepository\\.$#" + count: 1 + path: ../src/Composer/Repository/PearRepository.php + + - + message: "#^Call to an undefined method object\\:\\:getVersion\\(\\)\\.$#" + count: 1 + path: ../src/Composer/Repository/PlatformRepository.php + + - + message: "#^Call to function in_array\\(\\) requires parameter \\#3 to be set\\.$#" + count: 1 + path: ../src/Composer/Repository/PlatformRepository.php + + - + message: "#^Cannot call method getVersion\\(\\) on Composer\\\\Package\\\\BasePackage\\|null\\.$#" + count: 1 + path: ../src/Composer/Repository/PlatformRepository.php + + - + message: "#^Only booleans are allowed in &&, mixed given on the right side\\.$#" + count: 1 + path: ../src/Composer/Repository/PlatformRepository.php + + - + message: "#^Only booleans are allowed in &&, string given on the right side\\.$#" + count: 1 + path: ../src/Composer/Repository/PlatformRepository.php + + - + message: "#^Only booleans are allowed in an if condition, mixed given\\.$#" + count: 1 + path: ../src/Composer/Repository/PlatformRepository.php + + - + message: "#^Only booleans are allowed in an if condition, string\\|null given\\.$#" + count: 1 + path: ../src/Composer/Repository/PlatformRepository.php + + - + message: "#^Parameter \\#1 \\$override of method Composer\\\\Repository\\\\PlatformRepository\\:\\:addOverriddenPackage\\(\\) expects array\\{version\\: string, name\\: string\\}, array\\{name\\: string, version\\: string\\|false\\} given\\.$#" + count: 1 + path: ../src/Composer/Repository/PlatformRepository.php + + - + message: "#^Parameter \\#1 \\$version of method Composer\\\\Semver\\\\VersionParser\\:\\:normalize\\(\\) expects string, string\\|null given\\.$#" + count: 1 + path: ../src/Composer/Repository/PlatformRepository.php + + - + message: "#^Parameter \\#2 \\$prettyVersion of method Composer\\\\Repository\\\\PlatformRepository\\:\\:addLibrary\\(\\) expects string, string\\|null given\\.$#" + count: 4 + path: ../src/Composer/Repository/PlatformRepository.php + + - + message: "#^Parameter \\#2 \\$subject of static method Composer\\\\Pcre\\\\Preg\\:\\:isMatch\\(\\) expects string, string\\|null given\\.$#" + count: 1 + path: ../src/Composer/Repository/PlatformRepository.php + + - + message: "#^Short ternary operator is not allowed\\. Use null coalesce operator if applicable or consider using long ternary\\.$#" + count: 3 + path: ../src/Composer/Repository/PlatformRepository.php + + - + message: "#^Construct empty\\(\\) is not allowed\\. Use more strict comparison\\.$#" + count: 3 + path: ../src/Composer/Repository/RepositoryFactory.php + + - + message: "#^Method Composer\\\\Repository\\\\RepositoryFactory\\:\\:createRepo\\(\\) should return Composer\\\\Repository\\\\RepositoryInterface but returns Composer\\\\Repository\\\\RepositoryInterface\\|false\\.$#" + count: 1 + path: ../src/Composer/Repository/RepositoryFactory.php + + - + message: "#^Method Composer\\\\Repository\\\\RepositoryFactory\\:\\:generateRepositoryName\\(\\) should return string but returns int\\|string\\.$#" + count: 1 + path: ../src/Composer/Repository/RepositoryFactory.php + + - + message: "#^Only booleans are allowed in a negated boolean, Composer\\\\Config\\|null given\\.$#" + count: 1 + path: ../src/Composer/Repository/RepositoryFactory.php + + - + message: "#^Only booleans are allowed in a negated boolean, Composer\\\\IO\\\\IOInterface\\|null given\\.$#" + count: 1 + path: ../src/Composer/Repository/RepositoryFactory.php + + - + message: "#^Only booleans are allowed in a negated boolean, Composer\\\\Repository\\\\RepositoryManager\\|null given\\.$#" + count: 2 + path: ../src/Composer/Repository/RepositoryFactory.php + + - + message: "#^Only booleans are allowed in an if condition, Composer\\\\IO\\\\IOInterface\\|null given\\.$#" + count: 1 + path: ../src/Composer/Repository/RepositoryFactory.php + + - + message: "#^Parameter \\#1 \\$str of function strtr expects string, string\\|false given\\.$#" + count: 1 + path: ../src/Composer/Repository/RepositoryFactory.php + + - + message: "#^Parameter \\#3 \\$name of method Composer\\\\Repository\\\\RepositoryManager\\:\\:createRepository\\(\\) expects string\\|null, int\\|string given\\.$#" + count: 1 + path: ../src/Composer/Repository/RepositoryFactory.php + + - + message: "#^Only booleans are allowed in an if condition, Composer\\\\Package\\\\BasePackage\\|null given\\.$#" + count: 1 + path: ../src/Composer/Repository/RepositoryManager.php + + - + message: "#^Short ternary operator is not allowed\\. Use null coalesce operator if applicable or consider using long ternary\\.$#" + count: 1 + path: ../src/Composer/Repository/RepositoryManager.php + + - + message: "#^Foreach overwrites \\$repo with its value variable\\.$#" + count: 1 + path: ../src/Composer/Repository/RepositorySet.php + + - + message: "#^Only booleans are allowed in a ternary operator condition, array\\\\> given\\.$#" + count: 1 + path: ../src/Composer/Repository/RepositorySet.php + + - + message: "#^Only booleans are allowed in an if condition, array\\\\> given\\.$#" + count: 1 + path: ../src/Composer/Repository/RepositorySet.php + + - + message: "#^Short ternary operator is not allowed\\. Use null coalesce operator if applicable or consider using long ternary\\.$#" + count: 1 + path: ../src/Composer/Repository/RepositorySet.php + + - + message: "#^Only booleans are allowed in a negated boolean, string given\\.$#" + count: 1 + path: ../src/Composer/Repository/Vcs/FossilDriver.php + + - + message: "#^Parameter \\#1 \\$file of method Composer\\\\Util\\\\Filesystem\\:\\:remove\\(\\) expects string, string\\|null given\\.$#" + count: 1 + path: ../src/Composer/Repository/Vcs/FossilDriver.php + + - + message: "#^Parameter \\#1 \\$filename of function is_file expects string, string\\|null given\\.$#" + count: 1 + path: ../src/Composer/Repository/Vcs/FossilDriver.php + + - + message: "#^Call to function array_search\\(\\) requires parameter \\#3 to be set\\.$#" + count: 2 + path: ../src/Composer/Repository/Vcs/GitBitbucketDriver.php + + - + message: "#^Cannot call method read\\(\\) on Composer\\\\Cache\\|null\\.$#" + count: 1 + path: ../src/Composer/Repository/Vcs/GitBitbucketDriver.php + + - + message: "#^Cannot call method write\\(\\) on Composer\\\\Cache\\|null\\.$#" + count: 1 + path: ../src/Composer/Repository/Vcs/GitBitbucketDriver.php + + - + message: "#^Construct empty\\(\\) is not allowed\\. Use more strict comparison\\.$#" + count: 5 + path: ../src/Composer/Repository/Vcs/GitBitbucketDriver.php + + - + message: "#^Method Composer\\\\Repository\\\\Vcs\\\\GitBitbucketDriver\\:\\:getSource\\(\\) should return array\\{type\\: string, url\\: string, reference\\: string\\} but returns array\\{type\\: string\\|null, url\\: string, reference\\: string\\}\\.$#" + count: 1 + path: ../src/Composer/Repository/Vcs/GitBitbucketDriver.php + + - + message: "#^Only booleans are allowed in &&, string\\|false given on the right side\\.$#" + count: 1 + path: ../src/Composer/Repository/Vcs/GitBitbucketDriver.php + + - + message: "#^Only booleans are allowed in a negated boolean, Composer\\\\Repository\\\\Vcs\\\\VcsDriver\\|null given\\.$#" + count: 1 + path: ../src/Composer/Repository/Vcs/GitBitbucketDriver.php + + - + message: "#^Only booleans are allowed in an if condition, Composer\\\\Repository\\\\Vcs\\\\VcsDriver\\|null given\\.$#" + count: 10 + path: ../src/Composer/Repository/Vcs/GitBitbucketDriver.php + + - + message: "#^Only booleans are allowed in an if condition, mixed given\\.$#" + count: 1 + path: ../src/Composer/Repository/Vcs/GitBitbucketDriver.php + + - + message: "#^Property Composer\\\\Repository\\\\Vcs\\\\GitBitbucketDriver\\:\\:\\$branches \\(array\\\\) does not accept array\\\\.$#" + count: 1 + path: ../src/Composer/Repository/Vcs/GitBitbucketDriver.php + + - + message: "#^Property Composer\\\\Repository\\\\Vcs\\\\GitBitbucketDriver\\:\\:\\$tags \\(array\\\\) does not accept array\\\\.$#" + count: 1 + path: ../src/Composer/Repository/Vcs/GitBitbucketDriver.php + + - + message: "#^Short ternary operator is not allowed\\. Use null coalesce operator if applicable or consider using long ternary\\.$#" + count: 2 + path: ../src/Composer/Repository/Vcs/GitBitbucketDriver.php + + - + message: "#^Call to function in_array\\(\\) requires parameter \\#3 to be set\\.$#" + count: 1 + path: ../src/Composer/Repository/Vcs/GitDriver.php + + - + message: "#^Only booleans are allowed in &&, string given on the left side\\.$#" + count: 3 + path: ../src/Composer/Repository/Vcs/GitDriver.php + + - + message: "#^Only booleans are allowed in a negated boolean, string given\\.$#" + count: 1 + path: ../src/Composer/Repository/Vcs/GitDriver.php + + - + message: "#^Parameter \\#1 \\$url of static method Composer\\\\Util\\\\Url\\:\\:sanitize\\(\\) expects string, string\\|false given\\.$#" + count: 1 + path: ../src/Composer/Repository/Vcs/GitDriver.php + + - + message: "#^Property Composer\\\\Repository\\\\Vcs\\\\GitDriver\\:\\:\\$branches \\(array\\\\) does not accept array\\\\.$#" + count: 1 + path: ../src/Composer/Repository/Vcs/GitDriver.php + + - + message: "#^Call to function array_search\\(\\) requires parameter \\#3 to be set\\.$#" + count: 2 + path: ../src/Composer/Repository/Vcs/GitHubDriver.php + + - + message: "#^Call to function base64_decode\\(\\) requires parameter \\#2 to be set\\.$#" + count: 2 + path: ../src/Composer/Repository/Vcs/GitHubDriver.php + + - + message: "#^Call to function in_array\\(\\) requires parameter \\#3 to be set\\.$#" + count: 1 + path: ../src/Composer/Repository/Vcs/GitHubDriver.php + + - + message: "#^Cannot call method read\\(\\) on Composer\\\\Cache\\|null\\.$#" + count: 1 + path: ../src/Composer/Repository/Vcs/GitHubDriver.php + + - + message: "#^Cannot call method write\\(\\) on Composer\\\\Cache\\|null\\.$#" + count: 1 + path: ../src/Composer/Repository/Vcs/GitHubDriver.php + + - + message: "#^Construct empty\\(\\) is not allowed\\. Use more strict comparison\\.$#" + count: 8 + path: ../src/Composer/Repository/Vcs/GitHubDriver.php + + - + message: "#^Foreach overwrites \\$key with its key variable\\.$#" + count: 1 + path: ../src/Composer/Repository/Vcs/GitHubDriver.php + + - + message: "#^Only booleans are allowed in &&, array\\\\>\\|false given on the right side\\.$#" + count: 1 + path: ../src/Composer/Repository/Vcs/GitHubDriver.php + + - + message: "#^Only booleans are allowed in &&, mixed given on the right side\\.$#" + count: 1 + path: ../src/Composer/Repository/Vcs/GitHubDriver.php + + - + message: "#^Only booleans are allowed in &&, string\\|false given on the right side\\.$#" + count: 1 + path: ../src/Composer/Repository/Vcs/GitHubDriver.php + + - + message: "#^Only booleans are allowed in a negated boolean, array\\\\|null given\\.$#" + count: 1 + path: ../src/Composer/Repository/Vcs/GitHubDriver.php + + - + message: "#^Only booleans are allowed in a negated boolean, int\\<0, max\\> given\\.$#" + count: 1 + path: ../src/Composer/Repository/Vcs/GitHubDriver.php + + - + message: "#^Only booleans are allowed in a negated boolean, string given\\.$#" + count: 2 + path: ../src/Composer/Repository/Vcs/GitHubDriver.php + + - + message: "#^Only booleans are allowed in a negated boolean, string\\|null given\\.$#" + count: 1 + path: ../src/Composer/Repository/Vcs/GitHubDriver.php + + - + message: "#^Only booleans are allowed in an if condition, Composer\\\\Repository\\\\Vcs\\\\GitDriver\\|null given\\.$#" + count: 8 + path: ../src/Composer/Repository/Vcs/GitHubDriver.php + + - + message: "#^Only booleans are allowed in an if condition, array given\\.$#" + count: 1 + path: ../src/Composer/Repository/Vcs/GitHubDriver.php + + - + message: "#^Only booleans are allowed in an if condition, array\\\\|null given\\.$#" + count: 1 + path: ../src/Composer/Repository/Vcs/GitHubDriver.php + + - + message: "#^Only booleans are allowed in an if condition, mixed given\\.$#" + count: 1 + path: ../src/Composer/Repository/Vcs/GitHubDriver.php + + - + message: "#^Only booleans are allowed in an if condition, string\\|null given\\.$#" + count: 2 + path: ../src/Composer/Repository/Vcs/GitHubDriver.php + + - + message: "#^Only booleans are allowed in \\|\\|, int\\<0, max\\> given on the right side\\.$#" + count: 1 + path: ../src/Composer/Repository/Vcs/GitHubDriver.php + + - + message: "#^Parameter \\#1 \\$headers of method Composer\\\\Util\\\\GitHub\\:\\:getRateLimit\\(\\) expects array\\, array\\\\|null given\\.$#" + count: 1 + path: ../src/Composer/Repository/Vcs/GitHubDriver.php + + - + message: "#^Property Composer\\\\Repository\\\\Vcs\\\\GitHubDriver\\:\\:\\$tags \\(array\\\\) does not accept array\\\\.$#" + count: 1 + path: ../src/Composer/Repository/Vcs/GitHubDriver.php + + - + message: "#^Short ternary operator is not allowed\\. Use null coalesce operator if applicable or consider using long ternary\\.$#" + count: 2 + path: ../src/Composer/Repository/Vcs/GitHubDriver.php + + - + message: "#^Call to function in_array\\(\\) requires parameter \\#3 to be set\\.$#" + count: 5 + path: ../src/Composer/Repository/Vcs/GitLabDriver.php + + - + message: "#^Cannot call method read\\(\\) on Composer\\\\Cache\\|null\\.$#" + count: 1 + path: ../src/Composer/Repository/Vcs/GitLabDriver.php + + - + message: "#^Cannot call method write\\(\\) on Composer\\\\Cache\\|null\\.$#" + count: 1 + path: ../src/Composer/Repository/Vcs/GitLabDriver.php + + - + message: "#^Construct empty\\(\\) is not allowed\\. Use more strict comparison\\.$#" + count: 7 + path: ../src/Composer/Repository/Vcs/GitLabDriver.php + + - + message: "#^Only booleans are allowed in &&, mixed given on the left side\\.$#" + count: 1 + path: ../src/Composer/Repository/Vcs/GitLabDriver.php + + - + message: "#^Only booleans are allowed in &&, string given on the left side\\.$#" + count: 2 + path: ../src/Composer/Repository/Vcs/GitLabDriver.php + + - + message: "#^Only booleans are allowed in &&, string\\|false given on the right side\\.$#" + count: 1 + path: ../src/Composer/Repository/Vcs/GitLabDriver.php + + - + message: "#^Only booleans are allowed in a negated boolean, array\\ given\\.$#" + count: 2 + path: ../src/Composer/Repository/Vcs/GitLabDriver.php + + - + message: "#^Only booleans are allowed in an if condition, Composer\\\\Repository\\\\Vcs\\\\GitDriver\\|null given\\.$#" + count: 8 + path: ../src/Composer/Repository/Vcs/GitLabDriver.php + + - + message: "#^Only booleans are allowed in an if condition, mixed given\\.$#" + count: 2 + path: ../src/Composer/Repository/Vcs/GitLabDriver.php + + - + message: "#^Only booleans are allowed in an if condition, string given\\.$#" + count: 3 + path: ../src/Composer/Repository/Vcs/GitLabDriver.php + + - + message: "#^Parameter \\#1 \\$haystack of function strpos expects string, string\\|false given\\.$#" + count: 2 + path: ../src/Composer/Repository/Vcs/GitLabDriver.php + + - + message: "#^Parameter \\#2 \\$string of function explode expects string, string\\|null given\\.$#" + count: 1 + path: ../src/Composer/Repository/Vcs/GitLabDriver.php + + - + message: "#^Property Composer\\\\Repository\\\\Vcs\\\\VcsDriver\\:\\:\\$originUrl \\(string\\) does not accept string\\|false\\.$#" + count: 1 + path: ../src/Composer/Repository/Vcs/GitLabDriver.php + + - + message: "#^Short ternary operator is not allowed\\. Use null coalesce operator if applicable or consider using long ternary\\.$#" + count: 2 + path: ../src/Composer/Repository/Vcs/GitLabDriver.php + + - + message: "#^Only booleans are allowed in &&, string given on the left side\\.$#" + count: 3 + path: ../src/Composer/Repository/Vcs/HgDriver.php + + - + message: "#^Only booleans are allowed in a negated boolean, string given\\.$#" + count: 1 + path: ../src/Composer/Repository/Vcs/HgDriver.php + + - + message: "#^Property Composer\\\\Repository\\\\Vcs\\\\HgDriver\\:\\:\\$branches \\(array\\\\) does not accept array\\\\.$#" + count: 1 + path: ../src/Composer/Repository/Vcs/HgDriver.php + + - + message: "#^Property Composer\\\\Repository\\\\Vcs\\\\HgDriver\\:\\:\\$tags \\(array\\\\) does not accept array\\\\.$#" + count: 1 + path: ../src/Composer/Repository/Vcs/HgDriver.php + + - + message: "#^Cannot call method checkStream\\(\\) on Composer\\\\Util\\\\Perforce\\|null\\.$#" + count: 1 + path: ../src/Composer/Repository/Vcs/PerforceDriver.php + + - + message: "#^Cannot call method cleanupClientSpec\\(\\) on Composer\\\\Util\\\\Perforce\\|null\\.$#" + count: 1 + path: ../src/Composer/Repository/Vcs/PerforceDriver.php + + - + message: "#^Cannot call method connectClient\\(\\) on Composer\\\\Util\\\\Perforce\\|null\\.$#" + count: 1 + path: ../src/Composer/Repository/Vcs/PerforceDriver.php + + - + message: "#^Cannot call method getBranches\\(\\) on Composer\\\\Util\\\\Perforce\\|null\\.$#" + count: 1 + path: ../src/Composer/Repository/Vcs/PerforceDriver.php + + - + message: "#^Cannot call method getComposerInformation\\(\\) on Composer\\\\Util\\\\Perforce\\|null\\.$#" + count: 1 + path: ../src/Composer/Repository/Vcs/PerforceDriver.php + + - + message: "#^Cannot call method getFileContent\\(\\) on Composer\\\\Util\\\\Perforce\\|null\\.$#" + count: 1 + path: ../src/Composer/Repository/Vcs/PerforceDriver.php + + - + message: "#^Cannot call method getTags\\(\\) on Composer\\\\Util\\\\Perforce\\|null\\.$#" + count: 1 + path: ../src/Composer/Repository/Vcs/PerforceDriver.php + + - + message: "#^Cannot call method getUser\\(\\) on Composer\\\\Util\\\\Perforce\\|null\\.$#" + count: 1 + path: ../src/Composer/Repository/Vcs/PerforceDriver.php + + - + message: "#^Cannot call method p4Login\\(\\) on Composer\\\\Util\\\\Perforce\\|null\\.$#" + count: 1 + path: ../src/Composer/Repository/Vcs/PerforceDriver.php + + - + message: "#^Cannot call method writeP4ClientSpec\\(\\) on Composer\\\\Util\\\\Perforce\\|null\\.$#" + count: 1 + path: ../src/Composer/Repository/Vcs/PerforceDriver.php + + - + message: "#^Construct empty\\(\\) is not allowed\\. Use more strict comparison\\.$#" + count: 3 + path: ../src/Composer/Repository/Vcs/PerforceDriver.php + + - + message: "#^Cannot call method read\\(\\) on Composer\\\\Cache\\|null\\.$#" + count: 1 + path: ../src/Composer/Repository/Vcs/SvnDriver.php + + - + message: "#^Cannot call method write\\(\\) on Composer\\\\Cache\\|null\\.$#" + count: 1 + path: ../src/Composer/Repository/Vcs/SvnDriver.php + + - + message: "#^Construct empty\\(\\) is not allowed\\. Use more strict comparison\\.$#" + count: 2 + path: ../src/Composer/Repository/Vcs/SvnDriver.php + + - + message: "#^Method Composer\\\\Repository\\\\Vcs\\\\SvnDriver\\:\\:getRootIdentifier\\(\\) should return string but returns string\\|false\\.$#" + count: 1 + path: ../src/Composer/Repository/Vcs/SvnDriver.php + + - + message: "#^Only booleans are allowed in &&, Composer\\\\Cache\\|null given on the left side\\.$#" + count: 1 + path: ../src/Composer/Repository/Vcs/SvnDriver.php + + - + message: "#^Only booleans are allowed in &&, string given on the left side\\.$#" + count: 4 + path: ../src/Composer/Repository/Vcs/SvnDriver.php + + - + message: "#^Only booleans are allowed in &&, string\\|false given on the right side\\.$#" + count: 1 + path: ../src/Composer/Repository/Vcs/SvnDriver.php + + - + message: "#^Only booleans are allowed in a negated boolean, string given\\.$#" + count: 1 + path: ../src/Composer/Repository/Vcs/SvnDriver.php + + - + message: "#^Only booleans are allowed in an if condition, string given\\.$#" + count: 3 + path: ../src/Composer/Repository/Vcs/SvnDriver.php + + - + message: "#^Short ternary operator is not allowed\\. Use null coalesce operator if applicable or consider using long ternary\\.$#" + count: 1 + path: ../src/Composer/Repository/Vcs/SvnDriver.php + + - + message: "#^Strict comparison using \\!\\=\\= between string and false will always evaluate to true\\.$#" + count: 2 + path: ../src/Composer/Repository/Vcs/SvnDriver.php + + - + message: "#^Cannot call method read\\(\\) on Composer\\\\Cache\\|null\\.$#" + count: 1 + path: ../src/Composer/Repository/Vcs/VcsDriver.php + + - + message: "#^Cannot call method write\\(\\) on Composer\\\\Cache\\|null\\.$#" + count: 1 + path: ../src/Composer/Repository/Vcs/VcsDriver.php + + - + message: "#^Construct empty\\(\\) is not allowed\\. Use more strict comparison\\.$#" + count: 1 + path: ../src/Composer/Repository/Vcs/VcsDriver.php + + - + message: "#^Only booleans are allowed in &&, Composer\\\\Cache\\|null given on the left side\\.$#" + count: 1 + path: ../src/Composer/Repository/Vcs/VcsDriver.php + + - + message: "#^Only booleans are allowed in &&, DateTime\\|null given on the right side\\.$#" + count: 1 + path: ../src/Composer/Repository/Vcs/VcsDriver.php + + - + message: "#^Only booleans are allowed in &&, string\\|false given on the right side\\.$#" + count: 1 + path: ../src/Composer/Repository/Vcs/VcsDriver.php + + - + message: "#^Only booleans are allowed in a negated boolean, string\\|null given\\.$#" + count: 1 + path: ../src/Composer/Repository/Vcs/VcsDriver.php + + - + message: "#^Call to function array_search\\(\\) requires parameter \\#3 to be set\\.$#" + count: 1 + path: ../src/Composer/Repository/VcsRepository.php + + - + message: "#^Cannot call method load\\(\\) on Composer\\\\Package\\\\Loader\\\\LoaderInterface\\|null\\.$#" + count: 3 + path: ../src/Composer/Repository/VcsRepository.php + + - + message: "#^Construct empty\\(\\) is not allowed\\. Use more strict comparison\\.$#" + count: 1 + path: ../src/Composer/Repository/VcsRepository.php + + - + message: "#^Only booleans are allowed in &&, array\\ given on the right side\\.$#" + count: 1 + path: ../src/Composer/Repository/VcsRepository.php + + - + message: "#^Only booleans are allowed in a negated boolean, Composer\\\\Package\\\\Loader\\\\LoaderInterface\\|null given\\.$#" + count: 1 + path: ../src/Composer/Repository/VcsRepository.php + + - + message: "#^Only booleans are allowed in a negated boolean, Composer\\\\Repository\\\\Vcs\\\\VcsDriverInterface\\|null given\\.$#" + count: 1 + path: ../src/Composer/Repository/VcsRepository.php + + - + message: "#^Only booleans are allowed in a negated boolean, Composer\\\\Repository\\\\VersionCacheInterface\\|null given\\.$#" + count: 1 + path: ../src/Composer/Repository/VcsRepository.php + + - + message: "#^Only booleans are allowed in a negated boolean, array given\\.$#" + count: 2 + path: ../src/Composer/Repository/VcsRepository.php + + - + message: "#^Only booleans are allowed in a negated boolean, array\\ given\\.$#" + count: 1 + path: ../src/Composer/Repository/VcsRepository.php + + - + message: "#^Only booleans are allowed in a negated boolean, string\\|false given\\.$#" + count: 3 + path: ../src/Composer/Repository/VcsRepository.php + + - + message: "#^Only booleans are allowed in an if condition, Composer\\\\Package\\\\BasePackage\\|null given\\.$#" + count: 2 + path: ../src/Composer/Repository/VcsRepository.php + + - + message: "#^Only booleans are allowed in an if condition, Composer\\\\Package\\\\CompleteAliasPackage\\|Composer\\\\Package\\\\CompletePackage\\|false\\|null given\\.$#" + count: 2 + path: ../src/Composer/Repository/VcsRepository.php + + - + message: "#^Only booleans are allowed in an if condition, Composer\\\\Repository\\\\Vcs\\\\VcsDriverInterface\\|null given\\.$#" + count: 1 + path: ../src/Composer/Repository/VcsRepository.php + + - + message: "#^Only booleans are allowed in an if condition, array\\|null given\\.$#" + count: 2 + path: ../src/Composer/Repository/VcsRepository.php + + - + message: "#^Parameter \\#1 \\$object of function get_class expects object, Composer\\\\Repository\\\\Vcs\\\\VcsDriverInterface\\|null given\\.$#" + count: 1 + path: ../src/Composer/Repository/VcsRepository.php + + - + message: "#^Short ternary operator is not allowed\\. Use null coalesce operator if applicable or consider using long ternary\\.$#" + count: 7 + path: ../src/Composer/Repository/VcsRepository.php + + - + message: "#^Only booleans are allowed in &&, Composer\\\\EventDispatcher\\\\Event\\|null given on the right side\\.$#" + count: 1 + path: ../src/Composer/Script/Event.php + + - + message: "#^Parameter \\#2 \\$args of method Composer\\\\EventDispatcher\\\\Event\\:\\:__construct\\(\\) expects array\\, array\\ given\\.$#" + count: 1 + path: ../src/Composer/Script/Event.php + + - + message: "#^Parameter \\#3 \\$subject of static method Composer\\\\Pcre\\\\Preg\\:\\:replace\\(\\) expects string, string\\|false given\\.$#" + count: 1 + path: ../src/Composer/SelfUpdate/Keys.php + + - + message: "#^Only booleans are allowed in a negated boolean, array\\\\>\\> given\\.$#" + count: 1 + path: ../src/Composer/SelfUpdate/Versions.php + + - + message: "#^Only booleans are allowed in an if condition, string given\\.$#" + count: 1 + path: ../src/Composer/SelfUpdate/Versions.php + + - + message: "#^Parameter \\#1 \\$string of function trim expects string, string\\|false given\\.$#" + count: 1 + path: ../src/Composer/SelfUpdate/Versions.php + + - + message: "#^Short ternary operator is not allowed\\. Use null coalesce operator if applicable or consider using long ternary\\.$#" + count: 1 + path: ../src/Composer/SelfUpdate/Versions.php + + - + message: "#^Call to function in_array\\(\\) requires parameter \\#3 to be set\\.$#" + count: 1 + path: ../src/Composer/Util/AuthHelper.php + + - + message: "#^Construct empty\\(\\) is not allowed\\. Use more strict comparison\\.$#" + count: 1 + path: ../src/Composer/Util/AuthHelper.php + + - + message: "#^Only booleans are allowed in &&, string\\|null given on the left side\\.$#" + count: 1 + path: ../src/Composer/Util/AuthHelper.php + + - + message: "#^Only booleans are allowed in an if condition, Composer\\\\Config\\\\ConfigSourceInterface\\|false given\\.$#" + count: 1 + path: ../src/Composer/Util/AuthHelper.php + + - + message: "#^Parameter \\#1 \\$haystack of function strpos expects string, string\\|false\\|null given\\.$#" + count: 1 + path: ../src/Composer/Util/AuthHelper.php + + - + message: "#^Parameter \\#1 \\$scheme of method Composer\\\\Util\\\\GitLab\\:\\:authorizeOAuthInteractively\\(\\) expects string, string\\|false\\|null given\\.$#" + count: 1 + path: ../src/Composer/Util/AuthHelper.php + + - + message: "#^Parameter \\#2 \\$consumerKey of method Composer\\\\Util\\\\Bitbucket\\:\\:requestToken\\(\\) expects string, string\\|null given\\.$#" + count: 1 + path: ../src/Composer/Util/AuthHelper.php + + - + message: "#^Parameter \\#2 \\$string of function explode expects string, string\\|false\\|null given\\.$#" + count: 1 + path: ../src/Composer/Util/AuthHelper.php + + - + message: "#^Parameter \\#2 \\$username of method Composer\\\\IO\\\\IOInterface\\:\\:setAuthentication\\(\\) expects string, string\\|null given\\.$#" + count: 1 + path: ../src/Composer/Util/AuthHelper.php + + - + message: "#^Parameter \\#3 \\$consumerSecret of method Composer\\\\Util\\\\Bitbucket\\:\\:requestToken\\(\\) expects string, string\\|null given\\.$#" + count: 1 + path: ../src/Composer/Util/AuthHelper.php + + - + message: "#^Call to function in_array\\(\\) requires parameter \\#3 to be set\\.$#" + count: 1 + path: ../src/Composer/Util/Bitbucket.php + + - + message: "#^Offset 'access_token' does not exist on array\\{access_token\\: string, expires_in\\?\\: int\\}\\|null\\.$#" + count: 1 + path: ../src/Composer/Util/Bitbucket.php + + - + message: "#^Only booleans are allowed in a negated boolean, string given\\.$#" + count: 2 + path: ../src/Composer/Util/Bitbucket.php + + - + message: "#^Only booleans are allowed in an if condition, string\\|null given\\.$#" + count: 1 + path: ../src/Composer/Util/Bitbucket.php + + - + message: "#^Short ternary operator is not allowed\\. Use null coalesce operator if applicable or consider using long ternary\\.$#" + count: 2 + path: ../src/Composer/Util/Bitbucket.php + + - + message: "#^Only booleans are allowed in an if condition, string\\|null given\\.$#" + count: 1 + path: ../src/Composer/Util/ComposerMirror.php + + - + message: "#^Construct empty\\(\\) is not allowed\\. Use more strict comparison\\.$#" + count: 4 + path: ../src/Composer/Util/ConfigValidator.php + + - + message: "#^Only booleans are allowed in &&, array\\\\|null given on the left side\\.$#" + count: 1 + path: ../src/Composer/Util/ConfigValidator.php + + - + message: "#^Only booleans are allowed in &&, int given on the left side\\.$#" + count: 1 + path: ../src/Composer/Util/ConfigValidator.php + + - + message: "#^Only booleans are allowed in a negated boolean, int given\\.$#" + count: 1 + path: ../src/Composer/Util/ErrorHandler.php + + - + message: "#^Only booleans are allowed in an if condition, Composer\\\\IO\\\\IOInterface\\|null given\\.$#" + count: 1 + path: ../src/Composer/Util/ErrorHandler.php + + - + message: "#^Anonymous function uses \\$this assigned to variable \\$self\\. Use \\$this directly in the function body\\.$#" + count: 1 + path: ../src/Composer/Util/Filesystem.php + + - + message: "#^Cannot call method getPathname\\(\\) on SplFileInfo\\|string\\.$#" + count: 1 + path: ../src/Composer/Util/Filesystem.php + + - + message: "#^Cannot call method isDir\\(\\) on SplFileInfo\\|string\\.$#" + count: 1 + path: ../src/Composer/Util/Filesystem.php + + - + message: "#^Casting to string something that's already string\\.$#" + count: 2 + path: ../src/Composer/Util/Filesystem.php + + - + message: "#^Construct empty\\(\\) is not allowed\\. Use more strict comparison\\.$#" + count: 1 + path: ../src/Composer/Util/Filesystem.php + + - + message: "#^Method Composer\\\\Util\\\\Filesystem\\:\\:size\\(\\) should return int but returns int\\<0, max\\>\\|false\\.$#" + count: 1 + path: ../src/Composer/Util/Filesystem.php + + - + message: "#^Offset 'message' does not exist on array\\{type\\: int, message\\: string, file\\: string, line\\: int\\}\\|null\\.$#" + count: 2 + path: ../src/Composer/Util/Filesystem.php + + - + message: "#^Only booleans are allowed in a negated boolean, Composer\\\\Util\\\\ProcessExecutor\\|null given\\.$#" + count: 1 + path: ../src/Composer/Util/Filesystem.php + + - + message: "#^Only booleans are allowed in a negated boolean, int\\<0, max\\> given\\.$#" + count: 1 + path: ../src/Composer/Util/Filesystem.php + + - + message: "#^Only booleans are allowed in a negated boolean, string\\|false given\\.$#" + count: 1 + path: ../src/Composer/Util/Filesystem.php + + - + message: "#^Only booleans are allowed in a ternary operator condition, array\\\\|false given\\.$#" + count: 1 + path: ../src/Composer/Util/Filesystem.php + + - + message: "#^Only booleans are allowed in a ternary operator condition, int\\<0, max\\> given\\.$#" + count: 1 + path: ../src/Composer/Util/Filesystem.php + + - + message: "#^Only numeric types are allowed in \\+, bool given on the right side\\.$#" + count: 1 + path: ../src/Composer/Util/Filesystem.php + + - + message: "#^Parameter \\#1 \\$directory of function chdir expects string, string\\|false given\\.$#" + count: 1 + path: ../src/Composer/Util/Filesystem.php + + - + message: "#^Parameter \\#1 \\$from of function stream_copy_to_stream expects resource, resource\\|false given\\.$#" + count: 1 + path: ../src/Composer/Util/Filesystem.php + + - + message: "#^Parameter \\#1 \\$stream of function fclose expects resource, resource\\|false given\\.$#" + count: 4 + path: ../src/Composer/Util/Filesystem.php + + - + message: "#^Parameter \\#1 \\$stream of function feof expects resource, resource\\|false given\\.$#" + count: 1 + path: ../src/Composer/Util/Filesystem.php + + - + message: "#^Parameter \\#1 \\$stream of function fread expects resource, resource\\|false given\\.$#" + count: 2 + path: ../src/Composer/Util/Filesystem.php + + - + message: "#^Parameter \\#2 \\$to of function stream_copy_to_stream expects resource, resource\\|false given\\.$#" + count: 1 + path: ../src/Composer/Util/Filesystem.php + + - + message: "#^Short ternary operator is not allowed\\. Use null coalesce operator if applicable or consider using long ternary\\.$#" + count: 1 + path: ../src/Composer/Util/Filesystem.php + + - + message: "#^Call to function in_array\\(\\) requires parameter \\#3 to be set\\.$#" + count: 1 + path: ../src/Composer/Util/Git.php + + - + message: "#^Construct empty\\(\\) is not allowed\\. Use more strict comparison\\.$#" + count: 1 + path: ../src/Composer/Util/Git.php + + - + message: "#^Only booleans are allowed in &&, string given on the right side\\.$#" + count: 1 + path: ../src/Composer/Util/Git.php + + - + message: "#^Only booleans are allowed in &&, string\\|false given on the left side\\.$#" + count: 1 + path: ../src/Composer/Util/Git.php + + - + message: "#^Only booleans are allowed in &&, string\\|false given on the right side\\.$#" + count: 1 + path: ../src/Composer/Util/Git.php + + - + message: "#^Only booleans are allowed in &&, string\\|null given on the left side\\.$#" + count: 1 + path: ../src/Composer/Util/Git.php + + - + message: "#^Only booleans are allowed in an if condition, array\\\\|null given\\.$#" + count: 1 + path: ../src/Composer/Util/Git.php + + - + message: "#^Only booleans are allowed in an if condition, int\\<0, max\\>\\|false given\\.$#" + count: 1 + path: ../src/Composer/Util/Git.php + + - + message: "#^Only booleans are allowed in an if condition, string\\|false given\\.$#" + count: 2 + path: ../src/Composer/Util/Git.php + + - + message: "#^Parameter \\#1 \\$haystack of function strpos expects string, string\\|false given\\.$#" + count: 1 + path: ../src/Composer/Util/Git.php + + - + message: "#^Parameter \\#1 \\$string of function rawurlencode expects string, string\\|null given\\.$#" + count: 17 + path: ../src/Composer/Util/Git.php + + - + message: "#^Parameter \\#2 \\$consumerKey of method Composer\\\\Util\\\\Bitbucket\\:\\:requestToken\\(\\) expects string, string\\|null given\\.$#" + count: 1 + path: ../src/Composer/Util/Git.php + + - + message: "#^Parameter \\#2 \\$username of method Composer\\\\IO\\\\IOInterface\\:\\:setAuthentication\\(\\) expects string, string\\|null given\\.$#" + count: 1 + path: ../src/Composer/Util/Git.php + + - + message: "#^Parameter \\#3 \\$consumerSecret of method Composer\\\\Util\\\\Bitbucket\\:\\:requestToken\\(\\) expects string, string\\|null given\\.$#" + count: 1 + path: ../src/Composer/Util/Git.php + + - + message: "#^Call to function in_array\\(\\) requires parameter \\#3 to be set\\.$#" + count: 2 + path: ../src/Composer/Util/GitHub.php + + - + message: "#^Only booleans are allowed in a negated boolean, string given\\.$#" + count: 1 + path: ../src/Composer/Util/GitHub.php + + - + message: "#^Only booleans are allowed in an if condition, string\\|null given\\.$#" + count: 1 + path: ../src/Composer/Util/GitHub.php + + - + message: "#^Parameter \\#1 \\$string of function trim expects string, string\\|null given\\.$#" + count: 1 + path: ../src/Composer/Util/GitHub.php + + - + message: "#^Short ternary operator is not allowed\\. Use null coalesce operator if applicable or consider using long ternary\\.$#" + count: 2 + path: ../src/Composer/Util/GitHub.php + + - + message: "#^Call to function in_array\\(\\) requires parameter \\#3 to be set\\.$#" + count: 1 + path: ../src/Composer/Util/GitLab.php + + - + message: "#^Only booleans are allowed in an if condition, string\\|null given\\.$#" + count: 1 + path: ../src/Composer/Util/GitLab.php + + - + message: "#^Parameter \\#1 \\$json of function json_decode expects string, string\\|null given\\.$#" + count: 1 + path: ../src/Composer/Util/GitLab.php + + - + message: "#^Short ternary operator is not allowed\\. Use null coalesce operator if applicable or consider using long ternary\\.$#" + count: 2 + path: ../src/Composer/Util/GitLab.php + + - + message: "#^Construct empty\\(\\) is not allowed\\. Use more strict comparison\\.$#" + count: 1 + path: ../src/Composer/Util/Hg.php + + - + message: "#^Parameter \\#1 \\$string of function rawurlencode expects string, string\\|null given\\.$#" + count: 2 + path: ../src/Composer/Util/Hg.php + + - + message: "#^Array \\(array\\\\) does not accept array\\{url\\: string, origin\\: string, attributes\\: non\\-empty\\-array\\, options\\: array, progress\\: array, curlHandle\\: CurlHandle, filename\\: string\\|null, headerHandle\\: resource\\|false, \\.\\.\\.\\}\\.$#" + count: 1 + path: ../src/Composer/Util/Http/CurlDownloader.php + + - + message: "#^Call to function in_array\\(\\) requires parameter \\#3 to be set\\.$#" + count: 1 + path: ../src/Composer/Util/Http/CurlDownloader.php + + - + message: "#^Call to function is_resource\\(\\) with resource will always evaluate to true\\.$#" + count: 4 + path: ../src/Composer/Util/Http/CurlDownloader.php + + - + message: "#^Cannot access offset 'features' on array\\|false\\.$#" + count: 2 + path: ../src/Composer/Util/Http/CurlDownloader.php + + - + message: "#^Construct empty\\(\\) is not allowed\\. Use more strict comparison\\.$#" + count: 3 + path: ../src/Composer/Util/Http/CurlDownloader.php + + - + message: "#^Method Composer\\\\Util\\\\Http\\\\CurlDownloader\\:\\:isAuthenticatedRetryNeeded\\(\\) should return array\\{retry\\: bool, storeAuth\\: bool\\|string\\} but returns array\\{retry\\: bool, storeAuth\\: bool\\|string\\}\\|null\\.$#" + count: 2 + path: ../src/Composer/Util/Http/CurlDownloader.php + + - + message: "#^Offset 'retry' does not exist on array\\{retry\\: bool, storeAuth\\: bool\\|string\\}\\|null\\.$#" + count: 2 + path: ../src/Composer/Util/Http/CurlDownloader.php + + - + message: "#^Only booleans are allowed in &&, Composer\\\\Util\\\\Http\\\\CurlResponse\\|null given on the right side\\.$#" + count: 1 + path: ../src/Composer/Util/Http/CurlDownloader.php + + - + message: "#^Only booleans are allowed in &&, array\\\\|null given on the right side\\.$#" + count: 1 + path: ../src/Composer/Util/Http/CurlDownloader.php + + - + message: "#^Only booleans are allowed in &&, int given on the right side\\.$#" + count: 2 + path: ../src/Composer/Util/Http/CurlDownloader.php + + - + message: "#^Only booleans are allowed in &&, mixed given on the right side\\.$#" + count: 1 + path: ../src/Composer/Util/Http/CurlDownloader.php + + - + message: "#^Only booleans are allowed in a negated boolean, array\\\\> given\\.$#" + count: 1 + path: ../src/Composer/Util/Http/CurlDownloader.php + + - + message: "#^Only booleans are allowed in a negated boolean, resource\\|false given\\.$#" + count: 1 + path: ../src/Composer/Util/Http/CurlDownloader.php + + - + message: "#^Only booleans are allowed in a negated boolean, string given\\.$#" + count: 1 + path: ../src/Composer/Util/Http/CurlDownloader.php + + - + message: "#^Only booleans are allowed in a negated boolean, string\\|null given\\.$#" + count: 1 + path: ../src/Composer/Util/Http/CurlDownloader.php + + - + message: "#^Only booleans are allowed in an elseif condition, string\\|false\\|null given\\.$#" + count: 1 + path: ../src/Composer/Util/Http/CurlDownloader.php + + - + message: "#^Only booleans are allowed in an if condition, string given\\.$#" + count: 2 + path: ../src/Composer/Util/Http/CurlDownloader.php + + - + message: "#^Only booleans are allowed in an if condition, string\\|false given\\.$#" + count: 7 + path: ../src/Composer/Util/Http/CurlDownloader.php + + - + message: "#^Only booleans are allowed in an if condition, string\\|false\\|null given\\.$#" + count: 1 + path: ../src/Composer/Util/Http/CurlDownloader.php + + - + message: "#^Only booleans are allowed in an if condition, string\\|null given\\.$#" + count: 2 + path: ../src/Composer/Util/Http/CurlDownloader.php + + - + message: "#^Only booleans are allowed in \\|\\|, string given on the right side\\.$#" + count: 1 + path: ../src/Composer/Util/Http/CurlDownloader.php + + - + message: "#^Parameter \\#1 \\$handle of function curl_close expects CurlHandle, resource given\\.$#" + count: 1 + path: ../src/Composer/Util/Http/CurlDownloader.php + + - + message: "#^Parameter \\#1 \\$handle of function curl_getinfo expects CurlHandle, resource given\\.$#" + count: 1 + path: ../src/Composer/Util/Http/CurlDownloader.php + + - + message: "#^Parameter \\#1 \\$haystack of function strpos expects string, string\\|null given\\.$#" + count: 1 + path: ../src/Composer/Util/Http/CurlDownloader.php + + - + message: "#^Parameter \\#1 \\$json of function json_decode expects string, string\\|null given\\.$#" + count: 1 + path: ../src/Composer/Util/Http/CurlDownloader.php + + - + message: "#^Parameter \\#1 \\$multi_handle of function curl_multi_add_handle expects CurlMultiHandle, resource\\|null given\\.$#" + count: 1 + path: ../src/Composer/Util/Http/CurlDownloader.php + + - + message: "#^Parameter \\#1 \\$multi_handle of function curl_multi_exec expects CurlMultiHandle, resource\\|null given\\.$#" + count: 1 + path: ../src/Composer/Util/Http/CurlDownloader.php + + - + message: "#^Parameter \\#1 \\$multi_handle of function curl_multi_info_read expects CurlMultiHandle, resource\\|null given\\.$#" + count: 1 + path: ../src/Composer/Util/Http/CurlDownloader.php + + - + message: "#^Parameter \\#1 \\$multi_handle of function curl_multi_remove_handle expects CurlMultiHandle, resource\\|null given\\.$#" + count: 2 + path: ../src/Composer/Util/Http/CurlDownloader.php + + - + message: "#^Parameter \\#1 \\$multi_handle of function curl_multi_select expects CurlMultiHandle, resource\\|null given\\.$#" + count: 1 + path: ../src/Composer/Util/Http/CurlDownloader.php + + - + message: "#^Parameter \\#1 \\$str of function preg_quote expects string, string\\|false\\|null given\\.$#" + count: 1 + path: ../src/Composer/Util/Http/CurlDownloader.php + + - + message: "#^Parameter \\#1 \\$string of function rtrim expects string, string\\|false given\\.$#" + count: 1 + path: ../src/Composer/Util/Http/CurlDownloader.php + + - + message: "#^Parameter \\#1 \\$string of function strlen expects string, string\\|null given\\.$#" + count: 1 + path: ../src/Composer/Util/Http/CurlDownloader.php + + - + message: "#^Parameter \\#1 \\$string of function strtolower expects string, string\\|null given\\.$#" + count: 1 + path: ../src/Composer/Util/Http/CurlDownloader.php + + - + message: "#^Parameter \\#1 \\$string of function substr expects string, string\\|null given\\.$#" + count: 1 + path: ../src/Composer/Util/Http/CurlDownloader.php + + - + message: "#^Parameter \\#2 \\$handle of function curl_multi_remove_handle expects CurlHandle, resource given\\.$#" + count: 1 + path: ../src/Composer/Util/Http/CurlDownloader.php + + - + message: "#^Parameter \\#2 \\$subject of static method Composer\\\\Pcre\\\\Preg\\:\\:isMatch\\(\\) expects string, string\\|null given\\.$#" + count: 1 + path: ../src/Composer/Util/Http/CurlDownloader.php + + - + message: "#^Parameter \\#3 \\$attributes of method Composer\\\\Util\\\\Http\\\\CurlDownloader\\:\\:restartJob\\(\\) expects array\\{retryAuthFailure\\?\\: bool, redirects\\?\\: int, storeAuth\\?\\: bool\\}, array\\{storeAuth\\: bool\\|string\\} given\\.$#" + count: 1 + path: ../src/Composer/Util/Http/CurlDownloader.php + + - + message: "#^Parameter \\#3 \\$errorMessage of method Composer\\\\Util\\\\Http\\\\CurlDownloader\\:\\:failResponse\\(\\) expects string, string\\|null given\\.$#" + count: 1 + path: ../src/Composer/Util/Http/CurlDownloader.php + + - + message: "#^Parameter \\#4 \\$body of class Composer\\\\Util\\\\Http\\\\CurlResponse constructor expects string\\|null, string\\|false given\\.$#" + count: 2 + path: ../src/Composer/Util/Http/CurlDownloader.php + + - + message: "#^Parameter \\#6 \\$copyTo of method Composer\\\\Util\\\\Http\\\\CurlDownloader\\:\\:initDownload\\(\\) expects string\\|null, string\\|false given\\.$#" + count: 1 + path: ../src/Composer/Util/Http/CurlDownloader.php + + - + message: "#^Parameter \\#7 \\$attributes of method Composer\\\\Util\\\\Http\\\\CurlDownloader\\:\\:initDownload\\(\\) expects array\\{retryAuthFailure\\?\\: bool, redirects\\?\\: int, retries\\?\\: int, storeAuth\\?\\: bool\\}, non\\-empty\\-array\\ given\\.$#" + count: 1 + path: ../src/Composer/Util/Http/CurlDownloader.php + + - + message: "#^Property Composer\\\\Util\\\\Http\\\\CurlDownloader\\:\\:\\$multiHandle \\(resource\\|null\\) does not accept CurlMultiHandle\\.$#" + count: 1 + path: ../src/Composer/Util/Http/CurlDownloader.php + + - + message: "#^Property Composer\\\\Util\\\\Http\\\\CurlDownloader\\:\\:\\$shareHandle \\(resource\\|null\\) does not accept CurlShareHandle\\.$#" + count: 1 + path: ../src/Composer/Util/Http/CurlDownloader.php + + - + message: "#^Short ternary operator is not allowed\\. Use null coalesce operator if applicable or consider using long ternary\\.$#" + count: 1 + path: ../src/Composer/Util/Http/CurlDownloader.php + + - + message: "#^Cannot access offset 'host' on array\\{scheme\\?\\: string, host\\?\\: string, port\\?\\: int, user\\?\\: string, pass\\?\\: string, path\\?\\: string, query\\?\\: string, fragment\\?\\: string\\}\\|false\\.$#" + count: 1 + path: ../src/Composer/Util/Http/ProxyHelper.php + + - + message: "#^Cannot access offset 'user' on array\\{scheme\\?\\: string, host\\?\\: string, port\\?\\: int, user\\?\\: string, pass\\?\\: string, path\\?\\: string, query\\?\\: string, fragment\\?\\: string\\}\\|false\\.$#" + count: 1 + path: ../src/Composer/Util/Http/ProxyHelper.php + + - + message: "#^Construct empty\\(\\) is not allowed\\. Use more strict comparison\\.$#" + count: 1 + path: ../src/Composer/Util/Http/ProxyHelper.php + + - + message: "#^Foreach overwrites \\$name with its value variable\\.$#" + count: 1 + path: ../src/Composer/Util/Http/ProxyHelper.php + + - + message: "#^Implicit array creation is not allowed \\- variable \\$options does not exist\\.$#" + count: 1 + path: ../src/Composer/Util/Http/ProxyHelper.php + + - + message: "#^Only booleans are allowed in a negated boolean, int\\|false\\|null given\\.$#" + count: 1 + path: ../src/Composer/Util/Http/ProxyHelper.php + + - + message: "#^Only booleans are allowed in an if condition, string\\|null given\\.$#" + count: 3 + path: ../src/Composer/Util/Http/ProxyHelper.php + + - + message: "#^Parameter \\#1 \\$proxy of static method Composer\\\\Util\\\\Http\\\\ProxyHelper\\:\\:formatParsedUrl\\(\\) expects array\\{scheme\\?\\: string, host\\: string, port\\?\\: int, user\\?\\: string, pass\\?\\: string\\}, array\\{scheme\\?\\: string, host\\?\\: string, port\\?\\: int, user\\?\\: string, pass\\?\\: string, path\\?\\: string, query\\?\\: string, fragment\\?\\: string\\}\\|false given\\.$#" + count: 1 + path: ../src/Composer/Util/Http/ProxyHelper.php + + - + message: "#^Only booleans are allowed in &&, Composer\\\\Util\\\\NoProxyPattern\\|null given on the left side\\.$#" + count: 1 + path: ../src/Composer/Util/Http/ProxyManager.php + + - + message: "#^Only booleans are allowed in &&, string\\|null given on the right side\\.$#" + count: 1 + path: ../src/Composer/Util/Http/ProxyManager.php + + - + message: "#^Only booleans are allowed in a negated boolean, Composer\\\\Util\\\\Http\\\\ProxyManager\\|null given\\.$#" + count: 1 + path: ../src/Composer/Util/Http/ProxyManager.php + + - + message: "#^Only booleans are allowed in an if condition, string\\|null given\\.$#" + count: 4 + path: ../src/Composer/Util/Http/ProxyManager.php + + - + message: "#^Parameter \\#3 \\$formattedUrl of class Composer\\\\Util\\\\Http\\\\RequestProxy constructor expects string, string\\|null given\\.$#" + count: 1 + path: ../src/Composer/Util/Http/ProxyManager.php + + - + message: "#^Short ternary operator is not allowed\\. Use null coalesce operator if applicable or consider using long ternary\\.$#" + count: 1 + path: ../src/Composer/Util/Http/ProxyManager.php + + - + message: "#^Only booleans are allowed in an if condition, string given\\.$#" + count: 1 + path: ../src/Composer/Util/Http/RequestProxy.php + + - + message: "#^Short ternary operator is not allowed\\. Use null coalesce operator if applicable or consider using long ternary\\.$#" + count: 1 + path: ../src/Composer/Util/Http/RequestProxy.php + + - + message: "#^Casting to int something that's already int\\.$#" + count: 1 + path: ../src/Composer/Util/Http/Response.php + + - + message: "#^Anonymous function uses \\$this assigned to variable \\$downloader\\. Use \\$this directly in the function body\\.$#" + count: 2 + path: ../src/Composer/Util/HttpDownloader.php + + - + message: "#^Argument of an invalid type array\\\\>\\|string supplied for foreach, only iterables are supported\\.$#" + count: 1 + path: ../src/Composer/Util/HttpDownloader.php + + - + message: "#^Binary operation \"\\.\" between non\\-empty\\-string and non\\-empty\\-array\\\\|non\\-empty\\-string results in an error\\.$#" + count: 1 + path: ../src/Composer/Util/HttpDownloader.php + + - + message: "#^Cannot call method abortRequest\\(\\) on Composer\\\\Util\\\\Http\\\\CurlDownloader\\|null\\.$#" + count: 1 + path: ../src/Composer/Util/HttpDownloader.php + + - + message: "#^Cannot call method copy\\(\\) on Composer\\\\Util\\\\RemoteFilesystem\\|null\\.$#" + count: 1 + path: ../src/Composer/Util/HttpDownloader.php + + - + message: "#^Cannot call method download\\(\\) on Composer\\\\Util\\\\Http\\\\CurlDownloader\\|null\\.$#" + count: 2 + path: ../src/Composer/Util/HttpDownloader.php + + - + message: "#^Cannot call method findStatusCode\\(\\) on Composer\\\\Util\\\\RemoteFilesystem\\|null\\.$#" + count: 2 + path: ../src/Composer/Util/HttpDownloader.php + + - + message: "#^Cannot call method getContents\\(\\) on Composer\\\\Util\\\\RemoteFilesystem\\|null\\.$#" + count: 1 + path: ../src/Composer/Util/HttpDownloader.php + + - + message: "#^Cannot call method getLastHeaders\\(\\) on Composer\\\\Util\\\\RemoteFilesystem\\|null\\.$#" + count: 2 + path: ../src/Composer/Util/HttpDownloader.php + + - + message: "#^Construct empty\\(\\) is not allowed\\. Use more strict comparison\\.$#" + count: 4 + path: ../src/Composer/Util/HttpDownloader.php + + - + message: "#^Offset 'copyTo' does not exist on array\\{url\\: string, options\\?\\: array, copyTo\\?\\: string\\|null\\}\\.$#" + count: 2 + path: ../src/Composer/Util/HttpDownloader.php + + - + message: "#^Offset 'curl_id' on array\\{curl_id\\: int, exception\\: Composer\\\\Downloader\\\\TransportException, id\\: int, origin\\: string, reject\\: mixed, request\\: array\\{url\\: string, options\\?\\: array, copyTo\\?\\: string\\|null\\}, resolve\\: mixed, response\\: Composer\\\\Util\\\\Http\\\\Response, \\.\\.\\.\\} in isset\\(\\) always exists and is not nullable\\.$#" + count: 1 + path: ../src/Composer/Util/HttpDownloader.php + + - + message: "#^Offset 'exception' does not exist on array\\{id\\: int, status\\: 4, request\\: array\\{url\\: string, options\\?\\: array, copyTo\\?\\: string\\|null\\}, sync\\: bool, origin\\: string, resolve\\?\\: callable\\(\\)\\: mixed, reject\\?\\: callable\\(\\)\\: mixed, curl_id\\?\\: int, \\.\\.\\.\\}\\.$#" + count: 1 + path: ../src/Composer/Util/HttpDownloader.php + + - + message: "#^Offset 'options' does not exist on array\\{url\\: string, options\\?\\: array, copyTo\\?\\: string\\|null\\}\\.$#" + count: 5 + path: ../src/Composer/Util/HttpDownloader.php + + - + message: "#^Offset 'reject' does not exist on array\\{id\\: int, status\\: 2, request\\: array\\{url\\: string, options\\?\\: array, copyTo\\?\\: string\\|null\\}, sync\\: bool, origin\\: string, resolve\\?\\: callable\\(\\)\\: mixed, reject\\?\\: callable\\(\\)\\: mixed, curl_id\\?\\: int, \\.\\.\\.\\}\\.$#" + count: 1 + path: ../src/Composer/Util/HttpDownloader.php + + - + message: "#^Offset 'resolve' does not exist on array\\{id\\: int, status\\: 2, request\\: array\\{url\\: string, options\\?\\: array, copyTo\\?\\: string\\|null\\}, sync\\: bool, origin\\: string, resolve\\?\\: callable\\(\\)\\: mixed, reject\\?\\: callable\\(\\)\\: mixed, curl_id\\?\\: int, \\.\\.\\.\\}\\.$#" + count: 1 + path: ../src/Composer/Util/HttpDownloader.php + + - + message: "#^Only booleans are allowed in &&, Composer\\\\Util\\\\Http\\\\CurlDownloader\\|null given on the left side\\.$#" + count: 1 + path: ../src/Composer/Util/HttpDownloader.php + + - + message: "#^Only booleans are allowed in a negated boolean, Composer\\\\Util\\\\Http\\\\CurlDownloader\\|null given\\.$#" + count: 1 + path: ../src/Composer/Util/HttpDownloader.php + + - + message: "#^Only booleans are allowed in an if condition, Composer\\\\Util\\\\Http\\\\CurlDownloader\\|null given\\.$#" + count: 1 + path: ../src/Composer/Util/HttpDownloader.php + + - + message: "#^Only booleans are allowed in an if condition, string\\|null given\\.$#" + count: 2 + path: ../src/Composer/Util/HttpDownloader.php + + - + message: "#^Parameter \\#1 \\$constraints of method Composer\\\\Package\\\\Version\\\\VersionParser\\:\\:parseConstraints\\(\\) expects string, array\\\\>\\|string given\\.$#" + count: 1 + path: ../src/Composer/Util/HttpDownloader.php + + - + message: "#^Parameter \\#2 \\$code of class Composer\\\\Util\\\\Http\\\\Response constructor expects int, int\\|null given\\.$#" + count: 2 + path: ../src/Composer/Util/HttpDownloader.php + + - + message: "#^Parameter \\#4 \\$body of class Composer\\\\Util\\\\Http\\\\Response constructor expects string\\|null, bool\\|string given\\.$#" + count: 1 + path: ../src/Composer/Util/HttpDownloader.php + + - + message: "#^Construct empty\\(\\) is not allowed\\. Use more strict comparison\\.$#" + count: 3 + path: ../src/Composer/Util/IniHelper.php + + - + message: "#^Only booleans are allowed in &&, Symfony\\\\Component\\\\Console\\\\Helper\\\\ProgressBar\\|null given on the left side\\.$#" + count: 1 + path: ../src/Composer/Util/Loop.php + + - + message: "#^Only booleans are allowed in a negated boolean, int given\\.$#" + count: 1 + path: ../src/Composer/Util/Loop.php + + - + message: "#^Only booleans are allowed in an if condition, Composer\\\\Util\\\\ProcessExecutor\\|null given\\.$#" + count: 3 + path: ../src/Composer/Util/Loop.php + + - + message: "#^Only booleans are allowed in an if condition, Symfony\\\\Component\\\\Console\\\\Helper\\\\ProgressBar\\|null given\\.$#" + count: 2 + path: ../src/Composer/Util/Loop.php + + - + message: "#^Cannot access offset int\\ on array\\|false\\.$#" + count: 6 + path: ../src/Composer/Util/NoProxyPattern.php + + - + message: "#^Construct empty\\(\\) is not allowed\\. Use more strict comparison\\.$#" + count: 2 + path: ../src/Composer/Util/NoProxyPattern.php + + - + message: "#^Method Composer\\\\Util\\\\NoProxyPattern\\:\\:getRule\\(\\) should return stdClass\\|null but returns object\\|null\\.$#" + count: 1 + path: ../src/Composer/Util/NoProxyPattern.php + + - + message: "#^Only booleans are allowed in a negated boolean, bool\\|stdClass given\\.$#" + count: 1 + path: ../src/Composer/Util/NoProxyPattern.php + + - + message: "#^Only booleans are allowed in a negated boolean, stdClass\\|null given\\.$#" + count: 1 + path: ../src/Composer/Util/NoProxyPattern.php + + - + message: "#^Only booleans are allowed in a negated boolean, string\\|false given\\.$#" + count: 1 + path: ../src/Composer/Util/NoProxyPattern.php + + - + message: "#^Only booleans are allowed in a negated boolean, string\\|false\\|null given\\.$#" + count: 1 + path: ../src/Composer/Util/NoProxyPattern.php + + - + message: "#^Only booleans are allowed in a ternary operator condition, int\\|false\\|null given\\.$#" + count: 1 + path: ../src/Composer/Util/NoProxyPattern.php + + - + message: "#^Only booleans are allowed in an if condition, float given\\.$#" + count: 1 + path: ../src/Composer/Util/NoProxyPattern.php + + - + message: "#^Only booleans are allowed in an if condition, int\\<\\-7, 7\\> given\\.$#" + count: 1 + path: ../src/Composer/Util/NoProxyPattern.php + + - + message: "#^Only booleans are allowed in \\|\\|, mixed given on the left side\\.$#" + count: 2 + path: ../src/Composer/Util/NoProxyPattern.php + + - + message: "#^Only numeric types are allowed in \\+, int\\<0, max\\>\\|false given on the left side\\.$#" + count: 1 + path: ../src/Composer/Util/NoProxyPattern.php + + - + message: "#^Parameter \\#1 \\$binary of method Composer\\\\Util\\\\NoProxyPattern\\:\\:ipMapTo6\\(\\) expects string, string\\|false given\\.$#" + count: 1 + path: ../src/Composer/Util/NoProxyPattern.php + + - + message: "#^Parameter \\#1 \\$string of function strlen expects string, string\\|false given\\.$#" + count: 1 + path: ../src/Composer/Util/NoProxyPattern.php + + - + message: "#^Parameter \\#3 \\$length of function substr expects int\\|null, int\\<0, max\\>\\|false given\\.$#" + count: 1 + path: ../src/Composer/Util/NoProxyPattern.php + + - + message: "#^Parameter \\#3 \\$url of method Composer\\\\Util\\\\NoProxyPattern\\:\\:match\\(\\) expects stdClass, stdClass\\|true given\\.$#" + count: 1 + path: ../src/Composer/Util/NoProxyPattern.php + + - + message: "#^Call to function method_exists\\(\\) with 'Symfony\\\\\\\\Component…' and 'fromShellCommandline' will always evaluate to true\\.$#" + count: 1 + path: ../src/Composer/Util/Perforce.php + + - + message: "#^Only booleans are allowed in a negated boolean, array\\ given\\.$#" + count: 1 + path: ../src/Composer/Util/Perforce.php + + - + message: "#^Only booleans are allowed in a negated boolean, string given\\.$#" + count: 1 + path: ../src/Composer/Util/Perforce.php + + - + message: "#^Only booleans are allowed in a negated boolean, string\\|null given\\.$#" + count: 1 + path: ../src/Composer/Util/Perforce.php + + - + message: "#^Only booleans are allowed in an if condition, int given\\.$#" + count: 2 + path: ../src/Composer/Util/Perforce.php + + - + message: "#^Parameter \\#1 \\$directory of function chdir expects string, string\\|false given\\.$#" + count: 1 + path: ../src/Composer/Util/Perforce.php + + - + message: "#^Parameter \\#1 \\$stream of function fclose expects resource, resource\\|false given\\.$#" + count: 2 + path: ../src/Composer/Util/Perforce.php + + - + message: "#^Parameter \\#1 \\$stream of function fwrite expects resource, resource\\|false given\\.$#" + count: 13 + path: ../src/Composer/Util/Perforce.php + + - + message: "#^Parameter \\#1 \\$stream of method Composer\\\\Util\\\\Perforce\\:\\:getStreamWithoutLabel\\(\\) expects string, string\\|null given\\.$#" + count: 1 + path: ../src/Composer/Util/Perforce.php + + - + message: "#^Parameter \\#1 \\$string1 of function strcmp expects string, string\\|null given\\.$#" + count: 1 + path: ../src/Composer/Util/Perforce.php + + - + message: "#^Parameter \\#2 \\$needle of function strpos expects string, string\\|null given\\.$#" + count: 1 + path: ../src/Composer/Util/Perforce.php + + - + message: "#^Parameter \\#3 \\$length of function substr expects int\\|null, int\\<0, max\\>\\|false given\\.$#" + count: 1 + path: ../src/Composer/Util/Perforce.php + + - + message: "#^Cannot access offset 'dir' on array\\|false\\.$#" + count: 1 + path: ../src/Composer/Util/Platform.php + + - + message: "#^Casting to string something that's already string\\.$#" + count: 1 + path: ../src/Composer/Util/Platform.php + + - + message: "#^Only booleans are allowed in &&, array\\|false given on the left side\\.$#" + count: 1 + path: ../src/Composer/Util/Platform.php + + - + message: "#^Only booleans are allowed in &&, string\\|false given on the right side\\.$#" + count: 1 + path: ../src/Composer/Util/Platform.php + + - + message: "#^Only booleans are allowed in a negated boolean, string\\|false given\\.$#" + count: 1 + path: ../src/Composer/Util/Platform.php + + - + message: "#^Only booleans are allowed in a ternary operator condition, array\\\\|false given\\.$#" + count: 1 + path: ../src/Composer/Util/Platform.php + + - + message: "#^Short ternary operator is not allowed\\. Use null coalesce operator if applicable or consider using long ternary\\.$#" + count: 2 + path: ../src/Composer/Util/Platform.php + + - + message: "#^Anonymous function uses \\$this assigned to variable \\$self\\. Use \\$this directly in the function body\\.$#" + count: 2 + path: ../src/Composer/Util/ProcessExecutor.php + + - + message: "#^Call to function method_exists\\(\\) with 'Symfony\\\\\\\\Component…' and 'fromShellCommandline' will always evaluate to true\\.$#" + count: 2 + path: ../src/Composer/Util/ProcessExecutor.php + + - + message: "#^Method Composer\\\\Util\\\\ProcessExecutor\\:\\:doExecute\\(\\) should return int but returns int\\|null\\.$#" + count: 1 + path: ../src/Composer/Util/ProcessExecutor.php + + - + message: "#^Only booleans are allowed in &&, Composer\\\\IO\\\\IOInterface\\|null given on the left side\\.$#" + count: 2 + path: ../src/Composer/Util/ProcessExecutor.php + + - + message: "#^Only booleans are allowed in &&, string\\|false given on the right side\\.$#" + count: 2 + path: ../src/Composer/Util/ProcessExecutor.php + + - + message: "#^Only booleans are allowed in a negated boolean, int given\\.$#" + count: 1 + path: ../src/Composer/Util/ProcessExecutor.php + + - + message: "#^Parameter \\#1 \\$filename of function is_dir expects string, string\\|false given\\.$#" + count: 1 + path: ../src/Composer/Util/ProcessExecutor.php + + - + message: "#^Parameter \\#2 \\$cwd of static method Symfony\\\\Component\\\\Process\\\\Process\\:\\:fromShellCommandline\\(\\) expects string\\|null, string\\|false\\|null given\\.$#" + count: 1 + path: ../src/Composer/Util/ProcessExecutor.php + + - + message: "#^Short ternary operator is not allowed\\. Use null coalesce operator if applicable or consider using long ternary\\.$#" + count: 2 + path: ../src/Composer/Util/ProcessExecutor.php + + - + message: "#^Call to function in_array\\(\\) requires parameter \\#3 to be set\\.$#" + count: 1 + path: ../src/Composer/Util/RemoteFilesystem.php + + - + message: "#^Construct empty\\(\\) is not allowed\\. Use more strict comparison\\.$#" + count: 10 + path: ../src/Composer/Util/RemoteFilesystem.php + + - + message: "#^Method Composer\\\\Util\\\\RemoteFilesystem\\:\\:copy\\(\\) should return bool but returns bool\\|string\\.$#" + count: 1 + path: ../src/Composer/Util/RemoteFilesystem.php + + - + message: "#^Method Composer\\\\Util\\\\RemoteFilesystem\\:\\:get\\(\\) should return bool\\|string but returns string\\|true\\|null\\.$#" + count: 1 + path: ../src/Composer/Util/RemoteFilesystem.php + + - + message: "#^Offset 'retry' does not exist on array\\{retry\\: bool, storeAuth\\: bool\\|string\\}\\|null\\.$#" + count: 1 + path: ../src/Composer/Util/RemoteFilesystem.php + + - + message: "#^Offset 'storeAuth' does not exist on array\\{retry\\: bool, storeAuth\\: bool\\|string\\}\\|null\\.$#" + count: 1 + path: ../src/Composer/Util/RemoteFilesystem.php + + - + message: "#^Only booleans are allowed in &&, bool\\|string given on the left side\\.$#" + count: 1 + path: ../src/Composer/Util/RemoteFilesystem.php + + - + message: "#^Only booleans are allowed in &&, int\\|null given on the left side\\.$#" + count: 1 + path: ../src/Composer/Util/RemoteFilesystem.php + + - + message: "#^Only booleans are allowed in &&, string given on the left side\\.$#" + count: 1 + path: ../src/Composer/Util/RemoteFilesystem.php + + - + message: "#^Only booleans are allowed in &&, string\\|false given on the left side\\.$#" + count: 1 + path: ../src/Composer/Util/RemoteFilesystem.php + + - + message: "#^Only booleans are allowed in &&, string\\|null given on the left side\\.$#" + count: 2 + path: ../src/Composer/Util/RemoteFilesystem.php + + - + message: "#^Only booleans are allowed in &&, string\\|null given on the right side\\.$#" + count: 1 + path: ../src/Composer/Util/RemoteFilesystem.php + + - + message: "#^Only booleans are allowed in a negated boolean, string\\|null given\\.$#" + count: 1 + path: ../src/Composer/Util/RemoteFilesystem.php + + - + message: "#^Only booleans are allowed in an elseif condition, string\\|false\\|null given\\.$#" + count: 1 + path: ../src/Composer/Util/RemoteFilesystem.php + + - + message: "#^Only booleans are allowed in an if condition, array\\\\|null given\\.$#" + count: 1 + path: ../src/Composer/Util/RemoteFilesystem.php + + - + message: "#^Only booleans are allowed in an if condition, string given\\.$#" + count: 2 + path: ../src/Composer/Util/RemoteFilesystem.php + + - + message: "#^Only booleans are allowed in an if condition, string\\|false\\|null given\\.$#" + count: 1 + path: ../src/Composer/Util/RemoteFilesystem.php + + - + message: "#^Only booleans are allowed in an if condition, string\\|null given\\.$#" + count: 1 + path: ../src/Composer/Util/RemoteFilesystem.php + + - + message: "#^Parameter \\#1 \\$httpStatus of method Composer\\\\Util\\\\RemoteFilesystem\\:\\:promptAuthAndRetry\\(\\) expects int\\<1, max\\>, int\\|null given\\.$#" + count: 1 + path: ../src/Composer/Util/RemoteFilesystem.php + + - + message: "#^Parameter \\#1 \\$json of function json_decode expects string, string\\|false given\\.$#" + count: 1 + path: ../src/Composer/Util/RemoteFilesystem.php + + - + message: "#^Parameter \\#1 \\$originUrl of method Composer\\\\Util\\\\RemoteFilesystem\\:\\:get\\(\\) expects string, string\\|false\\|null given\\.$#" + count: 1 + path: ../src/Composer/Util/RemoteFilesystem.php + + - + message: "#^Parameter \\#1 \\$result of method Composer\\\\Util\\\\RemoteFilesystem\\:\\:decodeResult\\(\\) expects string\\|false, bool\\|string given\\.$#" + count: 1 + path: ../src/Composer/Util/RemoteFilesystem.php + + - + message: "#^Parameter \\#1 \\$result of method Composer\\\\Util\\\\RemoteFilesystem\\:\\:decodeResult\\(\\) expects string\\|false, non\\-empty\\-string\\|true given\\.$#" + count: 1 + path: ../src/Composer/Util/RemoteFilesystem.php + + - + message: "#^Parameter \\#1 \\$str of function preg_quote expects string, string\\|false\\|null given\\.$#" + count: 1 + path: ../src/Composer/Util/RemoteFilesystem.php + + - + message: "#^Parameter \\#1 \\$str of static method Composer\\\\Util\\\\Platform\\:\\:strlen\\(\\) expects string, string\\|false given\\.$#" + count: 5 + path: ../src/Composer/Util/RemoteFilesystem.php + + - + message: "#^Parameter \\#1 \\$string of function base64_encode expects string, string\\|false given\\.$#" + count: 1 + path: ../src/Composer/Util/RemoteFilesystem.php + + - + message: "#^Parameter \\#1 \\$string of function substr expects string, string\\|false\\|null given\\.$#" + count: 1 + path: ../src/Composer/Util/RemoteFilesystem.php + + - + message: "#^Parameter \\#2 \\$hostname of static method Composer\\\\Util\\\\TlsHelper\\:\\:checkCertificateHost\\(\\) expects string, string\\|false\\|null given\\.$#" + count: 1 + path: ../src/Composer/Util/RemoteFilesystem.php + + - + message: "#^Parameter \\#5 \\$length of function file_get_contents expects int\\<0, max\\>\\|null, int given\\.$#" + count: 1 + path: ../src/Composer/Util/RemoteFilesystem.php + + - + message: "#^Property Composer\\\\Util\\\\RemoteFilesystem\\:\\:\\$scheme \\(string\\) does not accept string\\|false\\|null\\.$#" + count: 1 + path: ../src/Composer/Util/RemoteFilesystem.php + + - + message: "#^Property Composer\\\\Util\\\\RemoteFilesystem\\:\\:\\$storeAuth \\(bool\\) does not accept bool\\|string\\.$#" + count: 1 + path: ../src/Composer/Util/RemoteFilesystem.php + + - + message: "#^Short ternary operator is not allowed\\. Use null coalesce operator if applicable or consider using long ternary\\.$#" + count: 1 + path: ../src/Composer/Util/RemoteFilesystem.php + + - + message: "#^Construct empty\\(\\) is not allowed\\. Use more strict comparison\\.$#" + count: 1 + path: ../src/Composer/Util/Silencer.php + + - + message: "#^Cannot access offset 'version' on array\\|false\\.$#" + count: 1 + path: ../src/Composer/Util/StreamContextFactory.php + + - + message: "#^Method Composer\\\\Util\\\\StreamContextFactory\\:\\:initOptions\\(\\) should return array\\{http\\: array\\{header\\: array\\, proxy\\?\\: string, request_fulluri\\: bool\\}, ssl\\?\\: array\\} but returns array\\.$#" + count: 1 + path: ../src/Composer/Util/StreamContextFactory.php + + - + message: "#^Only booleans are allowed in a ternary operator condition, string\\|false given\\.$#" + count: 1 + path: ../src/Composer/Util/StreamContextFactory.php + + - + message: "#^Only booleans are allowed in a ternary operator condition, string\\|null given\\.$#" + count: 1 + path: ../src/Composer/Util/StreamContextFactory.php + + - + message: "#^Only booleans are allowed in an if condition, array given\\.$#" + count: 1 + path: ../src/Composer/Util/StreamContextFactory.php + + - + message: "#^Cannot access offset 'user' on array\\{scheme\\?\\: string, host\\?\\: string, port\\?\\: int, user\\?\\: string, pass\\?\\: string, path\\?\\: string, query\\?\\: string, fragment\\?\\: string\\}\\|false\\.$#" + count: 1 + path: ../src/Composer/Util/Svn.php + + - + message: "#^Casting to bool something that's already \\*NEVER\\*\\.$#" + count: 1 + path: ../src/Composer/Util/Svn.php + + - + message: "#^Construct empty\\(\\) is not allowed\\. Use more strict comparison\\.$#" + count: 2 + path: ../src/Composer/Util/Svn.php + + - + message: "#^Method Composer\\\\Util\\\\Svn\\:\\:execute\\(\\) should return string but returns string\\|null\\.$#" + count: 1 + path: ../src/Composer/Util/Svn.php + + - + message: "#^Method Composer\\\\Util\\\\Svn\\:\\:executeLocal\\(\\) should return string but returns string\\|null\\.$#" + count: 1 + path: ../src/Composer/Util/Svn.php + + - + message: "#^Only booleans are allowed in a negated boolean, string\\|null given\\.$#" + count: 1 + path: ../src/Composer/Util/Svn.php + + - + message: "#^Only booleans are allowed in an if condition, string\\|null given\\.$#" + count: 1 + path: ../src/Composer/Util/Svn.php + + - + message: "#^Parameter \\#2 \\$cwd of method Composer\\\\Util\\\\Svn\\:\\:executeWithAuthRetry\\(\\) expects string, string\\|null given\\.$#" + count: 2 + path: ../src/Composer/Util/Svn.php + + - + message: "#^Parameter \\#4 \\$path of method Composer\\\\Util\\\\Svn\\:\\:executeWithAuthRetry\\(\\) expects string, string\\|null given\\.$#" + count: 1 + path: ../src/Composer/Util/Svn.php + + - + message: "#^Short ternary operator is not allowed\\. Use null coalesce operator if applicable or consider using long ternary\\.$#" + count: 1 + path: ../src/Composer/Util/Svn.php + + - + message: "#^Only booleans are allowed in a ternary operator condition, Composer\\\\Package\\\\PackageInterface\\|null given\\.$#" + count: 1 + path: ../src/Composer/Util/SyncHelper.php + + - + message: "#^Only booleans are allowed in an if condition, React\\\\Promise\\\\PromiseInterface\\|null given\\.$#" + count: 1 + path: ../src/Composer/Util/SyncHelper.php + + - + message: "#^Parameter \\#2 \\$target of method Composer\\\\Downloader\\\\DownloaderInterface\\:\\:update\\(\\) expects Composer\\\\Package\\\\PackageInterface, Composer\\\\Package\\\\PackageInterface\\|null given\\.$#" + count: 1 + path: ../src/Composer/Util/SyncHelper.php + + - + message: "#^Only booleans are allowed in &&, array\\ given on the left side\\.$#" + count: 1 + path: ../src/Composer/Util/Tar.php + + - + message: "#^Call to function base64_decode\\(\\) requires parameter \\#2 to be set\\.$#" + count: 1 + path: ../src/Composer/Util/TlsHelper.php + + - + message: "#^Cannot access offset 'key' on array\\|false\\.$#" + count: 1 + path: ../src/Composer/Util/TlsHelper.php + + - + message: "#^Cannot access offset 'subject' on array\\|false\\.$#" + count: 1 + path: ../src/Composer/Util/TlsHelper.php + + - + message: "#^Construct empty\\(\\) is not allowed\\. Use more strict comparison\\.$#" + count: 1 + path: ../src/Composer/Util/TlsHelper.php + + - + message: "#^Only booleans are allowed in &&, \\(callable\\)\\|null given on the left side\\.$#" + count: 1 + path: ../src/Composer/Util/TlsHelper.php + + - + message: "#^Only numeric types are allowed in \\+, int\\<0, max\\>\\|false given on the left side\\.$#" + count: 1 + path: ../src/Composer/Util/TlsHelper.php + + - + message: "#^Only numeric types are allowed in \\-, int\\<0, max\\>\\|false given on the right side\\.$#" + count: 1 + path: ../src/Composer/Util/TlsHelper.php + + - + message: "#^Call to function in_array\\(\\) requires parameter \\#3 to be set\\.$#" + count: 1 + path: ../src/Composer/Util/Url.php + + - + message: "#^Only booleans are allowed in an if condition, int\\|false\\|null given\\.$#" + count: 1 + path: ../src/Composer/Util/Url.php + + - + message: "#^Method Composer\\\\Util\\\\Zip\\:\\:getComposerJson\\(\\) should return string\\|null but returns string\\|false\\|null\\.$#" + count: 1 + path: ../src/Composer/Util/Zip.php + + - + message: "#^Only booleans are allowed in &&, array\\ given on the left side\\.$#" + count: 1 + path: ../src/Composer/Util/Zip.php + + - + message: "#^Parameter \\#1 \\$haystack of function strpos expects string, string\\|false given\\.$#" + count: 1 + path: ../src/Composer/Util/Zip.php + + - + message: "#^Parameter \\#1 \\$name of method ZipArchive\\:\\:getStream\\(\\) expects string, string\\|false given\\.$#" + count: 1 + path: ../src/Composer/Util/Zip.php + + - + message: "#^Parameter \\#1 \\$path of function dirname expects string, string\\|false given\\.$#" + count: 1 + path: ../src/Composer/Util/Zip.php + + - + message: "#^Only booleans are allowed in a negated boolean, Composer\\\\Autoload\\\\ClassLoader\\|null given\\.$#" + count: 2 + path: ../src/bootstrap.php + + - + message: "#^Call to function method_exists\\(\\) with 'Symfony\\\\\\\\Component…' and 'fromShellCommandline' will always evaluate to true\\.$#" + count: 1 + path: ../tests/Composer/Test/AllFunctionalTest.php + + - + message: "#^Call to method RecursiveDirectoryIterator\\:\\:getSubPathname\\(\\) with incorrect case\\: getSubPathName$#" + count: 1 + path: ../tests/Composer/Test/AllFunctionalTest.php + + - + message: "#^Method Composer\\\\Test\\\\AllFunctionalTest\\:\\:getTestFiles\\(\\) should return array\\\\> but returns array\\\\>\\.$#" + count: 1 + path: ../tests/Composer/Test/AllFunctionalTest.php + + - + message: "#^Only booleans are allowed in an if condition, string\\|false given\\.$#" + count: 1 + path: ../tests/Composer/Test/AllFunctionalTest.php + + - + message: "#^Only booleans are allowed in an if condition, string\\|null given\\.$#" + count: 1 + path: ../tests/Composer/Test/AllFunctionalTest.php + + - + message: "#^Only booleans are allowed in \\|\\|, string given on the right side\\.$#" + count: 1 + path: ../tests/Composer/Test/AllFunctionalTest.php + + - + message: "#^Only numeric types are allowed in \\-, int\\<0, max\\>\\|false given on the left side\\.$#" + count: 3 + path: ../tests/Composer/Test/AllFunctionalTest.php + + - + message: "#^Parameter \\#2 \\$subject of static method Composer\\\\Pcre\\\\Preg\\:\\:split\\(\\) expects string, string\\|false given\\.$#" + count: 1 + path: ../tests/Composer/Test/AllFunctionalTest.php + + - + message: "#^Anonymous function uses \\$this assigned to variable \\$that\\. Use \\$this directly in the function body\\.$#" + count: 3 + path: ../tests/Composer/Test/Autoload/AutoloadGeneratorTest.php + + - + message: "#^Dynamic call to static method Composer\\\\Test\\\\Autoload\\\\AutoloadGeneratorTest\\:\\:assertFileContentEquals\\(\\)\\.$#" + count: 28 + path: ../tests/Composer/Test/Autoload/AutoloadGeneratorTest.php + + - + message: "#^Dynamic call to static method Composer\\\\Test\\\\TestCase\\:\\:ensureDirectoryExistsAndClear\\(\\)\\.$#" + count: 1 + path: ../tests/Composer/Test/Autoload/AutoloadGeneratorTest.php + + - + message: "#^Dynamic call to static method Composer\\\\Test\\\\TestCase\\:\\:getUniqueTmpDirectory\\(\\)\\.$#" + count: 1 + path: ../tests/Composer/Test/Autoload/AutoloadGeneratorTest.php + + - + message: "#^Only booleans are allowed in an if condition, array\\ given\\.$#" + count: 2 + path: ../tests/Composer/Test/Autoload/AutoloadGeneratorTest.php + + - + message: "#^Parameter \\#1 \\$include_path of function set_include_path expects string, string\\|false given\\.$#" + count: 2 + path: ../tests/Composer/Test/Autoload/AutoloadGeneratorTest.php + + - + message: "#^Parameter \\#2 \\$haystack of method PHPUnit\\\\Framework\\\\Assert\\:\\:assertStringContainsString\\(\\) expects string, string\\|false given\\.$#" + count: 8 + path: ../tests/Composer/Test/Autoload/AutoloadGeneratorTest.php + + - + message: "#^Parameter \\#2 \\$haystack of method PHPUnit\\\\Framework\\\\Assert\\:\\:assertStringNotContainsString\\(\\) expects string, string\\|false given\\.$#" + count: 3 + path: ../tests/Composer/Test/Autoload/AutoloadGeneratorTest.php + + - + message: "#^Property Composer\\\\Test\\\\Autoload\\\\AutoloadGeneratorTest\\:\\:\\$origDir \\(string\\) does not accept string\\|false\\.$#" + count: 1 + path: ../tests/Composer/Test/Autoload/AutoloadGeneratorTest.php + + - + message: "#^Dynamic call to static method Composer\\\\Test\\\\TestCase\\:\\:ensureDirectoryExistsAndClear\\(\\)\\.$#" + count: 1 + path: ../tests/Composer/Test/Autoload/ClassMapGeneratorTest.php + + - + message: "#^Dynamic call to static method Composer\\\\Test\\\\TestCase\\:\\:getUniqueTmpDirectory\\(\\)\\.$#" + count: 2 + path: ../tests/Composer/Test/Autoload/ClassMapGeneratorTest.php + + - + message: "#^Parameter \\#1 \\$expected of method Composer\\\\Test\\\\Autoload\\\\ClassMapGeneratorTest\\:\\:assertEqualsNormalized\\(\\) expects array\\, array\\ given\\.$#" + count: 3 + path: ../tests/Composer/Test/Autoload/ClassMapGeneratorTest.php + + - + message: "#^Parameter \\#2 \\$actual of method Composer\\\\Test\\\\Autoload\\\\ClassMapGeneratorTest\\:\\:assertEqualsNormalized\\(\\) expects array\\, array\\ given\\.$#" + count: 3 + path: ../tests/Composer/Test/Autoload/ClassMapGeneratorTest.php + + - + message: "#^Dynamic call to static method Composer\\\\Test\\\\TestCase\\:\\:getUniqueTmpDirectory\\(\\)\\.$#" + count: 1 + path: ../tests/Composer/Test/CacheTest.php + + - + message: "#^Dynamic call to static method Composer\\\\Test\\\\TestCase\\:\\:getUniqueTmpDirectory\\(\\)\\.$#" + count: 1 + path: ../tests/Composer/Test/Config/JsonConfigSourceTest.php + + - + message: "#^Short ternary operator is not allowed\\. Use null coalesce operator if applicable or consider using long ternary\\.$#" + count: 1 + path: ../tests/Composer/Test/Config/JsonConfigSourceTest.php + + - + message: "#^Only booleans are allowed in an if condition, array\\|null given\\.$#" + count: 1 + path: ../tests/Composer/Test/ConfigTest.php + + - + message: "#^Parameter \\#1 \\$string of function rtrim expects string, string\\|false given\\.$#" + count: 2 + path: ../tests/Composer/Test/ConfigTest.php + + - + message: "#^Short ternary operator is not allowed\\. Use null coalesce operator if applicable or consider using long ternary\\.$#" + count: 2 + path: ../tests/Composer/Test/ConfigTest.php + + - + message: "#^Call to an undefined method Composer\\\\Package\\\\CompleteAliasPackage\\|Composer\\\\Package\\\\CompletePackage\\:\\:setProvides\\(\\)\\.$#" + count: 2 + path: ../tests/Composer/Test/DependencyResolver/DefaultPolicyTest.php + + - + message: "#^Call to an undefined method Composer\\\\Package\\\\CompleteAliasPackage\\|Composer\\\\Package\\\\CompletePackage\\:\\:setReplaces\\(\\)\\.$#" + count: 3 + path: ../tests/Composer/Test/DependencyResolver/DefaultPolicyTest.php + + - + message: "#^Casting to string something that's already string\\.$#" + count: 3 + path: ../tests/Composer/Test/DependencyResolver/PoolBuilderTest.php + + - + message: "#^Construct empty\\(\\) is not allowed\\. Use more strict comparison\\.$#" + count: 11 + path: ../tests/Composer/Test/DependencyResolver/PoolBuilderTest.php + + - + message: "#^Foreach overwrites \\$section with its key variable\\.$#" + count: 1 + path: ../tests/Composer/Test/DependencyResolver/PoolBuilderTest.php + + - + message: "#^Method Composer\\\\Test\\\\DependencyResolver\\\\PoolBuilderTest\\:\\:getPackageResultSet\\(\\) should return array\\ but returns array\\\\|int\\<1, max\\>\\|string\\>\\.$#" + count: 1 + path: ../tests/Composer/Test/DependencyResolver/PoolBuilderTest.php + + - + message: "#^Only booleans are allowed in &&, mixed given on the right side\\.$#" + count: 2 + path: ../tests/Composer/Test/DependencyResolver/PoolBuilderTest.php + + - + message: "#^Only booleans are allowed in an if condition, int\\|false given\\.$#" + count: 2 + path: ../tests/Composer/Test/DependencyResolver/PoolBuilderTest.php + + - + message: "#^Only booleans are allowed in an if condition, string\\|null given\\.$#" + count: 1 + path: ../tests/Composer/Test/DependencyResolver/PoolBuilderTest.php + + - + message: "#^Parameter \\#1 \\$directory of class RecursiveDirectoryIterator constructor expects string, string\\|false given\\.$#" + count: 1 + path: ../tests/Composer/Test/DependencyResolver/PoolBuilderTest.php + + - + message: "#^Parameter \\#1 \\$directory of function chdir expects string, string\\|false given\\.$#" + count: 1 + path: ../tests/Composer/Test/DependencyResolver/PoolBuilderTest.php + + - + message: "#^Parameter \\#1 \\$filename of function file_get_contents expects string, string\\|false given\\.$#" + count: 1 + path: ../tests/Composer/Test/DependencyResolver/PoolBuilderTest.php + + - + message: "#^Parameter \\#2 \\$fixturesDir of method Composer\\\\Test\\\\DependencyResolver\\\\PoolBuilderTest\\:\\:readTestFile\\(\\) expects string, string\\|false given\\.$#" + count: 1 + path: ../tests/Composer/Test/DependencyResolver/PoolBuilderTest.php + + - + message: "#^Parameter \\#2 \\$packageIds of method Composer\\\\Test\\\\DependencyResolver\\\\PoolBuilderTest\\:\\:getPackageResultSet\\(\\) expects array\\, array\\ given\\.$#" + count: 2 + path: ../tests/Composer/Test/DependencyResolver/PoolBuilderTest.php + + - + message: "#^Parameter \\#2 \\$subject of static method Composer\\\\Pcre\\\\Preg\\:\\:split\\(\\) expects string, string\\|false given\\.$#" + count: 1 + path: ../tests/Composer/Test/DependencyResolver/PoolBuilderTest.php + + - + message: "#^Parameter \\#2 \\.\\.\\.\\$values of function sprintf expects bool\\|float\\|int\\|string\\|null, array\\|string given\\.$#" + count: 2 + path: ../tests/Composer/Test/DependencyResolver/PoolBuilderTest.php + + - + message: "#^Construct empty\\(\\) is not allowed\\. Use more strict comparison\\.$#" + count: 1 + path: ../tests/Composer/Test/DependencyResolver/PoolOptimizerTest.php + + - + message: "#^Foreach overwrites \\$section with its key variable\\.$#" + count: 1 + path: ../tests/Composer/Test/DependencyResolver/PoolOptimizerTest.php + + - + message: "#^Parameter \\#1 \\$directory of class RecursiveDirectoryIterator constructor expects string, string\\|false given\\.$#" + count: 1 + path: ../tests/Composer/Test/DependencyResolver/PoolOptimizerTest.php + + - + message: "#^Parameter \\#1 \\$filename of function file_get_contents expects string, string\\|false given\\.$#" + count: 1 + path: ../tests/Composer/Test/DependencyResolver/PoolOptimizerTest.php + + - + message: "#^Parameter \\#2 \\$fixturesDir of method Composer\\\\Test\\\\DependencyResolver\\\\PoolOptimizerTest\\:\\:readTestFile\\(\\) expects string, string\\|false given\\.$#" + count: 1 + path: ../tests/Composer/Test/DependencyResolver/PoolOptimizerTest.php + + - + message: "#^Parameter \\#2 \\$subject of static method Composer\\\\Pcre\\\\Preg\\:\\:split\\(\\) expects string, string\\|false given\\.$#" + count: 1 + path: ../tests/Composer/Test/DependencyResolver/PoolOptimizerTest.php + + - + message: "#^Parameter \\#2 \\.\\.\\.\\$values of function sprintf expects bool\\|float\\|int\\|string\\|null, array\\|string given\\.$#" + count: 2 + path: ../tests/Composer/Test/DependencyResolver/PoolOptimizerTest.php + + - + message: "#^Parameter \\#1 \\$packages of class Composer\\\\DependencyResolver\\\\Pool constructor expects array\\, array\\\\|null given\\.$#" + count: 1 + path: ../tests/Composer/Test/DependencyResolver/PoolTest.php + + - + message: "#^Cannot access offset 'hash' on array\\|false\\.$#" + count: 1 + path: ../tests/Composer/Test/DependencyResolver/RuleTest.php + + - + message: "#^Call to an undefined method Composer\\\\Package\\\\CompleteAliasPackage\\|Composer\\\\Package\\\\CompletePackage\\:\\:setConflicts\\(\\)\\.$#" + count: 2 + path: ../tests/Composer/Test/DependencyResolver/SolverTest.php + + - + message: "#^Call to an undefined method Composer\\\\Package\\\\CompleteAliasPackage\\|Composer\\\\Package\\\\CompletePackage\\:\\:setProvides\\(\\)\\.$#" + count: 3 + path: ../tests/Composer/Test/DependencyResolver/SolverTest.php + + - + message: "#^Call to an undefined method Composer\\\\Package\\\\CompleteAliasPackage\\|Composer\\\\Package\\\\CompletePackage\\:\\:setReplaces\\(\\)\\.$#" + count: 9 + path: ../tests/Composer/Test/DependencyResolver/SolverTest.php + + - + message: "#^Call to an undefined method Composer\\\\Package\\\\CompleteAliasPackage\\|Composer\\\\Package\\\\CompletePackage\\:\\:setRequires\\(\\)\\.$#" + count: 46 + path: ../tests/Composer/Test/DependencyResolver/SolverTest.php + + - + message: "#^Cannot access property \\$testFlagLearnedPositiveLiteral on Composer\\\\DependencyResolver\\\\Solver\\|null\\.$#" + count: 2 + path: ../tests/Composer/Test/DependencyResolver/SolverTest.php + + - + message: "#^Cannot call method solve\\(\\) on Composer\\\\DependencyResolver\\\\Solver\\|null\\.$#" + count: 8 + path: ../tests/Composer/Test/DependencyResolver/SolverTest.php + + - + message: "#^Parameter \\#1 \\$package of method Composer\\\\Test\\\\TestCase\\:\\:getAliasPackage\\(\\) expects Composer\\\\Package\\\\Package, Composer\\\\Package\\\\CompleteAliasPackage\\|Composer\\\\Package\\\\CompletePackage given\\.$#" + count: 5 + path: ../tests/Composer/Test/DependencyResolver/SolverTest.php + + - + message: "#^Call to an undefined method Composer\\\\Package\\\\CompleteAliasPackage\\|Composer\\\\Package\\\\CompletePackage\\:\\:setExtra\\(\\)\\.$#" + count: 2 + path: ../tests/Composer/Test/DependencyResolver/TransactionTest.php + + - + message: "#^Call to an undefined method Composer\\\\Package\\\\CompleteAliasPackage\\|Composer\\\\Package\\\\CompletePackage\\:\\:setProvides\\(\\)\\.$#" + count: 1 + path: ../tests/Composer/Test/DependencyResolver/TransactionTest.php + + - + message: "#^Call to an undefined method Composer\\\\Package\\\\CompleteAliasPackage\\|Composer\\\\Package\\\\CompletePackage\\:\\:setRequires\\(\\)\\.$#" + count: 3 + path: ../tests/Composer/Test/DependencyResolver/TransactionTest.php + + - + message: "#^Call to an undefined method Composer\\\\Package\\\\CompleteAliasPackage\\|Composer\\\\Package\\\\CompletePackage\\:\\:setType\\(\\)\\.$#" + count: 2 + path: ../tests/Composer/Test/DependencyResolver/TransactionTest.php + + - + message: "#^Parameter \\#1 \\$package of method Composer\\\\Test\\\\TestCase\\:\\:getAliasPackage\\(\\) expects Composer\\\\Package\\\\Package, Composer\\\\Package\\\\CompleteAliasPackage\\|Composer\\\\Package\\\\CompletePackage given\\.$#" + count: 4 + path: ../tests/Composer/Test/DependencyResolver/TransactionTest.php + + - + message: "#^Only booleans are allowed in a ternary operator condition, int\\<0, max\\>\\|false given\\.$#" + count: 1 + path: ../tests/Composer/Test/Downloader/ArchiveDownloaderTest.php + + - + message: "#^Only booleans are allowed in an if condition, string\\|null given\\.$#" + count: 1 + path: ../tests/Composer/Test/Downloader/DownloadManagerTest.php + + - + message: "#^Anonymous function uses \\$this assigned to variable \\$self\\. Use \\$this directly in the function body\\.$#" + count: 6 + path: ../tests/Composer/Test/Downloader/FileDownloaderTest.php + + - + message: "#^Dynamic call to static method Composer\\\\Test\\\\TestCase\\:\\:getUniqueTmpDirectory\\(\\)\\.$#" + count: 6 + path: ../tests/Composer/Test/Downloader/FileDownloaderTest.php + + - + message: "#^Parameter \\#1 \\$promises of method Composer\\\\Util\\\\Loop\\:\\:wait\\(\\) expects array\\, array\\ given\\.$#" + count: 5 + path: ../tests/Composer/Test/Downloader/FileDownloaderTest.php + + - + message: "#^Short ternary operator is not allowed\\. Use null coalesce operator if applicable or consider using long ternary\\.$#" + count: 3 + path: ../tests/Composer/Test/Downloader/FileDownloaderTest.php + + - + message: "#^Dynamic call to static method Composer\\\\Test\\\\TestCase\\:\\:getUniqueTmpDirectory\\(\\)\\.$#" + count: 1 + path: ../tests/Composer/Test/Downloader/FossilDownloaderTest.php + + - + message: "#^Short ternary operator is not allowed\\. Use null coalesce operator if applicable or consider using long ternary\\.$#" + count: 4 + path: ../tests/Composer/Test/Downloader/FossilDownloaderTest.php + + - + message: "#^Dynamic call to static method Composer\\\\Test\\\\TestCase\\:\\:getUniqueTmpDirectory\\(\\)\\.$#" + count: 1 + path: ../tests/Composer/Test/Downloader/GitDownloaderTest.php + + - + message: "#^Only booleans are allowed in a negated boolean, Composer\\\\Config\\|null given\\.$#" + count: 1 + path: ../tests/Composer/Test/Downloader/GitDownloaderTest.php + + - + message: "#^Short ternary operator is not allowed\\. Use null coalesce operator if applicable or consider using long ternary\\.$#" + count: 3 + path: ../tests/Composer/Test/Downloader/GitDownloaderTest.php + + - + message: "#^Dynamic call to static method Composer\\\\Test\\\\TestCase\\:\\:getUniqueTmpDirectory\\(\\)\\.$#" + count: 1 + path: ../tests/Composer/Test/Downloader/HgDownloaderTest.php + + - + message: "#^Short ternary operator is not allowed\\. Use null coalesce operator if applicable or consider using long ternary\\.$#" + count: 4 + path: ../tests/Composer/Test/Downloader/HgDownloaderTest.php + + - + message: "#^Dynamic call to static method Composer\\\\Test\\\\TestCase\\:\\:getUniqueTmpDirectory\\(\\)\\.$#" + count: 1 + path: ../tests/Composer/Test/Downloader/PerforceDownloaderTest.php + + - + message: "#^Dynamic call to static method Composer\\\\Test\\\\TestCase\\:\\:getUniqueTmpDirectory\\(\\)\\.$#" + count: 1 + path: ../tests/Composer/Test/Downloader/XzDownloaderTest.php + + - + message: "#^Parameter \\#1 \\$promises of method Composer\\\\Util\\\\Loop\\:\\:wait\\(\\) expects array\\, array\\ given\\.$#" + count: 1 + path: ../tests/Composer/Test/Downloader/XzDownloaderTest.php + + - + message: "#^Dynamic call to static method Composer\\\\Test\\\\TestCase\\:\\:getUniqueTmpDirectory\\(\\)\\.$#" + count: 1 + path: ../tests/Composer/Test/Downloader/ZipDownloaderTest.php + + - + message: "#^Parameter \\#1 \\$promises of method Composer\\\\Util\\\\Loop\\:\\:wait\\(\\) expects array\\, array\\ given\\.$#" + count: 1 + path: ../tests/Composer/Test/Downloader/ZipDownloaderTest.php + + - + message: "#^Only booleans are allowed in a negated boolean, string\\|false given\\.$#" + count: 2 + path: ../tests/Composer/Test/EventDispatcher/EventDispatcherTest.php + + - + message: "#^Only booleans are allowed in an if condition, string\\|false given\\.$#" + count: 1 + path: ../tests/Composer/Test/EventDispatcher/EventDispatcherTest.php + + - + message: "#^Parameter \\#1 \\$directory of function chdir expects string, string\\|false given\\.$#" + count: 1 + path: ../tests/Composer/Test/EventDispatcher/EventDispatcherTest.php + + - + message: "#^Parameter \\#2 \\$haystack of static method PHPUnit\\\\Framework\\\\Assert\\:\\:assertStringContainsString\\(\\) expects string, string\\|false given\\.$#" + count: 1 + path: ../tests/Composer/Test/EventDispatcher/EventDispatcherTest.php + + - + message: "#^Parameter \\#2 \\$haystack of static method PHPUnit\\\\Framework\\\\Assert\\:\\:assertStringNotContainsString\\(\\) expects string, string\\|false given\\.$#" + count: 1 + path: ../tests/Composer/Test/EventDispatcher/EventDispatcherTest.php + + - + message: "#^Call to function is_array\\(\\) with array\\ will always evaluate to true\\.$#" + count: 1 + path: ../tests/Composer/Test/IO/NullIOTest.php + + - + message: """ + #^Call to deprecated method getRawData\\(\\) of class Composer\\\\InstalledVersions\\: + Use getAllRawData\\(\\) instead which returns all datasets for all autoloaders present in the process\\. getRawData only returns the first dataset loaded, which may not be what you expect\\.$# + """ + count: 1 + path: ../tests/Composer/Test/InstalledVersionsTest.php + + - + message: "#^Dynamic call to static method Composer\\\\Test\\\\TestCase\\:\\:getUniqueTmpDirectory\\(\\)\\.$#" + count: 1 + path: ../tests/Composer/Test/InstalledVersionsTest.php + + - + message: "#^Parameter \\#1 \\$path of function realpath expects string, string\\|null given\\.$#" + count: 1 + path: ../tests/Composer/Test/InstalledVersionsTest.php + + - + message: "#^Call to function base64_decode\\(\\) requires parameter \\#2 to be set\\.$#" + count: 1 + path: ../tests/Composer/Test/Installer/BinaryInstallerTest.php + + - + message: "#^Dynamic call to static method Composer\\\\Test\\\\TestCase\\:\\:ensureDirectoryExistsAndClear\\(\\)\\.$#" + count: 3 + path: ../tests/Composer/Test/Installer/BinaryInstallerTest.php + + - + message: "#^Dynamic call to static method Composer\\\\Test\\\\TestCase\\:\\:getUniqueTmpDirectory\\(\\)\\.$#" + count: 1 + path: ../tests/Composer/Test/Installer/BinaryInstallerTest.php + + - + message: "#^Call to method PHPUnit\\\\Framework\\\\Assert\\:\\:assertInstanceOf\\(\\) with 'Composer\\\\\\\\Composer' and Composer\\\\Composer will always evaluate to true\\.$#" + count: 1 + path: ../tests/Composer/Test/Installer/InstallerEventTest.php + + - + message: "#^Call to method PHPUnit\\\\Framework\\\\Assert\\:\\:assertInstanceOf\\(\\) with 'Composer\\\\\\\\IO…' and Composer\\\\IO\\\\IOInterface will always evaluate to true\\.$#" + count: 1 + path: ../tests/Composer/Test/Installer/InstallerEventTest.php + + - + message: "#^Dynamic call to static method Composer\\\\Test\\\\TestCase\\:\\:ensureDirectoryExistsAndClear\\(\\)\\.$#" + count: 2 + path: ../tests/Composer/Test/Installer/LibraryInstallerTest.php + + - + message: "#^Dynamic call to static method Composer\\\\Test\\\\TestCase\\:\\:getUniqueTmpDirectory\\(\\)\\.$#" + count: 1 + path: ../tests/Composer/Test/Installer/LibraryInstallerTest.php + + - + message: "#^Call to an undefined method Composer\\\\Package\\\\CompleteAliasPackage\\|Composer\\\\Package\\\\CompletePackage\\:\\:setRequires\\(\\)\\.$#" + count: 4 + path: ../tests/Composer/Test/InstallerTest.php + + - + message: "#^Call to function is_array\\(\\) with array\\ will always evaluate to true\\.$#" + count: 1 + path: ../tests/Composer/Test/InstallerTest.php + + - + message: "#^Construct empty\\(\\) is not allowed\\. Use more strict comparison\\.$#" + count: 9 + path: ../tests/Composer/Test/InstallerTest.php + + - + message: "#^Foreach overwrites \\$section with its key variable\\.$#" + count: 1 + path: ../tests/Composer/Test/InstallerTest.php + + - + message: "#^Only booleans are allowed in &&, array\\|false given on the left side\\.$#" + count: 1 + path: ../tests/Composer/Test/InstallerTest.php + + - + message: "#^Only booleans are allowed in a ternary operator condition, array\\|null given\\.$#" + count: 1 + path: ../tests/Composer/Test/InstallerTest.php + + - + message: "#^Only booleans are allowed in an if condition, array\\|false given\\.$#" + count: 1 + path: ../tests/Composer/Test/InstallerTest.php + + - + message: "#^Only booleans are allowed in an if condition, string\\|null given\\.$#" + count: 2 + path: ../tests/Composer/Test/InstallerTest.php + + - + message: "#^Parameter \\#1 \\$directory of class RecursiveDirectoryIterator constructor expects string, string\\|false given\\.$#" + count: 1 + path: ../tests/Composer/Test/InstallerTest.php + + - + message: "#^Parameter \\#1 \\$filename of function file_get_contents expects string, string\\|false given\\.$#" + count: 1 + path: ../tests/Composer/Test/InstallerTest.php + + - + message: "#^Parameter \\#1 \\$json of function json_decode expects string, string\\|false\\|null given\\.$#" + count: 1 + path: ../tests/Composer/Test/InstallerTest.php + + - + message: "#^Parameter \\#1 \\$json of function json_decode expects string, string\\|null given\\.$#" + count: 1 + path: ../tests/Composer/Test/InstallerTest.php + + - + message: "#^Parameter \\#1 \\$str of function strtr expects string, string\\|false given\\.$#" + count: 1 + path: ../tests/Composer/Test/InstallerTest.php + + - + message: "#^Parameter \\#2 \\$fixturesDir of method Composer\\\\Test\\\\InstallerTest\\:\\:readTestFile\\(\\) expects string, string\\|false given\\.$#" + count: 1 + path: ../tests/Composer/Test/InstallerTest.php + + - + message: "#^Parameter \\#2 \\$subject of static method Composer\\\\Pcre\\\\Preg\\:\\:split\\(\\) expects string, string\\|false given\\.$#" + count: 1 + path: ../tests/Composer/Test/InstallerTest.php + + - + message: "#^Parameter \\#2 \\.\\.\\.\\$values of function sprintf expects bool\\|float\\|int\\|string\\|null, array\\|string given\\.$#" + count: 2 + path: ../tests/Composer/Test/InstallerTest.php + + - + message: "#^Parameter \\#4 \\$composerFileContents of class Composer\\\\Package\\\\Locker constructor expects string, string\\|false given\\.$#" + count: 1 + path: ../tests/Composer/Test/InstallerTest.php + + - + message: "#^Property Composer\\\\Test\\\\InstallerTest\\:\\:\\$prevCwd \\(string\\) does not accept string\\|false\\.$#" + count: 1 + path: ../tests/Composer/Test/InstallerTest.php + + - + message: "#^Short ternary operator is not allowed\\. Use null coalesce operator if applicable or consider using long ternary\\.$#" + count: 5 + path: ../tests/Composer/Test/InstallerTest.php + + - + message: "#^Dynamic call to static method Composer\\\\Json\\\\JsonFile\\:\\:encode\\(\\)\\.$#" + count: 4 + path: ../tests/Composer/Test/Json/JsonFileTest.php + + - + message: "#^Parameter \\#1 \\$version1 of function version_compare expects string, string\\|false given\\.$#" + count: 1 + path: ../tests/Composer/Test/Json/JsonFileTest.php + + - + message: "#^Parameter \\#1 \\$contents of class Composer\\\\Json\\\\JsonManipulator constructor expects string, string\\|false given\\.$#" + count: 1 + path: ../tests/Composer/Test/Json/JsonManipulatorTest.php + + - + message: "#^Parameter \\#1 \\$expectedJson of method PHPUnit\\\\Framework\\\\Assert\\:\\:assertJsonStringEqualsJsonString\\(\\) expects string, string\\|false given\\.$#" + count: 1 + path: ../tests/Composer/Test/Json/JsonManipulatorTest.php + + - + message: "#^Parameter \\#1 \\$message of class Composer\\\\Json\\\\JsonValidationException constructor expects string, string\\|null given\\.$#" + count: 1 + path: ../tests/Composer/Test/Json/JsonValidationExceptionTest.php + + - + message: "#^Parameter \\#2 \\$errors of class Composer\\\\Json\\\\JsonValidationException constructor expects array\\, array\\\\|null given\\.$#" + count: 1 + path: ../tests/Composer/Test/Json/JsonValidationExceptionTest.php + + - + message: "#^Property Composer\\\\Test\\\\Mock\\\\HttpDownloaderMock\\:\\:\\$defaultHandler \\(array\\{status\\: int, body\\: string, headers\\: array\\\\}\\) does not accept non\\-empty\\-array\\\\|int\\|string\\>\\.$#" + count: 1 + path: ../tests/Composer/Test/Mock/HttpDownloaderMock.php + + - + message: "#^Property Composer\\\\Test\\\\Mock\\\\HttpDownloaderMock\\:\\:\\$expectations \\(array\\\\}\\>\\|null\\) does not accept array\\\\>\\.$#" + count: 1 + path: ../tests/Composer/Test/Mock/HttpDownloaderMock.php + + - + message: "#^Composer\\\\Test\\\\Mock\\\\InstallationManagerMock\\:\\:__construct\\(\\) does not call parent constructor from Composer\\\\Installer\\\\InstallationManager\\.$#" + count: 1 + path: ../tests/Composer/Test/Mock/InstallationManagerMock.php + + - + message: "#^Variable method call on \\$this\\(Composer\\\\Test\\\\Mock\\\\InstallationManagerMock\\)\\.$#" + count: 1 + path: ../tests/Composer/Test/Mock/InstallationManagerMock.php + + - + message: "#^Only booleans are allowed in an elseif condition, array\\ given\\.$#" + count: 1 + path: ../tests/Composer/Test/Mock/ProcessExecutorMock.php + + - + message: "#^Only booleans are allowed in an if condition, string given\\.$#" + count: 2 + path: ../tests/Composer/Test/Mock/ProcessExecutorMock.php + + - + message: "#^Parameter \\#2 \\$cwd of method Composer\\\\Test\\\\Mock\\\\ProcessExecutorMock\\:\\:doExecute\\(\\) expects string, string\\|null given\\.$#" + count: 4 + path: ../tests/Composer/Test/Mock/ProcessExecutorMock.php + + - + message: "#^Property Composer\\\\Test\\\\Mock\\\\ProcessExecutorMock\\:\\:\\$defaultHandler \\(array\\{return\\: int, stdout\\: string, stderr\\: string\\}\\) does not accept non\\-empty\\-array\\\\.$#" + count: 1 + path: ../tests/Composer/Test/Mock/ProcessExecutorMock.php + + - + message: "#^Property Composer\\\\Test\\\\Mock\\\\ProcessExecutorMock\\:\\:\\$expectations \\(array\\\\|null\\) does not accept array\\\\>\\.$#" + count: 1 + path: ../tests/Composer/Test/Mock/ProcessExecutorMock.php + + - + message: "#^Composer\\\\Test\\\\Mock\\\\VersionGuesserMock\\:\\:__construct\\(\\) does not call parent constructor from Composer\\\\Package\\\\Version\\\\VersionGuesser\\.$#" + count: 1 + path: ../tests/Composer/Test/Mock/VersionGuesserMock.php + + - + message: "#^Call to function method_exists\\(\\) with 'Symfony\\\\\\\\Component…' and 'fromShellCommandline' will always evaluate to true\\.$#" + count: 1 + path: ../tests/Composer/Test/Package/Archiver/ArchivableFilesFinderTest.php + + - + message: "#^Dynamic call to static method Composer\\\\Test\\\\TestCase\\:\\:getUniqueTmpDirectory\\(\\)\\.$#" + count: 1 + path: ../tests/Composer/Test/Package/Archiver/ArchivableFilesFinderTest.php + + - + message: "#^Dynamic call to static method Composer\\\\Factory\\:\\:createConfig\\(\\)\\.$#" + count: 1 + path: ../tests/Composer/Test/Package/Archiver/ArchiveManagerTest.php + + - + message: "#^Dynamic call to static method Composer\\\\Factory\\:\\:createHttpDownloader\\(\\)\\.$#" + count: 1 + path: ../tests/Composer/Test/Package/Archiver/ArchiveManagerTest.php + + - + message: "#^Parameter \\#1 \\$directory of function chdir expects string, string\\|false given\\.$#" + count: 8 + path: ../tests/Composer/Test/Package/Archiver/ArchiveManagerTest.php + + - + message: "#^Dynamic call to static method Composer\\\\Test\\\\TestCase\\:\\:getUniqueTmpDirectory\\(\\)\\.$#" + count: 1 + path: ../tests/Composer/Test/Package/Archiver/ArchiverTest.php + + - + message: "#^Parameter \\#1 \\$url of method Composer\\\\Package\\\\Package\\:\\:setSourceUrl\\(\\) expects string, string\\|false given\\.$#" + count: 1 + path: ../tests/Composer/Test/Package/Archiver/ArchiverTest.php + + - + message: "#^Dynamic call to static method Composer\\\\Test\\\\TestCase\\:\\:getUniqueTmpDirectory\\(\\)\\.$#" + count: 2 + path: ../tests/Composer/Test/Package/Archiver/PharArchiverTest.php + + - + message: "#^Parameter \\#1 \\$directory of function chdir expects string, string\\|false given\\.$#" + count: 1 + path: ../tests/Composer/Test/Package/Archiver/PharArchiverTest.php + + - + message: "#^Parameter \\#1 \\$sources of method Composer\\\\Package\\\\Archiver\\\\PharArchiver\\:\\:archive\\(\\) expects string, string\\|null given\\.$#" + count: 2 + path: ../tests/Composer/Test/Package/Archiver/PharArchiverTest.php + + - + message: "#^Parameter \\#3 \\$currentWorkDir of method Composer\\\\Test\\\\Package\\\\Archiver\\\\PharArchiverTest\\:\\:writeFile\\(\\) expects string, string\\|false given\\.$#" + count: 5 + path: ../tests/Composer/Test/Package/Archiver/PharArchiverTest.php + + - + message: "#^Construct empty\\(\\) is not allowed\\. Use more strict comparison\\.$#" + count: 1 + path: ../tests/Composer/Test/Package/Archiver/ZipArchiverTest.php + + - + message: "#^Parameter \\#1 \\$directory of function chdir expects string, string\\|false given\\.$#" + count: 1 + path: ../tests/Composer/Test/Package/Archiver/ZipArchiverTest.php + + - + message: "#^Parameter \\#1 \\$sources of method Composer\\\\Package\\\\Archiver\\\\ZipArchiver\\:\\:archive\\(\\) expects string, string\\|null given\\.$#" + count: 1 + path: ../tests/Composer/Test/Package/Archiver/ZipArchiverTest.php + + - + message: "#^Parameter \\#3 \\$currentWorkDir of method Composer\\\\Test\\\\Package\\\\Archiver\\\\ZipArchiverTest\\:\\:writeFile\\(\\) expects string, string\\|false given\\.$#" + count: 1 + path: ../tests/Composer/Test/Package/Archiver/ZipArchiverTest.php + + - + message: "#^Anonymous function uses \\$this assigned to variable \\$self\\. Use \\$this directly in the function body\\.$#" + count: 1 + path: ../tests/Composer/Test/Package/BasePackageTest.php + + - + message: "#^Implicit array creation is not allowed \\- variable \\$provider does not exist\\.$#" + count: 1 + path: ../tests/Composer/Test/Package/CompletePackageTest.php + + - + message: "#^Short ternary operator is not allowed\\. Use null coalesce operator if applicable or consider using long ternary\\.$#" + count: 2 + path: ../tests/Composer/Test/Package/Dumper/ArrayDumperTest.php + + - + message: "#^Call to method PHPUnit\\\\Framework\\\\Assert\\:\\:assertTrue\\(\\) with true will always evaluate to true\\.$#" + count: 1 + path: ../tests/Composer/Test/Package/Loader/ValidatingArrayLoaderTest.php + + - + message: "#^Offset 'commit' does not exist on array\\{version\\: string, commit\\: string\\|null, pretty_version\\: string\\|null, feature_version\\?\\: string\\|null, feature_pretty_version\\?\\: string\\|null\\}\\|null\\.$#" + count: 6 + path: ../tests/Composer/Test/Package/Version/VersionGuesserTest.php + + - + message: "#^Offset 'feature_pretty…' does not exist on array\\{version\\: string, commit\\: string\\|null, pretty_version\\: string\\|null, feature_version\\?\\: string\\|null, feature_pretty_version\\?\\: string\\|null\\}\\|null\\.$#" + count: 2 + path: ../tests/Composer/Test/Package/Version/VersionGuesserTest.php + + - + message: "#^Offset 'feature_version' does not exist on array\\{version\\: string, commit\\: string\\|null, pretty_version\\: string\\|null, feature_version\\?\\: string\\|null, feature_pretty_version\\?\\: string\\|null\\}\\|null\\.$#" + count: 2 + path: ../tests/Composer/Test/Package/Version/VersionGuesserTest.php + + - + message: "#^Offset 'pretty_version' does not exist on array\\{version\\: string, commit\\: string\\|null, pretty_version\\: string\\|null, feature_version\\?\\: string\\|null, feature_pretty_version\\?\\: string\\|null\\}\\|null\\.$#" + count: 5 + path: ../tests/Composer/Test/Package/Version/VersionGuesserTest.php + + - + message: "#^Offset 'version' does not exist on array\\{version\\: string, commit\\: string\\|null, pretty_version\\: string\\|null, feature_version\\?\\: string\\|null, feature_pretty_version\\?\\: string\\|null\\}\\|null\\.$#" + count: 14 + path: ../tests/Composer/Test/Package/Version/VersionGuesserTest.php + + - + message: "#^Parameter \\#2 \\$array of method PHPUnit\\\\Framework\\\\Assert\\:\\:assertArrayNotHasKey\\(\\) expects array\\|ArrayAccess, array\\\\|null given\\.$#" + count: 4 + path: ../tests/Composer/Test/Package/Version/VersionGuesserTest.php + + - + message: "#^Only booleans are allowed in an if condition, string\\|null given\\.$#" + count: 1 + path: ../tests/Composer/Test/Package/Version/VersionSelectorTest.php + + - + message: "#^Dynamic call to static method Composer\\\\Test\\\\TestCase\\:\\:getVersionParser\\(\\)\\.$#" + count: 1 + path: ../tests/Composer/Test/Platform/VersionTest.php + + - + message: "#^Only booleans are allowed in a ternary operator condition, string\\|null given\\.$#" + count: 1 + path: ../tests/Composer/Test/Platform/VersionTest.php + + - + message: "#^Array \\(array\\\\) does not accept Composer\\\\Package\\\\CompleteAliasPackage\\|Composer\\\\Package\\\\CompletePackage\\.$#" + count: 1 + path: ../tests/Composer/Test/Plugin/PluginInstallerTest.php + + - + message: "#^Call to method PHPUnit\\\\Framework\\\\Assert\\:\\:assertInstanceOf\\(\\) with 'Composer\\\\\\\\Command…' and Composer\\\\Command\\\\BaseCommand will always evaluate to true\\.$#" + count: 1 + path: ../tests/Composer/Test/Plugin/PluginInstallerTest.php + + - + message: "#^Call to method PHPUnit\\\\Framework\\\\Assert\\:\\:assertInstanceOf\\(\\) with 'Composer\\\\\\\\Plugin…' and Composer\\\\Plugin\\\\Capability\\\\CommandProvider will always evaluate to true\\.$#" + count: 1 + path: ../tests/Composer/Test/Plugin/PluginInstallerTest.php + + - + message: "#^Call to method PHPUnit\\\\Framework\\\\Assert\\:\\:assertInstanceOf\\(\\) with 'Composer\\\\\\\\Plugin…' and Composer\\\\Test\\\\Plugin\\\\Mock\\\\Capability will always evaluate to true\\.$#" + count: 1 + path: ../tests/Composer/Test/Plugin/PluginInstallerTest.php + + - + message: "#^Call to method PHPUnit\\\\Framework\\\\Assert\\:\\:assertInstanceOf\\(\\) with 'Composer\\\\\\\\Test…' and Composer\\\\Test\\\\Plugin\\\\Mock\\\\Capability will always evaluate to true\\.$#" + count: 1 + path: ../tests/Composer/Test/Plugin/PluginInstallerTest.php + + - + message: "#^Dynamic call to static method Composer\\\\Test\\\\TestCase\\:\\:getUniqueTmpDirectory\\(\\)\\.$#" + count: 1 + path: ../tests/Composer/Test/Plugin/PluginInstallerTest.php + + - + message: "#^Parameter \\#2 \\$capabilityClassName of method Composer\\\\Plugin\\\\PluginManager\\:\\:getPluginCapability\\(\\) expects class\\-string\\, string given\\.$#" + count: 2 + path: ../tests/Composer/Test/Plugin/PluginInstallerTest.php + + - + message: "#^Unable to resolve the template type CapabilityClass in call to method Composer\\\\Plugin\\\\PluginManager\\:\\:getPluginCapability\\(\\)$#" + count: 2 + path: ../tests/Composer/Test/Plugin/PluginInstallerTest.php + + - + message: "#^Instanceof between Symfony\\\\Component\\\\Console\\\\Input\\\\ArrayInput and Symfony\\\\Component\\\\Console\\\\Input\\\\StreamableInputInterface will always evaluate to true\\.$#" + count: 1 + path: ../tests/Composer/Test/Question/StrictConfirmationQuestionTest.php + + - + message: "#^Parameter \\#1 \\$stream of class Symfony\\\\Component\\\\Console\\\\Output\\\\StreamOutput constructor expects resource, resource\\|false given\\.$#" + count: 1 + path: ../tests/Composer/Test/Question/StrictConfirmationQuestionTest.php + + - + message: "#^Call to an undefined method Composer\\\\Package\\\\CompleteAliasPackage\\|Composer\\\\Package\\\\CompletePackage\\:\\:setType\\(\\)\\.$#" + count: 1 + path: ../tests/Composer/Test/Repository/ArrayRepositoryTest.php + + - + message: "#^Parameter \\#1 \\$package of method Composer\\\\Test\\\\TestCase\\:\\:getAliasPackage\\(\\) expects Composer\\\\Package\\\\Package, Composer\\\\Package\\\\CompleteAliasPackage\\|Composer\\\\Package\\\\CompletePackage given\\.$#" + count: 1 + path: ../tests/Composer/Test/Repository/ArrayRepositoryTest.php + + - + message: "#^Cannot call method getDistType\\(\\) on Composer\\\\Package\\\\BasePackage\\|null\\.$#" + count: 1 + path: ../tests/Composer/Test/Repository/ArtifactRepositoryTest.php + + - + message: "#^Parameter \\#1 \\$haystack of function strpos expects string, string\\|null given\\.$#" + count: 2 + path: ../tests/Composer/Test/Repository/ArtifactRepositoryTest.php + + - + message: "#^Cannot call method getName\\(\\) on Composer\\\\Package\\\\BasePackage\\|null\\.$#" + count: 2 + path: ../tests/Composer/Test/Repository/CompositeRepositoryTest.php + + - + message: "#^Cannot call method getPrettyVersion\\(\\) on Composer\\\\Package\\\\BasePackage\\|null\\.$#" + count: 2 + path: ../tests/Composer/Test/Repository/CompositeRepositoryTest.php + + - + message: "#^Parameter \\#1 \\$callback of function call_user_func_array expects callable\\(\\)\\: mixed, array\\{Composer\\\\Repository\\\\CompositeRepository, string\\} given\\.$#" + count: 1 + path: ../tests/Composer/Test/Repository/CompositeRepositoryTest.php + + - + message: "#^Call to an undefined method Composer\\\\Package\\\\CompleteAliasPackage\\|Composer\\\\Package\\\\CompletePackage\\:\\:setType\\(\\)\\.$#" + count: 1 + path: ../tests/Composer/Test/Repository/FilesystemRepositoryTest.php + + - + message: "#^Dynamic call to static method Composer\\\\Test\\\\TestCase\\:\\:getUniqueTmpDirectory\\(\\)\\.$#" + count: 1 + path: ../tests/Composer/Test/Repository/FilesystemRepositoryTest.php + + - + message: "#^Parameter \\#1 \\$package of method Composer\\\\Test\\\\TestCase\\:\\:getAliasPackage\\(\\) expects Composer\\\\Package\\\\Package, Composer\\\\Package\\\\CompleteAliasPackage\\|Composer\\\\Package\\\\CompletePackage given\\.$#" + count: 2 + path: ../tests/Composer/Test/Repository/FilesystemRepositoryTest.php + + - + message: "#^Call to an undefined method Composer\\\\Package\\\\CompleteAliasPackage\\|Composer\\\\Package\\\\CompletePackage\\:\\:setProvides\\(\\)\\.$#" + count: 1 + path: ../tests/Composer/Test/Repository/InstalledRepositoryTest.php + + - + message: "#^Call to an undefined method Composer\\\\Package\\\\CompleteAliasPackage\\|Composer\\\\Package\\\\CompletePackage\\:\\:setReplaces\\(\\)\\.$#" + count: 1 + path: ../tests/Composer/Test/Repository/InstalledRepositoryTest.php + + - + message: "#^Parameter \\#1 \\$path of function realpath expects string, string\\|false given\\.$#" + count: 3 + path: ../tests/Composer/Test/Repository/PathRepositoryTest.php + + - + message: "#^Parameter \\#1 \\$string of function strlen expects string, string\\|false given\\.$#" + count: 1 + path: ../tests/Composer/Test/Repository/PathRepositoryTest.php + + - + message: "#^Call to method PHPUnit\\\\Framework\\\\Assert\\:\\:assertInstanceOf\\(\\) with 'Composer\\\\\\\\Repository…' and Composer\\\\Repository\\\\FilterRepository will always evaluate to true\\.$#" + count: 1 + path: ../tests/Composer/Test/Repository/RepositoryManagerTest.php + + - + message: "#^Call to method PHPUnit\\\\Framework\\\\Assert\\:\\:assertInstanceOf\\(\\) with 'Composer\\\\\\\\Repository…' and Composer\\\\Repository\\\\RepositoryInterface will always evaluate to true\\.$#" + count: 1 + path: ../tests/Composer/Test/Repository/RepositoryManagerTest.php + + - + message: "#^Dynamic call to static method Composer\\\\Test\\\\TestCase\\:\\:getUniqueTmpDirectory\\(\\)\\.$#" + count: 1 + path: ../tests/Composer/Test/Repository/RepositoryManagerTest.php + + - + message: "#^Dynamic call to static method Composer\\\\Test\\\\TestCase\\:\\:getUniqueTmpDirectory\\(\\)\\.$#" + count: 1 + path: ../tests/Composer/Test/Repository/Vcs/FossilDriverTest.php + + - + message: "#^Dynamic call to static method Composer\\\\Test\\\\TestCase\\:\\:getUniqueTmpDirectory\\(\\)\\.$#" + count: 1 + path: ../tests/Composer/Test/Repository/Vcs/GitBitbucketDriverTest.php + + - + message: "#^Dynamic call to static method Composer\\\\Test\\\\TestCase\\:\\:getUniqueTmpDirectory\\(\\)\\.$#" + count: 1 + path: ../tests/Composer/Test/Repository/Vcs/GitHubDriverTest.php + + - + message: "#^Offset 'reference' does not exist on array\\{type\\: string, url\\: string, reference\\: string, shasum\\: string\\}\\|null\\.$#" + count: 4 + path: ../tests/Composer/Test/Repository/Vcs/GitHubDriverTest.php + + - + message: "#^Offset 'type' does not exist on array\\{type\\: string, url\\: string, reference\\: string, shasum\\: string\\}\\|null\\.$#" + count: 4 + path: ../tests/Composer/Test/Repository/Vcs/GitHubDriverTest.php + + - + message: "#^Offset 'url' does not exist on array\\{type\\: string, url\\: string, reference\\: string, shasum\\: string\\}\\|null\\.$#" + count: 4 + path: ../tests/Composer/Test/Repository/Vcs/GitHubDriverTest.php + + - + message: "#^Parameter \\#1 \\$objectOrValue of method ReflectionProperty\\:\\:setValue\\(\\) expects object\\|null, object\\|string given\\.$#" + count: 1 + path: ../tests/Composer/Test/Repository/Vcs/GitHubDriverTest.php + + - + message: "#^Dynamic call to static method Composer\\\\Test\\\\TestCase\\:\\:getUniqueTmpDirectory\\(\\)\\.$#" + count: 1 + path: ../tests/Composer/Test/Repository/Vcs/GitLabDriverTest.php + + - + message: "#^Dynamic call to static method Composer\\\\Test\\\\TestCase\\:\\:getUniqueTmpDirectory\\(\\)\\.$#" + count: 1 + path: ../tests/Composer/Test/Repository/Vcs/HgDriverTest.php + + - + message: "#^Dynamic call to static method Composer\\\\Test\\\\TestCase\\:\\:getUniqueTmpDirectory\\(\\)\\.$#" + count: 1 + path: ../tests/Composer/Test/Repository/Vcs/PerforceDriverTest.php + + - + message: "#^Parameter \\#1 \\$repoConfig of class Composer\\\\Repository\\\\Vcs\\\\PerforceDriver constructor expects array\\{url\\: string\\}, array\\ given\\.$#" + count: 1 + path: ../tests/Composer/Test/Repository/Vcs/PerforceDriverTest.php + + - + message: "#^Dynamic call to static method Composer\\\\Test\\\\TestCase\\:\\:getUniqueTmpDirectory\\(\\)\\.$#" + count: 1 + path: ../tests/Composer/Test/Repository/Vcs/SvnDriverTest.php + + - + message: "#^Dynamic call to static method Composer\\\\Test\\\\TestCase\\:\\:getUniqueTmpDirectory\\(\\)\\.$#" + count: 2 + path: ../tests/Composer/Test/Repository/VcsRepositoryTest.php + + - + message: "#^Only booleans are allowed in a negated boolean, string given\\.$#" + count: 1 + path: ../tests/Composer/Test/Repository/VcsRepositoryTest.php + + - + message: "#^Only booleans are allowed in a negated boolean, string\\|null given\\.$#" + count: 1 + path: ../tests/Composer/Test/Repository/VcsRepositoryTest.php + + - + message: "#^Only booleans are allowed in an if condition, string\\|null given\\.$#" + count: 1 + path: ../tests/Composer/Test/Repository/VcsRepositoryTest.php + + - + message: "#^Parameter \\#1 \\$directory of function chdir expects string, string\\|false given\\.$#" + count: 1 + path: ../tests/Composer/Test/Repository/VcsRepositoryTest.php + + - + message: "#^Parameter \\#3 \\$cwd of method Composer\\\\Util\\\\ProcessExecutor\\:\\:execute\\(\\) expects string\\|null, string\\|false given\\.$#" + count: 1 + path: ../tests/Composer/Test/Repository/VcsRepositoryTest.php + + - + message: "#^Method Composer\\\\Test\\\\TestCase\\:\\:getPackage\\(\\) should return Composer\\\\Package\\\\CompleteAliasPackage\\|Composer\\\\Package\\\\CompletePackage but returns PackageClass of Composer\\\\Package\\\\PackageInterface\\.$#" + count: 1 + path: ../tests/Composer/Test/TestCase.php + + - + message: "#^Method Composer\\\\Test\\\\TestCase\\:\\:getUniqueTmpDirectory\\(\\) should return string but returns string\\|false\\.$#" + count: 1 + path: ../tests/Composer/Test/TestCase.php + + - + message: "#^Only booleans are allowed in &&, mixed given on the right side\\.$#" + count: 1 + path: ../tests/Composer/Test/TestCase.php + + - + message: "#^Only booleans are allowed in a negated boolean, Composer\\\\Semver\\\\VersionParser\\|null given\\.$#" + count: 1 + path: ../tests/Composer/Test/TestCase.php + + - + message: "#^Variable method call on Composer\\\\Package\\\\PackageInterface\\.$#" + count: 1 + path: ../tests/Composer/Test/TestCase.php + + - + message: "#^Dynamic call to static method Composer\\\\Test\\\\TestCase\\:\\:getUniqueTmpDirectory\\(\\)\\.$#" + count: 2 + path: ../tests/Composer/Test/Util/FilesystemTest.php + + - + message: "#^Anonymous function uses \\$this assigned to variable \\$that\\. Use \\$this directly in the function body\\.$#" + count: 2 + path: ../tests/Composer/Test/Util/GitTest.php + + - + message: "#^Call to method PHPUnit\\\\Framework\\\\Assert\\:\\:assertInstanceOf\\(\\) with 'Composer\\\\\\\\Util\\\\\\\\Http…' and Composer\\\\Util\\\\Http\\\\ProxyManager will always evaluate to true\\.$#" + count: 1 + path: ../tests/Composer/Test/Util/Http/ProxyManagerTest.php + + - + message: "#^Call to method PHPUnit\\\\Framework\\\\Assert\\:\\:assertInstanceOf\\(\\) with 'Composer\\\\\\\\Util\\\\\\\\Http…' and Composer\\\\Util\\\\Http\\\\RequestProxy will always evaluate to true\\.$#" + count: 1 + path: ../tests/Composer/Test/Util/Http/ProxyManagerTest.php + + - + message: "#^Only booleans are allowed in an if condition, string given\\.$#" + count: 2 + path: ../tests/Composer/Test/Util/Http/ProxyManagerTest.php + + - + message: "#^Parameter \\#1 \\$haystack of function stripos expects string, string\\|null given\\.$#" + count: 1 + path: ../tests/Composer/Test/Util/Http/ProxyManagerTest.php + + - + message: "#^Only booleans are allowed in an if condition, string\\|false\\|null given\\.$#" + count: 1 + path: ../tests/Composer/Test/Util/NoProxyPatternTest.php + + - + message: "#^Implicit array creation is not allowed \\- variable \\$packages does not exist\\.$#" + count: 1 + path: ../tests/Composer/Test/Util/PackageSorterTest.php + + - + message: "#^Call to method Composer\\\\Util\\\\Perforce\\:\\:queryP4User\\(\\) with incorrect case\\: queryP4user$#" + count: 6 + path: ../tests/Composer/Test/Util/PerforceTest.php + + - + message: "#^Dynamic call to static method Composer\\\\Util\\\\Perforce\\:\\:checkServerExists\\(\\)\\.$#" + count: 2 + path: ../tests/Composer/Test/Util/PerforceTest.php + + - + message: "#^Parameter \\#2 \\$string of method PHPUnit\\\\Framework\\\\Assert\\:\\:assertStringStartsWith\\(\\) expects string, string\\|false given\\.$#" + count: 2 + path: ../tests/Composer/Test/Util/PerforceTest.php + + - + message: "#^Short ternary operator is not allowed\\. Use null coalesce operator if applicable or consider using long ternary\\.$#" + count: 1 + path: ../tests/Composer/Test/Util/PlatformTest.php + + - + message: "#^Call to method PHPUnit\\\\Framework\\\\Assert\\:\\:assertNotNull\\(\\) with string will always evaluate to true\\.$#" + count: 1 + path: ../tests/Composer/Test/Util/ProcessExecutorTest.php + + - + message: "#^Dynamic call to static method Composer\\\\Util\\\\ProcessExecutor\\:\\:getTimeout\\(\\)\\.$#" + count: 1 + path: ../tests/Composer/Test/Util/ProcessExecutorTest.php + + - + message: "#^Call to method PHPUnit\\\\Framework\\\\Assert\\:\\:assertTrue\\(\\) with true and 'callbackGet must…' will always evaluate to true\\.$#" + count: 1 + path: ../tests/Composer/Test/Util/RemoteFilesystemTest.php + + - + message: "#^Parameter \\#1 \\$object of method ReflectionProperty\\:\\:getValue\\(\\) expects object\\|null, object\\|string given\\.$#" + count: 1 + path: ../tests/Composer/Test/Util/RemoteFilesystemTest.php + + - + message: "#^Parameter \\#1 \\$objectOrValue of method ReflectionProperty\\:\\:setValue\\(\\) expects object\\|null, object\\|string given\\.$#" + count: 1 + path: ../tests/Composer/Test/Util/RemoteFilesystemTest.php + + - + message: "#^Parameter \\#1 \\$originUrl of method Composer\\\\Util\\\\RemoteFilesystem\\:\\:getContents\\(\\) expects string, string\\|false\\|null given\\.$#" + count: 2 + path: ../tests/Composer/Test/Util/RemoteFilesystemTest.php + + - + message: "#^Parameter \\#2 \\$haystack of method PHPUnit\\\\Framework\\\\Assert\\:\\:assertStringContainsString\\(\\) expects string, bool\\|string given\\.$#" + count: 1 + path: ../tests/Composer/Test/Util/RemoteFilesystemTest.php + + - + message: "#^Parameter \\#2 \\$haystack of method PHPUnit\\\\Framework\\\\Assert\\:\\:assertStringContainsString\\(\\) expects string, string\\|false given\\.$#" + count: 2 + path: ../tests/Composer/Test/Util/RemoteFilesystemTest.php + + - + message: "#^Implicit array creation is not allowed \\- variable \\$certificate does not exist\\.$#" + count: 2 + path: ../tests/Composer/Test/Util/TlsHelperTest.php + + - + message: "#^Offset 'cn' does not exist on array\\{cn\\: string, san\\: array\\\\}\\|null\\.$#" + count: 1 + path: ../tests/Composer/Test/Util/TlsHelperTest.php + + - + message: "#^Offset 'san' does not exist on array\\{cn\\: string, san\\: array\\\\}\\|null\\.$#" + count: 1 + path: ../tests/Composer/Test/Util/TlsHelperTest.php + + - + message: "#^Only booleans are allowed in a ternary operator condition, array\\ given\\.$#" + count: 1 + path: ../tests/Composer/Test/Util/TlsHelperTest.php + diff --git a/phpstan/baseline.neon b/phpstan/baseline.neon index af31ad97d..5fadcc72c 100644 --- a/phpstan/baseline.neon +++ b/phpstan/baseline.neon @@ -950,11 +950,6 @@ parameters: count: 1 path: ../src/Composer/Command/GlobalCommand.php - - - message: "#^Return type \\(int\\|void\\) of method Composer\\\\Command\\\\GlobalCommand\\:\\:run\\(\\) should be covariant with return type \\(int\\) of method Symfony\\\\Component\\\\Console\\\\Command\\\\Command\\:\\:run\\(\\)$#" - count: 1 - path: ../src/Composer/Command/GlobalCommand.php - - message: "#^Cannot call method getPackage\\(\\) on Composer\\\\Composer\\|null\\.$#" count: 1 @@ -2440,16 +2435,6 @@ parameters: count: 3 path: ../src/Composer/Compiler.php - - - message: "#^Only booleans are allowed in an if condition, array\\ given\\.$#" - count: 1 - path: ../src/Composer/Compiler.php - - - - message: "#^Only booleans are allowed in an if condition, array\\ given\\.$#" - count: 1 - path: ../src/Composer/Compiler.php - - message: "#^Parameter \\#1 \\$haystack of function strpos expects string, string\\|false given\\.$#" count: 1 @@ -4235,6 +4220,11 @@ parameters: count: 2 path: ../src/Composer/Installer/InstallationManager.php + - + message: "#^Constant PHP_WINDOWS_EVENT_CTRL_C not found\\.$#" + count: 1 + path: ../src/Composer/Installer/InstallationManager.php + - message: "#^Construct empty\\(\\) is not allowed\\. Use more strict comparison\\.$#" count: 1 @@ -4245,6 +4235,11 @@ parameters: count: 2 path: ../src/Composer/Installer/InstallationManager.php + - + message: "#^Function sapi_windows_set_ctrl_handler not found\\.$#" + count: 3 + path: ../src/Composer/Installer/InstallationManager.php + - message: "#^Only booleans are allowed in &&, Composer\\\\EventDispatcher\\\\EventDispatcher\\|null given on the right side\\.$#" count: 2 @@ -6745,6 +6740,16 @@ parameters: count: 2 path: ../src/Composer/Util/Http/CurlDownloader.php + - + message: "#^Constant CURLOPT_PROXY_CAINFO not found\\.$#" + count: 1 + path: ../src/Composer/Util/Http/CurlDownloader.php + + - + message: "#^Constant CURLOPT_PROXY_CAPATH not found\\.$#" + count: 1 + path: ../src/Composer/Util/Http/CurlDownloader.php + - message: "#^Construct empty\\(\\) is not allowed\\. Use more strict comparison\\.$#" count: 3 @@ -8450,12 +8455,12 @@ parameters: path: ../tests/Composer/Test/Json/JsonValidationExceptionTest.php - - message: "#^Composer\\\\Test\\\\Mock\\\\HttpDownloaderMock\\:\\:__construct\\(\\) does not call parent constructor from Composer\\\\Util\\\\HttpDownloader\\.$#" + message: "#^Property Composer\\\\Test\\\\Mock\\\\HttpDownloaderMock\\:\\:\\$defaultHandler \\(array\\{status\\: int, body\\: string, headers\\: array\\\\}\\) does not accept non\\-empty\\-array\\\\|int\\|string\\>\\.$#" count: 1 path: ../tests/Composer/Test/Mock/HttpDownloaderMock.php - - message: "#^Construct empty\\(\\) is not allowed\\. Use more strict comparison\\.$#" + message: "#^Property Composer\\\\Test\\\\Mock\\\\HttpDownloaderMock\\:\\:\\$expectations \\(array\\\\}\\>\\|null\\) does not accept array\\\\>\\.$#" count: 1 path: ../tests/Composer/Test/Mock/HttpDownloaderMock.php @@ -8469,31 +8474,11 @@ parameters: count: 1 path: ../tests/Composer/Test/Mock/InstallationManagerMock.php - - - message: "#^Call to method PHPUnit\\\\Framework\\\\Assert\\:\\:assertTrue\\(\\) with true will always evaluate to true\\.$#" - count: 1 - path: ../tests/Composer/Test/Mock/ProcessExecutorMock.php - - - - message: "#^Only booleans are allowed in &&, array\\\\> given on the left side\\.$#" - count: 1 - path: ../tests/Composer/Test/Mock/ProcessExecutorMock.php - - - - message: "#^Only booleans are allowed in a ternary operator condition, array\\\\> given\\.$#" - count: 1 - path: ../tests/Composer/Test/Mock/ProcessExecutorMock.php - - message: "#^Only booleans are allowed in an elseif condition, array\\ given\\.$#" count: 1 path: ../tests/Composer/Test/Mock/ProcessExecutorMock.php - - - message: "#^Only booleans are allowed in an if condition, array\\\\> given\\.$#" - count: 1 - path: ../tests/Composer/Test/Mock/ProcessExecutorMock.php - - message: "#^Only booleans are allowed in an if condition, string given\\.$#" count: 2 @@ -8510,7 +8495,7 @@ parameters: path: ../tests/Composer/Test/Mock/ProcessExecutorMock.php - - message: "#^Property Composer\\\\Test\\\\Mock\\\\ProcessExecutorMock\\:\\:\\$expectations \\(array\\\\) does not accept array\\\\>\\.$#" + message: "#^Property Composer\\\\Test\\\\Mock\\\\ProcessExecutorMock\\:\\:\\$expectations \\(array\\\\|null\\) does not accept array\\\\>\\.$#" count: 1 path: ../tests/Composer/Test/Mock/ProcessExecutorMock.php @@ -8824,11 +8809,6 @@ parameters: count: 1 path: ../tests/Composer/Test/Repository/RepositoryManagerTest.php - - - message: "#^Only booleans are allowed in an if condition, string\\|null given\\.$#" - count: 1 - path: ../tests/Composer/Test/Repository/RepositoryManagerTest.php - - message: "#^Dynamic call to static method Composer\\\\Test\\\\TestCase\\:\\:getUniqueTmpDirectory\\(\\)\\.$#" count: 1 @@ -8869,31 +8849,6 @@ parameters: count: 1 path: ../tests/Composer/Test/Repository/Vcs/GitLabDriverTest.php - - - message: "#^Parameter \\#1 \\$io of static method Composer\\\\Repository\\\\Vcs\\\\GitLabDriver\\:\\:supports\\(\\) expects Composer\\\\IO\\\\IOInterface, object given\\.$#" - count: 1 - path: ../tests/Composer/Test/Repository/Vcs/GitLabDriverTest.php - - - - message: "#^Parameter \\#2 \\$io of class Composer\\\\Repository\\\\Vcs\\\\GitLabDriver constructor expects Composer\\\\IO\\\\IOInterface, object given\\.$#" - count: 9 - path: ../tests/Composer/Test/Repository/Vcs/GitLabDriverTest.php - - - - message: "#^Parameter \\#4 \\$body of class Composer\\\\Util\\\\Http\\\\Response constructor expects string\\|null, string\\|false given\\.$#" - count: 2 - path: ../tests/Composer/Test/Repository/Vcs/GitLabDriverTest.php - - - - message: "#^Parameter \\#4 \\$httpDownloader of class Composer\\\\Repository\\\\Vcs\\\\GitLabDriver constructor expects Composer\\\\Util\\\\HttpDownloader, object given\\.$#" - count: 9 - path: ../tests/Composer/Test/Repository/Vcs/GitLabDriverTest.php - - - - message: "#^Parameter \\#5 \\$process of class Composer\\\\Repository\\\\Vcs\\\\GitLabDriver constructor expects Composer\\\\Util\\\\ProcessExecutor, object given\\.$#" - count: 9 - path: ../tests/Composer/Test/Repository/Vcs/GitLabDriverTest.php - - message: "#^Dynamic call to static method Composer\\\\Test\\\\TestCase\\:\\:getUniqueTmpDirectory\\(\\)\\.$#" count: 1 @@ -8944,11 +8899,6 @@ parameters: count: 1 path: ../tests/Composer/Test/Repository/VcsRepositoryTest.php - - - message: "#^Call to function method_exists\\(\\) with \\$this\\(Composer\\\\Test\\\\TestCase\\) and 'expectException' will always evaluate to true\\.$#" - count: 1 - path: ../tests/Composer/Test/TestCase.php - - message: "#^Method Composer\\\\Test\\\\TestCase\\:\\:getPackage\\(\\) should return Composer\\\\Package\\\\CompleteAliasPackage\\|Composer\\\\Package\\\\CompletePackage but returns PackageClass of Composer\\\\Package\\\\PackageInterface\\.$#" count: 1 diff --git a/phpstan/config.neon b/phpstan/config.neon index 457123ae3..b13ba7e09 100644 --- a/phpstan/config.neon +++ b/phpstan/config.neon @@ -3,6 +3,7 @@ includes: - ../vendor/phpstan/phpstan-deprecation-rules/rules.neon - ../vendor/phpstan/phpstan-strict-rules/rules.neon - ./baseline.neon + - ./ignore-by-php-version.neon.php parameters: level: 8 @@ -36,22 +37,16 @@ parameters: # we don't have different constructors for parent/child - '~^Unsafe usage of new static\(\)\.$~' - # BC with older PHPUnit - - '~^Call to an undefined static method Composer\\Test\\PolyfillTestCase::setExpectedException\(\)\.$~' - - '~^Call to an undefined method Composer\\Test\\[a-zA-Z0-9\\]+::(assertFileDoesNotExist|assertMatchesRegularExpression)\(\)\.$~' - - # Mock errors - - '~^Call to an undefined method (PHPUnit\\Framework\\MockObject\\MockObject|Prophecy\\Prophecy\\ObjectProphecy)::.*$~' - # Ignore some irrelevant errors in test files - '~Method Composer\\Test\\[^:]+::(setUp(BeforeClass)?|tearDown(AfterClass)?|test[^(]+)\(\) has no return type specified.~' - '~Method Composer\\Test\\[^:]+::(data\w+|provide\w+|\w+?Provider)\(\) has no return type specified.~' # PHPUnit assertions as instance methods - '~Dynamic call to static method PHPUnit\\Framework\\Assert::\w+\(\)~' - - '~Dynamic call to static method PHPUnit\\Framework\\TestCase::(once|at|exactly|will|exactly|returnValue|returnCallback|any|atLeastOnce|throwException|onConsecutiveCalls|never|returnValueMap)\(\)~' + - '~Dynamic call to static method PHPUnit\\Framework\\TestCase::(once|atLeast|exactly|will|exactly|returnValue|returnCallback|any|atLeastOnce|throwException|onConsecutiveCalls|never|returnValueMap)\(\)~' bootstrapFiles: + - ./locate-phpunit-autoloader.php - ../tests/bootstrap.php paths: diff --git a/phpstan/ignore-by-php-version.neon.php b/phpstan/ignore-by-php-version.neon.php new file mode 100644 index 000000000..a88d63bce --- /dev/null +++ b/phpstan/ignore-by-php-version.neon.php @@ -0,0 +1,14 @@ += 80000) { + $config = array_merge_recursive($config, $adapter->load(__DIR__ . '/baseline-8.1.neon')); +} +$config['parameters']['phpVersion'] = PHP_VERSION_ID; + +return $config; diff --git a/phpstan/locate-phpunit-autoloader.php b/phpstan/locate-phpunit-autoloader.php new file mode 100644 index 000000000..93a179389 --- /dev/null +++ b/phpstan/locate-phpunit-autoloader.php @@ -0,0 +1,22 @@ += 80000 && false !== strpos($dir, 'phpunit-9')) { + break; + } + if (PHP_VERSION_ID < 80000 && false !== strpos($dir, 'phpunit-8')) { + break; + } +} + +if (null === $bestDirFound) { + echo 'Run "composer test" to initialize PHPUnit sources before running PHPStan'.PHP_EOL; + exit(1); +} + +include $bestDirFound.'/vendor/autoload.php'; diff --git a/phpunit.xml.dist b/phpunit.xml.dist index dbb5253eb..c10b24865 100644 --- a/phpunit.xml.dist +++ b/phpunit.xml.dist @@ -16,7 +16,6 @@ > - diff --git a/src/Composer/Autoload/ClassMapGenerator.php b/src/Composer/Autoload/ClassMapGenerator.php index 3ac096772..d5af18586 100644 --- a/src/Composer/Autoload/ClassMapGenerator.php +++ b/src/Composer/Autoload/ClassMapGenerator.php @@ -163,7 +163,8 @@ class ClassMapGenerator $rejectedClasses = array(); $realSubPath = substr($filePath, strlen($basePath) + 1); - $realSubPath = substr($realSubPath, 0, strrpos($realSubPath, '.')); + $dotPosition = strrpos($realSubPath, '.'); + $realSubPath = substr($realSubPath, 0, $dotPosition === false ? PHP_INT_MAX : $dotPosition); foreach ($classes as $class) { // silently skip if ns doesn't have common root @@ -226,7 +227,7 @@ class ClassMapGenerator $message = 'File at "%s" does not exist, check your classmap definitions'; } elseif (!Filesystem::isReadable($path)) { $message = 'File at "%s" is not readable, check its permissions'; - } elseif ('' === trim(file_get_contents($path))) { + } elseif ('' === trim((string) file_get_contents($path))) { // The input file was really empty and thus contains no classes return array(); } else { diff --git a/src/Composer/Cache.php b/src/Composer/Cache.php index c7da5c612..33c7bb8e5 100644 --- a/src/Composer/Cache.php +++ b/src/Composer/Cache.php @@ -218,7 +218,7 @@ class Cache $file = Preg::replace('{[^'.$this->allowlist.']}i', '-', $file); if (file_exists($this->root . $file)) { try { - touch($this->root . $file, filemtime($this->root . $file), time()); + touch($this->root . $file, (int) filemtime($this->root . $file), time()); } catch (\ErrorException $e) { // fallback in case the above failed due to incorrect ownership // see https://github.com/composer/composer/issues/4070 diff --git a/src/Composer/Command/GlobalCommand.php b/src/Composer/Command/GlobalCommand.php index ad629de4b..91aae03f0 100644 --- a/src/Composer/Command/GlobalCommand.php +++ b/src/Composer/Command/GlobalCommand.php @@ -62,10 +62,9 @@ EOT } /** - * @return int|void * @throws \Symfony\Component\Console\Exception\ExceptionInterface */ - public function run(InputInterface $input, OutputInterface $output) + public function run(InputInterface $input, OutputInterface $output): int { if (!method_exists($input, '__toString')) { throw new \LogicException('Expected an Input instance that is stringable, got '.get_class($input)); diff --git a/src/Composer/Command/SelfUpdateCommand.php b/src/Composer/Command/SelfUpdateCommand.php index 541636c1e..424940e30 100644 --- a/src/Composer/Command/SelfUpdateCommand.php +++ b/src/Composer/Command/SelfUpdateCommand.php @@ -298,6 +298,9 @@ TAGSPUBKEY } $pubkeyid = openssl_pkey_get_public($sigFile); + if (false === $pubkeyid) { + throw new \RuntimeException('Failed loading the public key from '.$sigFile); + } $algo = defined('OPENSSL_ALGO_SHA384') ? OPENSSL_ALGO_SHA384 : 'SHA384'; if (!in_array('sha384', array_map('strtolower', openssl_get_md_methods()))) { throw new \RuntimeException('SHA384 is not supported by your openssl extension, could not verify the phar file integrity'); @@ -308,6 +311,7 @@ TAGSPUBKEY // PHP 8 automatically frees the key instance and deprecates the function if (PHP_VERSION_ID < 80000) { + // @phpstan-ignore-next-line openssl_free_key($pubkeyid); } diff --git a/src/Composer/Compiler.php b/src/Composer/Compiler.php index 622965076..b0aafa74c 100644 --- a/src/Composer/Compiler.php +++ b/src/Composer/Compiler.php @@ -50,25 +50,13 @@ class Compiler unlink($pharFile); } - // TODO in v2.3 always call with an array - if (method_exists('Symfony\Component\Process\Process', 'fromShellCommandline')) { - $process = new Process(array('git', 'log', '--pretty="%H"', '-n1', 'HEAD'), __DIR__); - } else { - // @phpstan-ignore-next-line - $process = new Process('git log --pretty="%H" -n1 HEAD', __DIR__); - } + $process = new Process(array('git', 'log', '--pretty=%H', '-n1', 'HEAD'), __DIR__); if ($process->run() != 0) { throw new \RuntimeException('Can\'t run git log. You must ensure to run compile from composer git repository clone and that git binary is available.'); } $this->version = trim($process->getOutput()); - // TODO in v2.3 always call with an array - if (method_exists('Symfony\Component\Process\Process', 'fromShellCommandline')) { - $process = new Process(array('git', 'log', '-n1', '--pretty=%ci', 'HEAD'), __DIR__); - } else { - // @phpstan-ignore-next-line - $process = new Process('git log -n1 --pretty=%ci HEAD', __DIR__); - } + $process = new Process(array('git', 'log', '-n1', '--pretty=%ci', 'HEAD'), __DIR__); if ($process->run() != 0) { throw new \RuntimeException('Can\'t run git log. You must ensure to run compile from composer git repository clone and that git binary is available.'); } @@ -137,8 +125,8 @@ class Compiler $finder->files() ->ignoreVCS(true) ->notPath('/\/(composer\.(json|lock)|[A-Z]+\.md|\.gitignore|appveyor.yml|phpunit\.xml\.dist|phpstan\.neon\.dist|phpstan-config\.neon)$/') - ->notPath('/bin\/(jsonlint|validate-json|simple-phpunit)(\.bat)?$/') - ->notPath('symfony/debug/Resources/ext/') + ->notPath('/bin\/(jsonlint|validate-json|simple-phpunit|phpstan|phpstan\.phar)(\.bat)?$/') + ->notPath('symfony/console/Resources/completion.bash') ->notPath('justinrainbow/json-schema/demo/') ->notPath('justinrainbow/json-schema/dist/') ->notPath('composer/installed.json') @@ -150,13 +138,18 @@ class Compiler ->sort($finderSort) ; - $extraFiles = array( - realpath(__DIR__ . '/../../vendor/composer/spdx-licenses/res/spdx-exceptions.json'), - realpath(__DIR__ . '/../../vendor/composer/spdx-licenses/res/spdx-licenses.json'), - realpath(CaBundle::getBundledCaBundlePath()), - realpath(__DIR__ . '/../../vendor/symfony/console/Resources/bin/hiddeninput.exe'), - realpath(__DIR__ . '/../../vendor/symfony/polyfill-mbstring/Resources/mb_convert_variables.php8'), - ); + $extraFiles = []; + foreach (array( + __DIR__ . '/../../vendor/composer/spdx-licenses/res/spdx-exceptions.json', + __DIR__ . '/../../vendor/composer/spdx-licenses/res/spdx-licenses.json', + CaBundle::getBundledCaBundlePath(), + __DIR__ . '/../../vendor/symfony/console/Resources/bin/hiddeninput.exe', + ) as $file) { + $extraFiles[$file] = realpath($file); + if (!file_exists($file)) { + throw new \RuntimeException('Extra file listed is missing from the filesystem: '.$file); + } + } $unexpectedFiles = array(); foreach ($finder as $file) { @@ -173,11 +166,11 @@ class Compiler } } - if ($extraFiles) { - throw new \RuntimeException('These files were expected but not added to the phar, they might be excluded or gone from the source package:'.PHP_EOL.implode(PHP_EOL, $extraFiles)); + if (count($extraFiles) > 0) { + throw new \RuntimeException('These files were expected but not added to the phar, they might be excluded or gone from the source package:'.PHP_EOL.var_export($extraFiles, true)); } - if ($unexpectedFiles) { - throw new \RuntimeException('These files were unexpectedly added to the phar, make sure they are excluded or listed in $extraFiles:'.PHP_EOL.implode(PHP_EOL, $unexpectedFiles)); + if (count($unexpectedFiles) > 0) { + throw new \RuntimeException('These files were unexpectedly added to the phar, make sure they are excluded or listed in $extraFiles:'.PHP_EOL.var_export($unexpectedFiles, true)); } // Add bin/composer @@ -200,7 +193,14 @@ class Compiler $util->updateTimestamps($this->versionDate); $util->save($pharFile, \Phar::SHA512); - Linter::lint($pharFile); + Linter::lint($pharFile, [ + 'vendor/symfony/console/Attribute/AsCommand.php', + 'vendor/symfony/polyfill-intl-grapheme/bootstrap80.php', + 'vendor/symfony/polyfill-intl-normalizer/bootstrap80.php', + 'vendor/symfony/polyfill-mbstring/bootstrap80.php', + 'vendor/symfony/polyfill-php73/Resources/stubs/JsonException.php', + 'vendor/symfony/service-contracts/Attribute/SubscribedService.php', + ]); } /** diff --git a/src/Composer/Composer.php b/src/Composer/Composer.php index 624e02507..749c9e35d 100644 --- a/src/Composer/Composer.php +++ b/src/Composer/Composer.php @@ -55,7 +55,7 @@ class Composer const VERSION = '@package_version@'; const BRANCH_ALIAS_VERSION = '@package_branch_alias_version@'; const RELEASE_DATE = '@release_date@'; - const SOURCE_VERSION = '2.2.999-dev+source'; + const SOURCE_VERSION = '2.3.999-dev+source'; /** * Version number of the internal composer-runtime-api package diff --git a/src/Composer/Console/Application.php b/src/Composer/Console/Application.php index b5af14af8..cc9f08685 100644 --- a/src/Composer/Console/Application.php +++ b/src/Composer/Console/Application.php @@ -119,10 +119,7 @@ class Application extends BaseApplication parent::__construct('Composer', Composer::getVersion()); } - /** - * @return int - */ - public function run(InputInterface $input = null, OutputInterface $output = null) + public function run(InputInterface $input = null, OutputInterface $output = null): int { if (null === $output) { $output = Factory::createOutput(); @@ -131,10 +128,7 @@ class Application extends BaseApplication return parent::run($input, $output); } - /** - * @return int - */ - public function doRun(InputInterface $input, OutputInterface $output) + public function doRun(InputInterface $input, OutputInterface $output): int { $this->disablePluginsByDefault = $input->hasParameterOption('--no-plugins'); $this->disableScriptsByDefault = $input->hasParameterOption('--no-scripts'); @@ -483,10 +477,7 @@ class Application extends BaseApplication return $this->io; } - /** - * @return string - */ - public function getHelp() + public function getHelp(): string { return self::$logo . parent::getHelp(); } @@ -495,7 +486,7 @@ class Application extends BaseApplication * Initializes all the composer commands. * @return \Symfony\Component\Console\Command\Command[] */ - protected function getDefaultCommands() + protected function getDefaultCommands(): array { $commands = array_merge(parent::getDefaultCommands(), array( new Command\AboutCommand(), @@ -535,10 +526,7 @@ class Application extends BaseApplication return $commands; } - /** - * @return string - */ - public function getLongVersion() + public function getLongVersion(): string { if (Composer::BRANCH_ALIAS_VERSION && Composer::BRANCH_ALIAS_VERSION !== '@package_branch_alias_version'.'@') { return sprintf( @@ -553,10 +541,7 @@ class Application extends BaseApplication return parent::getLongVersion() . ' ' . Composer::RELEASE_DATE; } - /** - * @return InputDefinition - */ - protected function getDefaultInputDefinition() + protected function getDefaultInputDefinition(): InputDefinition { $definition = parent::getDefaultInputDefinition(); $definition->addOption(new InputOption('--profile', null, InputOption::VALUE_NONE, 'Display timing and memory usage information')); diff --git a/src/Composer/Console/HtmlOutputFormatter.php b/src/Composer/Console/HtmlOutputFormatter.php index 7fc0876ec..fcb8fab4b 100644 --- a/src/Composer/Console/HtmlOutputFormatter.php +++ b/src/Composer/Console/HtmlOutputFormatter.php @@ -60,12 +60,7 @@ class HtmlOutputFormatter extends OutputFormatter parent::__construct(true, $styles); } - /** - * @param ?string $message - * - * @return string - */ - public function format($message) + public function format(?string $message): ?string { $formatted = parent::format($message); diff --git a/src/Composer/DependencyResolver/Decisions.php b/src/Composer/DependencyResolver/Decisions.php index 8dfd8d86d..6a4809d5d 100644 --- a/src/Composer/DependencyResolver/Decisions.php +++ b/src/Composer/DependencyResolver/Decisions.php @@ -205,20 +205,12 @@ class Decisions implements \Iterator, \Countable array_pop($this->decisionQueue); } - /** - * @return int - */ - #[\ReturnTypeWillChange] - public function count() + public function count(): int { return \count($this->decisionQueue); } - /** - * @return void - */ - #[\ReturnTypeWillChange] - public function rewind() + public function rewind(): void { end($this->decisionQueue); } @@ -232,29 +224,17 @@ class Decisions implements \Iterator, \Countable return current($this->decisionQueue); } - /** - * @return ?int - */ - #[\ReturnTypeWillChange] - public function key() + public function key(): ?int { return key($this->decisionQueue); } - /** - * @return void - */ - #[\ReturnTypeWillChange] - public function next() + public function next(): void { prev($this->decisionQueue); } - /** - * @return bool - */ - #[\ReturnTypeWillChange] - public function valid() + public function valid(): bool { return false !== current($this->decisionQueue); } diff --git a/src/Composer/DependencyResolver/Pool.php b/src/Composer/DependencyResolver/Pool.php index 857f62df8..0fa5783e4 100644 --- a/src/Composer/DependencyResolver/Pool.php +++ b/src/Composer/DependencyResolver/Pool.php @@ -129,10 +129,8 @@ class Pool implements \Countable /** * Returns how many packages have been loaded into the pool - * @return int */ - #[\ReturnTypeWillChange] - public function count() + public function count(): int { return \count($this->packages); } diff --git a/src/Composer/DependencyResolver/RuleSet.php b/src/Composer/DependencyResolver/RuleSet.php index b754046a6..47868178f 100644 --- a/src/Composer/DependencyResolver/RuleSet.php +++ b/src/Composer/DependencyResolver/RuleSet.php @@ -103,11 +103,7 @@ class RuleSet implements \IteratorAggregate, \Countable } } - /** - * @return int - */ - #[\ReturnTypeWillChange] - public function count() + public function count(): int { return $this->nextRuleId; } @@ -127,11 +123,7 @@ class RuleSet implements \IteratorAggregate, \Countable return $this->rules; } - /** - * @return RuleSetIterator - */ - #[\ReturnTypeWillChange] - public function getIterator() + public function getIterator(): RuleSetIterator { return new RuleSetIterator($this->getRules()); } diff --git a/src/Composer/DependencyResolver/RuleSetIterator.php b/src/Composer/DependencyResolver/RuleSetIterator.php index 1450c1cba..e7afb55d3 100644 --- a/src/Composer/DependencyResolver/RuleSetIterator.php +++ b/src/Composer/DependencyResolver/RuleSetIterator.php @@ -42,11 +42,7 @@ class RuleSetIterator implements \Iterator $this->rewind(); } - /** - * @return Rule - */ - #[\ReturnTypeWillChange] - public function current() + public function current(): Rule { return $this->rules[$this->currentType][$this->currentOffset]; } @@ -54,17 +50,12 @@ class RuleSetIterator implements \Iterator /** * @return RuleSet::TYPE_*|-1 */ - #[\ReturnTypeWillChange] - public function key() + public function key(): int { return $this->currentType; } - /** - * @return void - */ - #[\ReturnTypeWillChange] - public function next() + public function next(): void { $this->currentOffset++; @@ -88,11 +79,7 @@ class RuleSetIterator implements \Iterator } } - /** - * @return void - */ - #[\ReturnTypeWillChange] - public function rewind() + public function rewind(): void { $this->currentOffset = 0; @@ -111,11 +98,7 @@ class RuleSetIterator implements \Iterator } while (isset($this->types[$this->currentTypeOffset]) && !\count($this->rules[$this->currentType])); } - /** - * @return bool - */ - #[\ReturnTypeWillChange] - public function valid() + public function valid(): bool { return isset($this->rules[$this->currentType], $this->rules[$this->currentType][$this->currentOffset]); } diff --git a/src/Composer/IO/BaseIO.php b/src/Composer/IO/BaseIO.php index 24a0c3b62..33cc14eef 100644 --- a/src/Composer/IO/BaseIO.php +++ b/src/Composer/IO/BaseIO.php @@ -159,74 +159,47 @@ abstract class BaseIO implements IOInterface ProcessExecutor::setTimeout((int) $config->get('process-timeout')); } - /** - * @return void - */ - public function emergency($message, array $context = array()) + public function emergency($message, array $context = array()): void { $this->log(LogLevel::EMERGENCY, $message, $context); } - /** - * @return void - */ - public function alert($message, array $context = array()) + public function alert($message, array $context = array()): void { $this->log(LogLevel::ALERT, $message, $context); } - /** - * @return void - */ - public function critical($message, array $context = array()) + public function critical($message, array $context = array()): void { $this->log(LogLevel::CRITICAL, $message, $context); } - /** - * @return void - */ - public function error($message, array $context = array()) + public function error($message, array $context = array()): void { $this->log(LogLevel::ERROR, $message, $context); } - /** - * @return void - */ - public function warning($message, array $context = array()) + public function warning($message, array $context = array()): void { $this->log(LogLevel::WARNING, $message, $context); } - /** - * @return void - */ - public function notice($message, array $context = array()) + public function notice($message, array $context = array()): void { $this->log(LogLevel::NOTICE, $message, $context); } - /** - * @return void - */ - public function info($message, array $context = array()) + public function info($message, array $context = array()): void { $this->log(LogLevel::INFO, $message, $context); } - /** - * @return void - */ - public function debug($message, array $context = array()) + public function debug($message, array $context = array()): void { $this->log(LogLevel::DEBUG, $message, $context); } - /** - * @return void - */ - public function log($level, $message, array $context = array()) + public function log($level, $message, array $context = array()): void { if (in_array($level, array(LogLevel::EMERGENCY, LogLevel::ALERT, LogLevel::CRITICAL, LogLevel::ERROR))) { $this->writeError(''.$message.''); diff --git a/src/Composer/Installer/InstallationManager.php b/src/Composer/Installer/InstallationManager.php index 07e6709c7..e1d3d2ee2 100644 --- a/src/Composer/Installer/InstallationManager.php +++ b/src/Composer/Installer/InstallationManager.php @@ -223,7 +223,7 @@ class InstallationManager }; $handleInterruptsUnix = function_exists('pcntl_async_signals') && function_exists('pcntl_signal'); - $handleInterruptsWindows = function_exists('sapi_windows_set_ctrl_handler') && PHP_SAPI === 'cli'; + $handleInterruptsWindows = PHP_VERSION_ID >= 70400 && function_exists('sapi_windows_set_ctrl_handler') && PHP_SAPI === 'cli'; $prevHandler = null; $windowsHandler = null; if ($handleInterruptsUnix) { diff --git a/src/Composer/Package/Archiver/ArchivableFilesFilter.php b/src/Composer/Package/Archiver/ArchivableFilesFilter.php index 6f25923d7..3242df7e8 100644 --- a/src/Composer/Package/Archiver/ArchivableFilesFilter.php +++ b/src/Composer/Package/Archiver/ArchivableFilesFilter.php @@ -23,8 +23,7 @@ class ArchivableFilesFilter extends FilterIterator /** * @return bool true if the current element is acceptable, otherwise false. */ - #[\ReturnTypeWillChange] - public function accept() + public function accept(): bool { $file = $this->getInnerIterator()->current(); if ($file->isDir()) { diff --git a/src/Composer/Package/Archiver/ArchivableFilesFinder.php b/src/Composer/Package/Archiver/ArchivableFilesFinder.php index 4dcb718ba..b1d5650ed 100644 --- a/src/Composer/Package/Archiver/ArchivableFilesFinder.php +++ b/src/Composer/Package/Archiver/ArchivableFilesFinder.php @@ -90,8 +90,7 @@ class ArchivableFilesFinder extends \FilterIterator parent::__construct($this->finder->getIterator()); } - #[\ReturnTypeWillChange] - public function accept() + public function accept(): bool { /** @var SplFileInfo $current */ $current = $this->getInnerIterator()->current(); diff --git a/src/Composer/Package/Locker.php b/src/Composer/Package/Locker.php index 7911c4c23..d8ab66dc4 100644 --- a/src/Composer/Package/Locker.php +++ b/src/Composer/Package/Locker.php @@ -80,7 +80,7 @@ class Locker */ public static function getContentHash($composerFileContents) { - $content = json_decode($composerFileContents, true); + $content = JsonFile::parseJson($composerFileContents, 'composer.json'); $relevantKeys = array( 'name', @@ -107,7 +107,7 @@ class Locker ksort($relevantContent); - return md5(json_encode($relevantContent)); + return md5(JsonFile::encode($relevantContent, 0)); } /** diff --git a/src/Composer/Plugin/PluginInterface.php b/src/Composer/Plugin/PluginInterface.php index 2bbc08f50..c2a35e50a 100644 --- a/src/Composer/Plugin/PluginInterface.php +++ b/src/Composer/Plugin/PluginInterface.php @@ -32,7 +32,7 @@ interface PluginInterface * * @var string */ - const PLUGIN_API_VERSION = '2.2.0'; + const PLUGIN_API_VERSION = '2.3.0'; /** * Apply plugin modifications to Composer diff --git a/src/Composer/Repository/ArrayRepository.php b/src/Composer/Repository/ArrayRepository.php index 3d4e15abd..03e5fd819 100644 --- a/src/Composer/Repository/ArrayRepository.php +++ b/src/Composer/Repository/ArrayRepository.php @@ -322,8 +322,7 @@ class ArrayRepository implements RepositoryInterface * * @return int Number of packages */ - #[\ReturnTypeWillChange] - public function count() + public function count(): int { if (null === $this->packages) { $this->initialize(); diff --git a/src/Composer/Repository/CompositeRepository.php b/src/Composer/Repository/CompositeRepository.php index d6cfc46e7..83603081c 100644 --- a/src/Composer/Repository/CompositeRepository.php +++ b/src/Composer/Repository/CompositeRepository.php @@ -178,8 +178,7 @@ class CompositeRepository implements RepositoryInterface /** * @inheritDoc */ - #[\ReturnTypeWillChange] - public function count() + public function count(): int { $total = 0; foreach ($this->repositories as $repository) { diff --git a/src/Composer/Repository/FilterRepository.php b/src/Composer/Repository/FilterRepository.php index 0ee1ae53d..6e27cf837 100644 --- a/src/Composer/Repository/FilterRepository.php +++ b/src/Composer/Repository/FilterRepository.php @@ -181,8 +181,7 @@ class FilterRepository implements RepositoryInterface /** * @inheritDoc */ - #[\ReturnTypeWillChange] - public function count() + public function count(): int { if ($this->repo->count() > 0) { return count($this->getPackages()); diff --git a/src/Composer/Util/ErrorHandler.php b/src/Composer/Util/ErrorHandler.php index 1bb7d4301..4a7901b41 100644 --- a/src/Composer/Util/ErrorHandler.php +++ b/src/Composer/Util/ErrorHandler.php @@ -54,15 +54,6 @@ class ErrorHandler } if (self::$io) { - // ignore symfony/* deprecation warnings - // TODO remove in 2.3 - if (Preg::isMatch('{^Return type of Symfony\\\\.*ReturnTypeWillChange}is', $message)) { - return true; - } - if (strpos(strtr($file, '\\', '/'), 'vendor/symfony/') !== false) { - return true; - } - self::$io->writeError('Deprecation Notice: '.$message.' in '.$file.':'.$line.''); if (self::$io->isVerbose()) { self::$io->writeError('Stack trace:'); diff --git a/src/Composer/Util/Http/Response.php b/src/Composer/Util/Http/Response.php index d94638ae4..39c68d6f2 100644 --- a/src/Composer/Util/Http/Response.php +++ b/src/Composer/Util/Http/Response.php @@ -25,7 +25,7 @@ class Response private $request; /** @var int */ private $code; - /** @var string[] */ + /** @var list */ private $headers; /** @var ?string */ private $body; @@ -33,7 +33,7 @@ class Response /** * @param Request $request * @param int $code - * @param string[] $headers + * @param list $headers * @param ?string $body */ public function __construct(array $request, $code, array $headers, $body) diff --git a/src/Composer/Util/Perforce.php b/src/Composer/Util/Perforce.php index d8ee9436b..eeca4cc60 100644 --- a/src/Composer/Util/Perforce.php +++ b/src/Composer/Util/Perforce.php @@ -98,9 +98,7 @@ class Perforce */ public static function checkServerExists($url, ProcessExecutor $processExecutor) { - $output = null; - - return 0 === $processExecutor->execute('p4 -p ' . ProcessExecutor::escape($url) . ' info -s', $output); + return 0 === $processExecutor->execute('p4 -p ' . ProcessExecutor::escape($url) . ' info -s', $ignoredOutput); } /** diff --git a/src/Composer/Util/Svn.php b/src/Composer/Util/Svn.php index 333802035..562cf5fd2 100644 --- a/src/Composer/Util/Svn.php +++ b/src/Composer/Util/Svn.php @@ -165,7 +165,7 @@ class Svn } $errorOutput = $this->process->getErrorOutput(); - $fullOutput = implode("\n", array($output, $errorOutput)); + $fullOutput = trim(implode("\n", array($output, $errorOutput))); // the error is not auth-related if (false === stripos($fullOutput, 'Could not authenticate to server:') diff --git a/src/Composer/Util/TlsHelper.php b/src/Composer/Util/TlsHelper.php index 1ba0f806d..16ecbc527 100644 --- a/src/Composer/Util/TlsHelper.php +++ b/src/Composer/Util/TlsHelper.php @@ -137,7 +137,11 @@ final class TlsHelper */ public static function getCertificateFingerprint($certificate) { - $pubkeydetails = openssl_pkey_get_details(openssl_get_publickey($certificate)); + $pubkey = openssl_get_publickey($certificate); + if ($pubkey === false) { + throw new \RuntimeException('Failed to retrieve the public key from certificate'); + } + $pubkeydetails = openssl_pkey_get_details($pubkey); $pubkeypem = $pubkeydetails['key']; //Convert PEM to DER before SHA1'ing $start = '-----BEGIN PUBLIC KEY-----'; diff --git a/tests/Composer/Test/AllFunctionalTest.php b/tests/Composer/Test/AllFunctionalTest.php index aefea3312..b693dc2c6 100644 --- a/tests/Composer/Test/AllFunctionalTest.php +++ b/tests/Composer/Test/AllFunctionalTest.php @@ -31,15 +31,16 @@ class AllFunctionalTest extends TestCase */ private static $pharPath; - public function setUp() + public function setUp(): void { $this->oldcwd = getcwd(); chdir(__DIR__.'/Fixtures/functional'); } - public function tearDown() + protected function tearDown(): void { + parent::tearDown(); if ($this->oldcwd) { chdir($this->oldcwd); } @@ -51,12 +52,12 @@ class AllFunctionalTest extends TestCase } } - public static function setUpBeforeClass() + public static function setUpBeforeClass(): void { self::$pharPath = self::getUniqueTmpDirectory() . '/composer.phar'; } - public static function tearDownAfterClass() + public static function tearDownAfterClass(): void { $fs = new Filesystem; $fs->removeDirectory(dirname(self::$pharPath)); @@ -123,18 +124,10 @@ class AllFunctionalTest extends TestCase 'COMPOSER_CACHE_DIR' => $this->testDir.'cache', ); - // TODO in v2.3 always call with an array - if (method_exists('Symfony\Component\Process\Process', 'fromShellCommandline')) { - $cmd = array((defined('PHP_BINARY') ? PHP_BINARY : 'php'), self::$pharPath, '--no-ansi', $testData['RUN']); - $proc = new Process($cmd, $this->testDir, $env, null, 300); - } else { - $cmd = (defined('PHP_BINARY') ? escapeshellcmd(PHP_BINARY) : 'php') .' '.escapeshellarg(self::$pharPath).' --no-ansi '.$testData['RUN']; - // @phpstan-ignore-next-line - $proc = new Process($cmd, $this->testDir, $env, null, 300); - } + $proc = Process::fromShellCommandline(escapeshellcmd(PHP_BINARY).' '.escapeshellarg(self::$pharPath).' --no-ansi '.$testData['RUN'], $this->testDir, $env, null, 300); $output = ''; - $exitcode = $proc->run(function ($type, $buffer) use (&$output) { + $exitCode = $proc->run(function ($type, $buffer) use (&$output) { $output .= $buffer; }); @@ -176,16 +169,16 @@ class AllFunctionalTest extends TestCase } } if (isset($testData['EXPECT-REGEX'])) { - $this->assertRegExp($testData['EXPECT-REGEX'], $this->cleanOutput($output)); + $this->assertMatchesRegularExpression($testData['EXPECT-REGEX'], $this->cleanOutput($output)); } if (isset($testData['EXPECT-REGEXES'])) { $cleanOutput = $this->cleanOutput($output); foreach (explode("\n", $testData['EXPECT-REGEXES']) as $regex) { - $this->assertRegExp($regex, $cleanOutput, 'Output: '.$output); + $this->assertMatchesRegularExpression($regex, $cleanOutput, 'Output: '.$output); } } if (isset($testData['EXPECT-EXIT-CODE'])) { - $this->assertSame($testData['EXPECT-EXIT-CODE'], $exitcode); + $this->assertSame($testData['EXPECT-EXIT-CODE'], $exitCode); } } @@ -204,7 +197,7 @@ class AllFunctionalTest extends TestCase /** * @param string $file - * @return array + * @return array{RUN: string, EXPECT?: string, EXPECT-EXIT-CODE?: int, EXPECT-REGEX?: string, EXPECT-REGEXES?: string, TEST?: string} */ private function parseTestFile($file) { @@ -261,7 +254,7 @@ class AllFunctionalTest extends TestCase throw new \RuntimeException('The test file must have a section named "EXPECT", "EXPECT-REGEX", or "EXPECT-REGEXES".'); } - return $data; + return $data; // @phpstan-ignore-line } /** diff --git a/tests/Composer/Test/ApplicationTest.php b/tests/Composer/Test/ApplicationTest.php index d24024e73..b2877de50 100644 --- a/tests/Composer/Test/ApplicationTest.php +++ b/tests/Composer/Test/ApplicationTest.php @@ -14,11 +14,12 @@ namespace Composer\Test; use Composer\Console\Application; use Composer\XdebugHandler\XdebugHandler; +use Symfony\Component\Console\Output\BufferedOutput; use Symfony\Component\Console\Output\OutputInterface; class ApplicationTest extends TestCase { - public function tearDown() + protected function tearDown(): void { parent::tearDown(); @@ -34,27 +35,26 @@ class ApplicationTest extends TestCase putenv('COMPOSER_NO_INTERACTION=1'); - $index = 0; - $inputMock->expects($this->at($index++)) + $inputMock->expects($this->any()) ->method('hasParameterOption') - ->with($this->equalTo('--no-plugins')) - ->will($this->returnValue(true)); + ->willReturnCallback(function ($opt): bool { + switch ($opt) { + case '--no-plugins': + return true; + case '--no-scripts': + return false; + case '--no-cache': + return false; + } - $inputMock->expects($this->at($index++)) - ->method('hasParameterOption') - ->with($this->equalTo('--no-scripts')) - ->will($this->returnValue(false)); + return false; + }); - $inputMock->expects($this->at($index++)) + $inputMock->expects($this->once()) ->method('setInteractive') ->with($this->equalTo(false)); - $inputMock->expects($this->at($index++)) - ->method('hasParameterOption') - ->with($this->equalTo('--no-cache')) - ->will($this->returnValue(false)); - - $inputMock->expects($this->at($index++)) + $inputMock->expects($this->once()) ->method('getParameterOption') ->with($this->equalTo(array('--working-dir', '-d'))) ->will($this->returnValue(false)); @@ -63,33 +63,22 @@ class ApplicationTest extends TestCase ->method('getFirstArgument') ->will($this->returnValue('show')); - $index = 0; - $outputMock->expects($this->at($index++)) - ->method("write"); + $output = new BufferedOutput(); + $expectedOutput = ''; if (XdebugHandler::isXdebugActive()) { - $outputMock->expects($this->at($index++)) - ->method("getVerbosity") - ->willReturn(OutputInterface::VERBOSITY_NORMAL); - - $outputMock->expects($this->at($index++)) - ->method("write") - ->with($this->equalTo('Composer is operating slower than normal because you have Xdebug enabled. See https://getcomposer.org/xdebug')); + $expectedOutput .= 'Composer is operating slower than normal because you have Xdebug enabled. See https://getcomposer.org/xdebug'.PHP_EOL; } - $outputMock->expects($this->at($index++)) - ->method("getVerbosity") - ->willReturn(OutputInterface::VERBOSITY_NORMAL); - - $outputMock->expects($this->at($index++)) - ->method("write") - ->with($this->equalTo(sprintf('Warning: This development build of Composer is over 60 days old. It is recommended to update it by running "%s self-update" to get the latest version.', $_SERVER['PHP_SELF']))); + $expectedOutput .= sprintf('Warning: This development build of Composer is over 60 days old. It is recommended to update it by running "%s self-update" to get the latest version.', $_SERVER['PHP_SELF']).PHP_EOL; if (!defined('COMPOSER_DEV_WARNING_TIME')) { define('COMPOSER_DEV_WARNING_TIME', time() - 1); } - $application->doRun($inputMock, $outputMock); + $application->doRun($inputMock, $output); + + $this->assertStringContainsString($expectedOutput, $output->fetch()); } /** @@ -107,27 +96,26 @@ class ApplicationTest extends TestCase putenv('COMPOSER_NO_INTERACTION=1'); - $index = 0; - $inputMock->expects($this->at($index++)) + $inputMock->expects($this->any()) ->method('hasParameterOption') - ->with($this->equalTo('--no-plugins')) - ->will($this->returnValue(true)); + ->willReturnCallback(function ($opt): bool { + switch ($opt) { + case '--no-plugins': + return true; + case '--no-scripts': + return false; + case '--no-cache': + return false; + } - $inputMock->expects($this->at($index++)) - ->method('hasParameterOption') - ->with($this->equalTo('--no-scripts')) - ->will($this->returnValue(false)); + return false; + }); - $inputMock->expects($this->at($index++)) + $inputMock->expects($this->once()) ->method('setInteractive') ->with($this->equalTo(false)); - $inputMock->expects($this->at($index++)) - ->method('hasParameterOption') - ->with($this->equalTo('--no-cache')) - ->will($this->returnValue(false)); - - $inputMock->expects($this->at($index++)) + $inputMock->expects($this->once()) ->method('getParameterOption') ->with($this->equalTo(array('--working-dir', '-d'))) ->will($this->returnValue(false)); diff --git a/tests/Composer/Test/Autoload/AutoloadGeneratorTest.php b/tests/Composer/Test/Autoload/AutoloadGeneratorTest.php index 0a801ad63..40046caec 100644 --- a/tests/Composer/Test/Autoload/AutoloadGeneratorTest.php +++ b/tests/Composer/Test/Autoload/AutoloadGeneratorTest.php @@ -29,7 +29,7 @@ use Composer\Installer\InstallationManager; use Composer\Config; use Composer\EventDispatcher\EventDispatcher; use Composer\Util\Platform; -use PHPUnit_Framework_MockObject_MockObject as MockObject; +use PHPUnit\Framework\MockObject\MockObject; class AutoloadGeneratorTest extends TestCase { @@ -54,12 +54,12 @@ class AutoloadGeneratorTest extends TestCase private $origDir; /** - * @var InstallationManager|MockObject + * @var InstallationManager&MockObject */ private $im; /** - * @var InstalledRepositoryInterface|MockObject + * @var InstalledRepositoryInterface&MockObject */ private $repository; @@ -74,7 +74,7 @@ class AutoloadGeneratorTest extends TestCase private $fs; /** - * @var EventDispatcher|MockObject + * @var EventDispatcher&MockObject */ private $eventDispatcher; @@ -89,7 +89,7 @@ class AutoloadGeneratorTest extends TestCase */ public $configValueMap; - protected function setUp() + protected function setUp(): void { $this->fs = new Filesystem; $that = $this; @@ -148,8 +148,9 @@ class AutoloadGeneratorTest extends TestCase $this->generator = new AutoloadGenerator($this->eventDispatcher); } - protected function tearDown() + protected function tearDown(): void { + parent::tearDown(); chdir($this->origDir); if (is_dir($this->workingDir)) { @@ -957,17 +958,13 @@ EOF; $notAutoloadPackages[] = $b = new Package('b/b', '1.0', '1.0'); $notAutoloadPackages[] = $c = new Package('c/c', '1.0', '1.0'); - $this->repository->expects($this->at(1)) + $this->repository->expects($this->exactly(3)) ->method('getCanonicalPackages') - ->will($this->returnValue($autoloadPackages)); - - $this->repository->expects($this->at(3)) - ->method('getCanonicalPackages') - ->will($this->returnValue($notAutoloadPackages)); - - $this->repository->expects($this->at(5)) - ->method('getCanonicalPackages') - ->will($this->returnValue($notAutoloadPackages)); + ->willReturnOnConsecutiveCalls( + $autoloadPackages, + $notAutoloadPackages, + $notAutoloadPackages + ); $this->fs->ensureDirectoryExists($this->vendorDir.'/a/a'); $this->fs->ensureDirectoryExists($this->vendorDir.'/b/b'); @@ -1283,14 +1280,12 @@ EOF; public function testPreAndPostEventsAreDispatchedDuringAutoloadDump() { $this->eventDispatcher - ->expects($this->at(0)) + ->expects($this->exactly(2)) ->method('dispatchScript') - ->with(ScriptEvents::PRE_AUTOLOAD_DUMP, false); - - $this->eventDispatcher - ->expects($this->at(1)) - ->method('dispatchScript') - ->with(ScriptEvents::POST_AUTOLOAD_DUMP, false); + ->withConsecutive( + [ScriptEvents::PRE_AUTOLOAD_DUMP, false], + [ScriptEvents::POST_AUTOLOAD_DUMP, false] + ); $package = new RootPackage('root/a', '1.0', '1.0'); $package->setAutoload(array('psr-0' => array('Prefix' => 'foo/bar/non/existing/'))); @@ -1866,38 +1861,16 @@ EOF; /** * @param string $expected * @param string $actual - * @param string $message - * @param bool $canonicalize - * @param bool $ignoreCase + * @param string|null $message * * @return void */ - public static function assertFileContentEquals($expected, $actual, $message = '', $canonicalize = false, $ignoreCase = false) + public static function assertFileContentEquals(string $expected, string $actual, ?string $message = null) { - self::assertEqualsNormalized( - file_get_contents($expected), - file_get_contents($actual), - $message ?: $expected.' equals '.$actual, - 0, - 10, - $canonicalize, - $ignoreCase + self::assertSame( + str_replace("\r", '', (string) file_get_contents($expected)), + str_replace("\r", '', (string) file_get_contents($actual)), + $message ?? $expected.' equals '.$actual ); } - - /** - * @param string $expected - * @param string $actual - * @param string $message - * @param int $delta - * @param int $maxDepth - * @param bool $canonicalize - * @param bool $ignoreCase - * - * @return void - */ - public static function assertEqualsNormalized($expected, $actual, $message = '', $delta = 0, $maxDepth = 10, $canonicalize = false, $ignoreCase = false) - { - parent::assertEquals(str_replace("\r", '', $expected), str_replace("\r", '', $actual), $message, $delta, $maxDepth, $canonicalize, $ignoreCase); - } } diff --git a/tests/Composer/Test/Autoload/ClassMapGeneratorTest.php b/tests/Composer/Test/Autoload/ClassMapGeneratorTest.php index 5b3b114ce..b08983e2f 100644 --- a/tests/Composer/Test/Autoload/ClassMapGeneratorTest.php +++ b/tests/Composer/Test/Autoload/ClassMapGeneratorTest.php @@ -146,7 +146,8 @@ class ClassMapGeneratorTest extends TestCase $find = $r->getMethod('findClasses'); $find->setAccessible(true); - $this->setExpectedException('RuntimeException', 'does not exist'); + self::expectException('RuntimeException'); + self::expectExceptionMessage('does not exist'); $find->invoke(null, __DIR__ . '/no-file'); } @@ -232,7 +233,8 @@ class ClassMapGeneratorTest extends TestCase public function testCreateMapThrowsWhenDirectoryDoesNotExist() { - $this->setExpectedException('RuntimeException', 'Could not scan for classes inside'); + self::expectException('RuntimeException'); + self::expectExceptionMessage('Could not scan for classes inside'); ClassMapGenerator::createMap(__DIR__ . '/no-file.no-foler'); } diff --git a/tests/Composer/Test/CacheTest.php b/tests/Composer/Test/CacheTest.php index 2d2fba28c..4bc0c3994 100644 --- a/tests/Composer/Test/CacheTest.php +++ b/tests/Composer/Test/CacheTest.php @@ -28,7 +28,7 @@ class CacheTest extends TestCase /** @var Cache&\PHPUnit\Framework\MockObject\MockObject */ private $cache; - public function setUp() + public function setUp(): void { $this->root = $this->getUniqueTmpDirectory(); $this->files = array(); @@ -44,7 +44,7 @@ class CacheTest extends TestCase $io = $this->getMockBuilder('Composer\IO\IOInterface')->getMock(); $this->cache = $this->getMockBuilder('Composer\Cache') - ->setMethods(array('getFinder')) + ->onlyMethods(array('getFinder')) ->setConstructorArgs(array($io, $this->root)) ->getMock(); $this->cache @@ -53,8 +53,9 @@ class CacheTest extends TestCase ->will($this->returnValue($this->finder)); } - protected function tearDown() + protected function tearDown(): void { + parent::tearDown(); if (is_dir($this->root)) { $fs = new Filesystem; $fs->removeDirectory($this->root); diff --git a/tests/Composer/Test/Command/ArchiveCommandTest.php b/tests/Composer/Test/Command/ArchiveCommandTest.php index 41a5c0993..d454552e2 100644 --- a/tests/Composer/Test/Command/ArchiveCommandTest.php +++ b/tests/Composer/Test/Command/ArchiveCommandTest.php @@ -49,17 +49,14 @@ class ArchiveCommandTest extends TestCase $composer->setPackage($package); $command = $this->getMockBuilder('Composer\Command\ArchiveCommand') - ->setMethods(array( + ->onlyMethods(array( 'mergeApplicationDefinition', - 'bind', 'getSynopsis', 'initialize', - 'isInteractive', 'getComposer', ))->getMock(); $command->expects($this->atLeastOnce())->method('getComposer') ->willReturn($composer); - $command->method('isInteractive')->willReturn(false); $command->run($input, $output); } @@ -73,12 +70,10 @@ class ArchiveCommandTest extends TestCase $config = Factory::createConfig(); $command = $this->getMockBuilder('Composer\Command\ArchiveCommand') - ->setMethods(array( + ->onlyMethods(array( 'mergeApplicationDefinition', - 'bind', 'getSynopsis', 'initialize', - 'isInteractive', 'getComposer', 'archive', ))->getMock(); @@ -96,7 +91,6 @@ class ArchiveCommandTest extends TestCase false, null )->willReturn(0); - $command->method('isInteractive')->willReturn(false); $this->assertEquals(0, $command->run($input, $output)); } diff --git a/tests/Composer/Test/Command/InitCommandTest.php b/tests/Composer/Test/Command/InitCommandTest.php index 8006fe106..7cb6fe94c 100644 --- a/tests/Composer/Test/Command/InitCommandTest.php +++ b/tests/Composer/Test/Command/InitCommandTest.php @@ -82,14 +82,14 @@ class InitCommandTest extends TestCase public function testParseEmptyAuthorString() { $command = new InitCommand; - $this->setExpectedException('InvalidArgumentException'); + self::expectException('InvalidArgumentException'); $command->parseAuthorString(''); } public function testParseAuthorStringWithInvalidEmail() { $command = new InitCommand; - $this->setExpectedException('InvalidArgumentException'); + self::expectException('InvalidArgumentException'); $command->parseAuthorString('John Smith '); } diff --git a/tests/Composer/Test/Command/RunScriptCommandTest.php b/tests/Composer/Test/Command/RunScriptCommandTest.php index 6b1618224..066f156b2 100644 --- a/tests/Composer/Test/Command/RunScriptCommandTest.php +++ b/tests/Composer/Test/Command/RunScriptCommandTest.php @@ -47,6 +47,9 @@ class RunScriptCommandTest extends TestCase ->method('hasArgument') ->with('command') ->willReturn(false); + $input + ->method('isInteractive') + ->willReturn(false); $output = $this->getMockBuilder('Symfony\Component\Console\Output\OutputInterface')->getMock(); @@ -73,17 +76,14 @@ class RunScriptCommandTest extends TestCase $composer->setEventDispatcher($ed); $command = $this->getMockBuilder('Composer\Command\RunScriptCommand') - ->setMethods(array( + ->onlyMethods(array( 'mergeApplicationDefinition', - 'bind', 'getSynopsis', 'initialize', - 'isInteractive', 'getComposer', )) ->getMock(); $command->expects($this->any())->method('getComposer')->willReturn($composer); - $command->method('isInteractive')->willReturn(false); $command->run($input, $output); } diff --git a/tests/Composer/Test/Config/JsonConfigSourceTest.php b/tests/Composer/Test/Config/JsonConfigSourceTest.php index 4e1000b5e..3d9e68980 100644 --- a/tests/Composer/Test/Config/JsonConfigSourceTest.php +++ b/tests/Composer/Test/Config/JsonConfigSourceTest.php @@ -34,14 +34,15 @@ class JsonConfigSourceTest extends TestCase return __DIR__.'/Fixtures/'.$name; } - protected function setUp() + protected function setUp(): void { $this->fs = new Filesystem; $this->workingDir = $this->getUniqueTmpDirectory(); } - protected function tearDown() + protected function tearDown(): void { + parent::tearDown(); if (is_dir($this->workingDir)) { $this->fs->removeDirectory($this->workingDir); } diff --git a/tests/Composer/Test/ConfigTest.php b/tests/Composer/Test/ConfigTest.php index 06f655721..579987a52 100644 --- a/tests/Composer/Test/ConfigTest.php +++ b/tests/Composer/Test/ConfigTest.php @@ -259,10 +259,8 @@ class ConfigTest extends TestCase */ public function testProhibitedUrlsThrowException($url) { - $this->setExpectedException( - 'Composer\Downloader\TransportException', - 'Your configuration does not allow connections to ' . $url - ); + self::expectException('Composer\Downloader\TransportException'); + self::expectExceptionMessage('Your configuration does not allow connections to ' . $url); $config = new Config(false); $config->prohibitUrlByConfig($url); } diff --git a/tests/Composer/Test/DependencyResolver/DefaultPolicyTest.php b/tests/Composer/Test/DependencyResolver/DefaultPolicyTest.php index cae72c66d..9703706d5 100644 --- a/tests/Composer/Test/DependencyResolver/DefaultPolicyTest.php +++ b/tests/Composer/Test/DependencyResolver/DefaultPolicyTest.php @@ -32,7 +32,7 @@ class DefaultPolicyTest extends TestCase /** @var DefaultPolicy */ protected $policy; - public function setUp() + public function setUp(): void { $this->repositorySet = new RepositorySet('dev'); $this->repo = new ArrayRepository; diff --git a/tests/Composer/Test/DependencyResolver/RuleSetIteratorTest.php b/tests/Composer/Test/DependencyResolver/RuleSetIteratorTest.php index f0321a42c..3f2429024 100644 --- a/tests/Composer/Test/DependencyResolver/RuleSetIteratorTest.php +++ b/tests/Composer/Test/DependencyResolver/RuleSetIteratorTest.php @@ -27,7 +27,7 @@ class RuleSetIteratorTest extends TestCase /** @var Pool */ protected $pool; - protected function setUp() + protected function setUp(): void { $this->pool = new Pool(); diff --git a/tests/Composer/Test/DependencyResolver/RuleSetTest.php b/tests/Composer/Test/DependencyResolver/RuleSetTest.php index 1cdd83a9b..f25e3df4f 100644 --- a/tests/Composer/Test/DependencyResolver/RuleSetTest.php +++ b/tests/Composer/Test/DependencyResolver/RuleSetTest.php @@ -67,7 +67,7 @@ class RuleSetTest extends TestCase { $ruleSet = new RuleSet; - $this->setExpectedException('OutOfBoundsException'); + self::expectException('OutOfBoundsException'); // @phpstan-ignore-next-line $ruleSet->add(new GenericRule(array(), Rule::RULE_ROOT_REQUIRE, array('packageName' => '', 'constraint' => new MatchAllConstraint)), 7); } diff --git a/tests/Composer/Test/DependencyResolver/SolverTest.php b/tests/Composer/Test/DependencyResolver/SolverTest.php index 7afb38c2e..e6e51c2fb 100644 --- a/tests/Composer/Test/DependencyResolver/SolverTest.php +++ b/tests/Composer/Test/DependencyResolver/SolverTest.php @@ -48,7 +48,7 @@ class SolverTest extends TestCase /** @var Pool */ protected $pool; - public function setUp() + public function setUp(): void { $this->repoSet = new RepositorySet(); $this->repo = new ArrayRepository; @@ -537,7 +537,7 @@ class SolverTest extends TestCase $this->request->requireName('A'); // must explicitly pick the provider, so error in this case - $this->setExpectedException('Composer\DependencyResolver\SolverProblemsException'); + self::expectException('Composer\DependencyResolver\SolverProblemsException'); $this->createSolver(); $this->solver->solve($this->request); } @@ -571,7 +571,7 @@ class SolverTest extends TestCase $this->request->requireName('A'); - $this->setExpectedException('Composer\DependencyResolver\SolverProblemsException'); + self::expectException('Composer\DependencyResolver\SolverProblemsException'); $this->createSolver(); $this->solver->solve($this->request); } @@ -743,7 +743,7 @@ class SolverTest extends TestCase $this->request->requireName('C', $this->getVersionConstraint('==', '2.0.0.0-dev')); - $this->setExpectedException('Composer\DependencyResolver\SolverProblemsException'); + self::expectException('Composer\DependencyResolver\SolverProblemsException'); $this->createSolver(); $this->solver->solve($this->request); diff --git a/tests/Composer/Test/DependencyResolver/TransactionTest.php b/tests/Composer/Test/DependencyResolver/TransactionTest.php index 76f6beede..4c19a6098 100644 --- a/tests/Composer/Test/DependencyResolver/TransactionTest.php +++ b/tests/Composer/Test/DependencyResolver/TransactionTest.php @@ -23,7 +23,7 @@ use Composer\Test\TestCase; class TransactionTest extends TestCase { - public function setUp() + public function setUp(): void { } diff --git a/tests/Composer/Test/Downloader/DownloadManagerTest.php b/tests/Composer/Test/Downloader/DownloadManagerTest.php index db4ccbda8..7c84a1c9b 100644 --- a/tests/Composer/Test/Downloader/DownloadManagerTest.php +++ b/tests/Composer/Test/Downloader/DownloadManagerTest.php @@ -13,6 +13,7 @@ namespace Composer\Test\Downloader; use Composer\Downloader\DownloadManager; +use Composer\Package\PackageInterface; use Composer\Test\TestCase; class DownloadManagerTest extends TestCase @@ -23,7 +24,7 @@ class DownloadManagerTest extends TestCase /** @var \Composer\IO\IOInterface&\PHPUnit\Framework\MockObject\MockObject */ protected $io; - public function setUp() + public function setUp(): void { $this->filesystem = $this->getMockBuilder('Composer\Util\Filesystem')->getMock(); $this->io = $this->getMockBuilder('Composer\IO\IOInterface')->getMock(); @@ -37,7 +38,7 @@ class DownloadManagerTest extends TestCase $manager->setDownloader('test', $downloader); $this->assertSame($downloader, $manager->getDownloader('test')); - $this->setExpectedException('InvalidArgumentException'); + self::expectException('InvalidArgumentException'); $manager->getDownloader('unregistered'); } @@ -51,7 +52,7 @@ class DownloadManagerTest extends TestCase $manager = new DownloadManager($this->io, false, $this->filesystem); - $this->setExpectedException('InvalidArgumentException'); + self::expectException('InvalidArgumentException'); $manager->getDownloaderForPackage($package); } @@ -76,7 +77,7 @@ class DownloadManagerTest extends TestCase $manager = $this->getMockBuilder('Composer\Downloader\DownloadManager') ->setConstructorArgs(array($this->io, false, $this->filesystem)) - ->setMethods(array('getDownloader')) + ->onlyMethods(array('getDownloader')) ->getMock(); $manager @@ -108,7 +109,7 @@ class DownloadManagerTest extends TestCase $manager = $this->getMockBuilder('Composer\Downloader\DownloadManager') ->setConstructorArgs(array($this->io, false, $this->filesystem)) - ->setMethods(array('getDownloader')) + ->onlyMethods(array('getDownloader')) ->getMock(); $manager @@ -117,7 +118,7 @@ class DownloadManagerTest extends TestCase ->with('git') ->will($this->returnValue($downloader)); - $this->setExpectedException('LogicException'); + self::expectException('LogicException'); $manager->getDownloaderForPackage($package); } @@ -142,7 +143,7 @@ class DownloadManagerTest extends TestCase $manager = $this->getMockBuilder('Composer\Downloader\DownloadManager') ->setConstructorArgs(array($this->io, false, $this->filesystem)) - ->setMethods(array('getDownloader')) + ->onlyMethods(array('getDownloader')) ->getMock(); $manager @@ -174,7 +175,7 @@ class DownloadManagerTest extends TestCase $manager = $this->getMockBuilder('Composer\Downloader\DownloadManager') ->setConstructorArgs(array($this->io, false, $this->filesystem)) - ->setMethods(array('getDownloader')) + ->onlyMethods(array('getDownloader')) ->getMock(); $manager @@ -183,7 +184,7 @@ class DownloadManagerTest extends TestCase ->with('pear') ->will($this->returnValue($downloader)); - $this->setExpectedException('LogicException'); + self::expectException('LogicException'); $manager->getDownloaderForPackage($package); } @@ -226,7 +227,7 @@ class DownloadManagerTest extends TestCase $manager = $this->getMockBuilder('Composer\Downloader\DownloadManager') ->setConstructorArgs(array($this->io, false, $this->filesystem)) - ->setMethods(array('getDownloaderForPackage')) + ->onlyMethods(array('getDownloaderForPackage')) ->getMock(); $manager ->expects($this->once()) @@ -254,13 +255,12 @@ class DownloadManagerTest extends TestCase ->will($this->returnValue('prettyPackage')); $package - ->expects($this->at(3)) + ->expects($this->exactly(2)) ->method('setInstallationSource') - ->with('dist'); - $package - ->expects($this->at(5)) - ->method('setInstallationSource') - ->with('source'); + ->withConsecutive( + ['dist'], + ['source'] + ); $downloaderFail = $this->createDownloaderMock(); $downloaderFail @@ -277,18 +277,16 @@ class DownloadManagerTest extends TestCase $manager = $this->getMockBuilder('Composer\Downloader\DownloadManager') ->setConstructorArgs(array($this->io, false, $this->filesystem)) - ->setMethods(array('getDownloaderForPackage')) + ->onlyMethods(array('getDownloaderForPackage')) ->getMock(); $manager - ->expects($this->at(0)) + ->expects($this->exactly(2)) ->method('getDownloaderForPackage') ->with($package) - ->will($this->returnValue($downloaderFail)); - $manager - ->expects($this->at(1)) - ->method('getDownloaderForPackage') - ->with($package) - ->will($this->returnValue($downloaderSuccess)); + ->willReturnOnConsecutiveCalls( + $downloaderFail, + $downloaderSuccess + ); $manager->download($package, 'target_dir'); } @@ -307,7 +305,7 @@ class DownloadManagerTest extends TestCase $manager = new DownloadManager($this->io, false, $this->filesystem); - $this->setExpectedException('InvalidArgumentException'); + self::expectException('InvalidArgumentException'); $manager->download($package, 'target_dir'); } @@ -336,7 +334,7 @@ class DownloadManagerTest extends TestCase $manager = $this->getMockBuilder('Composer\Downloader\DownloadManager') ->setConstructorArgs(array($this->io, false, $this->filesystem)) - ->setMethods(array('getDownloaderForPackage')) + ->onlyMethods(array('getDownloaderForPackage')) ->getMock(); $manager ->expects($this->once()) @@ -372,7 +370,7 @@ class DownloadManagerTest extends TestCase $manager = $this->getMockBuilder('Composer\Downloader\DownloadManager') ->setConstructorArgs(array($this->io, false, $this->filesystem)) - ->setMethods(array('getDownloaderForPackage')) + ->onlyMethods(array('getDownloaderForPackage')) ->getMock(); $manager ->expects($this->once()) @@ -402,7 +400,7 @@ class DownloadManagerTest extends TestCase $manager = $this->getMockBuilder('Composer\Downloader\DownloadManager') ->setConstructorArgs(array($this->io, false, $this->filesystem)) - ->setMethods(array('getDownloaderForPackage')) + ->onlyMethods(array('getDownloaderForPackage')) ->getMock(); $manager ->expects($this->once()) @@ -438,7 +436,7 @@ class DownloadManagerTest extends TestCase $manager = $this->getMockBuilder('Composer\Downloader\DownloadManager') ->setConstructorArgs(array($this->io, false, $this->filesystem)) - ->setMethods(array('getDownloaderForPackage')) + ->onlyMethods(array('getDownloaderForPackage')) ->getMock(); $manager ->expects($this->once()) @@ -475,7 +473,7 @@ class DownloadManagerTest extends TestCase $manager = $this->getMockBuilder('Composer\Downloader\DownloadManager') ->setConstructorArgs(array($this->io, false, $this->filesystem)) - ->setMethods(array('getDownloaderForPackage')) + ->onlyMethods(array('getDownloaderForPackage')) ->getMock(); $manager ->expects($this->once()) @@ -512,7 +510,7 @@ class DownloadManagerTest extends TestCase $manager = $this->getMockBuilder('Composer\Downloader\DownloadManager') ->setConstructorArgs(array($this->io, false, $this->filesystem)) - ->setMethods(array('getDownloaderForPackage')) + ->onlyMethods(array('getDownloaderForPackage')) ->getMock(); $manager ->expects($this->once()) @@ -539,7 +537,7 @@ class DownloadManagerTest extends TestCase $manager = new DownloadManager($this->io, false, $this->filesystem); $manager->setPreferSource(true); - $this->setExpectedException('InvalidArgumentException'); + self::expectException('InvalidArgumentException'); $manager->download($package, 'target_dir'); } @@ -642,20 +640,30 @@ class DownloadManagerTest extends TestCase { $initial = null; if ($prevPkgSource) { - $initial = $this->prophesize('Composer\Package\PackageInterface'); - $initial->getInstallationSource()->willReturn($prevPkgSource); - $initial->isDev()->willReturn($prevPkgIsDev); + $initial = $this->getMockBuilder(PackageInterface::class)->getMock(); + $initial->expects($this->atLeastOnce()) + ->method('getInstallationSource') + ->willReturn($prevPkgSource); + $initial->expects($this->any()) + ->method('isDev') + ->willReturn($prevPkgIsDev); } - $target = $this->prophesize('Composer\Package\PackageInterface'); - $target->getSourceType()->willReturn(in_array('source', $targetAvailable, true) ? 'git' : null); - $target->getDistType()->willReturn(in_array('dist', $targetAvailable, true) ? 'zip' : null); - $target->isDev()->willReturn($targetIsDev); + $target = $this->getMockBuilder(PackageInterface::class)->getMock(); + $target->expects($this->atLeastOnce()) + ->method('getSourceType') + ->willReturn(in_array('source', $targetAvailable, true) ? 'git' : null); + $target->expects($this->atLeastOnce()) + ->method('getDistType') + ->willReturn(in_array('dist', $targetAvailable, true) ? 'zip' : null); + $target->expects($this->any()) + ->method('isDev') + ->willReturn($targetIsDev); $manager = new DownloadManager($this->io, false, $this->filesystem); $method = new \ReflectionMethod($manager, 'getAvailableSources'); $method->setAccessible(true); - $this->assertEquals($expected, $method->invoke($manager, $target->reveal(), $initial ? $initial->reveal() : null)); + $this->assertEquals($expected, $method->invoke($manager, $target, $initial ?? null)); } public static function updatesProvider() @@ -688,7 +696,7 @@ class DownloadManagerTest extends TestCase $manager = $this->getMockBuilder('Composer\Downloader\DownloadManager') ->setConstructorArgs(array($this->io, false, $this->filesystem)) - ->setMethods(array('getDownloaderForPackage')) + ->onlyMethods(array('getDownloaderForPackage')) ->getMock(); $manager ->expects($this->exactly(2)) @@ -711,7 +719,7 @@ class DownloadManagerTest extends TestCase $manager = $this->getMockBuilder('Composer\Downloader\DownloadManager') ->setConstructorArgs(array($this->io, false, $this->filesystem)) - ->setMethods(array('getDownloaderForPackage')) + ->onlyMethods(array('getDownloaderForPackage')) ->getMock(); $manager ->expects($this->once()) @@ -728,7 +736,7 @@ class DownloadManagerTest extends TestCase $manager = $this->getMockBuilder('Composer\Downloader\DownloadManager') ->setConstructorArgs(array($this->io, false, $this->filesystem)) - ->setMethods(array('getDownloaderForPackage')) + ->onlyMethods(array('getDownloaderForPackage')) ->getMock(); $manager ->expects($this->once()) @@ -771,7 +779,7 @@ class DownloadManagerTest extends TestCase $manager = $this->getMockBuilder('Composer\Downloader\DownloadManager') ->setConstructorArgs(array($this->io, false, $this->filesystem)) - ->setMethods(array('getDownloaderForPackage')) + ->onlyMethods(array('getDownloaderForPackage')) ->getMock(); $manager ->expects($this->once()) @@ -814,7 +822,7 @@ class DownloadManagerTest extends TestCase $manager = $this->getMockBuilder('Composer\Downloader\DownloadManager') ->setConstructorArgs(array($this->io, false, $this->filesystem)) - ->setMethods(array('getDownloaderForPackage')) + ->onlyMethods(array('getDownloaderForPackage')) ->getMock(); $manager ->expects($this->once()) @@ -860,7 +868,7 @@ class DownloadManagerTest extends TestCase $manager = $this->getMockBuilder('Composer\Downloader\DownloadManager') ->setConstructorArgs(array($this->io, false, $this->filesystem)) - ->setMethods(array('getDownloaderForPackage')) + ->onlyMethods(array('getDownloaderForPackage')) ->getMock(); $manager ->expects($this->once()) @@ -907,7 +915,7 @@ class DownloadManagerTest extends TestCase $manager = $this->getMockBuilder('Composer\Downloader\DownloadManager') ->setConstructorArgs(array($this->io, false, $this->filesystem)) - ->setMethods(array('getDownloaderForPackage')) + ->onlyMethods(array('getDownloaderForPackage')) ->getMock(); $manager ->expects($this->once()) @@ -954,7 +962,7 @@ class DownloadManagerTest extends TestCase $manager = $this->getMockBuilder('Composer\Downloader\DownloadManager') ->setConstructorArgs(array($this->io, false, $this->filesystem)) - ->setMethods(array('getDownloaderForPackage')) + ->onlyMethods(array('getDownloaderForPackage')) ->getMock(); $manager ->expects($this->once()) @@ -1001,7 +1009,7 @@ class DownloadManagerTest extends TestCase $manager = $this->getMockBuilder('Composer\Downloader\DownloadManager') ->setConstructorArgs(array($this->io, false, $this->filesystem)) - ->setMethods(array('getDownloaderForPackage')) + ->onlyMethods(array('getDownloaderForPackage')) ->getMock(); $manager ->expects($this->once()) @@ -1044,7 +1052,7 @@ class DownloadManagerTest extends TestCase $manager = $this->getMockBuilder('Composer\Downloader\DownloadManager') ->setConstructorArgs(array($this->io, false, $this->filesystem)) - ->setMethods(array('getDownloaderForPackage')) + ->onlyMethods(array('getDownloaderForPackage')) ->getMock(); $manager ->expects($this->once()) @@ -1087,7 +1095,7 @@ class DownloadManagerTest extends TestCase $manager = $this->getMockBuilder('Composer\Downloader\DownloadManager') ->setConstructorArgs(array($this->io, false, $this->filesystem)) - ->setMethods(array('getDownloaderForPackage')) + ->onlyMethods(array('getDownloaderForPackage')) ->getMock(); $manager ->expects($this->once()) diff --git a/tests/Composer/Test/Downloader/FileDownloaderTest.php b/tests/Composer/Test/Downloader/FileDownloaderTest.php index 7ad59b30d..0a7e05c60 100644 --- a/tests/Composer/Test/Downloader/FileDownloaderTest.php +++ b/tests/Composer/Test/Downloader/FileDownloaderTest.php @@ -30,7 +30,7 @@ class FileDownloaderTest extends TestCase /** @var \Composer\Config&\PHPUnit\Framework\MockObject\MockObject */ private $config; - public function setUp() + public function setUp(): void { $this->httpDownloader = $this->getMockBuilder('Composer\Util\HttpDownloader')->disableOriginalConstructor()->getMock(); $this->config = $this->getMockBuilder('Composer\Config')->getMock(); @@ -67,7 +67,7 @@ class FileDownloaderTest extends TestCase ->will($this->returnValue(null)) ; - $this->setExpectedException('InvalidArgumentException'); + self::expectException('InvalidArgumentException'); $downloader = $this->getDownloader(); $downloader->download($packageMock, '/path'); @@ -85,7 +85,7 @@ class FileDownloaderTest extends TestCase ->will($this->returnValue(array('url'))) ; - $path = tempnam($this->getUniqueTmpDirectory(), 'c'); + $path = $this->createTempFile($this->getUniqueTmpDirectory()); $downloader = $this->getDownloader(); try { @@ -220,7 +220,7 @@ class FileDownloaderTest extends TestCase $dispatcher = new EventDispatcher( $composerMock, $this->getMockBuilder('Composer\IO\IOInterface')->getMock(), - new ProcessExecutorMock + $this->getProcessExecutorMock() ); $dispatcher->addListener(PluginEvents::PRE_FILE_DOWNLOAD, function (PreFileDownloadEvent $event) use ($expectedUrl) { $event->setProcessedUrl($expectedUrl); @@ -322,7 +322,7 @@ class FileDownloaderTest extends TestCase $dispatcher = new EventDispatcher( $composerMock, $this->getMockBuilder('Composer\IO\IOInterface')->getMock(), - new ProcessExecutorMock + $this->getProcessExecutorMock() ); $dispatcher->addListener(PluginEvents::PRE_FILE_DOWNLOAD, function (PreFileDownloadEvent $event) use ($customCacheKey) { $event->setCustomCacheKey($customCacheKey); @@ -387,15 +387,12 @@ class FileDownloaderTest extends TestCase $this->config = $this->getMockBuilder('Composer\Config')->getMock(); $this->config - ->expects($this->at(0)) + ->expects($this->atLeast(2)) ->method('get') - ->with('cache-files-ttl') - ->will($this->returnValue($expectedTtl)); - $this->config - ->expects($this->at(1)) - ->method('get') - ->with('cache-files-maxsize') - ->will($this->returnValue('500M')); + ->willReturnMap([ + ['cache-files-ttl', 0, $expectedTtl], + ['cache-files-maxsize', 0, '500M'], + ]); $cacheMock = $this->getMockBuilder('Composer\Cache') ->disableOriginalConstructor() @@ -492,13 +489,12 @@ class FileDownloaderTest extends TestCase ->will($this->returnValue(array($distUrl))); $ioMock = $this->getMockBuilder('Composer\IO\IOInterface')->getMock(); - $ioMock->expects($this->at(0)) + $ioMock->expects($this->atLeast(2)) ->method('writeError') - ->with($this->stringContains('Downloading')); - - $ioMock->expects($this->at(1)) - ->method('writeError') - ->with($this->stringContains('Downgrading')); + ->withConsecutive( + [$this->stringContains('Downloading')], + [$this->stringContains('Downgrading')] + ); $path = $this->getUniqueTmpDirectory(); $filesystem = $this->getMockBuilder('Composer\Util\Filesystem')->getMock(); diff --git a/tests/Composer/Test/Downloader/FossilDownloaderTest.php b/tests/Composer/Test/Downloader/FossilDownloaderTest.php index 05978d4db..da9b04c5d 100644 --- a/tests/Composer/Test/Downloader/FossilDownloaderTest.php +++ b/tests/Composer/Test/Downloader/FossilDownloaderTest.php @@ -22,13 +22,14 @@ class FossilDownloaderTest extends TestCase /** @var string */ private $workingDir; - protected function setUp() + protected function setUp(): void { $this->workingDir = $this->getUniqueTmpDirectory(); } - protected function tearDown() + protected function tearDown(): void { + parent::tearDown(); if (is_dir($this->workingDir)) { $fs = new Filesystem; $fs->removeDirectory($this->workingDir); @@ -46,7 +47,7 @@ class FossilDownloaderTest extends TestCase { $io = $io ?: $this->getMockBuilder('Composer\IO\IOInterface')->getMock(); $config = $config ?: $this->getMockBuilder('Composer\Config')->getMock(); - $executor = $executor ?: new ProcessExecutorMock; + $executor = $executor ?: $this->getProcessExecutorMock(); $filesystem = $filesystem ?: $this->getMockBuilder('Composer\Util\Filesystem')->getMock(); return new FossilDownloader($io, $config, $executor, $filesystem); @@ -59,7 +60,7 @@ class FossilDownloaderTest extends TestCase ->method('getSourceReference') ->will($this->returnValue(null)); - $this->setExpectedException('InvalidArgumentException'); + self::expectException('InvalidArgumentException'); $downloader = $this->getDownloaderMock(); $downloader->install($packageMock, '/path'); @@ -75,7 +76,7 @@ class FossilDownloaderTest extends TestCase ->method('getSourceUrls') ->will($this->returnValue(array('http://fossil.kd2.org/kd2fw/'))); - $process = new ProcessExecutorMock; + $process = $this->getProcessExecutorMock(); $process->expects(array( $this->getCmd('fossil clone -- \'http://fossil.kd2.org/kd2fw/\' \'repo.fossil\''), $this->getCmd('fossil open --nested -- \'repo.fossil\''), @@ -84,8 +85,6 @@ class FossilDownloaderTest extends TestCase $downloader = $this->getDownloaderMock(null, null, $process); $downloader->install($packageMock, 'repo'); - - $process->assertComplete($this); } public function testUpdateforPackageWithoutSourceReference() @@ -96,7 +95,7 @@ class FossilDownloaderTest extends TestCase ->method('getSourceReference') ->will($this->returnValue(null)); - $this->setExpectedException('InvalidArgumentException'); + self::expectException('InvalidArgumentException'); $downloader = $this->getDownloaderMock(); $downloader->prepare('update', $sourcePackageMock, '/path', $initialPackageMock); @@ -124,7 +123,7 @@ class FossilDownloaderTest extends TestCase ->method('getVersion') ->will($this->returnValue('1.0.0.0')); - $process = new ProcessExecutorMock; + $process = $this->getProcessExecutorMock(); $process->expects(array( $this->getCmd("fossil changes"), $this->getCmd("fossil pull && fossil up 'trunk'"), @@ -134,8 +133,6 @@ class FossilDownloaderTest extends TestCase $downloader->prepare('update', $packageMock, $this->workingDir, $packageMock); $downloader->update($packageMock, $packageMock, $this->workingDir); $downloader->cleanup('update', $packageMock, $this->workingDir, $packageMock); - - $process->assertComplete($this); } public function testRemove() @@ -146,7 +143,7 @@ class FossilDownloaderTest extends TestCase $packageMock = $this->getMockBuilder('Composer\Package\PackageInterface')->getMock(); - $process = new ProcessExecutorMock; + $process = $this->getProcessExecutorMock(); $process->expects(array( $this->getCmd('fossil changes'), ), true); @@ -161,8 +158,6 @@ class FossilDownloaderTest extends TestCase $downloader->prepare('uninstall', $packageMock, $this->workingDir); $downloader->remove($packageMock, $this->workingDir); $downloader->cleanup('uninstall', $packageMock, $this->workingDir); - - $process->assertComplete($this); } public function testGetInstallationSource() diff --git a/tests/Composer/Test/Downloader/GitDownloaderTest.php b/tests/Composer/Test/Downloader/GitDownloaderTest.php index d3b046406..d5494564d 100644 --- a/tests/Composer/Test/Downloader/GitDownloaderTest.php +++ b/tests/Composer/Test/Downloader/GitDownloaderTest.php @@ -27,7 +27,7 @@ class GitDownloaderTest extends TestCase /** @var string */ private $workingDir; - protected function setUp() + protected function setUp(): void { $this->skipIfNotExecutable('git'); @@ -37,8 +37,9 @@ class GitDownloaderTest extends TestCase $this->workingDir = $this->getUniqueTmpDirectory(); } - protected function tearDown() + protected function tearDown(): void { + parent::tearDown(); if (is_dir($this->workingDir)) { $this->fs->removeDirectory($this->workingDir); } @@ -85,7 +86,7 @@ class GitDownloaderTest extends TestCase protected function getDownloaderMock($io = null, $config = null, $executor = null, $filesystem = null) { $io = $io ?: $this->getMockBuilder('Composer\IO\IOInterface')->getMock(); - $executor = $executor ?: new ProcessExecutorMock; + $executor = $executor ?: $this->getProcessExecutorMock(); $filesystem = $filesystem ?: $this->getMockBuilder('Composer\Util\Filesystem')->getMock(); $config = $this->setupConfig($config); @@ -99,7 +100,7 @@ class GitDownloaderTest extends TestCase ->method('getSourceReference') ->will($this->returnValue(null)); - $this->setExpectedException('InvalidArgumentException'); + self::expectException('InvalidArgumentException'); $downloader = $this->getDownloaderMock(); $downloader->download($packageMock, '/path'); @@ -124,7 +125,7 @@ class GitDownloaderTest extends TestCase ->method('getPrettyVersion') ->will($this->returnValue('dev-master')); - $process = new ProcessExecutorMock; + $process = $this->getProcessExecutorMock(); $process->expects(array( $this->winCompat("git clone --no-checkout -- 'https://example.com/composer/composer' 'composerPath' && cd 'composerPath' && git remote add composer -- 'https://example.com/composer/composer' && git fetch composer && git remote set-url origin -- 'https://example.com/composer/composer' && git remote set-url composer -- 'https://example.com/composer/composer'"), $this->winCompat("git branch -r"), @@ -136,8 +137,6 @@ class GitDownloaderTest extends TestCase $downloader->prepare('install', $packageMock, 'composerPath'); $downloader->install($packageMock, 'composerPath'); $downloader->cleanup('install', $packageMock, 'composerPath'); - - $process->assertComplete($this); } public function testDownloadWithCache() @@ -165,7 +164,7 @@ class GitDownloaderTest extends TestCase $filesystem = new \Composer\Util\Filesystem; $filesystem->removeDirectory($cachePath); - $process = new ProcessExecutorMock; + $process = $this->getProcessExecutorMock(); $process->expects(array( array('cmd' => $this->winCompat(sprintf("git clone --mirror -- 'https://example.com/composer/composer' '%s'", $cachePath)), 'callback' => function () use ($cachePath) { @mkdir($cachePath, 0777, true); @@ -183,8 +182,6 @@ class GitDownloaderTest extends TestCase $downloader->install($packageMock, 'composerPath'); $downloader->cleanup('install', $packageMock, 'composerPath'); @rmdir($cachePath); - - $process->assertComplete($this); } public function testDownloadUsesVariousProtocolsAndSetsPushUrlForGithub() @@ -203,7 +200,7 @@ class GitDownloaderTest extends TestCase ->method('getPrettyVersion') ->will($this->returnValue('1.0.0')); - $process = new ProcessExecutorMock; + $process = $this->getProcessExecutorMock(); $process->expects(array( array( 'cmd' => $this->winCompat("git clone --no-checkout -- 'https://github.com/mirrors/composer' 'composerPath' && cd 'composerPath' && git remote add composer -- 'https://github.com/mirrors/composer' && git fetch composer && git remote set-url origin -- 'https://github.com/mirrors/composer' && git remote set-url composer -- 'https://github.com/mirrors/composer'"), @@ -222,8 +219,6 @@ class GitDownloaderTest extends TestCase $downloader->prepare('install', $packageMock, 'composerPath'); $downloader->install($packageMock, 'composerPath'); $downloader->cleanup('install', $packageMock, 'composerPath'); - - $process->assertComplete($this); } public function pushUrlProvider() @@ -260,7 +255,7 @@ class GitDownloaderTest extends TestCase ->method('getPrettyVersion') ->will($this->returnValue('1.0.0')); - $process = new ProcessExecutorMock; + $process = $this->getProcessExecutorMock(); $process->expects(array( $this->winCompat("git clone --no-checkout -- '{$url}' 'composerPath' && cd 'composerPath' && git remote add composer -- '{$url}' && git fetch composer && git remote set-url origin -- '{$url}' && git remote set-url composer -- '{$url}'"), $this->winCompat("git remote set-url --push origin -- '{$pushUrl}'"), @@ -276,8 +271,6 @@ class GitDownloaderTest extends TestCase $downloader->prepare('install', $packageMock, 'composerPath'); $downloader->install($packageMock, 'composerPath'); $downloader->cleanup('install', $packageMock, 'composerPath'); - - $process->assertComplete($this); } public function testDownloadThrowsRuntimeExceptionIfGitCommandFails() @@ -296,7 +289,7 @@ class GitDownloaderTest extends TestCase ->method('getPrettyVersion') ->will($this->returnValue('1.0.0')); - $process = new ProcessExecutorMock; + $process = $this->getProcessExecutorMock(); $process->expects(array( array( 'cmd' => $this->winCompat("git clone --no-checkout -- 'https://example.com/composer/composer' 'composerPath' && cd 'composerPath' && git remote add composer -- 'https://example.com/composer/composer' && git fetch composer && git remote set-url origin -- 'https://example.com/composer/composer' && git remote set-url composer -- 'https://example.com/composer/composer'"), @@ -312,8 +305,6 @@ class GitDownloaderTest extends TestCase $downloader->install($packageMock, 'composerPath'); $downloader->cleanup('install', $packageMock, 'composerPath'); - $process->assertComplete($this); - $this->fail('This test should throw'); } catch (\RuntimeException $e) { if ('RuntimeException' !== get_class($e)) { @@ -331,7 +322,7 @@ class GitDownloaderTest extends TestCase ->method('getSourceReference') ->will($this->returnValue(null)); - $this->setExpectedException('InvalidArgumentException'); + self::expectException('InvalidArgumentException'); $downloader = $this->getDownloaderMock(); $downloader->download($sourcePackageMock, '/path', $initialPackageMock); @@ -358,7 +349,7 @@ class GitDownloaderTest extends TestCase ->method('getPrettyVersion') ->will($this->returnValue('1.0.0')); - $process = new ProcessExecutorMock; + $process = $this->getProcessExecutorMock(); $process->expects(array( $this->winCompat('git show-ref --head -d'), $this->winCompat('git status --porcelain --untracked-files=no'), @@ -375,8 +366,6 @@ class GitDownloaderTest extends TestCase $downloader->prepare('update', $packageMock, $this->workingDir, $packageMock); $downloader->update($packageMock, $packageMock, $this->workingDir); $downloader->cleanup('update', $packageMock, $this->workingDir, $packageMock); - - $process->assertComplete($this); } public function testUpdateWithNewRepoUrl() @@ -400,7 +389,7 @@ class GitDownloaderTest extends TestCase ->method('getPrettyVersion') ->will($this->returnValue('1.0.0')); - $process = new ProcessExecutorMock; + $process = $this->getProcessExecutorMock(); $process->expects(array( $this->winCompat("git show-ref --head -d"), $this->winCompat("git status --porcelain --untracked-files=no"), @@ -426,8 +415,6 @@ composer https://github.com/old/url (push) $downloader->prepare('update', $packageMock, $this->workingDir, $packageMock); $downloader->update($packageMock, $packageMock, $this->workingDir); $downloader->cleanup('update', $packageMock, $this->workingDir, $packageMock); - - $process->assertComplete($this); } /** @@ -449,7 +436,7 @@ composer https://github.com/old/url (push) ->method('getVersion') ->will($this->returnValue('1.0.0.0')); - $process = new ProcessExecutorMock; + $process = $this->getProcessExecutorMock(); $process->expects(array( $this->winCompat('git show-ref --head -d'), $this->winCompat('git status --porcelain --untracked-files=no'), @@ -463,7 +450,6 @@ composer https://github.com/old/url (push) 'return' => 1, ), $this->winCompat('git --version'), - $this->winCompat('git branch -r'), ), true); $this->fs->ensureDirectoryExists($this->workingDir.'/.git'); @@ -476,8 +462,6 @@ composer https://github.com/old/url (push) $downloader->update($packageMock, $packageMock, $this->workingDir); $downloader->cleanup('update', $packageMock, $this->workingDir, $packageMock); - $process->assertComplete($this); - $this->fail('This test should throw'); } catch (\RuntimeException $e) { if ('RuntimeException' !== get_class($e)) { @@ -506,7 +490,7 @@ composer https://github.com/old/url (push) ->method('getPrettyVersion') ->will($this->returnValue('1.0.0')); - $process = new ProcessExecutorMock; + $process = $this->getProcessExecutorMock(); $process->expects(array( $this->winCompat('git show-ref --head -d'), $this->winCompat('git status --porcelain --untracked-files=no'), @@ -532,8 +516,6 @@ composer https://github.com/old/url (push) $downloader->prepare('update', $packageMock, $this->workingDir, $packageMock); $downloader->update($packageMock, $packageMock, $this->workingDir); $downloader->cleanup('update', $packageMock, $this->workingDir, $packageMock); - - $process->assertComplete($this); } public function testDowngradeShowsAppropriateMessage() @@ -569,12 +551,14 @@ composer https://github.com/old/url (push) ->method('getFullPrettyVersion') ->will($this->returnValue('1.0.0')); - $process = new ProcessExecutorMock; + $process = $this->getProcessExecutorMock(); $ioMock = $this->getMockBuilder('Composer\IO\IOInterface')->getMock(); - $ioMock->expects($this->at(0)) + $ioMock->expects($this->atLeastOnce()) ->method('writeError') - ->with($this->stringContains('Downgrading')); + ->withConsecutive( + [$this->stringContains('Downgrading')] + ); $this->fs->ensureDirectoryExists($this->workingDir.'/.git'); $downloader = $this->getDownloaderMock($ioMock, null, $process); @@ -611,12 +595,14 @@ composer https://github.com/old/url (push) ->method('getPrettyVersion') ->will($this->returnValue('dev-ref2')); - $process = new ProcessExecutorMock; + $process = $this->getProcessExecutorMock(); $ioMock = $this->getMockBuilder('Composer\IO\IOInterface')->getMock(); - $ioMock->expects($this->at(0)) + $ioMock->expects($this->atLeastOnce()) ->method('writeError') - ->with($this->stringContains('Upgrading')); + ->withConsecutive( + [$this->stringContains('Upgrading')] + ); $this->fs->ensureDirectoryExists($this->workingDir.'/.git'); $downloader = $this->getDownloaderMock($ioMock, null, $process); @@ -631,7 +617,7 @@ composer https://github.com/old/url (push) $expectedGitResetCommand = $this->winCompat("git status --porcelain --untracked-files=no"); $packageMock = $this->getMockBuilder('Composer\Package\PackageInterface')->getMock(); - $process = new ProcessExecutorMock; + $process = $this->getProcessExecutorMock(); $process->expects(array( 'git show-ref --head -d', $expectedGitResetCommand, @@ -649,8 +635,6 @@ composer https://github.com/old/url (push) $downloader->prepare('uninstall', $packageMock, $this->workingDir); $downloader->remove($packageMock, $this->workingDir); $downloader->cleanup('uninstall', $packageMock, $this->workingDir); - - $process->assertComplete($this); } public function testGetInstallationSource() diff --git a/tests/Composer/Test/Downloader/HgDownloaderTest.php b/tests/Composer/Test/Downloader/HgDownloaderTest.php index 3c3015a23..dbe816bd2 100644 --- a/tests/Composer/Test/Downloader/HgDownloaderTest.php +++ b/tests/Composer/Test/Downloader/HgDownloaderTest.php @@ -22,13 +22,14 @@ class HgDownloaderTest extends TestCase /** @var string */ private $workingDir; - protected function setUp() + protected function setUp(): void { $this->workingDir = $this->getUniqueTmpDirectory(); } - protected function tearDown() + protected function tearDown(): void { + parent::tearDown(); if (is_dir($this->workingDir)) { $fs = new Filesystem; $fs->removeDirectory($this->workingDir); @@ -46,7 +47,7 @@ class HgDownloaderTest extends TestCase { $io = $io ?: $this->getMockBuilder('Composer\IO\IOInterface')->getMock(); $config = $config ?: $this->getMockBuilder('Composer\Config')->getMock(); - $executor = $executor ?: new ProcessExecutorMock; + $executor = $executor ?: $this->getProcessExecutorMock(); $filesystem = $filesystem ?: $this->getMockBuilder('Composer\Util\Filesystem')->getMock(); return new HgDownloader($io, $config, $executor, $filesystem); @@ -59,7 +60,7 @@ class HgDownloaderTest extends TestCase ->method('getSourceReference') ->will($this->returnValue(null)); - $this->setExpectedException('InvalidArgumentException'); + self::expectException('InvalidArgumentException'); $downloader = $this->getDownloaderMock(); $downloader->install($packageMock, '/path'); @@ -75,7 +76,7 @@ class HgDownloaderTest extends TestCase ->method('getSourceUrls') ->will($this->returnValue(array('https://mercurial.dev/l3l0/composer'))); - $process = new ProcessExecutorMock; + $process = $this->getProcessExecutorMock(); $process->expects(array( $this->getCmd('hg clone -- \'https://mercurial.dev/l3l0/composer\' \'composerPath\''), $this->getCmd('hg up -- \'ref\''), @@ -83,8 +84,6 @@ class HgDownloaderTest extends TestCase $downloader = $this->getDownloaderMock(null, null, $process); $downloader->install($packageMock, 'composerPath'); - - $process->assertComplete($this); } public function testUpdateforPackageWithoutSourceReference() @@ -95,7 +94,7 @@ class HgDownloaderTest extends TestCase ->method('getSourceReference') ->will($this->returnValue(null)); - $this->setExpectedException('InvalidArgumentException'); + self::expectException('InvalidArgumentException'); $downloader = $this->getDownloaderMock(); $downloader->prepare('update', $sourcePackageMock, '/path', $initialPackageMock); @@ -118,7 +117,7 @@ class HgDownloaderTest extends TestCase ->method('getSourceUrls') ->will($this->returnValue(array('https://github.com/l3l0/composer'))); - $process = new ProcessExecutorMock; + $process = $this->getProcessExecutorMock(); $process->expects(array( $this->getCmd('hg st'), $this->getCmd("hg pull -- 'https://github.com/l3l0/composer' && hg up -- 'ref'"), @@ -128,8 +127,6 @@ class HgDownloaderTest extends TestCase $downloader->prepare('update', $packageMock, $this->workingDir, $packageMock); $downloader->update($packageMock, $packageMock, $this->workingDir); $downloader->cleanup('update', $packageMock, $this->workingDir, $packageMock); - - $process->assertComplete($this); } public function testRemove() @@ -138,7 +135,7 @@ class HgDownloaderTest extends TestCase $fs->ensureDirectoryExists($this->workingDir.'/.hg'); $packageMock = $this->getMockBuilder('Composer\Package\PackageInterface')->getMock(); - $process = new ProcessExecutorMock; + $process = $this->getProcessExecutorMock(); $process->expects(array( $this->getCmd('hg st'), ), true); @@ -153,8 +150,6 @@ class HgDownloaderTest extends TestCase $downloader->prepare('uninstall', $packageMock, $this->workingDir); $downloader->remove($packageMock, $this->workingDir); $downloader->cleanup('uninstall', $packageMock, $this->workingDir); - - $process->assertComplete($this); } public function testGetInstallationSource() diff --git a/tests/Composer/Test/Downloader/PerforceDownloaderTest.php b/tests/Composer/Test/Downloader/PerforceDownloaderTest.php index 95bf048d3..9590e3133 100644 --- a/tests/Composer/Test/Downloader/PerforceDownloaderTest.php +++ b/tests/Composer/Test/Downloader/PerforceDownloaderTest.php @@ -43,13 +43,13 @@ class PerforceDownloaderTest extends TestCase /** @var string */ protected $testPath; - protected function setUp() + protected function setUp(): void { $this->testPath = $this->getUniqueTmpDirectory(); $this->repoConfig = $this->getRepoConfig(); $this->config = $this->getConfig(); $this->io = $this->getMockIoInterface(); - $this->processExecutor = new ProcessExecutorMock; + $this->processExecutor = $this->getProcessExecutorMock(); $this->repository = $this->getMockRepository($this->repoConfig, $this->io, $this->config); $this->package = $this->getMockPackageInterface($this->repository); $this->downloader = new PerforceDownloader($this->io, $this->config, $this->processExecutor); @@ -103,7 +103,7 @@ class PerforceDownloaderTest extends TestCase protected function getMockRepository(array $repoConfig, IOInterface $io, Config $config) { $repository = $this->getMockBuilder('Composer\Repository\VcsRepository') - ->setMethods(array('getRepoConfig')) + ->onlyMethods(array('getRepoConfig')) ->setConstructorArgs(array($repoConfig, $io, $config, Factory::createHttpDownloader($io, $config))) ->getMock(); $repository->expects($this->any())->method('getRepoConfig')->will($this->returnValue($repoConfig)); @@ -140,13 +140,13 @@ class PerforceDownloaderTest extends TestCase $this->io->expects($this->once())->method('writeError')->with($this->stringContains('Cloning '.$ref)); $perforceMethods = array('setStream', 'p4Login', 'writeP4ClientSpec', 'connectClient', 'syncCodeBase', 'cleanupClientSpec'); $perforce = $this->getMockBuilder('Composer\Util\Perforce')->disableOriginalConstructor()->getMock(); - $perforce->expects($this->at(0))->method('initializePath')->with($this->equalTo($this->testPath)); - $perforce->expects($this->at(1))->method('setStream')->with($this->equalTo($ref)); - $perforce->expects($this->at(2))->method('p4Login'); - $perforce->expects($this->at(3))->method('writeP4ClientSpec'); - $perforce->expects($this->at(4))->method('connectClient'); - $perforce->expects($this->at(5))->method('syncCodeBase')->with($label); - $perforce->expects($this->at(6))->method('cleanupClientSpec'); + $perforce->expects($this->once())->method('initializePath')->with($this->equalTo($this->testPath)); + $perforce->expects($this->once())->method('setStream')->with($this->equalTo($ref)); + $perforce->expects($this->once())->method('p4Login'); + $perforce->expects($this->once())->method('writeP4ClientSpec'); + $perforce->expects($this->once())->method('connectClient'); + $perforce->expects($this->once())->method('syncCodeBase')->with($label); + $perforce->expects($this->once())->method('cleanupClientSpec'); $this->downloader->setPerforce($perforce); $this->downloader->doInstall($this->package, $this->testPath, 'url'); } @@ -163,13 +163,13 @@ class PerforceDownloaderTest extends TestCase $this->io->expects($this->once())->method('writeError')->with($this->stringContains('Cloning '.$ref)); $perforceMethods = array('setStream', 'p4Login', 'writeP4ClientSpec', 'connectClient', 'syncCodeBase', 'cleanupClientSpec'); $perforce = $this->getMockBuilder('Composer\Util\Perforce')->disableOriginalConstructor()->getMock(); - $perforce->expects($this->at(0))->method('initializePath')->with($this->equalTo($this->testPath)); - $perforce->expects($this->at(1))->method('setStream')->with($this->equalTo($ref)); - $perforce->expects($this->at(2))->method('p4Login'); - $perforce->expects($this->at(3))->method('writeP4ClientSpec'); - $perforce->expects($this->at(4))->method('connectClient'); - $perforce->expects($this->at(5))->method('syncCodeBase')->with($label); - $perforce->expects($this->at(6))->method('cleanupClientSpec'); + $perforce->expects($this->once())->method('initializePath')->with($this->equalTo($this->testPath)); + $perforce->expects($this->once())->method('setStream')->with($this->equalTo($ref)); + $perforce->expects($this->once())->method('p4Login'); + $perforce->expects($this->once())->method('writeP4ClientSpec'); + $perforce->expects($this->once())->method('connectClient'); + $perforce->expects($this->once())->method('syncCodeBase')->with($label); + $perforce->expects($this->once())->method('cleanupClientSpec'); $this->downloader->setPerforce($perforce); $this->downloader->doInstall($this->package, $this->testPath, 'url'); } diff --git a/tests/Composer/Test/Downloader/XzDownloaderTest.php b/tests/Composer/Test/Downloader/XzDownloaderTest.php index 1b28e707a..cae7bf299 100644 --- a/tests/Composer/Test/Downloader/XzDownloaderTest.php +++ b/tests/Composer/Test/Downloader/XzDownloaderTest.php @@ -31,7 +31,7 @@ class XzDownloaderTest extends TestCase */ private $testDir; - public function setUp() + public function setUp(): void { if (Platform::isWindows()) { $this->markTestSkipped('Skip test on Windows'); @@ -39,8 +39,12 @@ class XzDownloaderTest extends TestCase $this->testDir = $this->getUniqueTmpDirectory(); } - public function tearDown() + protected function tearDown(): void { + if (Platform::isWindows()) { + return; + } + parent::tearDown(); $this->fs = new Filesystem; $this->fs->removeDirectory($this->testDir); } diff --git a/tests/Composer/Test/Downloader/ZipDownloaderTest.php b/tests/Composer/Test/Downloader/ZipDownloaderTest.php index b8e148f2b..8ecb2719f 100644 --- a/tests/Composer/Test/Downloader/ZipDownloaderTest.php +++ b/tests/Composer/Test/Downloader/ZipDownloaderTest.php @@ -32,7 +32,7 @@ class ZipDownloaderTest extends TestCase /** @var \Composer\Package\PackageInterface&\PHPUnit\Framework\MockObject\MockObject */ private $package; - public function setUp() + public function setUp(): void { $this->testDir = $this->getUniqueTmpDirectory(); $this->io = $this->getMockBuilder('Composer\IO\IOInterface')->getMock(); @@ -42,8 +42,9 @@ class ZipDownloaderTest extends TestCase $this->package = $this->getMockBuilder('Composer\Package\PackageInterface')->getMock(); } - public function tearDown() + protected function tearDown(): void { + parent::tearDown(); $fs = new Filesystem; $fs->removeDirectory($this->testDir); $this->setPrivateProperty('hasZipArchive', null); @@ -107,7 +108,8 @@ class ZipDownloaderTest extends TestCase public function testZipArchiveOnlyFailed() { - $this->setExpectedException('RuntimeException', 'There was an error extracting the ZIP file'); + self::expectException('RuntimeException'); + self::expectExceptionMessage('There was an error extracting the ZIP file'); if (!class_exists('ZipArchive')) { $this->markTestSkipped('zip extension missing'); } @@ -115,10 +117,10 @@ class ZipDownloaderTest extends TestCase $this->setPrivateProperty('hasZipArchive', true); $downloader = new MockedZipDownloader($this->io, $this->config, $this->httpDownloader); $zipArchive = $this->getMockBuilder('ZipArchive')->getMock(); - $zipArchive->expects($this->at(0)) + $zipArchive->expects($this->once()) ->method('open') ->will($this->returnValue(true)); - $zipArchive->expects($this->at(1)) + $zipArchive->expects($this->once()) ->method('extractTo') ->will($this->returnValue(false)); @@ -129,7 +131,8 @@ class ZipDownloaderTest extends TestCase public function testZipArchiveExtractOnlyFailed() { - $this->setExpectedException('RuntimeException', 'The archive may contain identical file names with different capitalization (which fails on case insensitive filesystems): Not a directory'); + self::expectException('RuntimeException'); + self::expectExceptionMessage('The archive may contain identical file names with different capitalization (which fails on case insensitive filesystems): Not a directory'); if (!class_exists('ZipArchive')) { $this->markTestSkipped('zip extension missing'); } @@ -137,10 +140,10 @@ class ZipDownloaderTest extends TestCase $this->setPrivateProperty('hasZipArchive', true); $downloader = new MockedZipDownloader($this->io, $this->config, $this->httpDownloader); $zipArchive = $this->getMockBuilder('ZipArchive')->getMock(); - $zipArchive->expects($this->at(0)) + $zipArchive->expects($this->once()) ->method('open') ->will($this->returnValue(true)); - $zipArchive->expects($this->at(1)) + $zipArchive->expects($this->once()) ->method('extractTo') ->will($this->throwException(new \ErrorException('Not a directory'))); @@ -158,10 +161,10 @@ class ZipDownloaderTest extends TestCase $this->setPrivateProperty('hasZipArchive', true); $downloader = new MockedZipDownloader($this->io, $this->config, $this->httpDownloader); $zipArchive = $this->getMockBuilder('ZipArchive')->getMock(); - $zipArchive->expects($this->at(0)) + $zipArchive->expects($this->once()) ->method('open') ->will($this->returnValue(true)); - $zipArchive->expects($this->at(1)) + $zipArchive->expects($this->once()) ->method('extractTo') ->will($this->returnValue(true)); @@ -172,7 +175,8 @@ class ZipDownloaderTest extends TestCase public function testSystemUnzipOnlyFailed() { - $this->setExpectedException('Exception', 'Failed to extract : (1) unzip'); + self::expectException('Exception'); + self::expectExceptionMessage('Failed to extract : (1) unzip'); $this->setPrivateProperty('isWindows', false); $this->setPrivateProperty('hasZipArchive', false); $this->setPrivateProperty('unzipCommands', array(array('unzip', 'unzip -qq %s -d %s'))); @@ -189,7 +193,7 @@ class ZipDownloaderTest extends TestCase ->will($this->returnValue('output')); $processExecutor = $this->getMockBuilder('Composer\Util\ProcessExecutor')->getMock(); - $processExecutor->expects($this->at(0)) + $processExecutor->expects($this->once()) ->method('executeAsync') ->will($this->returnValue(\React\Promise\resolve($procMock))); @@ -216,7 +220,7 @@ class ZipDownloaderTest extends TestCase ->will($this->returnValue('output')); $processExecutor = $this->getMockBuilder('Composer\Util\ProcessExecutor')->getMock(); - $processExecutor->expects($this->at(0)) + $processExecutor->expects($this->once()) ->method('executeAsync') ->will($this->returnValue(\React\Promise\resolve($procMock))); @@ -246,15 +250,15 @@ class ZipDownloaderTest extends TestCase ->will($this->returnValue('output')); $processExecutor = $this->getMockBuilder('Composer\Util\ProcessExecutor')->getMock(); - $processExecutor->expects($this->at(0)) + $processExecutor->expects($this->once()) ->method('executeAsync') ->will($this->returnValue(\React\Promise\resolve($procMock))); $zipArchive = $this->getMockBuilder('ZipArchive')->getMock(); - $zipArchive->expects($this->at(0)) + $zipArchive->expects($this->once()) ->method('open') ->will($this->returnValue(true)); - $zipArchive->expects($this->at(1)) + $zipArchive->expects($this->once()) ->method('extractTo') ->will($this->returnValue(true)); @@ -266,7 +270,8 @@ class ZipDownloaderTest extends TestCase public function testNonWindowsFallbackFailed() { - $this->setExpectedException('Exception', 'There was an error extracting the ZIP file'); + self::expectException('Exception'); + self::expectExceptionMessage('There was an error extracting the ZIP file'); if (!class_exists('ZipArchive')) { $this->markTestSkipped('zip extension missing'); } @@ -286,15 +291,15 @@ class ZipDownloaderTest extends TestCase ->will($this->returnValue('output')); $processExecutor = $this->getMockBuilder('Composer\Util\ProcessExecutor')->getMock(); - $processExecutor->expects($this->at(0)) + $processExecutor->expects($this->once()) ->method('executeAsync') ->will($this->returnValue(\React\Promise\resolve($procMock))); $zipArchive = $this->getMockBuilder('ZipArchive')->getMock(); - $zipArchive->expects($this->at(0)) + $zipArchive->expects($this->once()) ->method('open') ->will($this->returnValue(true)); - $zipArchive->expects($this->at(1)) + $zipArchive->expects($this->once()) ->method('extractTo') ->will($this->returnValue(false)); diff --git a/tests/Composer/Test/EventDispatcher/EventDispatcherTest.php b/tests/Composer/Test/EventDispatcher/EventDispatcherTest.php index 9065c61ec..6b164781a 100644 --- a/tests/Composer/Test/EventDispatcher/EventDispatcherTest.php +++ b/tests/Composer/Test/EventDispatcher/EventDispatcherTest.php @@ -31,24 +31,23 @@ class EventDispatcherTest extends TestCase { public function testListenerExceptionsAreCaught() { - $this->setExpectedException('RuntimeException'); + self::expectException('RuntimeException'); $io = $this->getMockBuilder('Composer\IO\IOInterface')->getMock(); $dispatcher = $this->getDispatcherStubForListenersTest(array( 'Composer\Test\EventDispatcher\EventDispatcherTest::call', ), $io); - $io->expects($this->at(0)) + $io->expects($this->once()) ->method('isVerbose') ->willReturn(0); - $io->expects($this->at(1)) + $io->expects($this->atLeast(2)) ->method('writeError') - ->with('> Composer\Test\EventDispatcher\EventDispatcherTest::call'); - - $io->expects($this->at(2)) - ->method('writeError') - ->with('Script Composer\Test\EventDispatcher\EventDispatcherTest::call handling the post-install-cmd event terminated with an exception'); + ->withConsecutive( + ['> Composer\Test\EventDispatcher\EventDispatcherTest::call'], + ['Script Composer\Test\EventDispatcher\EventDispatcherTest::call handling the post-install-cmd event terminated with an exception'] + ); $dispatcher->dispatchScript(ScriptEvents::POST_INSTALL_CMD, false); } @@ -60,7 +59,7 @@ class EventDispatcherTest extends TestCase */ public function testDispatcherCanExecuteSingleCommandLineScript($command) { - $process = new ProcessExecutorMock; + $process = $this->getProcessExecutorMock(); $process->expects(array( $command, ), true); @@ -71,7 +70,7 @@ class EventDispatcherTest extends TestCase $this->getMockBuilder('Composer\IO\IOInterface')->getMock(), $process, )) - ->setMethods(array('getListeners')) + ->onlyMethods(array('getListeners')) ->getMock(); $listener = array($command); @@ -80,8 +79,6 @@ class EventDispatcherTest extends TestCase ->will($this->returnValue($listener)); $dispatcher->dispatchScript(ScriptEvents::POST_INSTALL_CMD, false); - - $process->assertComplete($this); } /** @@ -110,7 +107,7 @@ class EventDispatcherTest extends TestCase $dispatcher = new EventDispatcher( $composer, $this->getMockBuilder('Composer\IO\IOInterface')->getMock(), - new ProcessExecutorMock + $this->getProcessExecutorMock() ); $event = $this->getMockBuilder('Composer\Script\Event') @@ -139,7 +136,7 @@ class EventDispatcherTest extends TestCase { $generator = $this->getMockBuilder('Composer\Autoload\AutoloadGenerator') ->disableOriginalConstructor() - ->setMethods(array( + ->onlyMethods(array( 'buildPackageMap', 'parseAutoloads', 'createLoader', @@ -166,7 +163,7 @@ class EventDispatcherTest extends TestCase { $rm = $this->getMockBuilder('Composer\Repository\RepositoryManager') ->disableOriginalConstructor() - ->setMethods(array('getLocalRepository')) + ->onlyMethods(array('getLocalRepository')) ->getMock(); $repo = $this->getMockBuilder('Composer\Repository\InstalledRepositoryInterface')->getMock(); @@ -191,7 +188,7 @@ class EventDispatcherTest extends TestCase $dispatcher = new EventDispatcher( $composer, $io = new BufferIO('', OutputInterface::VERBOSITY_VERBOSE), - new ProcessExecutorMock + $this->getProcessExecutorMock() ); $listener = array($this, 'someMethod'); @@ -226,7 +223,7 @@ class EventDispatcherTest extends TestCase public function testDispatcherCanExecuteCliAndPhpInSameEventScriptStack() { - $process = new ProcessExecutorMock; + $process = $this->getProcessExecutorMock(); $process->expects(array( 'echo -n foo', 'echo -n bar', @@ -238,7 +235,7 @@ class EventDispatcherTest extends TestCase $io = new BufferIO('', OutputInterface::VERBOSITY_VERBOSE), $process, )) - ->setMethods(array( + ->onlyMethods(array( 'getListeners', )) ->getMock(); @@ -259,8 +256,6 @@ class EventDispatcherTest extends TestCase '> post-install-cmd: Composer\Test\EventDispatcher\EventDispatcherTest::someMethod'.PHP_EOL. '> post-install-cmd: echo -n bar'.PHP_EOL; $this->assertEquals($expected, $io->getOutput()); - - $process->assertComplete($this); } public function testDispatcherCanPutEnv() @@ -269,9 +264,9 @@ class EventDispatcherTest extends TestCase ->setConstructorArgs(array( $this->createComposerInstance(), $io = new BufferIO('', OutputInterface::VERBOSITY_VERBOSE), - new ProcessExecutorMock, + $this->getProcessExecutorMock(), )) - ->setMethods(array( + ->onlyMethods(array( 'getListeners', )) ->getMock(); @@ -302,8 +297,8 @@ class EventDispatcherTest extends TestCase $dispatcher = $this->getMockBuilder('Composer\EventDispatcher\EventDispatcher')->setConstructorArgs(array( $this->createComposerInstance(), $io = new BufferIO('', OutputInterface::VERBOSITY_VERBOSE), - new ProcessExecutorMock, - ))->setMethods(array( + $this->getProcessExecutorMock(), + ))->onlyMethods(array( 'getListeners', ))->getMock(); @@ -368,7 +363,7 @@ class EventDispatcherTest extends TestCase public function testDispatcherCanExecuteComposerScriptGroups() { - $process = new ProcessExecutorMock; + $process = $this->getProcessExecutorMock(); $process->expects(array( 'echo -n foo', 'echo -n baz', @@ -381,7 +376,7 @@ class EventDispatcherTest extends TestCase $io = new BufferIO('', OutputInterface::VERBOSITY_VERBOSE), $process, )) - ->setMethods(array( + ->onlyMethods(array( 'getListeners', )) ->getMock(); @@ -411,13 +406,11 @@ class EventDispatcherTest extends TestCase '> subgroup: echo -n baz'.PHP_EOL. '> group: echo -n bar'.PHP_EOL; $this->assertEquals($expected, $io->getOutput()); - - $process->assertComplete($this); } public function testRecursionInScriptsNames() { - $process = new ProcessExecutorMock; + $process = $this->getProcessExecutorMock(); $process->expects(array( 'echo Hello '.ProcessExecutor::escape('World'), ), true); @@ -428,7 +421,7 @@ class EventDispatcherTest extends TestCase $io = new BufferIO('', OutputInterface::VERBOSITY_VERBOSE), $process, )) - ->setMethods(array( + ->onlyMethods(array( 'getListeners', )) ->getMock(); @@ -452,21 +445,19 @@ class EventDispatcherTest extends TestCase "> hello: echo Hello " .$this->getCmd("'World'").PHP_EOL; $this->assertEquals($expected, $io->getOutput()); - - $process->assertComplete($this); } public function testDispatcherDetectInfiniteRecursion() { - $this->setExpectedException('RuntimeException'); + self::expectException('RuntimeException'); $dispatcher = $this->getMockBuilder('Composer\EventDispatcher\EventDispatcher') ->setConstructorArgs(array( $composer = $this->createComposerInstance(), $io = $this->getMockBuilder('Composer\IO\IOInterface')->getMock(), - new ProcessExecutorMock, + $this->getProcessExecutorMock(), )) - ->setMethods(array( + ->onlyMethods(array( 'getListeners', )) ->getMock(); @@ -500,7 +491,7 @@ class EventDispatcherTest extends TestCase $this->createComposerInstance(), $io, )) - ->setMethods(array('getListeners')) + ->onlyMethods(array('getListeners')) ->getMock(); $dispatcher->expects($this->atLeastOnce()) @@ -527,7 +518,7 @@ class EventDispatcherTest extends TestCase $io = $this->getMockBuilder('Composer\IO\IOInterface')->getMock(), new ProcessExecutor($io), )) - ->setMethods(array('getListeners')) + ->onlyMethods(array('getListeners')) ->getMock(); $listener = array('echo foo'); @@ -554,7 +545,7 @@ class EventDispatcherTest extends TestCase $io = $this->getMockBuilder('Composer\IO\IOInterface')->getMock(), new ProcessExecutor, )) - ->setMethods(array('getListeners')) + ->onlyMethods(array('getListeners')) ->getMock(); $code = 'exit 1'; @@ -563,23 +554,22 @@ class EventDispatcherTest extends TestCase ->method('getListeners') ->will($this->returnValue($listener)); - $io->expects($this->at(0)) + $io->expects($this->once()) ->method('isVerbose') ->willReturn(0); - $io->expects($this->at(1)) + $io->expects($this->atLeast(2)) ->method('writeError') - ->willReturn('> exit 1'); + ->withConsecutive( + ['> exit 1'], + ['Script '.$code.' handling the post-install-cmd event returned with error code 1'] + ); - $io->expects($this->at(2)) + $io->expects($this->once()) ->method('isInteractive') ->willReturn(1); - $io->expects($this->at(3)) - ->method('writeError') - ->with($this->equalTo('Script '.$code.' handling the post-install-cmd event returned with error code 1')); - - $this->setExpectedException('RuntimeException'); + self::expectException('RuntimeException'); $dispatcher->dispatchScript(ScriptEvents::POST_INSTALL_CMD, false); } @@ -589,9 +579,9 @@ class EventDispatcherTest extends TestCase ->setConstructorArgs(array( $this->createComposerInstance(), $this->getMockBuilder('Composer\IO\IOInterface')->getMock(), - new ProcessExecutorMock, + $this->getProcessExecutorMock(), )) - ->setMethods(array('getListeners')) + ->onlyMethods(array('getListeners')) ->getMock(); $dispatcher->expects($this->atLeastOnce()) diff --git a/tests/Composer/Test/Filter/PlatformRequirementFilter/PlatformRequirementFilterFactoryTest.php b/tests/Composer/Test/Filter/PlatformRequirementFilter/PlatformRequirementFilterFactoryTest.php index 10eaa3fb3..5db37cacf 100644 --- a/tests/Composer/Test/Filter/PlatformRequirementFilter/PlatformRequirementFilterFactoryTest.php +++ b/tests/Composer/Test/Filter/PlatformRequirementFilter/PlatformRequirementFilterFactoryTest.php @@ -32,7 +32,8 @@ final class PlatformRequirementFilterFactoryTest extends TestCase public function testFromBoolThrowsExceptionIfTypeIsUnknown() { - $this->setExpectedException('InvalidArgumentException', 'PlatformRequirementFilter: Unknown $boolOrList parameter NULL. Please report at https://github.com/composer/composer/issues/new.'); + self::expectException('InvalidArgumentException'); + self::expectExceptionMessage('PlatformRequirementFilter: Unknown $boolOrList parameter NULL. Please report at https://github.com/composer/composer/issues/new.'); PlatformRequirementFilterFactory::fromBoolOrList(null); } diff --git a/tests/Composer/Test/Fixtures/functional/installed-versions.test b/tests/Composer/Test/Fixtures/functional/installed-versions.test index fa9386c17..fe9ef1e11 100644 --- a/tests/Composer/Test/Fixtures/functional/installed-versions.test +++ b/tests/Composer/Test/Fixtures/functional/installed-versions.test @@ -8,7 +8,7 @@ Checks that package versions in InstalledVersions are correct on initial install update --EXPECT-- > Hooks::preUpdate -!!PreUpdate:["composer/ca-bundle","composer/composer","composer/metadata-minifier","composer/pcre","composer/semver","composer/spdx-licenses","composer/xdebug-handler","justinrainbow/json-schema","psr/log","react/promise","seld/jsonlint","seld/phar-utils","symfony/console","symfony/debug","symfony/filesystem","symfony/finder","symfony/polyfill-ctype","symfony/polyfill-mbstring","symfony/process"] +!!PreUpdate:["composer/ca-bundle","composer/composer","composer/metadata-minifier","composer/pcre","composer/semver","composer/spdx-licenses","composer/xdebug-handler","justinrainbow/json-schema","psr/container","psr/log","psr/log-implementation","react/promise","seld/jsonlint","seld/phar-utils","symfony/console","symfony/deprecation-contracts","symfony/filesystem","symfony/finder","symfony/polyfill-ctype","symfony/polyfill-intl-grapheme","symfony/polyfill-intl-normalizer","symfony/polyfill-mbstring","symfony/polyfill-php73","symfony/polyfill-php80","symfony/process","symfony/service-contracts","symfony/string"] !!Versions:console:%[2-8]\.\d+\.\d+.0%;process:%[2-8]\.\d+\.\d+.0%;filesystem:%[2-8]\.\d+\.\d+.0% Loading composer repositories with package information Updating dependencies @@ -26,12 +26,12 @@ Package operations: 6 installs, 0 updates, 0 removals%(\nAs there is no 'unzip' - Downloading symfony/filesystem (%v?[2-8]\.\d+\.\d+%) - Installing symfony/console (99999.1.2): Symlinking from symfony-console - Installing plugin/a (1.1.1): Symlinking from plugin-a -!!PluginAInit["composer/ca-bundle","composer/composer","composer/metadata-minifier","composer/pcre","composer/semver","composer/spdx-licenses","composer/xdebug-handler","justinrainbow/json-schema","psr/log","react/promise","seld/jsonlint","seld/phar-utils","symfony/console","symfony/debug","symfony/filesystem","symfony/finder","symfony/polyfill-ctype","symfony/polyfill-mbstring","symfony/process","root/pkg"] +!!PluginAInit["composer/ca-bundle","composer/composer","composer/metadata-minifier","composer/pcre","composer/semver","composer/spdx-licenses","composer/xdebug-handler","justinrainbow/json-schema","psr/container","psr/log","psr/log-implementation","react/promise","seld/jsonlint","seld/phar-utils","symfony/console","symfony/deprecation-contracts","symfony/filesystem","symfony/finder","symfony/polyfill-ctype","symfony/polyfill-intl-grapheme","symfony/polyfill-intl-normalizer","symfony/polyfill-mbstring","symfony/polyfill-php73","symfony/polyfill-php80","symfony/process","symfony/service-contracts","symfony/string","root/pkg"] !!PluginA:null !!PluginB:null !!Versions:console:%[2-8]\.\d+\.\d+.0%;process:%[2-8]\.\d+\.\d+.0%;filesystem:%[2-8]\.\d+\.\d+.0% - Installing plugin/b (2.2.2): Symlinking from plugin-b -!!PluginBInit["composer/ca-bundle","composer/composer","composer/metadata-minifier","composer/pcre","composer/semver","composer/spdx-licenses","composer/xdebug-handler","justinrainbow/json-schema","psr/log","react/promise","seld/jsonlint","seld/phar-utils","symfony/console","symfony/debug","symfony/filesystem","symfony/finder","symfony/polyfill-ctype","symfony/polyfill-mbstring","symfony/process","plugin/a","root/pkg"] +!!PluginBInit["composer/ca-bundle","composer/composer","composer/metadata-minifier","composer/pcre","composer/semver","composer/spdx-licenses","composer/xdebug-handler","justinrainbow/json-schema","psr/container","psr/log","psr/log-implementation","react/promise","seld/jsonlint","seld/phar-utils","symfony/console","symfony/deprecation-contracts","symfony/filesystem","symfony/finder","symfony/polyfill-ctype","symfony/polyfill-intl-grapheme","symfony/polyfill-intl-normalizer","symfony/polyfill-mbstring","symfony/polyfill-php73","symfony/polyfill-php80","symfony/process","symfony/service-contracts","symfony/string","plugin/a","root/pkg"] !!PluginA:1.1.1.0 !!PluginB:null !!Versions:console:%[2-8]\.\d+\.\d+.0%;process:%[2-8]\.\d+\.\d+.0%;filesystem:%[2-8]\.\d+\.\d+.0% @@ -42,7 +42,7 @@ Generating autoload files 2 packages you are using are looking for funding. Use the `composer fund` command to find out more! > Hooks::postUpdate -!!PostUpdate:["composer/ca-bundle","composer/composer","composer/metadata-minifier","composer/pcre","composer/semver","composer/spdx-licenses","composer/xdebug-handler","justinrainbow/json-schema","psr/log","react/promise","seld/jsonlint","seld/phar-utils","symfony/console","symfony/debug","symfony/filesystem","symfony/finder","symfony/polyfill-ctype","symfony/polyfill-mbstring","symfony/process","plugin/a","plugin/b","root/pkg"] +!!PostUpdate:["composer/ca-bundle","composer/composer","composer/metadata-minifier","composer/pcre","composer/semver","composer/spdx-licenses","composer/xdebug-handler","justinrainbow/json-schema","psr/container","psr/log","psr/log-implementation","react/promise","seld/jsonlint","seld/phar-utils","symfony/console","symfony/deprecation-contracts","symfony/filesystem","symfony/finder","symfony/polyfill-ctype","symfony/polyfill-intl-grapheme","symfony/polyfill-intl-normalizer","symfony/polyfill-mbstring","symfony/polyfill-php73","symfony/polyfill-php80","symfony/process","symfony/service-contracts","symfony/string","plugin/a","plugin/b","root/pkg"] !!Versions:console:%[2-8]\.\d+\.\d+.0%;process:%[2-8]\.\d+\.\d+.0%;filesystem:%[2-8]\.\d+\.\d+.0% --EXPECT-EXIT-CODE-- diff --git a/tests/Composer/Test/Fixtures/functional/installed-versions2.test b/tests/Composer/Test/Fixtures/functional/installed-versions2.test index bec76d430..a2d5f3362 100644 --- a/tests/Composer/Test/Fixtures/functional/installed-versions2.test +++ b/tests/Composer/Test/Fixtures/functional/installed-versions2.test @@ -7,14 +7,14 @@ Checks that package versions in InstalledVersions are correct during an upgrade. --RUN-- update plugin/* symfony/console symfony/filesystem symfony/process --EXPECT-- -!!PluginA:1.1.1.0["composer/ca-bundle","composer/composer","composer/metadata-minifier","composer/pcre","composer/semver","composer/spdx-licenses","composer/xdebug-handler","justinrainbow/json-schema","psr/log","react/promise","seld/jsonlint","seld/phar-utils","symfony/console","symfony/debug","symfony/filesystem","symfony/finder","symfony/polyfill-ctype","symfony/polyfill-mbstring","symfony/process","plugin/a","plugin/b","root/pkg"] +!!PluginA:1.1.1.0["composer/ca-bundle","composer/composer","composer/metadata-minifier","composer/pcre","composer/semver","composer/spdx-licenses","composer/xdebug-handler","justinrainbow/json-schema","psr/container","psr/log","psr/log-implementation","react/promise","seld/jsonlint","seld/phar-utils","symfony/console","symfony/deprecation-contracts","symfony/filesystem","symfony/finder","symfony/polyfill-ctype","symfony/polyfill-intl-grapheme","symfony/polyfill-intl-normalizer","symfony/polyfill-mbstring","symfony/polyfill-php73","symfony/polyfill-php80","symfony/process","symfony/service-contracts","symfony/string","plugin/a","plugin/b","root/pkg"] !!PluginB:2.2.2.0 !!Versions:console:%[2-8]\.\d+\.\d+.0%;process:%[2-8]\.\d+\.\d+.0%;filesystem:%[2-8]\.\d+\.\d+.0% -!!PluginB:2.2.2.0["composer/ca-bundle","composer/composer","composer/metadata-minifier","composer/pcre","composer/semver","composer/spdx-licenses","composer/xdebug-handler","justinrainbow/json-schema","psr/log","react/promise","seld/jsonlint","seld/phar-utils","symfony/console","symfony/debug","symfony/filesystem","symfony/finder","symfony/polyfill-ctype","symfony/polyfill-mbstring","symfony/process","plugin/a","plugin/b","root/pkg"] +!!PluginB:2.2.2.0["composer/ca-bundle","composer/composer","composer/metadata-minifier","composer/pcre","composer/semver","composer/spdx-licenses","composer/xdebug-handler","justinrainbow/json-schema","psr/container","psr/log","psr/log-implementation","react/promise","seld/jsonlint","seld/phar-utils","symfony/console","symfony/deprecation-contracts","symfony/filesystem","symfony/finder","symfony/polyfill-ctype","symfony/polyfill-intl-grapheme","symfony/polyfill-intl-normalizer","symfony/polyfill-mbstring","symfony/polyfill-php73","symfony/polyfill-php80","symfony/process","symfony/service-contracts","symfony/string","plugin/a","plugin/b","root/pkg"] !!PluginA:1.1.1.0 !!Versions:console:%[2-8]\.\d+\.\d+.0%;process:%[2-8]\.\d+\.\d+.0%;filesystem:%[2-8]\.\d+\.\d+.0% > Hooks::preUpdate -!!PreUpdate:["composer/ca-bundle","composer/composer","composer/metadata-minifier","composer/pcre","composer/semver","composer/spdx-licenses","composer/xdebug-handler","justinrainbow/json-schema","psr/log","react/promise","seld/jsonlint","seld/phar-utils","symfony/console","symfony/debug","symfony/filesystem","symfony/finder","symfony/polyfill-ctype","symfony/polyfill-mbstring","symfony/process","plugin/a","plugin/b","root/pkg"] +!!PreUpdate:["composer/ca-bundle","composer/composer","composer/metadata-minifier","composer/pcre","composer/semver","composer/spdx-licenses","composer/xdebug-handler","justinrainbow/json-schema","psr/container","psr/log","psr/log-implementation","react/promise","seld/jsonlint","seld/phar-utils","symfony/console","symfony/deprecation-contracts","symfony/filesystem","symfony/finder","symfony/polyfill-ctype","symfony/polyfill-intl-grapheme","symfony/polyfill-intl-normalizer","symfony/polyfill-mbstring","symfony/polyfill-php73","symfony/polyfill-php80","symfony/process","symfony/service-contracts","symfony/string","plugin/a","plugin/b","root/pkg"] !!Versions:console:%[2-8]\.\d+\.\d+.0%;process:%[2-8]\.\d+\.\d+.0%;filesystem:%[2-8]\.\d+\.\d+.0% Loading composer repositories with package information Updating dependencies @@ -30,12 +30,12 @@ Package operations: 0 installs, 5 updates, 0 removals%(\nAs there is no 'unzip' - Downloading symfony/filesystem (%v?[2-8]\.\d+\.\d+%) - Upgrading symfony/console (99999.1.2 => 99999.1.3): Mirroring from symfony-console - Upgrading plugin/a (1.1.1 => 1.1.2): Mirroring from plugin-a -!!PluginAInit["composer/ca-bundle","composer/composer","composer/metadata-minifier","composer/pcre","composer/semver","composer/spdx-licenses","composer/xdebug-handler","justinrainbow/json-schema","psr/log","react/promise","seld/jsonlint","seld/phar-utils","symfony/console","symfony/debug","symfony/filesystem","symfony/finder","symfony/polyfill-ctype","symfony/polyfill-mbstring","symfony/process","plugin/a","plugin/b","root/pkg"] +!!PluginAInit["composer/ca-bundle","composer/composer","composer/metadata-minifier","composer/pcre","composer/semver","composer/spdx-licenses","composer/xdebug-handler","justinrainbow/json-schema","psr/container","psr/log","psr/log-implementation","react/promise","seld/jsonlint","seld/phar-utils","symfony/console","symfony/deprecation-contracts","symfony/filesystem","symfony/finder","symfony/polyfill-ctype","symfony/polyfill-intl-grapheme","symfony/polyfill-intl-normalizer","symfony/polyfill-mbstring","symfony/polyfill-php73","symfony/polyfill-php80","symfony/process","symfony/service-contracts","symfony/string","plugin/a","plugin/b","root/pkg"] !!PluginA:1.1.1.0 !!PluginB:2.2.2.0 !!Versions:console:%[2-8]\.\d+\.\d+.0%;process:%[2-8]\.\d+\.\d+.0%;filesystem:%[2-8]\.\d+\.\d+.0% - Upgrading plugin/b (2.2.2 => 2.2.3): Mirroring from plugin-b -!!PluginBInit["composer/ca-bundle","composer/composer","composer/metadata-minifier","composer/pcre","composer/semver","composer/spdx-licenses","composer/xdebug-handler","justinrainbow/json-schema","psr/log","react/promise","seld/jsonlint","seld/phar-utils","symfony/console","symfony/debug","symfony/filesystem","symfony/finder","symfony/polyfill-ctype","symfony/polyfill-mbstring","symfony/process","plugin/a","plugin/b","root/pkg"] +!!PluginBInit["composer/ca-bundle","composer/composer","composer/metadata-minifier","composer/pcre","composer/semver","composer/spdx-licenses","composer/xdebug-handler","justinrainbow/json-schema","psr/container","psr/log","psr/log-implementation","react/promise","seld/jsonlint","seld/phar-utils","symfony/console","symfony/deprecation-contracts","symfony/filesystem","symfony/finder","symfony/polyfill-ctype","symfony/polyfill-intl-grapheme","symfony/polyfill-intl-normalizer","symfony/polyfill-mbstring","symfony/polyfill-php73","symfony/polyfill-php80","symfony/process","symfony/service-contracts","symfony/string","plugin/a","plugin/b","root/pkg"] !!PluginA:1.1.2.0 !!PluginB:2.2.2.0 !!Versions:console:%[2-8]\.\d+\.\d+.0%;process:%[2-8]\.\d+\.\d+.0%;filesystem:%[2-8]\.\d+\.\d+.0% @@ -45,7 +45,7 @@ Generating autoload files 2 packages you are using are looking for funding. Use the `composer fund` command to find out more! > Hooks::postUpdate -!!PostUpdate:["composer/ca-bundle","composer/composer","composer/metadata-minifier","composer/pcre","composer/semver","composer/spdx-licenses","composer/xdebug-handler","justinrainbow/json-schema","psr/log","react/promise","seld/jsonlint","seld/phar-utils","symfony/console","symfony/debug","symfony/filesystem","symfony/finder","symfony/polyfill-ctype","symfony/polyfill-mbstring","symfony/process","plugin/a","plugin/b","root/pkg"] +!!PostUpdate:["composer/ca-bundle","composer/composer","composer/metadata-minifier","composer/pcre","composer/semver","composer/spdx-licenses","composer/xdebug-handler","justinrainbow/json-schema","psr/container","psr/log","psr/log-implementation","react/promise","seld/jsonlint","seld/phar-utils","symfony/console","symfony/deprecation-contracts","symfony/filesystem","symfony/finder","symfony/polyfill-ctype","symfony/polyfill-intl-grapheme","symfony/polyfill-intl-normalizer","symfony/polyfill-mbstring","symfony/polyfill-php73","symfony/polyfill-php80","symfony/process","symfony/service-contracts","symfony/string","plugin/a","plugin/b","root/pkg"] !!Versions:console:%[2-8]\.\d+\.\d+.0%;process:%[2-8]\.\d+\.\d+.0%;filesystem:%[2-8]\.\d+\.\d+.0% !!PluginA:1.1.2.0 !!PluginB:2.2.3.0 diff --git a/tests/Composer/Test/IO/BufferIOTest.php b/tests/Composer/Test/IO/BufferIOTest.php index 7b8bf2f41..52c11562a 100644 --- a/tests/Composer/Test/IO/BufferIOTest.php +++ b/tests/Composer/Test/IO/BufferIOTest.php @@ -27,7 +27,8 @@ class BufferIOTest extends TestCase $input = $refl->getValue($bufferIO); if (!$input instanceof StreamableInputInterface) { - $this->setExpectedException('\RuntimeException', 'Setting the user inputs requires at least the version 3.2 of the symfony/console component.'); + self::expectException('\RuntimeException'); + self::expectExceptionMessage('Setting the user inputs requires at least the version 3.2 of the symfony/console component.'); } $bufferIO->setUserInputs(array( diff --git a/tests/Composer/Test/IO/ConsoleIOTest.php b/tests/Composer/Test/IO/ConsoleIOTest.php index 3d2d29fba..e275274cc 100644 --- a/tests/Composer/Test/IO/ConsoleIOTest.php +++ b/tests/Composer/Test/IO/ConsoleIOTest.php @@ -22,12 +22,12 @@ class ConsoleIOTest extends TestCase public function testIsInteractive() { $inputMock = $this->getMockBuilder('Symfony\Component\Console\Input\InputInterface')->getMock(); - $inputMock->expects($this->at(0)) + $inputMock->expects($this->exactly(2)) ->method('isInteractive') - ->will($this->returnValue(true)); - $inputMock->expects($this->at(1)) - ->method('isInteractive') - ->will($this->returnValue(false)); + ->willReturnOnConsecutiveCalls( + true, + false + ); $outputMock = $this->getMockBuilder('Symfony\Component\Console\Output\OutputInterface')->getMock(); $helperMock = $this->getMockBuilder('Symfony\Component\Console\Helper\HelperSet')->getMock(); @@ -109,27 +109,17 @@ class ConsoleIOTest extends TestCase $outputMock->expects($this->any()) ->method('getVerbosity') ->willReturn(OutputInterface::VERBOSITY_NORMAL); - $outputMock->expects($this->at(1)) + $outputMock->expects($this->atLeast(7)) ->method('write') - ->with($this->equalTo('something (strlen = 23)')); - $outputMock->expects($this->at(3)) - ->method('write') - ->with($this->equalTo(str_repeat("\x08", 23)), $this->equalTo(false)); - $outputMock->expects($this->at(5)) - ->method('write') - ->with($this->equalTo('shorter (12)'), $this->equalTo(false)); - $outputMock->expects($this->at(7)) - ->method('write') - ->with($this->equalTo(str_repeat(' ', 11)), $this->equalTo(false)); - $outputMock->expects($this->at(9)) - ->method('write') - ->with($this->equalTo(str_repeat("\x08", 11)), $this->equalTo(false)); - $outputMock->expects($this->at(11)) - ->method('write') - ->with($this->equalTo(str_repeat("\x08", 12)), $this->equalTo(false)); - $outputMock->expects($this->at(13)) - ->method('write') - ->with($this->equalTo('something longer than initial (34)')); + ->withConsecutive( + [$this->equalTo('something (strlen = 23)')], + [$this->equalTo(str_repeat("\x08", 23)), $this->equalTo(false)], + [$this->equalTo('shorter (12)'), $this->equalTo(false)], + [$this->equalTo(str_repeat(' ', 11)), $this->equalTo(false)], + [$this->equalTo(str_repeat("\x08", 11)), $this->equalTo(false)], + [$this->equalTo(str_repeat("\x08", 12)), $this->equalTo(false)], + [$this->equalTo('something longer than initial (34)')] + ); $helperMock = $this->getMockBuilder('Symfony\Component\Console\Helper\HelperSet')->getMock(); diff --git a/tests/Composer/Test/InstalledVersionsTest.php b/tests/Composer/Test/InstalledVersionsTest.php index d66005b54..e5ead9f65 100644 --- a/tests/Composer/Test/InstalledVersionsTest.php +++ b/tests/Composer/Test/InstalledVersionsTest.php @@ -22,7 +22,7 @@ class InstalledVersionsTest extends TestCase */ private $root; - public static function setUpBeforeClass() + public static function setUpBeforeClass(): void { // disable multiple-ClassLoader-based checks of InstalledVersions by making it seem like no // class loaders are registered @@ -31,12 +31,12 @@ class InstalledVersionsTest extends TestCase $prop->setValue(array()); } - public static function tearDownAfterClass() + public static function tearDownAfterClass(): void { self::setUpBeforeClass(); } - public function setUp() + public function setUp(): void { $this->root = $this->getUniqueTmpDirectory(); @@ -200,7 +200,7 @@ class InstalledVersionsTest extends TestCase public function testGetVersionOutOfBounds() { - $this->setExpectedException('OutOfBoundsException'); + self::expectException('OutOfBoundsException'); InstalledVersions::getVersion('not/installed'); } diff --git a/tests/Composer/Test/Installer/BinaryInstallerTest.php b/tests/Composer/Test/Installer/BinaryInstallerTest.php index b862556de..da7a8c477 100644 --- a/tests/Composer/Test/Installer/BinaryInstallerTest.php +++ b/tests/Composer/Test/Installer/BinaryInstallerTest.php @@ -46,7 +46,7 @@ class BinaryInstallerTest extends TestCase */ protected $fs; - protected function setUp() + protected function setUp(): void { $this->fs = new Filesystem; @@ -60,8 +60,9 @@ class BinaryInstallerTest extends TestCase $this->io = $this->getMockBuilder('Composer\IO\IOInterface')->getMock(); } - protected function tearDown() + protected function tearDown(): void { + parent::tearDown(); $this->fs->removeDirectory($this->rootDir); } diff --git a/tests/Composer/Test/Installer/InstallationManagerTest.php b/tests/Composer/Test/Installer/InstallationManagerTest.php index 687094a74..4447919a3 100644 --- a/tests/Composer/Test/Installer/InstallationManagerTest.php +++ b/tests/Composer/Test/Installer/InstallationManagerTest.php @@ -36,7 +36,7 @@ class InstallationManagerTest extends TestCase */ protected $io; - public function setUp() + public function setUp(): void { $this->loop = $this->getMockBuilder('Composer\Util\Loop')->disableOriginalConstructor()->getMock(); $this->repository = $this->getMockBuilder('Composer\Repository\InstalledRepositoryInterface')->getMock(); @@ -59,7 +59,7 @@ class InstallationManagerTest extends TestCase $manager->addInstaller($installer); $this->assertSame($installer, $manager->getInstaller('vendor')); - $this->setExpectedException('InvalidArgumentException'); + self::expectException('InvalidArgumentException'); $manager->getInstaller('unregistered'); } @@ -97,7 +97,7 @@ class InstallationManagerTest extends TestCase { $manager = $this->getMockBuilder('Composer\Installer\InstallationManager') ->setConstructorArgs(array($this->loop, $this->io)) - ->setMethods(array('install', 'update', 'uninstall')) + ->onlyMethods(array('install', 'update', 'uninstall')) ->getMock(); $installOperation = new InstallOperation($package = $this->createPackageMock()); diff --git a/tests/Composer/Test/Installer/LibraryInstallerTest.php b/tests/Composer/Test/Installer/LibraryInstallerTest.php index ee66ce65b..a302c0b90 100644 --- a/tests/Composer/Test/Installer/LibraryInstallerTest.php +++ b/tests/Composer/Test/Installer/LibraryInstallerTest.php @@ -65,7 +65,7 @@ class LibraryInstallerTest extends TestCase */ protected $fs; - protected function setUp() + protected function setUp(): void { $this->fs = new Filesystem; @@ -96,8 +96,9 @@ class LibraryInstallerTest extends TestCase $this->io = $this->getMockBuilder('Composer\IO\IOInterface')->getMock(); } - protected function tearDown() + protected function tearDown(): void { + parent::tearDown(); $this->fs->removeDirectory($this->rootDir); } @@ -222,7 +223,7 @@ class LibraryInstallerTest extends TestCase $this->assertFileExists($this->vendorDir, 'Vendor dir should be created'); $this->assertFileExists($this->binDir, 'Bin dir should be created'); - $this->setExpectedException('InvalidArgumentException'); + self::expectException('InvalidArgumentException'); $library->update($this->repository, $initial, $target); } @@ -259,7 +260,7 @@ class LibraryInstallerTest extends TestCase $library->uninstall($this->repository, $package); - $this->setExpectedException('InvalidArgumentException'); + self::expectException('InvalidArgumentException'); $library->uninstall($this->repository, $package); } diff --git a/tests/Composer/Test/Installer/MetapackageInstallerTest.php b/tests/Composer/Test/Installer/MetapackageInstallerTest.php index 9eedcbe70..e66bf28d3 100644 --- a/tests/Composer/Test/Installer/MetapackageInstallerTest.php +++ b/tests/Composer/Test/Installer/MetapackageInstallerTest.php @@ -30,7 +30,7 @@ class MetapackageInstallerTest extends TestCase */ private $io; - protected function setUp() + protected function setUp(): void { $this->repository = $this->getMockBuilder('Composer\Repository\InstalledRepositoryInterface')->getMock(); @@ -80,7 +80,7 @@ class MetapackageInstallerTest extends TestCase $this->installer->update($this->repository, $initial, $target); - $this->setExpectedException('InvalidArgumentException'); + self::expectException('InvalidArgumentException'); $this->installer->update($this->repository, $initial, $target); } @@ -102,7 +102,7 @@ class MetapackageInstallerTest extends TestCase $this->installer->uninstall($this->repository, $package); - $this->setExpectedException('InvalidArgumentException'); + self::expectException('InvalidArgumentException'); $this->installer->uninstall($this->repository, $package); } diff --git a/tests/Composer/Test/Installer/SuggestedPackagesReporterTest.php b/tests/Composer/Test/Installer/SuggestedPackagesReporterTest.php index c6f5b8721..8416c1e75 100644 --- a/tests/Composer/Test/Installer/SuggestedPackagesReporterTest.php +++ b/tests/Composer/Test/Installer/SuggestedPackagesReporterTest.php @@ -30,7 +30,7 @@ class SuggestedPackagesReporterTest extends TestCase */ private $suggestedPackagesReporter; - protected function setUp() + protected function setUp(): void { $this->io = $this->getMockBuilder('Composer\IO\IOInterface')->getMock(); @@ -141,13 +141,13 @@ class SuggestedPackagesReporterTest extends TestCase { $this->suggestedPackagesReporter->addPackage('a', 'b', 'c'); - $this->io->expects($this->at(0)) + $this->io->expects($this->exactly(3)) ->method('write') - ->with('a suggests:'); - - $this->io->expects($this->at(1)) - ->method('write') - ->with(' - b: c'); + ->withConsecutive( + ['a suggests:'], + [' - b: c'], + [''] + ); $this->suggestedPackagesReporter->output(SuggestedPackagesReporter::MODE_BY_PACKAGE); } @@ -159,13 +159,13 @@ class SuggestedPackagesReporterTest extends TestCase { $this->suggestedPackagesReporter->addPackage('a', 'b', ''); - $this->io->expects($this->at(0)) + $this->io->expects($this->exactly(3)) ->method('write') - ->with('a suggests:'); - - $this->io->expects($this->at(1)) - ->method('write') - ->with(' - b'); + ->withConsecutive( + ['a suggests:'], + [' - b'], + [''] + ); $this->suggestedPackagesReporter->output(SuggestedPackagesReporter::MODE_BY_PACKAGE); } @@ -178,17 +178,14 @@ class SuggestedPackagesReporterTest extends TestCase $this->suggestedPackagesReporter->addPackage('source', 'target1', "\x1b[1;37;42m Like us\r\non Facebook \x1b[0m"); $this->suggestedPackagesReporter->addPackage('source', 'target2', "Like us on Facebook"); - $this->io->expects($this->at(0)) + $this->io->expects($this->exactly(4)) ->method('write') - ->with('source suggests:'); - - $this->io->expects($this->at(1)) - ->method('write') - ->with(' - target1: [1;37;42m Like us on Facebook [0m'); - - $this->io->expects($this->at(2)) - ->method('write') - ->with(' - target2: \\Like us on Facebook\\'); + ->withConsecutive( + ['source suggests:'], + [' - target1: [1;37;42m Like us on Facebook [0m'], + [' - target2: \\Like us on Facebook\\'], + [''] + ); $this->suggestedPackagesReporter->output(SuggestedPackagesReporter::MODE_BY_PACKAGE); } @@ -201,25 +198,16 @@ class SuggestedPackagesReporterTest extends TestCase $this->suggestedPackagesReporter->addPackage('a', 'b', 'c'); $this->suggestedPackagesReporter->addPackage('source package', 'target', 'because reasons'); - $this->io->expects($this->at(0)) + $this->io->expects($this->exactly(6)) ->method('write') - ->with('a suggests:'); - - $this->io->expects($this->at(1)) - ->method('write') - ->with(' - b: c'); - - $this->io->expects($this->at(2)) - ->method('write') - ->with(''); - - $this->io->expects($this->at(3)) - ->method('write') - ->with('source package suggests:'); - - $this->io->expects($this->at(4)) - ->method('write') - ->with(' - target: because reasons'); + ->withConsecutive( + ['a suggests:'], + [' - b: c'], + [''], + ['source package suggests:'], + [' - target: because reasons'], + [''] + ); $this->suggestedPackagesReporter->output(SuggestedPackagesReporter::MODE_BY_PACKAGE); } @@ -251,13 +239,13 @@ class SuggestedPackagesReporterTest extends TestCase $this->suggestedPackagesReporter->addPackage('a', 'b', 'c'); $this->suggestedPackagesReporter->addPackage('source package', 'target', 'because reasons'); - $this->io->expects($this->at(0)) + $this->io->expects($this->exactly(3)) ->method('write') - ->with('source package suggests:'); - - $this->io->expects($this->at(1)) - ->method('write') - ->with(' - target: because reasons'); + ->withConsecutive( + ['source package suggests:'], + [' - target: because reasons'], + [''] + ); $this->suggestedPackagesReporter->output(SuggestedPackagesReporter::MODE_BY_PACKAGE, $repository); } diff --git a/tests/Composer/Test/InstallerTest.php b/tests/Composer/Test/InstallerTest.php index 46d2f625f..6381a5fe7 100644 --- a/tests/Composer/Test/InstallerTest.php +++ b/tests/Composer/Test/InstallerTest.php @@ -50,14 +50,15 @@ class InstallerTest extends TestCase /** @var ?string */ protected $tempComposerHome; - public function setUp() + public function setUp(): void { $this->prevCwd = getcwd(); chdir(__DIR__); } - public function tearDown() + protected function tearDown(): void { + parent::tearDown(); Platform::clearEnv('COMPOSER_POOL_OPTIMIZER'); chdir($this->prevCwd); @@ -234,7 +235,7 @@ class InstallerTest extends TestCase * @param ?string $expectOutput * @param ?string $expectOutputOptimized * @param string $expect - * @param int|string $expectResult + * @param int|class-string<\Throwable> $expectResult */ public function testSlowIntegration($file, $message, $condition, $composerConfig, $lock, $installed, $run, $expectLock, $expectInstalled, $expectOutput, $expectOutputOptimized, $expect, $expectResult) { @@ -257,7 +258,7 @@ class InstallerTest extends TestCase * @param ?string $expectOutput * @param ?string $expectOutputOptimized * @param string $expect - * @param int|string $expectResult + * @param int|class-string<\Throwable> $expectResult */ public function testIntegrationWithPoolOptimizer($file, $message, $condition, $composerConfig, $lock, $installed, $run, $expectLock, $expectInstalled, $expectOutput, $expectOutputOptimized, $expect, $expectResult) { @@ -280,7 +281,7 @@ class InstallerTest extends TestCase * @param ?string $expectOutput * @param ?string $expectOutputOptimized * @param string $expect - * @param int|string $expectResult + * @param int|class-string<\Throwable> $expectResult */ public function testIntegrationWithRawPool($file, $message, $condition, $composerConfig, $lock, $installed, $run, $expectLock, $expectInstalled, $expectOutput, $expectOutputOptimized, $expect, $expectResult) { @@ -301,7 +302,7 @@ class InstallerTest extends TestCase * @param ?mixed[] $expectInstalled * @param ?string $expectOutput * @param string $expect - * @param int|string $expectResult + * @param int|class-string<\Throwable> $expectResult * @return void */ private function doTestIntegration($file, $message, $condition, $composerConfig, $lock, $installed, $run, $expectLock, $expectInstalled, $expectOutput, $expect, $expectResult) @@ -318,7 +319,8 @@ class InstallerTest extends TestCase // Prepare for exceptions if (!is_int($expectResult)) { $normalizedOutput = rtrim(str_replace("\n", PHP_EOL, $expect)); - $this->setExpectedException($expectResult, $normalizedOutput); + self::expectException($expectResult); + self::expectExceptionMessage($normalizedOutput); } // Create Composer mock object according to configuration @@ -451,6 +453,9 @@ class InstallerTest extends TestCase $application->setAutoExit(false); $appOutput = fopen('php://memory', 'w+'); + if (false === $appOutput) { + self::fail('Failed to open memory stream'); + } $input = new StringInput($run.' -vvv'); $input->setInteractive(false); $result = $application->run($input, new StreamOutput($appOutput)); @@ -553,7 +558,7 @@ class InstallerTest extends TestCase if (!empty($testData['LOCK'])) { $lock = JsonFile::parseJson($testData['LOCK']); if (!isset($lock['hash'])) { - $lock['hash'] = md5(json_encode($composer)); + $lock['hash'] = md5(JsonFile::encode($composer, 0)); } } if (!empty($testData['INSTALLED'])) { diff --git a/tests/Composer/Test/Json/JsonFileTest.php b/tests/Composer/Test/Json/JsonFileTest.php index 93b462f7f..2b4748eef 100644 --- a/tests/Composer/Test/Json/JsonFileTest.php +++ b/tests/Composer/Test/Json/JsonFileTest.php @@ -99,7 +99,7 @@ class JsonFileTest extends TestCase public function testSchemaValidationError() { - $file = tempnam(sys_get_temp_dir(), 'c'); + $file = $this->createTempFile(); file_put_contents($file, '{ "name": null }'); $json = new JsonFile($file); $expectedMessage = sprintf('"%s" does not match the expected JSON schema', $file); @@ -123,7 +123,7 @@ class JsonFileTest extends TestCase public function testSchemaValidationLaxAdditionalProperties() { - $file = tempnam(sys_get_temp_dir(), 'c'); + $file = $this->createTempFile(); file_put_contents($file, '{ "name": "vendor/package", "description": "generic description", "foo": "bar" }'); $json = new JsonFile($file); try { @@ -139,7 +139,7 @@ class JsonFileTest extends TestCase public function testSchemaValidationLaxRequired() { - $file = tempnam(sys_get_temp_dir(), 'c'); + $file = $this->createTempFile(); $json = new JsonFile($file); $expectedMessage = sprintf('"%s" does not match the expected JSON schema', $file); @@ -209,10 +209,10 @@ class JsonFileTest extends TestCase public function testCustomSchemaValidationLax() { - $file = tempnam(sys_get_temp_dir(), 'c'); + $file = $this->createTempFile(); file_put_contents($file, '{ "custom": "property", "another custom": "property" }'); - $schema = tempnam(sys_get_temp_dir(), 'c'); + $schema = $this->createTempFile(); file_put_contents($schema, '{ "properties": { "custom": { "type": "string" }}}'); $json = new JsonFile($file); @@ -225,10 +225,10 @@ class JsonFileTest extends TestCase public function testCustomSchemaValidationStrict() { - $file = tempnam(sys_get_temp_dir(), 'c'); + $file = $this->createTempFile(); file_put_contents($file, '{ "custom": "property" }'); - $schema = tempnam(sys_get_temp_dir(), 'c'); + $schema = $this->createTempFile(); file_put_contents($schema, '{ "properties": { "custom": { "type": "string" }}}'); $json = new JsonFile($file); diff --git a/tests/Composer/Test/Mock/HttpDownloaderMock.php b/tests/Composer/Test/Mock/HttpDownloaderMock.php index b58a9628a..fe482ee67 100644 --- a/tests/Composer/Test/Mock/HttpDownloaderMock.php +++ b/tests/Composer/Test/Mock/HttpDownloaderMock.php @@ -12,31 +12,120 @@ namespace Composer\Test\Mock; +use Composer\Config; +use Composer\IO\BufferIO; +use Composer\IO\IOInterface; use Composer\Util\HttpDownloader; use Composer\Util\Http\Response; use Composer\Downloader\TransportException; +use PHPUnit\Framework\Assert; +use PHPUnit\Framework\AssertionFailedError; class HttpDownloaderMock extends HttpDownloader { /** - * @var array + * @var array|null, status: int, body: string, headers: list}>|null */ - protected $contentMap; + private $expectations = null; + /** + * @var bool + */ + private $strict = false; + /** + * @var array{status: int, body: string, headers: array} + */ + private $defaultHandler = array('status' => 200, 'body' => '', 'headers' => []); + /** + * @var string[] + */ + private $log = array(); + + public function __construct(IOInterface $io = null, Config $config = null) + { + if ($io === null) { + $io = new BufferIO(); + } + if ($config === null) { + $config = new Config(false); + } + parent::__construct($io, $config); + } /** - * @param array $contentMap associative array of locations and content + * @param array, status?: int, body?: string, headers?: array}> $expectations + * @param bool $strict set to true if you want to provide *all* expected http requests, and not just a subset you are interested in testing + * @param array{status?: int, body?: string, headers?: array} $defaultHandler default URL handler for undefined requests if not in strict mode */ - public function __construct(array $contentMap) + public function expects(array $expectations, bool $strict = false, array $defaultHandler = array('status' => 200, 'body' => '', 'headers' => [])): void { - $this->contentMap = $contentMap; + $default = ['url' => '', 'options' => null, 'status' => 200, 'body' => '', 'headers' => ['']]; + $this->expectations = array_map(function (array $expect) use ($default): array { + if (count($diff = array_diff_key(array_merge($default, $expect), $default)) > 0) { + throw new \UnexpectedValueException('Unexpected keys in process execution step: '.implode(', ', array_keys($diff))); + } + + return array_merge($default, $expect); + }, $expectations); + $this->strict = $strict; + $this->defaultHandler = array_merge($this->defaultHandler, $defaultHandler); } - public function get($fileUrl, $options = array()) + public function assertComplete(): void { - if (!empty($this->contentMap[$fileUrl])) { - return new Response(array('url' => $fileUrl), 200, array(), $this->contentMap[$fileUrl]); + // this was not configured to expect anything, so no need to react here + if (!is_array($this->expectations)) { + return; } - throw new TransportException('The "'.$fileUrl.'" file could not be downloaded (NOT FOUND)', 404); + if (count($this->expectations) > 0) { + $expectations = array_map(function ($expect) { + return $expect['url']; + }, $this->expectations); + throw new AssertionFailedError( + 'There are still '.count($this->expectations).' expected HTTP requests which have not been consumed:'.PHP_EOL. + implode(PHP_EOL, $expectations).PHP_EOL.PHP_EOL. + 'Received calls:'.PHP_EOL.implode(PHP_EOL, $this->log) + ); + } + + // dummy assertion to ensure the test is not marked as having no assertions + Assert::assertTrue(true); // @phpstan-ignore-line + } + + public function get($fileUrl, $options = array()): Response + { + $this->log[] = $fileUrl; + + if (is_array($this->expectations) && count($this->expectations) > 0 && $fileUrl === $this->expectations[0]['url'] && ($this->expectations[0]['options'] === null || $options === $this->expectations[0]['options'])) { + $expect = array_shift($this->expectations); + + return $this->respond($fileUrl, $expect['status'], $expect['headers'], $expect['body']); + } + + if (!$this->strict) { + return $this->respond($fileUrl, $this->defaultHandler['status'], $this->defaultHandler['headers'], $this->defaultHandler['body']); + } + + throw new AssertionFailedError( + 'Received unexpected request for "'.$fileUrl.'"'.PHP_EOL. + (is_array($this->expectations) && count($this->expectations) > 0 ? 'Expected "'.$this->expectations[0]['url'].'" at this point.' : 'Expected no more calls at this point.').PHP_EOL. + 'Received calls:'.PHP_EOL.implode(PHP_EOL, array_slice($this->log, 0, -1)) + ); + } + + /** + * @param string[] $headers + */ + private function respond(string $url, int $status, array $headers, string $body): Response + { + if ($status < 400) { + return new Response(array('url' => $url), $status, $headers, $body); + } + + $e = new TransportException('The "'.$url.'" file could not be downloaded', $status); + $e->setHeaders($headers); + $e->setResponse($body); + + throw $e; } } diff --git a/tests/Composer/Test/Mock/ProcessExecutorMock.php b/tests/Composer/Test/Mock/ProcessExecutorMock.php index 247f815a8..61adeca70 100644 --- a/tests/Composer/Test/Mock/ProcessExecutorMock.php +++ b/tests/Composer/Test/Mock/ProcessExecutorMock.php @@ -14,6 +14,7 @@ namespace Composer\Test\Mock; use Composer\Util\ProcessExecutor; use Composer\Util\Platform; +use PHPUnit\Framework\Assert; use PHPUnit\Framework\TestCase; use PHPUnit\Framework\AssertionFailedError; use Symfony\Component\Process\Process; @@ -25,9 +26,9 @@ use React\Promise\Promise; class ProcessExecutorMock extends ProcessExecutor { /** - * @var array + * @var array|null */ - private $expectations = array(); + private $expectations = null; /** * @var bool */ @@ -64,10 +65,14 @@ class ProcessExecutorMock extends ProcessExecutor $this->defaultHandler = array_merge($this->defaultHandler, $defaultHandler); } - /** @return void */ - public function assertComplete(TestCase $testCase) + public function assertComplete(): void { - if ($this->expectations) { + // this was not configured to expect anything, so no need to react here + if (!is_array($this->expectations)) { + return; + } + + if (count($this->expectations) > 0) { $expectations = array_map(function ($expect) { return $expect['cmd']; }, $this->expectations); @@ -78,7 +83,8 @@ class ProcessExecutorMock extends ProcessExecutor ); } - $testCase->assertTrue(true); + // dummy assertion to ensure the test is not marked as having no assertions + Assert::assertTrue(true); // @phpstan-ignore-line } public function execute($command, &$output = null, $cwd = null) @@ -115,7 +121,7 @@ class ProcessExecutorMock extends ProcessExecutor $this->log[] = $command; - if ($this->expectations && $command === $this->expectations[0]['cmd']) { + if (is_array($this->expectations) && count($this->expectations) > 0 && $command === $this->expectations[0]['cmd']) { $expect = array_shift($this->expectations); $stdout = $expect['stdout']; $stderr = $expect['stderr']; @@ -130,7 +136,7 @@ class ProcessExecutorMock extends ProcessExecutor } else { throw new AssertionFailedError( 'Received unexpected command "'.$command.'" in "'.$cwd.'"'.PHP_EOL. - ($this->expectations ? 'Expected "'.$this->expectations[0]['cmd'].'" at this point.' : 'Expected no more calls at this point.').PHP_EOL. + (is_array($this->expectations) && count($this->expectations) > 0 ? 'Expected "'.$this->expectations[0]['cmd'].'" at this point.' : 'Expected no more calls at this point.').PHP_EOL. 'Received calls:'.PHP_EOL.implode(PHP_EOL, array_slice($this->log, 0, -1)) ); } diff --git a/tests/Composer/Test/Package/Archiver/ArchivableFilesFinderTest.php b/tests/Composer/Test/Package/Archiver/ArchivableFilesFinderTest.php index 6aad38c2c..ca77abb31 100644 --- a/tests/Composer/Test/Package/Archiver/ArchivableFilesFinderTest.php +++ b/tests/Composer/Test/Package/Archiver/ArchivableFilesFinderTest.php @@ -33,7 +33,7 @@ class ArchivableFilesFinderTest extends TestCase */ protected $fs; - protected function setUp() + protected function setUp(): void { $fs = new Filesystem; $this->fs = $fs; @@ -95,8 +95,9 @@ class ArchivableFilesFinderTest extends TestCase } } - protected function tearDown() + protected function tearDown(): void { + parent::tearDown(); $fs = new Filesystem; $fs->removeDirectory($this->sources); } diff --git a/tests/Composer/Test/Package/Archiver/ArchiveManagerTest.php b/tests/Composer/Test/Package/Archiver/ArchiveManagerTest.php index c73091ad1..9d1aff56e 100644 --- a/tests/Composer/Test/Package/Archiver/ArchiveManagerTest.php +++ b/tests/Composer/Test/Package/Archiver/ArchiveManagerTest.php @@ -32,7 +32,7 @@ class ArchiveManagerTest extends ArchiverTest */ protected $targetDir; - public function setUp() + public function setUp(): void { parent::setUp(); @@ -50,7 +50,7 @@ class ArchiveManagerTest extends ArchiverTest public function testUnknownFormat() { - $this->setExpectedException('RuntimeException'); + self::expectException('RuntimeException'); $package = $this->setupPackage(); diff --git a/tests/Composer/Test/Package/Archiver/ArchiverTest.php b/tests/Composer/Test/Package/Archiver/ArchiverTest.php index 62e62cce0..9601fa1c6 100644 --- a/tests/Composer/Test/Package/Archiver/ArchiverTest.php +++ b/tests/Composer/Test/Package/Archiver/ArchiverTest.php @@ -34,15 +34,16 @@ abstract class ArchiverTest extends TestCase */ protected $testDir; - public function setUp() + public function setUp(): void { $this->filesystem = new Filesystem(); $this->process = new ProcessExecutor(); $this->testDir = $this->getUniqueTmpDirectory(); } - public function tearDown() + protected function tearDown(): void { + parent::tearDown(); $this->filesystem->removeDirectory($this->testDir); } diff --git a/tests/Composer/Test/Package/BasePackageTest.php b/tests/Composer/Test/Package/BasePackageTest.php index 7ecaa5de6..3a2449bb0 100644 --- a/tests/Composer/Test/Package/BasePackageTest.php +++ b/tests/Composer/Test/Package/BasePackageTest.php @@ -35,7 +35,7 @@ class BasePackageTest extends TestCase public function testSetAnotherRepository() { - $this->setExpectedException('LogicException'); + self::expectException('LogicException'); $package = $this->getMockForAbstractClass('Composer\Package\BasePackage', array('foo')); diff --git a/tests/Composer/Test/Package/Dumper/ArrayDumperTest.php b/tests/Composer/Test/Package/Dumper/ArrayDumperTest.php index c4ace9e82..f3ab86c3c 100644 --- a/tests/Composer/Test/Package/Dumper/ArrayDumperTest.php +++ b/tests/Composer/Test/Package/Dumper/ArrayDumperTest.php @@ -24,11 +24,11 @@ class ArrayDumperTest extends TestCase */ private $dumper; /** - * @var \Composer\Package\CompletePackageInterface|\PHPUnit_Framework_MockObject_MockObject + * @var \Composer\Package\CompletePackageInterface|\PHPUnit\Framework\MockObject\MockObject */ private $package; - public function setUp() + public function setUp(): void { $this->dumper = new ArrayDumper(); $this->package = $this->getMockBuilder('Composer\Package\CompletePackageInterface')->getMock(); diff --git a/tests/Composer/Test/Package/Loader/ArrayLoaderTest.php b/tests/Composer/Test/Package/Loader/ArrayLoaderTest.php index 829fc633e..e20abaad5 100644 --- a/tests/Composer/Test/Package/Loader/ArrayLoaderTest.php +++ b/tests/Composer/Test/Package/Loader/ArrayLoaderTest.php @@ -24,7 +24,7 @@ class ArrayLoaderTest extends TestCase */ private $loader; - public function setUp() + public function setUp(): void { $this->loader = new ArrayLoader(null); } diff --git a/tests/Composer/Test/Package/Loader/RootPackageLoaderTest.php b/tests/Composer/Test/Package/Loader/RootPackageLoaderTest.php index d523debc0..462000325 100644 --- a/tests/Composer/Test/Package/Loader/RootPackageLoaderTest.php +++ b/tests/Composer/Test/Package/Loader/RootPackageLoaderTest.php @@ -20,8 +20,6 @@ use Composer\Package\RootPackage; use Composer\Package\Version\VersionGuesser; use Composer\Semver\VersionParser; use Composer\Test\TestCase; -use Composer\Test\Mock\ProcessExecutorMock; -use Prophecy\Argument; class RootPackageLoaderTest extends TestCase { @@ -81,7 +79,7 @@ class RootPackageLoaderTest extends TestCase $config = new Config; $config->merge(array('repositories' => array('packagist' => false))); - $loader = new RootPackageLoader($manager, $config, null, new VersionGuesser($config, $process = new ProcessExecutorMock, new VersionParser())); + $loader = new RootPackageLoader($manager, $config, null, new VersionGuesser($config, $process = $this->getProcessExecutorMock(), new VersionParser())); $process->expects(array(), false, array('return' => 1)); $package = $loader->load(array()); @@ -93,9 +91,10 @@ class RootPackageLoaderTest extends TestCase public function testPrettyVersionForRootPackageInVersionBranch() { // see #6845 - $manager = $this->prophesize('Composer\\Repository\\RepositoryManager'); - $versionGuesser = $this->prophesize('Composer\\Package\\Version\\VersionGuesser'); - $versionGuesser->guessVersion(Argument::cetera()) + $manager = $this->getMockBuilder('Composer\\Repository\\RepositoryManager')->disableOriginalConstructor()->getMock(); + $versionGuesser = $this->getMockBuilder('Composer\\Package\\Version\\VersionGuesser')->disableOriginalConstructor()->getMock(); + $versionGuesser->expects($this->atLeastOnce()) + ->method('guessVersion') ->willReturn(array( 'name' => 'A', 'version' => '3.0.9999999.9999999-dev', @@ -104,7 +103,7 @@ class RootPackageLoaderTest extends TestCase )); $config = new Config; $config->merge(array('repositories' => array('packagist' => false))); - $loader = new RootPackageLoader($manager->reveal(), $config, null, $versionGuesser->reveal()); + $loader = new RootPackageLoader($manager, $config, null, $versionGuesser); $package = $loader->load(array()); $this->assertEquals('3.0-dev', $package->getPrettyVersion()); @@ -121,7 +120,7 @@ class RootPackageLoaderTest extends TestCase ->getMock() ; - $process = new ProcessExecutorMock; + $process = $this->getProcessExecutorMock(); $process->expects(array( array( 'cmd' => 'git branch -a --no-color --no-abbrev -v', @@ -136,8 +135,6 @@ class RootPackageLoaderTest extends TestCase $package = $loader->load(array('require' => array('foo/bar' => 'self.version'))); $this->assertEquals("dev-master", $package->getPrettyVersion()); - - $process->assertComplete($this); } public function testNonFeatureBranchPrettyVersion() @@ -151,7 +148,7 @@ class RootPackageLoaderTest extends TestCase ->getMock() ; - $process = new ProcessExecutorMock; + $process = $this->getProcessExecutorMock(); $process->expects(array( array( 'cmd' => 'git branch -a --no-color --no-abbrev -v', @@ -165,7 +162,5 @@ class RootPackageLoaderTest extends TestCase $package = $loader->load(array('require' => array('foo/bar' => 'self.version'), "non-feature-branches" => array("latest-.*"))); $this->assertEquals("dev-latest-production", $package->getPrettyVersion()); - - $process->assertComplete($this); } } diff --git a/tests/Composer/Test/Package/LockerTest.php b/tests/Composer/Test/Package/LockerTest.php index bf8957bbe..3541de44f 100644 --- a/tests/Composer/Test/Package/LockerTest.php +++ b/tests/Composer/Test/Package/LockerTest.php @@ -12,6 +12,7 @@ namespace Composer\Test\Package; +use Composer\Json\JsonFile; use Composer\Package\Locker; use Composer\Plugin\PluginInterface; use Composer\IO\NullIO; @@ -53,7 +54,7 @@ class LockerTest extends TestCase ->method('exists') ->will($this->returnValue(false)); - $this->setExpectedException('LogicException'); + self::expectException('LogicException'); $locker->getLockedRepository(); } @@ -170,7 +171,7 @@ class LockerTest extends TestCase ->method('getPrettyName') ->will($this->returnValue('pkg1')); - $this->setExpectedException('LogicException'); + self::expectException('LogicException'); $locker->setLockData(array($package1), array(), array(), array(), array(), 'dev', array(), false, false, array()); } @@ -282,16 +283,13 @@ class LockerTest extends TestCase */ private function createPackageMock() { - return $this->getMockBuilder('Composer\Package\PackageInterface') - ->getMock(); + return $this->getMockBuilder('Composer\Package\PackageInterface')->getMock(); } /** * @param array $customData - * - * @return false|string */ - private function getJsonContent(array $customData = array()) + private function getJsonContent(array $customData = array()): string { $data = array_merge(array( 'minimum-stability' => 'beta', @@ -300,6 +298,6 @@ class LockerTest extends TestCase ksort($data); - return json_encode($data); + return JsonFile::encode($data, 0); } } diff --git a/tests/Composer/Test/Package/RootAliasPackageTest.php b/tests/Composer/Test/Package/RootAliasPackageTest.php index 10f9a179c..72ffbebcb 100644 --- a/tests/Composer/Test/Package/RootAliasPackageTest.php +++ b/tests/Composer/Test/Package/RootAliasPackageTest.php @@ -14,84 +14,112 @@ namespace Composer\Test\Package; use Composer\Package\Link; use Composer\Package\RootAliasPackage; +use Composer\Package\RootPackage; use Composer\Semver\Constraint\MatchAllConstraint; use Composer\Test\TestCase; -use Prophecy\Argument; +use PHPUnit\Framework\MockObject\MockObject; class RootAliasPackageTest extends TestCase { public function testUpdateRequires() { - $root = $this->getMockRootPackageInterface(); - $root->setRequires(Argument::type('array'))->shouldBeCalled(); - - $alias = new RootAliasPackage($root->reveal(), '1.0', '1.0.0.0'); - $this->assertEmpty($alias->getRequires()); $links = array(new Link('a', 'b', new MatchAllConstraint(), Link::TYPE_REQUIRE, 'self.version')); + + $root = $this->getMockRootPackage(); + $root->expects($this->once()) + ->method('setRequires') + ->with($this->equalTo($links)); + + $alias = new RootAliasPackage($root, '1.0', '1.0.0.0'); + $this->assertEmpty($alias->getRequires()); $alias->setRequires($links); $this->assertNotEmpty($alias->getRequires()); } public function testUpdateDevRequires() { - $root = $this->getMockRootPackageInterface(); - $root->setDevRequires(Argument::type('array'))->shouldBeCalled(); - - $alias = new RootAliasPackage($root->reveal(), '1.0', '1.0.0.0'); - $this->assertEmpty($alias->getDevRequires()); $links = array(new Link('a', 'b', new MatchAllConstraint(), Link::TYPE_DEV_REQUIRE, 'self.version')); + + $root = $this->getMockRootPackage(); + $root->expects($this->once()) + ->method('setDevRequires') + ->with($this->equalTo($links)); + + $alias = new RootAliasPackage($root, '1.0', '1.0.0.0'); + $this->assertEmpty($alias->getDevRequires()); $alias->setDevRequires($links); $this->assertNotEmpty($alias->getDevRequires()); } public function testUpdateConflicts() { - $root = $this->getMockRootPackageInterface(); - $root->setConflicts(Argument::type('array'))->shouldBeCalled(); - - $alias = new RootAliasPackage($root->reveal(), '1.0', '1.0.0.0'); - $this->assertEmpty($alias->getConflicts()); $links = array(new Link('a', 'b', new MatchAllConstraint(), Link::TYPE_CONFLICT, 'self.version')); + + $root = $this->getMockRootPackage(); + $root->expects($this->once()) + ->method('setConflicts') + ->with($this->equalTo($links)); + + $alias = new RootAliasPackage($root, '1.0', '1.0.0.0'); + $this->assertEmpty($alias->getConflicts()); $alias->setConflicts($links); $this->assertNotEmpty($alias->getConflicts()); } public function testUpdateProvides() { - $root = $this->getMockRootPackageInterface(); - $root->setProvides(Argument::type('array'))->shouldBeCalled(); - - $alias = new RootAliasPackage($root->reveal(), '1.0', '1.0.0.0'); - $this->assertEmpty($alias->getProvides()); $links = array(new Link('a', 'b', new MatchAllConstraint(), Link::TYPE_PROVIDE, 'self.version')); + + $root = $this->getMockRootPackage(); + $root->expects($this->once()) + ->method('setProvides') + ->with($this->equalTo($links)); + + $alias = new RootAliasPackage($root, '1.0', '1.0.0.0'); + $this->assertEmpty($alias->getProvides()); $alias->setProvides($links); $this->assertNotEmpty($alias->getProvides()); } public function testUpdateReplaces() { - $root = $this->getMockRootPackageInterface(); - $root->setReplaces(Argument::type('array'))->shouldBeCalled(); - - $alias = new RootAliasPackage($root->reveal(), '1.0', '1.0.0.0'); - $this->assertEmpty($alias->getReplaces()); $links = array(new Link('a', 'b', new MatchAllConstraint(), Link::TYPE_REPLACE, 'self.version')); + + $root = $this->getMockRootPackage(); + $root->expects($this->once()) + ->method('setReplaces') + ->with($this->equalTo($links)); + + $alias = new RootAliasPackage($root, '1.0', '1.0.0.0'); + $this->assertEmpty($alias->getReplaces()); $alias->setReplaces($links); $this->assertNotEmpty($alias->getReplaces()); } /** - * @return \Prophecy\Prophecy\ObjectProphecy + * @return RootPackage&MockObject */ - protected function getMockRootPackageInterface() + protected function getMockRootPackage() { - $root = $this->prophesize('Composer\\Package\\RootPackage'); - $root->getName()->willReturn('something/something')->shouldBeCalled(); - $root->getRequires()->willReturn(array())->shouldBeCalled(); - $root->getDevRequires()->willReturn(array())->shouldBeCalled(); - $root->getConflicts()->willReturn(array())->shouldBeCalled(); - $root->getProvides()->willReturn(array())->shouldBeCalled(); - $root->getReplaces()->willReturn(array())->shouldBeCalled(); + $root = $this->getMockBuilder(RootPackage::class)->disableOriginalConstructor()->getMock(); + $root->expects($this->atLeastOnce()) + ->method('getName') + ->willReturn('something/something'); + $root->expects($this->atLeastOnce()) + ->method('getRequires') + ->willReturn(array()); + $root->expects($this->atLeastOnce()) + ->method('getDevRequires') + ->willReturn(array()); + $root->expects($this->atLeastOnce()) + ->method('getConflicts') + ->willReturn(array()); + $root->expects($this->atLeastOnce()) + ->method('getProvides') + ->willReturn(array()); + $root->expects($this->atLeastOnce()) + ->method('getReplaces') + ->willReturn(array()); return $root; } diff --git a/tests/Composer/Test/Package/Version/VersionGuesserTest.php b/tests/Composer/Test/Package/Version/VersionGuesserTest.php index 292c78946..6bb2df0f9 100644 --- a/tests/Composer/Test/Package/Version/VersionGuesserTest.php +++ b/tests/Composer/Test/Package/Version/VersionGuesserTest.php @@ -22,7 +22,7 @@ use Composer\Test\Mock\ProcessExecutorMock; class VersionGuesserTest extends TestCase { - public function setUp() + public function setUp(): void { if (!function_exists('proc_open')) { $this->markTestSkipped('proc_open() is not available'); @@ -33,7 +33,7 @@ class VersionGuesserTest extends TestCase { $branch = 'default'; - $process = new ProcessExecutorMock; + $process = $this->getProcessExecutorMock(); $process->expects(array( array('cmd' => 'git branch -a --no-color --no-abbrev -v', 'return' => 128), array('cmd' => 'git describe --exact-match --tags', 'return' => 128), @@ -53,8 +53,6 @@ class VersionGuesserTest extends TestCase $this->assertEquals("dev-".$branch, $versionArray['version']); $this->assertEquals("dev-".$branch, $versionArray['pretty_version']); $this->assertEmpty($versionArray['commit']); - - $process->assertComplete($this); } public function testGuessVersionReturnsData() @@ -62,7 +60,7 @@ class VersionGuesserTest extends TestCase $commitHash = '03a15d220da53c52eddd5f32ffca64a7b3801bea'; $anotherCommitHash = '03a15d220da53c52eddd5f32ffca64a7b3801bea'; - $process = new ProcessExecutorMock; + $process = $this->getProcessExecutorMock(); $process->expects(array( array( 'cmd' => 'git branch -a --no-color --no-abbrev -v', @@ -80,8 +78,6 @@ class VersionGuesserTest extends TestCase $this->assertArrayNotHasKey('feature_version', $versionArray); $this->assertArrayNotHasKey('feature_pretty_version', $versionArray); $this->assertEquals($commitHash, $versionArray['commit']); - - $process->assertComplete($this); } public function testGuessVersionDoesNotSeeCustomDefaultBranchAsNonFeatureBranch() @@ -89,7 +85,7 @@ class VersionGuesserTest extends TestCase $commitHash = '03a15d220da53c52eddd5f32ffca64a7b3801bea'; $anotherCommitHash = '13a15d220da53c52eddd5f32ffca64a7b3801bea'; - $process = new ProcessExecutorMock; + $process = $this->getProcessExecutorMock(); $process->expects(array( array( 'cmd' => 'git branch -a --no-color --no-abbrev -v', @@ -105,8 +101,6 @@ class VersionGuesserTest extends TestCase $this->assertEquals("dev-current", $versionArray['version']); $this->assertEquals($anotherCommitHash, $versionArray['commit']); - - $process->assertComplete($this); } public function testGuessVersionReadsAndRespectsNonFeatureBranchesConfigurationForArbitraryNaming() @@ -114,7 +108,7 @@ class VersionGuesserTest extends TestCase $commitHash = '03a15d220da53c52eddd5f32ffca64a7b3801bea'; $anotherCommitHash = '13a15d220da53c52eddd5f32ffca64a7b3801bea'; - $process = new ProcessExecutorMock; + $process = $this->getProcessExecutorMock(); $process->expects(array( array( 'cmd' => 'git branch -a --no-color --no-abbrev -v', @@ -135,8 +129,6 @@ class VersionGuesserTest extends TestCase $this->assertEquals($anotherCommitHash, $versionArray['commit']); $this->assertEquals("dev-feature", $versionArray['feature_version']); $this->assertEquals("dev-feature", $versionArray['feature_pretty_version']); - - $process->assertComplete($this); } public function testGuessVersionReadsAndRespectsNonFeatureBranchesConfigurationForArbitraryNamingRegex() @@ -144,7 +136,7 @@ class VersionGuesserTest extends TestCase $commitHash = '03a15d220da53c52eddd5f32ffca64a7b3801bea'; $anotherCommitHash = '13a15d220da53c52eddd5f32ffca64a7b3801bea'; - $process = new ProcessExecutorMock; + $process = $this->getProcessExecutorMock(); $process->expects(array( array( 'cmd' => 'git branch -a --no-color --no-abbrev -v', @@ -165,8 +157,6 @@ class VersionGuesserTest extends TestCase $this->assertEquals($anotherCommitHash, $versionArray['commit']); $this->assertEquals("dev-feature", $versionArray['feature_version']); $this->assertEquals("dev-feature", $versionArray['feature_pretty_version']); - - $process->assertComplete($this); } public function testGuessVersionReadsAndRespectsNonFeatureBranchesConfigurationForArbitraryNamingWhenOnNonFeatureBranch() @@ -174,7 +164,7 @@ class VersionGuesserTest extends TestCase $commitHash = '03a15d220da53c52eddd5f32ffca64a7b3801bea'; $anotherCommitHash = '13a15d220da53c52eddd5f32ffca64a7b3801bea'; - $process = new ProcessExecutorMock; + $process = $this->getProcessExecutorMock(); $process->expects(array( array( 'cmd' => 'git branch -a --no-color --no-abbrev -v', @@ -191,15 +181,13 @@ class VersionGuesserTest extends TestCase $this->assertEquals($commitHash, $versionArray['commit']); $this->assertArrayNotHasKey('feature_version', $versionArray); $this->assertArrayNotHasKey('feature_pretty_version', $versionArray); - - $process->assertComplete($this); } public function testDetachedHeadBecomesDevHash() { $commitHash = '03a15d220da53c52eddd5f32ffca64a7b3801bea'; - $process = new ProcessExecutorMock; + $process = $this->getProcessExecutorMock(); $process->expects(array( array( 'cmd' => 'git branch -a --no-color --no-abbrev -v', @@ -214,15 +202,13 @@ class VersionGuesserTest extends TestCase $versionData = $guesser->guessVersion(array(), 'dummy/path'); $this->assertEquals("dev-$commitHash", $versionData['version']); - - $process->assertComplete($this); } public function testDetachedFetchHeadBecomesDevHashGit2() { $commitHash = '03a15d220da53c52eddd5f32ffca64a7b3801bea'; - $process = new ProcessExecutorMock; + $process = $this->getProcessExecutorMock(); $process->expects(array( array( 'cmd' => 'git branch -a --no-color --no-abbrev -v', @@ -237,15 +223,13 @@ class VersionGuesserTest extends TestCase $versionData = $guesser->guessVersion(array(), 'dummy/path'); $this->assertEquals("dev-$commitHash", $versionData['version']); - - $process->assertComplete($this); } public function testDetachedCommitHeadBecomesDevHashGit2() { $commitHash = '03a15d220da53c52eddd5f32ffca64a7b3801bea'; - $process = new ProcessExecutorMock; + $process = $this->getProcessExecutorMock(); $process->expects(array( array( 'cmd' => 'git branch -a --no-color --no-abbrev -v', @@ -260,13 +244,11 @@ class VersionGuesserTest extends TestCase $versionData = $guesser->guessVersion(array(), 'dummy/path'); $this->assertEquals("dev-$commitHash", $versionData['version']); - - $process->assertComplete($this); } public function testTagBecomesVersion() { - $process = new ProcessExecutorMock; + $process = $this->getProcessExecutorMock(); $process->expects(array( array( 'cmd' => 'git branch -a --no-color --no-abbrev -v', @@ -284,13 +266,11 @@ class VersionGuesserTest extends TestCase $versionData = $guesser->guessVersion(array(), 'dummy/path'); $this->assertEquals("2.0.5.0-alpha2", $versionData['version']); - - $process->assertComplete($this); } public function testTagBecomesPrettyVersion() { - $process = new ProcessExecutorMock; + $process = $this->getProcessExecutorMock(); $process->expects(array( array( 'cmd' => 'git branch -a --no-color --no-abbrev -v', @@ -309,13 +289,11 @@ class VersionGuesserTest extends TestCase $this->assertEquals('1.0.0.0', $versionData['version']); $this->assertEquals('1.0.0', $versionData['pretty_version']); - - $process->assertComplete($this); } public function testInvalidTagBecomesVersion() { - $process = new ProcessExecutorMock; + $process = $this->getProcessExecutorMock(); $process->expects(array( array( 'cmd' => 'git branch -a --no-color --no-abbrev -v', @@ -329,13 +307,11 @@ class VersionGuesserTest extends TestCase $versionData = $guesser->guessVersion(array(), 'dummy/path'); $this->assertEquals("dev-foo", $versionData['version']); - - $process->assertComplete($this); } public function testNumericBranchesShowNicely() { - $process = new ProcessExecutorMock; + $process = $this->getProcessExecutorMock(); $process->expects(array( array( 'cmd' => 'git branch -a --no-color --no-abbrev -v', @@ -350,13 +326,11 @@ class VersionGuesserTest extends TestCase $this->assertEquals("1.5.x-dev", $versionData['pretty_version']); $this->assertEquals("1.5.9999999.9999999-dev", $versionData['version']); - - $process->assertComplete($this); } public function testRemoteBranchesAreSelected() { - $process = new ProcessExecutorMock; + $process = $this->getProcessExecutorMock(); $process->expects(array( array( 'cmd' => 'git branch -a --no-color --no-abbrev -v', @@ -375,7 +349,5 @@ class VersionGuesserTest extends TestCase $versionData = $guesser->guessVersion(array('version' => 'self.version'), 'dummy/path'); $this->assertEquals("1.5.x-dev", $versionData['pretty_version']); $this->assertEquals("1.5.9999999.9999999-dev", $versionData['version']); - - $process->assertComplete($this); } } diff --git a/tests/Composer/Test/Package/Version/VersionSelectorTest.php b/tests/Composer/Test/Package/Version/VersionSelectorTest.php index 153c522f6..027534c6e 100644 --- a/tests/Composer/Test/Package/Version/VersionSelectorTest.php +++ b/tests/Composer/Test/Package/Version/VersionSelectorTest.php @@ -181,15 +181,13 @@ class VersionSelectorTest extends TestCase $packages = array($package1, $package2); $repositorySet = $this->createMockRepositorySet(); - $repositorySet->expects($this->at(0)) + $repositorySet->expects($this->exactly(2)) ->method('findPackages') ->with($packageName, null) - ->will($this->returnValue($packages)); - - $repositorySet->expects($this->at(1)) - ->method('findPackages') - ->with($packageName, null) - ->will($this->returnValue(array_reverse($packages))); + ->willReturnOnConsecutiveCalls( + $packages, + array_reverse($packages) + ); $versionSelector = new VersionSelector($repositorySet); $best = $versionSelector->findBestCandidate($packageName); diff --git a/tests/Composer/Test/Platform/HhvmDetectorTest.php b/tests/Composer/Test/Platform/HhvmDetectorTest.php index 36290361a..277ed9846 100644 --- a/tests/Composer/Test/Platform/HhvmDetectorTest.php +++ b/tests/Composer/Test/Platform/HhvmDetectorTest.php @@ -25,7 +25,7 @@ class HhvmDetectorTest extends TestCase */ private $hhvmDetector; - protected function setUp() + protected function setUp(): void { $this->hhvmDetector = new HhvmDetector(); $this->hhvmDetector->reset(); diff --git a/tests/Composer/Test/Plugin/PluginInstallerTest.php b/tests/Composer/Test/Plugin/PluginInstallerTest.php index 5091617a7..b1db2df42 100644 --- a/tests/Composer/Test/Plugin/PluginInstallerTest.php +++ b/tests/Composer/Test/Plugin/PluginInstallerTest.php @@ -68,7 +68,7 @@ class PluginInstallerTest extends TestCase */ protected $io; - protected function setUp() + protected function setUp(): void { $loader = new JsonLoader(new ArrayLoader()); $this->packages = array(); @@ -127,8 +127,9 @@ class PluginInstallerTest extends TestCase $this->composer->setPluginManager($this->pm); } - protected function tearDown() + protected function tearDown(): void { + parent::tearDown(); $filesystem = new Filesystem(); $filesystem->removeDirectory($this->directory); } @@ -282,7 +283,7 @@ class PluginInstallerTest extends TestCase { // reset the plugin manager's installed plugins $this->pm = $this->getMockBuilder('Composer\Plugin\PluginManager') - ->setMethods(array('getPluginApiVersion')) + ->onlyMethods(array('getPluginApiVersion')) ->setConstructorArgs(array($this->io, $this->composer)) ->getMock(); @@ -431,13 +432,13 @@ class PluginInstallerTest extends TestCase /** * @dataProvider invalidImplementationClassNames * @param callable $invalidImplementationClassNames - * @param string $expect + * @param class-string<\Throwable> $expect * * @return void */ public function testQueryingWithInvalidCapabilityClassNameThrows($invalidImplementationClassNames, $expect = 'UnexpectedValueException') { - $this->setExpectedException($expect); + self::expectException($expect); $capabilityApi = 'Composer\Plugin\Capability\Capability'; diff --git a/tests/Composer/Test/PolyfillTestCase.php b/tests/Composer/Test/PolyfillTestCase.php deleted file mode 100644 index dd40a196b..000000000 --- a/tests/Composer/Test/PolyfillTestCase.php +++ /dev/null @@ -1,759 +0,0 @@ - - * Jordi Boggiano - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Composer\Test { - use PHPUnit\Framework\TestCase; - use PHPUnit\Framework\Constraint\LogicalNot; - use PHPUnit\Framework\Constraint\StringContains; - - if (method_exists('PHPUnit\Framework\TestCase', 'assertStringContainsString')) { - abstract class PolyfillTestCase extends TestCase - { - } - } else { - abstract class PolyfillTestCase extends TestCase - { - // all the functions below are form https://github.com/symfony/phpunit-bridge/blob/bd341a45ef79b30918376e8b8e2279fac6894c3b/Legacy/PolyfillAssertTrait.php - - /** - * @param string $message - * - * @return void - */ - public static function assertIsInt($actual, $message = '') - { - static::assertInternalType('int', $actual, $message); - } - - /** - * @param string $message - * - * @return void - */ - public static function assertIsNumeric($actual, $message = '') - { - static::assertInternalType('numeric', $actual, $message); - } - - /** - * @param string $message - * - * @return void - */ - public static function assertIsObject($actual, $message = '') - { - static::assertInternalType('object', $actual, $message); - } - - /** - * @param string $message - * - * @return void - */ - public static function assertIsResource($actual, $message = '') - { - static::assertInternalType('resource', $actual, $message); - } - - /** - * @param string $message - * - * @return void - */ - public static function assertIsString($actual, $message = '') - { - static::assertInternalType('string', $actual, $message); - } - - /** - * @param string $message - * - * @return void - */ - public static function assertIsScalar($actual, $message = '') - { - static::assertInternalType('scalar', $actual, $message); - } - - /** - * @param string $message - * - * @return void - */ - public static function assertIsCallable($actual, $message = '') - { - static::assertInternalType('callable', $actual, $message); - } - - /** - * @param string $message - * - * @return void - */ - public static function assertIsIterable($actual, $message = '') - { - static::assertInternalType('iterable', $actual, $message); - } - - /** - * @param string $needle - * @param string $haystack - * @param string $message - * - * @return void - */ - public static function assertStringContainsString($needle, $haystack, $message = '') - { - $constraint = new StringContains($needle, false); - static::assertThat($haystack, $constraint, $message); - } - - /** - * @param string $needle - * @param string $haystack - * @param string $message - * - * @return void - */ - public static function assertStringContainsStringIgnoringCase($needle, $haystack, $message = '') - { - $constraint = new StringContains($needle, true); - static::assertThat($haystack, $constraint, $message); - } - - /** - * @param string $needle - * @param string $haystack - * @param string $message - * - * @return void - */ - public static function assertStringNotContainsString($needle, $haystack, $message = '') - { - $constraint = new LogicalNot(new StringContains($needle, false)); - static::assertThat($haystack, $constraint, $message); - } - - /** - * @param string $needle - * @param string $haystack - * @param string $message - * - * @return void - */ - public static function assertStringNotContainsStringIgnoringCase($needle, $haystack, $message = '') - { - $constraint = new LogicalNot(new StringContains($needle, true)); - static::assertThat($haystack, $constraint, $message); - } - - /** - * @param string $message - * - * @return void - */ - public static function assertFinite($actual, $message = '') - { - static::assertInternalType('float', $actual, $message); - static::assertTrue(is_finite($actual), $message ? $message : "Failed asserting that $actual is finite."); - } - - /** - * @param string $message - * - * @return void - */ - public static function assertInfinite($actual, $message = '') - { - static::assertInternalType('float', $actual, $message); - static::assertTrue(is_infinite($actual), $message ? $message : "Failed asserting that $actual is infinite."); - } - - /** - * @param string $message - * - * @return void - */ - public static function assertNan($actual, $message = '') - { - static::assertInternalType('float', $actual, $message); - static::assertTrue(is_nan($actual), $message ? $message : "Failed asserting that $actual is nan."); - } - - /** - * @param string $filename - * @param string $message - * - * @return void - */ - public static function assertIsReadable($filename, $message = '') - { - static::assertInternalType('string', $filename, $message); - static::assertTrue(is_readable($filename), $message ? $message : "Failed asserting that $filename is readable."); - } - - /** - * @param string $filename - * @param string $message - * - * @return void - */ - public static function assertNotIsReadable($filename, $message = '') - { - static::assertInternalType('string', $filename, $message); - static::assertFalse(is_readable($filename), $message ? $message : "Failed asserting that $filename is not readable."); - } - - /** - * @param string $filename - * @param string $message - * - * @return void - */ - public static function assertIsNotReadable($filename, $message = '') - { - static::assertNotIsReadable($filename, $message); - } - - /** - * @param string $filename - * @param string $message - * - * @return void - */ - public static function assertIsWritable($filename, $message = '') - { - static::assertInternalType('string', $filename, $message); - static::assertTrue(is_writable($filename), $message ? $message : "Failed asserting that $filename is writable."); - } - - /** - * @param string $filename - * @param string $message - * - * @return void - */ - public static function assertNotIsWritable($filename, $message = '') - { - static::assertInternalType('string', $filename, $message); - static::assertFalse(is_writable($filename), $message ? $message : "Failed asserting that $filename is not writable."); - } - - /** - * @param string $filename - * @param string $message - * - * @return void - */ - public static function assertIsNotWritable($filename, $message = '') - { - static::assertNotIsWritable($filename, $message); - } - - /** - * @param string $directory - * @param string $message - * - * @return void - */ - public static function assertDirectoryExists($directory, $message = '') - { - static::assertInternalType('string', $directory, $message); - static::assertTrue(is_dir($directory), $message ? $message : "Failed asserting that $directory exists."); - } - - /** - * @param string $directory - * @param string $message - * - * @return void - */ - public static function assertDirectoryNotExists($directory, $message = '') - { - static::assertInternalType('string', $directory, $message); - static::assertFalse(is_dir($directory), $message ? $message : "Failed asserting that $directory does not exist."); - } - - /** - * @param string $directory - * @param string $message - * - * @return void - */ - public static function assertDirectoryDoesNotExist($directory, $message = '') - { - static::assertDirectoryNotExists($directory, $message); - } - - /** - * @param string $directory - * @param string $message - * - * @return void - */ - public static function assertDirectoryIsReadable($directory, $message = '') - { - static::assertDirectoryExists($directory, $message); - static::assertIsReadable($directory, $message); - } - - /** - * @param string $directory - * @param string $message - * - * @return void - */ - public static function assertDirectoryNotIsReadable($directory, $message = '') - { - static::assertDirectoryExists($directory, $message); - static::assertNotIsReadable($directory, $message); - } - - /** - * @param string $directory - * @param string $message - * - * @return void - */ - public static function assertDirectoryIsNotReadable($directory, $message = '') - { - static::assertDirectoryNotIsReadable($directory, $message); - } - - /** - * @param string $directory - * @param string $message - * - * @return void - */ - public static function assertDirectoryIsWritable($directory, $message = '') - { - static::assertDirectoryExists($directory, $message); - static::assertIsWritable($directory, $message); - } - - /** - * @param string $directory - * @param string $message - * - * @return void - */ - public static function assertDirectoryNotIsWritable($directory, $message = '') - { - static::assertDirectoryExists($directory, $message); - static::assertNotIsWritable($directory, $message); - } - - /** - * @param string $directory - * @param string $message - * - * @return void - */ - public static function assertDirectoryIsNotWritable($directory, $message = '') - { - static::assertDirectoryNotIsWritable($directory, $message); - } - - /** - * @param string $filename - * @param string $message - * - * @return void - */ - public static function assertFileExists($filename, $message = '') - { - static::assertInternalType('string', $filename, $message); - static::assertTrue(file_exists($filename), $message ? $message : "Failed asserting that $filename exists."); - } - - /** - * @param string $filename - * @param string $message - * - * @return void - */ - public static function assertFileNotExists($filename, $message = '') - { - static::assertInternalType('string', $filename, $message); - static::assertFalse(file_exists($filename), $message ? $message : "Failed asserting that $filename does not exist."); - } - - /** - * @param string $filename - * @param string $message - * - * @return void - */ - public static function assertFileDoesNotExist($filename, $message = '') - { - static::assertFileNotExists($filename, $message); - } - - /** - * @param string $filename - * @param string $message - * - * @return void - */ - public static function assertFileIsReadable($filename, $message = '') - { - static::assertFileExists($filename, $message); - static::assertIsReadable($filename, $message); - } - - /** - * @param string $filename - * @param string $message - * - * @return void - */ - public static function assertFileNotIsReadable($filename, $message = '') - { - static::assertFileExists($filename, $message); - static::assertNotIsReadable($filename, $message); - } - - /** - * @param string $filename - * @param string $message - * - * @return void - */ - public static function assertFileIsNotReadable($filename, $message = '') - { - static::assertFileNotIsReadable($filename, $message); - } - - /** - * @param string $filename - * @param string $message - * - * @return void - */ - public static function assertFileIsWritable($filename, $message = '') - { - static::assertFileExists($filename, $message); - static::assertIsWritable($filename, $message); - } - - /** - * @param string $filename - * @param string $message - * - * @return void - */ - public static function assertFileNotIsWritable($filename, $message = '') - { - static::assertFileExists($filename, $message); - static::assertNotIsWritable($filename, $message); - } - - /** - * @param string $filename - * @param string $message - * - * @return void - */ - public static function assertFileIsNotWritable($filename, $message = '') - { - static::assertFileNotIsWritable($filename, $message); - } - - /** - * @param string $pattern - * @param string $string - * @param string $message - * - * @return void - */ - public static function assertMatchesRegularExpression($pattern, $string, $message = '') - { - static::assertRegExp($pattern, $string, $message); - } - - /** - * @param string $pattern - * @param string $string - * @param string $message - * - * @return void - */ - public static function assertDoesNotMatchRegularExpression($pattern, $string, $message = '') - { - static::assertNotRegExp($pattern, $string, $message); - } - } - } -} - -namespace { - foreach (array( - 'PHPUnit\Framework\Constraint\IsEqual', - 'PHPUnit\Framework\Constraint\StringContains', - 'PHPUnit\Framework\Constraint\TraversableContains', - ) as $class) { - if (!class_exists($class) && class_exists(str_replace('\\', '_', $class))) { - class_alias(str_replace('\\', '_', $class), $class); - } - } - - foreach (array( - 'PHPUnit\Framework\SelfDescribing', - ) as $interface) { - if (!interface_exists($interface) && interface_exists(str_replace('\\', '_', $interface))) { - class_alias(str_replace('\\', '_', $interface), $interface); - } - } - - if (!class_exists('PHPUnit\Framework\Constraint\Constraint')) { - class_alias('PHPUnit_Framework_Constraint', 'PHPUnit\Framework\Constraint\Constraint'); - } -} - -// all the code below taken from various PHPUnit versions to make things work on PHPUnit 4.8 / PHP 5.3 -/* - * This file is part of PHPUnit. - * - * (c) Sebastian Bergmann - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace PHPUnit\Framework\Constraint { - use PHPUnit\Framework\ExpectationFailedException; - - if (!class_exists('PHPUnit\Framework\Constraint\RegularExpression')) { - /** - * Constraint that asserts that the string it is evaluated for matches - * a regular expression. - * - * Checks a given value using the Perl Compatible Regular Expression extension - * in PHP. The pattern is matched by executing preg_match(). - * - * The pattern string passed in the constructor. - */ - class RegularExpression extends Constraint - { - /** - * @var string - */ - protected $pattern; - - /** - * @param string $pattern - */ - public function __construct($pattern) - { - parent::__construct(); - $this->pattern = $pattern; - } - - /** - * Evaluates the constraint for parameter $other. Returns true if the - * constraint is met, false otherwise. - * - * @param mixed $other Value or object to evaluate. - * - * @return bool - */ - protected function matches($other) - { - return \preg_match($this->pattern, $other) > 0; - } - - /** - * Returns a string representation of the constraint. - * - * @return string - */ - public function toString() - { - return \sprintf( - 'matches PCRE pattern "%s"', - $this->pattern - ); - } - } - } - - if (!class_exists('PHPUnit\Framework\Constraint\LogicalNot')) { - /** - * Logical NOT. - */ - class LogicalNot extends Constraint - { - /** - * @var Constraint - */ - protected $constraint; - - /** - * @param Constraint $constraint - */ - public function __construct($constraint) - { - parent::__construct(); - - if (!($constraint instanceof Constraint)) { - $constraint = new IsEqual($constraint); - } - - $this->constraint = $constraint; - } - - /** - * @param string $string - * - * @return string - */ - public static function negate($string) - { - $positives = array( - 'contains ', - 'exists', - 'has ', - 'is ', - 'are ', - 'matches ', - 'starts with ', - 'ends with ', - 'reference ', - 'not not ', - ); - - $negatives = array( - 'does not contain ', - 'does not exist', - 'does not have ', - 'is not ', - 'are not ', - 'does not match ', - 'starts not with ', - 'ends not with ', - 'don\'t reference ', - 'not ', - ); - - \preg_match('/(\'[\w\W]*\')([\w\W]*)("[\w\W]*")/i', $string, $matches); - - if (\count($matches) > 0) { - $nonInput = $matches[2]; - - $negatedString = \str_replace( - $nonInput, - \str_replace( - $positives, - $negatives, - $nonInput - ), - $string - ); - } else { - $negatedString = \str_replace( - $positives, - $negatives, - $string - ); - } - - return $negatedString; - } - - /** - * Evaluates the constraint for parameter $other - * - * If $returnResult is set to false (the default), an exception is thrown - * in case of a failure. null is returned otherwise. - * - * If $returnResult is true, the result of the evaluation is returned as - * a boolean value instead: true in case of success, false in case of a - * failure. - * - * @param mixed $other Value or object to evaluate. - * @param string $description Additional information about the test - * @param bool $returnResult Whether to return a result or throw an exception - * - * @throws ExpectationFailedException - * @return mixed - */ - public function evaluate($other, $description = '', $returnResult = false) - { - $success = !$this->constraint->evaluate($other, $description, true); - - if ($returnResult) { - return $success; - } - - if (!$success) { - $this->fail($other, $description); - } - } - - /** - * Returns the description of the failure - * - * The beginning of failure messages is "Failed asserting that" in most - * cases. This method should return the second part of that sentence. - * - * @param mixed $other Evaluated value or object. - * - * @return string - */ - protected function failureDescription($other) - { - switch (\get_class($this->constraint)) { - case 'PHPUnit\Framework\Constraint\LogicalAnd': - case 'PHPUnit\Framework\Constraint\LogicalNot': - case 'PHPUnit\Framework\Constraint\LogicalOr': - return 'not( ' . $this->constraint->failureDescription($other) . ' )'; - - default: - return self::negate( - $this->constraint->failureDescription($other) - ); - } - } - - /** - * Returns a string representation of the constraint. - * - * @return string - */ - public function toString() - { - switch (\get_class($this->constraint)) { - case 'PHPUnit\Framework\Constraint\LogicalAnd': - case 'PHPUnit\Framework\Constraint\LogicalNot': - case 'PHPUnit\Framework\Constraint\LogicalOr': - return 'not( ' . $this->constraint->toString() . ' )'; - - default: - return self::negate( - $this->constraint->toString() - ); - } - } - - /** - * Counts the number of constraint elements. - * - * @return int - */ - public function count() - { - return \count($this->constraint); - } - } - } -} diff --git a/tests/Composer/Test/Question/StrictConfirmationQuestionTest.php b/tests/Composer/Test/Question/StrictConfirmationQuestionTest.php index 78e0b3cb0..90fbb4a86 100644 --- a/tests/Composer/Test/Question/StrictConfirmationQuestionTest.php +++ b/tests/Composer/Test/Question/StrictConfirmationQuestionTest.php @@ -50,7 +50,8 @@ class StrictConfirmationQuestionTest extends TestCase { list($input, $dialog) = $this->createInput($answer."\n"); - $this->setExpectedException('InvalidArgumentException', 'Please answer yes, y, no, or n.'); + self::expectException('InvalidArgumentException'); + self::expectExceptionMessage('Please answer yes, y, no, or n.'); $question = new StrictConfirmationQuestion('Do you like French fries?'); $question->setMaxAttempts(1); diff --git a/tests/Composer/Test/Repository/ArtifactRepositoryTest.php b/tests/Composer/Test/Repository/ArtifactRepositoryTest.php index b164a43d6..49c37a61a 100644 --- a/tests/Composer/Test/Repository/ArtifactRepositoryTest.php +++ b/tests/Composer/Test/Repository/ArtifactRepositoryTest.php @@ -19,7 +19,7 @@ use Composer\Package\BasePackage; class ArtifactRepositoryTest extends TestCase { - public function setUp() + public function setUp(): void { parent::setUp(); if (!extension_loaded('zip')) { diff --git a/tests/Composer/Test/Repository/ComposerRepositoryTest.php b/tests/Composer/Test/Repository/ComposerRepositoryTest.php index d2f1ca8ed..3460ec2d8 100644 --- a/tests/Composer/Test/Repository/ComposerRepositoryTest.php +++ b/tests/Composer/Test/Repository/ComposerRepositoryTest.php @@ -37,7 +37,7 @@ class ComposerRepositoryTest extends TestCase ); $repository = $this->getMockBuilder('Composer\Repository\ComposerRepository') - ->setMethods(array('loadRootServerFile', 'createPackages')) + ->onlyMethods(array('loadRootServerFile', 'createPackages')) ->setConstructorArgs(array( $repoConfig, new NullIO, @@ -58,7 +58,7 @@ class ComposerRepositoryTest extends TestCase } $repository - ->expects($this->at(2)) + ->expects($this->once()) ->method('createPackages') ->with($this->identicalTo($expected), $this->equalTo('root file (http://example.org/packages.json)')) ->will($this->returnValue($stubs)); @@ -111,7 +111,7 @@ class ComposerRepositoryTest extends TestCase $this->getMockBuilder('Composer\Util\HttpDownloader')->disableOriginalConstructor()->getMock(), $this->getMockBuilder('Composer\EventDispatcher\EventDispatcher')->disableOriginalConstructor()->getMock(), )) - ->setMethods(array('fetchFile')) + ->onlyMethods(array('fetchFile')) ->getMock(); $cache = $this->getMockBuilder('Composer\Cache')->disableOriginalConstructor()->getMock(); @@ -156,7 +156,6 @@ class ComposerRepositoryTest extends TestCase ), ))); - $versionParser = new VersionParser(); $reflMethod = new \ReflectionMethod($repo, 'whatProvides'); $reflMethod->setAccessible(true); $packages = $reflMethod->invoke($repo, 'a'); @@ -181,16 +180,22 @@ class ComposerRepositoryTest extends TestCase ), ); - $httpDownloader = new HttpDownloaderMock(array( - 'http://example.org/packages.json' => JsonFile::encode(array('search' => '/search.json?q=%query%&type=%type%')), - 'http://example.org/search.json?q=foo&type=composer-plugin' => JsonFile::encode($result), - 'http://example.org/search.json?q=foo&type=library' => JsonFile::encode(array()), - )); + $httpDownloader = $this->getHttpDownloaderMock(); + $httpDownloader->expects( + [ + ['url' => 'http://example.org/packages.json', 'body' => JsonFile::encode(array('search' => '/search.json?q=%query%&type=%type%'))], + ['url' => 'http://example.org/search.json?q=foo&type=composer-plugin', 'body' => JsonFile::encode($result)], + ['url' => 'http://example.org/search.json?q=foo&type=library', 'body' => JsonFile::encode(array())], + ], + true + ); $eventDispatcher = $this->getMockBuilder('Composer\EventDispatcher\EventDispatcher') ->disableOriginalConstructor() ->getMock(); - $repository = new ComposerRepository($repoConfig, new NullIO, FactoryMock::createConfig(), $httpDownloader, $eventDispatcher); + $config = FactoryMock::createConfig(); + $config->merge(['config' => ['cache-read-only' => true]]); + $repository = new ComposerRepository($repoConfig, new NullIO, $config, $httpDownloader, $eventDispatcher); $this->assertSame( array(array('name' => 'foo', 'description' => null)), @@ -205,7 +210,7 @@ class ComposerRepositoryTest extends TestCase public function testSearchWithAbandonedPackages() { $repoConfig = array( - 'url' => 'http://2.example.org', + 'url' => 'http://example.org', ); $result = array( @@ -223,15 +228,22 @@ class ComposerRepositoryTest extends TestCase ), ); - $httpDownloader = new HttpDownloaderMock(array( - 'http://2.example.org/packages.json' => JsonFile::encode(array('search' => '/search.json?q=%query%')), - 'http://2.example.org/search.json?q=foo' => JsonFile::encode($result), - )); + $httpDownloader = $this->getHttpDownloaderMock(); + $httpDownloader->expects( + [ + ['url' => 'http://example.org/packages.json', 'body' => JsonFile::encode(array('search' => '/search.json?q=%query%'))], + ['url' => 'http://example.org/search.json?q=foo', 'body' => JsonFile::encode($result)], + ], + true + ); + $eventDispatcher = $this->getMockBuilder('Composer\EventDispatcher\EventDispatcher') ->disableOriginalConstructor() ->getMock(); - $repository = new ComposerRepository($repoConfig, new NullIO, FactoryMock::createConfig(), $httpDownloader, $eventDispatcher); + $config = FactoryMock::createConfig(); + $config->merge(['config' => ['cache-read-only' => true]]); + $repository = new ComposerRepository($repoConfig, new NullIO, $config, $httpDownloader, $eventDispatcher); $this->assertSame( array( @@ -313,15 +325,22 @@ class ComposerRepositoryTest extends TestCase public function testGetProviderNamesWillReturnPartialPackageNames() { - $httpDownloader = new HttpDownloaderMock(array( - 'http://example.org/packages.json' => JsonFile::encode(array( - 'providers-lazy-url' => '/foo/p/%package%.json', - 'packages' => array('foo/bar' => array( - 'dev-branch' => array('name' => 'foo/bar'), - 'v1.0.0' => array('name' => 'foo/bar'), - )), - )), - )); + $httpDownloader = $this->getHttpDownloaderMock(); + $httpDownloader->expects( + [ + [ + 'url' => 'http://example.org/packages.json', + 'body' => JsonFile::encode(array( + 'providers-lazy-url' => '/foo/p/%package%.json', + 'packages' => array('foo/bar' => array( + 'dev-branch' => array('name' => 'foo/bar'), + 'v1.0.0' => array('name' => 'foo/bar'), + )), + )), + ], + ], + true + ); $repository = new ComposerRepository( array('url' => 'http://example.org/packages.json'), diff --git a/tests/Composer/Test/Repository/CompositeRepositoryTest.php b/tests/Composer/Test/Repository/CompositeRepositoryTest.php index c6a1e3dc6..5e49d725a 100644 --- a/tests/Composer/Test/Repository/CompositeRepositoryTest.php +++ b/tests/Composer/Test/Repository/CompositeRepositoryTest.php @@ -129,7 +129,7 @@ class CompositeRepositoryTest extends TestCase /** * @dataProvider provideMethodCalls * - * @param string $method + * @param string $method * @param mixed[] $args */ public function testNoRepositories($method, $args) diff --git a/tests/Composer/Test/Repository/FilesystemRepositoryTest.php b/tests/Composer/Test/Repository/FilesystemRepositoryTest.php index 91e314407..ac1d78e4d 100644 --- a/tests/Composer/Test/Repository/FilesystemRepositoryTest.php +++ b/tests/Composer/Test/Repository/FilesystemRepositoryTest.php @@ -48,7 +48,7 @@ class FilesystemRepositoryTest extends TestCase public function testCorruptedRepositoryFile() { - $this->setExpectedException('Composer\Repository\InvalidRepositoryException'); + self::expectException('Composer\Repository\InvalidRepositoryException'); $json = $this->createJsonFileMock(); $repository = new FilesystemRepository($json); diff --git a/tests/Composer/Test/Repository/FilterRepositoryTest.php b/tests/Composer/Test/Repository/FilterRepositoryTest.php index 930d44e02..d18e8a13e 100644 --- a/tests/Composer/Test/Repository/FilterRepositoryTest.php +++ b/tests/Composer/Test/Repository/FilterRepositoryTest.php @@ -25,7 +25,7 @@ class FilterRepositoryTest extends TestCase */ private $arrayRepo; - public function setUp() + public function setUp(): void { $this->arrayRepo = new ArrayRepository(); $this->arrayRepo->addPackage($this->getPackage('foo/aaa', '1.0.0')); diff --git a/tests/Composer/Test/Repository/InstalledRepositoryTest.php b/tests/Composer/Test/Repository/InstalledRepositoryTest.php index 7b0d767ca..136c19c7b 100644 --- a/tests/Composer/Test/Repository/InstalledRepositoryTest.php +++ b/tests/Composer/Test/Repository/InstalledRepositoryTest.php @@ -45,7 +45,7 @@ class InstalledRepositoryTest extends TestCase { $arrayRepoOne = new ArrayRepository; - $this->setExpectedException('LogicException'); + self::expectException('LogicException'); new InstalledRepository(array($arrayRepoOne)); } diff --git a/tests/Composer/Test/Repository/PathRepositoryTest.php b/tests/Composer/Test/Repository/PathRepositoryTest.php index 03b6fe103..cb1aa0e3f 100644 --- a/tests/Composer/Test/Repository/PathRepositoryTest.php +++ b/tests/Composer/Test/Repository/PathRepositoryTest.php @@ -19,7 +19,7 @@ class PathRepositoryTest extends TestCase { public function testLoadPackageFromFileSystemWithIncorrectPath() { - $this->setExpectedException('RuntimeException'); + self::expectException('RuntimeException'); $ioInterface = $this->getMockBuilder('Composer\IO\IOInterface') ->getMock(); diff --git a/tests/Composer/Test/Repository/PlatformRepositoryTest.php b/tests/Composer/Test/Repository/PlatformRepositoryTest.php index ca95ae556..ec8ea8379 100644 --- a/tests/Composer/Test/Repository/PlatformRepositoryTest.php +++ b/tests/Composer/Test/Repository/PlatformRepositoryTest.php @@ -118,7 +118,7 @@ class PlatformRepositoryTest extends TestCase * * @param array $constants * @param array $packages - * @param array $functions + * @param list, string|bool}> $functions */ public function testPhpVersion(array $constants, array $packages, array $functions = array()) { @@ -1086,10 +1086,11 @@ Linked Version => 1.2.11', * @param string|string[] $extensions * @param string|null $info * @param array $expectations - * @param array $functions - * @param array $constants - * @param array $classDefinitions + * @param list $functions + * @param list $constants + * @param list $classDefinitions */ + public function testLibraryInformation( $extensions, $info, diff --git a/tests/Composer/Test/Repository/RepositoryManagerTest.php b/tests/Composer/Test/Repository/RepositoryManagerTest.php index a7f07c85a..1596c0a40 100644 --- a/tests/Composer/Test/Repository/RepositoryManagerTest.php +++ b/tests/Composer/Test/Repository/RepositoryManagerTest.php @@ -21,13 +21,14 @@ class RepositoryManagerTest extends TestCase /** @var string */ protected $tmpdir; - public function setUp() + public function setUp(): void { $this->tmpdir = $this->getUniqueTmpDirectory(); } - public function tearDown() + protected function tearDown(): void { + parent::tearDown(); if (is_dir($this->tmpdir)) { $fs = new Filesystem(); $fs->removeDirectory($this->tmpdir); @@ -56,17 +57,17 @@ class RepositoryManagerTest extends TestCase * * @param string $type * @param array $options - * @param string|null $exception + * @param class-string<\Throwable>|null $exception */ - public function testRepoCreation($type, $options, $exception = null) + public function testRepoCreation($type, $options, ?string $exception = null) { - if ($exception) { - $this->setExpectedException($exception); + if ($exception !== null) { + self::expectException($exception); } $rm = new RepositoryManager( $this->getMockBuilder('Composer\IO\IOInterface')->getMock(), - $config = $this->getMockBuilder('Composer\Config')->setMethods(array('get'))->getMock(), + $config = $this->getMockBuilder('Composer\Config')->onlyMethods(array('get'))->getMock(), $this->getMockBuilder('Composer\Util\HttpDownloader')->disableOriginalConstructor()->getMock(), $this->getMockBuilder('Composer\EventDispatcher\EventDispatcher')->disableOriginalConstructor()->getMock() ); @@ -118,7 +119,7 @@ class RepositoryManagerTest extends TestCase { $rm = new RepositoryManager( $this->getMockBuilder('Composer\IO\IOInterface')->getMock(), - $config = $this->getMockBuilder('Composer\Config')->setMethods(array('get'))->getMock(), + $config = $this->getMockBuilder('Composer\Config')->onlyMethods(array('get'))->getMock(), $this->getMockBuilder('Composer\Util\HttpDownloader')->disableOriginalConstructor()->getMock(), $this->getMockBuilder('Composer\EventDispatcher\EventDispatcher')->disableOriginalConstructor()->getMock() ); diff --git a/tests/Composer/Test/Repository/Vcs/FossilDriverTest.php b/tests/Composer/Test/Repository/Vcs/FossilDriverTest.php index 501893cbf..06c6bd5b6 100644 --- a/tests/Composer/Test/Repository/Vcs/FossilDriverTest.php +++ b/tests/Composer/Test/Repository/Vcs/FossilDriverTest.php @@ -28,7 +28,7 @@ class FossilDriverTest extends TestCase */ protected $config; - public function setUp() + public function setUp(): void { $this->home = $this->getUniqueTmpDirectory(); $this->config = new Config(); @@ -39,8 +39,9 @@ class FossilDriverTest extends TestCase )); } - public function tearDown() + protected function tearDown(): void { + parent::tearDown(); $fs = new Filesystem(); $fs->removeDirectory($this->home); } diff --git a/tests/Composer/Test/Repository/Vcs/GitBitbucketDriverTest.php b/tests/Composer/Test/Repository/Vcs/GitBitbucketDriverTest.php index e685b9dfd..a8ee520f0 100644 --- a/tests/Composer/Test/Repository/Vcs/GitBitbucketDriverTest.php +++ b/tests/Composer/Test/Repository/Vcs/GitBitbucketDriverTest.php @@ -33,7 +33,7 @@ class GitBitbucketDriverTest extends TestCase /** @var string */ private $home; - protected function setUp() + protected function setUp(): void { $this->io = $this->getMockBuilder('Composer\IO\IOInterface')->getMock(); @@ -51,8 +51,9 @@ class GitBitbucketDriverTest extends TestCase ->getMock(); } - public function tearDown() + protected function tearDown(): void { + parent::tearDown(); $fs = new Filesystem; $fs->removeDirectory($this->home); } @@ -80,10 +81,8 @@ class GitBitbucketDriverTest extends TestCase public function testGetRootIdentifierWrongScmType() { - $this->setExpectedException( - '\RuntimeException', - 'https://bitbucket.org/user/repo.git does not appear to be a git repository, use https://bitbucket.org/user/repo but remember that Bitbucket no longer supports the mercurial repositories. https://bitbucket.org/blog/sunsetting-mercurial-support-in-bitbucket' - ); + self::expectException('RuntimeException'); + self::expectExceptionMessage('https://bitbucket.org/user/repo.git does not appear to be a git repository, use https://bitbucket.org/user/repo but remember that Bitbucket no longer supports the mercurial repositories. https://bitbucket.org/blog/sunsetting-mercurial-support-in-bitbucket'); $this->httpDownloader->expects($this->once()) ->method('get') diff --git a/tests/Composer/Test/Repository/Vcs/GitHubDriverTest.php b/tests/Composer/Test/Repository/Vcs/GitHubDriverTest.php index d48a8fd1c..efafa0626 100644 --- a/tests/Composer/Test/Repository/Vcs/GitHubDriverTest.php +++ b/tests/Composer/Test/Repository/Vcs/GitHubDriverTest.php @@ -28,7 +28,7 @@ class GitHubDriverTest extends TestCase /** @var Config */ private $config; - public function setUp() + public function setUp(): void { $this->home = $this->getUniqueTmpDirectory(); $this->config = new Config(); @@ -39,8 +39,9 @@ class GitHubDriverTest extends TestCase )); } - public function tearDown() + protected function tearDown(): void { + parent::tearDown(); $fs = new Filesystem; $fs->removeDirectory($this->home); } @@ -58,18 +59,19 @@ class GitHubDriverTest extends TestCase ->method('isInteractive') ->will($this->returnValue(true)); - $httpDownloader = $this->getMockBuilder('Composer\Util\HttpDownloader') - ->setConstructorArgs(array($io, $this->config)) - ->getMock(); + $httpDownloader = $this->getHttpDownloaderMock($io, $this->config); + $httpDownloader->expects( + [ + ['url' => $repoApiUrl, 'status' => 404], + ['url' => 'https://api.github.com/', 'body' => '{}'], + ['url' => $repoApiUrl, 'body' => '{"master_branch": "test_master", "private": true, "owner": {"login": "composer"}, "name": "packagist"}'], + ], + true + ); - $process = new ProcessExecutorMock; + $process = $this->getProcessExecutorMock(); $process->expects(array(), false, array('return' => 1)); - $httpDownloader->expects($this->at(0)) - ->method('get') - ->with($this->equalTo($repoApiUrl)) - ->will($this->throwException(new TransportException('HTTP/1.1 404 Not Found', 404))); - $io->expects($this->once()) ->method('askAndHideAnswer') ->with($this->equalTo('Token (hidden): ')) @@ -79,16 +81,6 @@ class GitHubDriverTest extends TestCase ->method('setAuthentication') ->with($this->equalTo('github.com'), $this->matchesRegularExpression('{sometoken}'), $this->matchesRegularExpression('{x-oauth-basic}')); - $httpDownloader->expects($this->at(1)) - ->method('get') - ->with($this->equalTo($url = 'https://api.github.com/')) - ->will($this->returnValue(new Response(array('url' => $url), 200, array(), '{}'))); - - $httpDownloader->expects($this->at(2)) - ->method('get') - ->with($this->equalTo($url = $repoApiUrl)) - ->will($this->returnValue(new Response(array('url' => $url), 200, array(), '{"master_branch": "test_master", "private": true, "owner": {"login": "composer"}, "name": "packagist"}'))); - $configSource = $this->getMockBuilder('Composer\Config\ConfigSourceInterface')->getMock(); $authConfigSource = $this->getMockBuilder('Composer\Config\ConfigSourceInterface')->getMock(); $this->config->setConfigSource($configSource); @@ -127,21 +119,21 @@ class GitHubDriverTest extends TestCase ->method('isInteractive') ->will($this->returnValue(true)); - $httpDownloader = $this->getMockBuilder('Composer\Util\HttpDownloader') - ->setConstructorArgs(array($io, $this->config)) - ->getMock(); - $httpDownloader->expects($this->at(0)) - ->method('get') - ->with($this->equalTo($repoApiUrl)) - ->will($this->returnValue(new Response(array('url' => $repoApiUrl), 200, array(), '{"master_branch": "test_master", "owner": {"login": "composer"}, "name": "packagist"}'))); + $httpDownloader = $this->getHttpDownloaderMock($io, $this->config); + $httpDownloader->expects( + [ + ['url' => $repoApiUrl, 'body' => '{"master_branch": "test_master", "owner": {"login": "composer"}, "name": "packagist"}'], + ], + true + ); $repoConfig = array( 'url' => $repoUrl, ); $repoUrl = 'https://github.com/composer/packagist.git'; - $gitHubDriver = new GitHubDriver($repoConfig, $io, $this->config, $httpDownloader, new ProcessExecutorMock); + $gitHubDriver = new GitHubDriver($repoConfig, $io, $this->config, $httpDownloader, $this->getProcessExecutorMock()); $gitHubDriver->initialize(); $this->setAttribute($gitHubDriver, 'tags', array($identifier => $sha)); @@ -170,36 +162,24 @@ class GitHubDriverTest extends TestCase ->method('isInteractive') ->will($this->returnValue(true)); - $httpDownloader = $this->getMockBuilder('Composer\Util\HttpDownloader') - ->setConstructorArgs(array($io, $this->config)) - ->getMock(); - $httpDownloader->expects($this->at(0)) - ->method('get') - ->with($this->equalTo($url = $repoApiUrl)) - ->will($this->returnValue(new Response(array('url' => $url), 200, array(), '{"master_branch": "test_master", "owner": {"login": "composer"}, "name": "packagist"}'))); - - $httpDownloader->expects($this->at(1)) - ->method('get') - ->with($this->equalTo($url = 'https://api.github.com/repos/composer/packagist/contents/composer.json?ref=feature%2F3.2-foo')) - ->will($this->returnValue(new Response(array('url' => $url), 200, array(), '{"encoding":"base64","content":"'.base64_encode('{"support": {"source": "'.$repoUrl.'" }}').'"}'))); - - $httpDownloader->expects($this->at(2)) - ->method('get') - ->with($this->equalTo($url = 'https://api.github.com/repos/composer/packagist/commits/feature%2F3.2-foo')) - ->will($this->returnValue(new Response(array('url' => $url), 200, array(), '{"commit": {"committer":{ "date": "2012-09-10"}}}'))); - - $httpDownloader->expects($this->at(3)) - ->method('get') - ->with($this->equalTo($url = 'https://api.github.com/repos/composer/packagist/contents/.github/FUNDING.yml')) - ->will($this->returnValue(new Response(array('url' => $url), 200, array(), '{"encoding": "base64", "content": "'.base64_encode("custom: https://example.com").'"}'))); + $httpDownloader = $this->getHttpDownloaderMock($io, $this->config); + $httpDownloader->expects( + [ + ['url' => $repoApiUrl, 'body' => '{"master_branch": "test_master", "owner": {"login": "composer"}, "name": "packagist"}'], + ['url' => 'https://api.github.com/repos/composer/packagist/contents/composer.json?ref=feature%2F3.2-foo', 'body' => '{"encoding":"base64","content":"'.base64_encode('{"support": {"source": "'.$repoUrl.'" }}').'"}'], + ['url' => 'https://api.github.com/repos/composer/packagist/commits/feature%2F3.2-foo', 'body' => '{"commit": {"committer":{ "date": "2012-09-10"}}}'], + ['url' => 'https://api.github.com/repos/composer/packagist/contents/.github/FUNDING.yml', 'body' => '{"encoding": "base64", "content": "'.base64_encode("custom: https://example.com").'"}'], + ], + true + ); $repoConfig = array( 'url' => $repoUrl, ); $repoUrl = 'https://github.com/composer/packagist.git'; - $gitHubDriver = new GitHubDriver($repoConfig, $io, $this->config, $httpDownloader, new ProcessExecutorMock); + $gitHubDriver = new GitHubDriver($repoConfig, $io, $this->config, $httpDownloader, $this->getProcessExecutorMock()); $gitHubDriver->initialize(); $this->setAttribute($gitHubDriver, 'tags', array($identifier => $sha)); @@ -233,35 +213,22 @@ class GitHubDriverTest extends TestCase ->method('isInteractive') ->will($this->returnValue(true)); - $httpDownloader = $this->getMockBuilder('Composer\Util\HttpDownloader') - ->setConstructorArgs(array($io, $this->config)) - ->getMock(); - - $httpDownloader->expects($this->at(0)) - ->method('get') - ->with($this->equalTo($repoApiUrl)) - ->will($this->returnValue(new Response(array('url' => $repoApiUrl), 200, array(), '{"master_branch": "test_master", "owner": {"login": "composer"}, "name": "packagist", "archived": true}'))); - - $httpDownloader->expects($this->at(1)) - ->method('get') - ->with($this->equalTo($composerJsonUrl)) - ->will($this->returnValue(new Response(array('url' => $composerJsonUrl), 200, array(), '{"encoding": "base64", "content": "' . base64_encode('{"name": "composer/packagist"}') . '"}'))); - - $httpDownloader->expects($this->at(2)) - ->method('get') - ->with($this->equalTo($url = 'https://api.github.com/repos/composer/packagist/commits/'.$sha)) - ->will($this->returnValue(new Response(array('url' => $url), 200, array(), '{"commit": {"committer":{ "date": "2012-09-10"}}}'))); - - $httpDownloader->expects($this->at(3)) - ->method('get') - ->with($this->equalTo($url = 'https://api.github.com/repos/composer/packagist/contents/.github/FUNDING.yml')) - ->will($this->returnValue(new Response(array('url' => $url), 200, array(), '{"encoding": "base64", "content": "'.base64_encode("custom: https://example.com").'"}'))); + $httpDownloader = $this->getHttpDownloaderMock($io, $this->config); + $httpDownloader->expects( + [ + ['url' => $repoApiUrl, 'body' => '{"master_branch": "test_master", "owner": {"login": "composer"}, "name": "packagist", "archived": true}'], + ['url' => $composerJsonUrl, 'body' => '{"encoding": "base64", "content": "' . base64_encode('{"name": "composer/packagist"}') . '"}'], + ['url' => 'https://api.github.com/repos/composer/packagist/commits/'.$sha, 'body' => '{"commit": {"committer":{ "date": "2012-09-10"}}}'], + ['url' => 'https://api.github.com/repos/composer/packagist/contents/.github/FUNDING.yml', 'body' => '{"encoding": "base64", "content": "'.base64_encode("custom: https://example.com").'"}'], + ], + true + ); $repoConfig = array( 'url' => $repoUrl, ); - $gitHubDriver = new GitHubDriver($repoConfig, $io, $this->config, $httpDownloader, new ProcessExecutorMock); + $gitHubDriver = new GitHubDriver($repoConfig, $io, $this->config, $httpDownloader, $this->getProcessExecutorMock()); $gitHubDriver->initialize(); $this->setAttribute($gitHubDriver, 'tags', array($identifier => $sha)); @@ -283,20 +250,19 @@ class GitHubDriverTest extends TestCase ->method('isInteractive') ->will($this->returnValue(false)); - $httpDownloader = $this->getMockBuilder('Composer\Util\HttpDownloader') - ->setConstructorArgs(array($io, $this->config)) - ->getMock(); - - $httpDownloader->expects($this->at(0)) - ->method('get') - ->with($this->equalTo($repoApiUrl)) - ->will($this->throwException(new TransportException('HTTP/1.1 404 Not Found', 404))); + $httpDownloader = $this->getHttpDownloaderMock($io, $this->config); + $httpDownloader->expects( + [ + ['url' => $repoApiUrl, 'status' => 404], + ], + true + ); // clean local clone if present $fs = new Filesystem(); $fs->removeDirectory(sys_get_temp_dir() . '/composer-test'); - $process = new ProcessExecutorMock; + $process = $this->getProcessExecutorMock(); $process->expects(array( array('cmd' => 'git config github.accesstoken', 'return' => 1), 'git clone --mirror -- '.ProcessExecutor::escape($repoSshUrl).' '.ProcessExecutor::escape($this->config->get('cache-vcs-dir').'/git-github.com-composer-packagist.git/'), @@ -337,8 +303,6 @@ class GitHubDriverTest extends TestCase $this->assertEquals('git', $source['type']); $this->assertEquals($repoSshUrl, $source['url']); $this->assertEquals($sha, $source['reference']); - - $process->assertComplete($this); } /** diff --git a/tests/Composer/Test/Repository/Vcs/GitLabDriverTest.php b/tests/Composer/Test/Repository/Vcs/GitLabDriverTest.php index fd6f2936d..26df3a4e7 100644 --- a/tests/Composer/Test/Repository/Vcs/GitLabDriverTest.php +++ b/tests/Composer/Test/Repository/Vcs/GitLabDriverTest.php @@ -12,10 +12,15 @@ namespace Composer\Test\Repository\Vcs; +use Composer\IO\IOInterface; +use Composer\Json\JsonFile; use Composer\Repository\Vcs\GitLabDriver; use Composer\Config; +use Composer\Test\Mock\HttpDownloaderMock; use Composer\Test\TestCase; use Composer\Util\Filesystem; +use Composer\Util\ProcessExecutor; +use PHPUnit\Framework\MockObject\MockObject; use Prophecy\Argument; use Composer\Util\Http\Response; @@ -33,19 +38,19 @@ class GitLabDriverTest extends TestCase */ private $config; /** - * @var \Prophecy\Prophecy\ObjectProphecy + * @var MockObject&IOInterface */ private $io; /** - * @var \Prophecy\Prophecy\ObjectProphecy + * @var MockObject&ProcessExecutor */ private $process; /** - * @var \Prophecy\Prophecy\ObjectProphecy + * @var HttpDownloaderMock */ private $httpDownloader; - public function setUp() + public function setUp(): void { $this->home = $this->getUniqueTmpDirectory(); $this->config = new Config(); @@ -61,13 +66,14 @@ class GitLabDriverTest extends TestCase ), )); - $this->io = $this->prophesize('Composer\IO\IOInterface'); - $this->process = $this->prophesize('Composer\Util\ProcessExecutor'); - $this->httpDownloader = $this->prophesize('Composer\Util\HttpDownloader'); + $this->io = $this->getMockBuilder('Composer\IO\IOInterface')->disableOriginalConstructor()->getMock(); + $this->process = $this->getMockBuilder('Composer\Util\ProcessExecutor')->getMock(); + $this->httpDownloader = $this->getHttpDownloaderMock(); } - public function tearDown() + protected function tearDown(): void { + parent::tearDown(); $fs = new Filesystem(); $fs->removeDirectory($this->home); } @@ -108,11 +114,12 @@ class GitLabDriverTest extends TestCase } JSON; - $this->mockResponse($apiUrl, array(), $projectData) - ->shouldBeCalledTimes(1) - ; + $this->httpDownloader->expects( + [['url' => $apiUrl, 'body' => $projectData]], + true + ); - $driver = new GitLabDriver(array('url' => $url), $this->io->reveal(), $this->config, $this->httpDownloader->reveal(), $this->process->reveal()); + $driver = new GitLabDriver(array('url' => $url), $this->io, $this->config, $this->httpDownloader, $this->process); $driver->initialize(); $this->assertEquals($apiUrl, $driver->getApiUrl(), 'API URL is derived from the repository URL'); @@ -148,11 +155,12 @@ JSON; } JSON; - $this->mockResponse($apiUrl, array(), $projectData) - ->shouldBeCalledTimes(1) - ; + $this->httpDownloader->expects( + [['url' => $apiUrl, 'body' => $projectData]], + true + ); - $driver = new GitLabDriver(array('url' => $url), $this->io->reveal(), $this->config, $this->httpDownloader->reveal(), $this->process->reveal()); + $driver = new GitLabDriver(array('url' => $url), $this->io, $this->config, $this->httpDownloader, $this->process); $driver->initialize(); $this->assertEquals($apiUrl, $driver->getApiUrl(), 'API URL is derived from the repository URL'); @@ -187,11 +195,12 @@ JSON; } JSON; - $this->mockResponse($apiUrl, array(), $projectData) - ->shouldBeCalledTimes(1) - ; + $this->httpDownloader->expects( + [['url' => $apiUrl, 'body' => $projectData]], + true + ); - $driver = new GitLabDriver(array('url' => $url), $this->io->reveal(), $this->config, $this->httpDownloader->reveal(), $this->process->reveal()); + $driver = new GitLabDriver(array('url' => $url), $this->io, $this->config, $this->httpDownloader, $this->process); $driver->initialize(); $this->assertEquals($apiUrl, $driver->getApiUrl(), 'API URL is derived from the repository URL'); @@ -227,10 +236,12 @@ JSON; } JSON; - $this->mockResponse($apiUrl, array(), sprintf($projectData, $domain, $port, $namespace)) - ->shouldBeCalledTimes(1); + $this->httpDownloader->expects( + [['url' => $apiUrl, 'body' => sprintf($projectData, $domain, $port, $namespace)]], + true + ); - $driver = new GitLabDriver(array('url' => $url), $this->io->reveal(), $this->config, $this->httpDownloader->reveal(), $this->process->reveal()); + $driver = new GitLabDriver(array('url' => $url), $this->io, $this->config, $this->httpDownloader, $this->process); $driver->initialize(); $this->assertEquals($apiUrl, $driver->getApiUrl(), 'API URL is derived from the repository URL'); @@ -308,11 +319,11 @@ JSON; ] JSON; - $this->mockResponse($apiUrl, array(), $tagData) - ->shouldBeCalledTimes(1) - ; - - $driver->setHttpDownloader($this->httpDownloader->reveal()); + $this->httpDownloader->expects( + [['url' => $apiUrl, 'body' => $tagData]], + true + ); + $driver->setHttpDownloader($this->httpDownloader); $expected = array( 'v1.0.0' => '092ed2c762bbae331e3f51d4a17f67310bf99a81', @@ -327,8 +338,6 @@ JSON; { $driver = $this->testInitialize('https://gitlab.com/mygroup/myproject', 'https://gitlab.com/api/v4/projects/mygroup%2Fmyproject'); - $apiUrl = 'https://gitlab.com/api/v4/projects/mygroup%2Fmyproject/repository/branches?per_page=100'; - // @link http://doc.gitlab.com/ce/api/repositories.html#list-project-repository-branches $branchData = array( array( @@ -357,22 +366,25 @@ JSON; ); } - $branchData = json_encode($branchData); + $branchData = JsonFile::encode($branchData); - $headers = array('Link: ; rel="next", ; rel="first", ; rel="last"'); - $this->httpDownloader - ->get($apiUrl, array()) - ->willReturn(new Response(array('url' => $apiUrl), 200, $headers, $branchData)) - ->shouldBeCalledTimes(1); + $this->httpDownloader->expects( + [ + [ + 'url' => 'https://gitlab.com/api/v4/projects/mygroup%2Fmyproject/repository/branches?per_page=100', + 'body' => $branchData, + 'headers' => array('Link: ; rel="next", ; rel="first", ; rel="last"'), + ], + [ + 'url' => "http://gitlab.com/api/v4/projects/mygroup%2Fmyproject/repository/tags?id=mygroup%2Fmyproject&page=2&per_page=20", + 'body' => $branchData, + 'headers' => array('Link: ; rel="prev", ; rel="first", ; rel="last"'), + ], + ], + true + ); - $apiUrl = "http://gitlab.com/api/v4/projects/mygroup%2Fmyproject/repository/tags?id=mygroup%2Fmyproject&page=2&per_page=20"; - $headers = array('Link: ; rel="prev", ; rel="first", ; rel="last"'); - $this->httpDownloader - ->get($apiUrl, array()) - ->willReturn(new Response(array('url' => $apiUrl), 200, $headers, $branchData)) - ->shouldBeCalledTimes(1); - - $driver->setHttpDownloader($this->httpDownloader->reveal()); + $driver->setHttpDownloader($this->httpDownloader); $expected = array( 'mymaster' => '97eda36b5c1dd953a3792865c222d4e85e5f302e', @@ -410,11 +422,12 @@ JSON; ] JSON; - $this->mockResponse($apiUrl, array(), $branchData) - ->shouldBeCalledTimes(1) - ; + $this->httpDownloader->expects( + [['url' => $apiUrl, 'body' => $branchData]], + true + ); - $driver->setHttpDownloader($this->httpDownloader->reveal()); + $driver->setHttpDownloader($this->httpDownloader); $expected = array( 'mymaster' => '97eda36b5c1dd953a3792865c222d4e85e5f302e', @@ -434,7 +447,7 @@ JSON; */ public function testSupports($url, $expected) { - $this->assertSame($expected, GitLabDriver::supports($this->io->reveal(), $this->config, $url)); + $this->assertSame($expected, GitLabDriver::supports($this->io, $this->config, $url)); } public function dataForTestSupports() @@ -482,11 +495,12 @@ JSON; } JSON; - $this->mockResponse($apiUrl, array(), $projectData) - ->shouldBeCalledTimes(1) - ; + $this->httpDownloader->expects( + [['url' => $apiUrl, 'body' => $projectData]], + true + ); - $driver = new GitLabDriver(array('url' => $url), $this->io->reveal(), $this->config, $this->httpDownloader->reveal(), $this->process->reveal()); + $driver = new GitLabDriver(array('url' => $url), $this->io, $this->config, $this->httpDownloader, $this->process); $driver->initialize(); $this->assertEquals($apiUrl, $driver->getApiUrl(), 'API URL is derived from the repository URL'); @@ -513,11 +527,12 @@ JSON; } JSON; - $this->mockResponse($apiUrl, array(), $projectData) - ->shouldBeCalledTimes(1) - ; + $this->httpDownloader->expects( + [['url' => $apiUrl, 'body' => $projectData]], + true + ); - $driver = new GitLabDriver(array('url' => $url), $this->io->reveal(), $this->config, $this->httpDownloader->reveal(), $this->process->reveal()); + $driver = new GitLabDriver(array('url' => $url), $this->io, $this->config, $this->httpDownloader, $this->process); $driver->initialize(); $this->assertEquals($apiUrl, $driver->getApiUrl(), 'API URL is derived from the repository URL'); @@ -544,11 +559,12 @@ JSON; } JSON; - $this->mockResponse($apiUrl, array(), $projectData) - ->shouldBeCalledTimes(1) - ; + $this->httpDownloader->expects( + [['url' => $apiUrl, 'body' => $projectData]], + true + ); - $driver = new GitLabDriver(array('url' => $url), $this->io->reveal(), $this->config, $this->httpDownloader->reveal(), $this->process->reveal()); + $driver = new GitLabDriver(array('url' => $url), $this->io, $this->config, $this->httpDownloader, $this->process); $driver->initialize(); $this->assertEquals($apiUrl, $driver->getApiUrl(), 'API URL is derived from the repository URL'); @@ -577,15 +593,17 @@ JSON; } JSON; - $this->mockResponse(Argument::cetera(), $options, $projectData) - ->shouldBeCalled(); + $this->httpDownloader->expects( + [['url' => 'https:///api/v4/projects/%2Fmyproject', 'body' => $projectData]], + true + ); $driver = new GitLabDriver( array('url' => 'https://gitlab.mycompany.local/mygroup/myproject', 'options' => $options), - $this->io->reveal(), + $this->io, $this->config, - $this->httpDownloader->reveal(), - $this->process->reveal() + $this->httpDownloader, + $this->process ); $driver->initialize(); } @@ -611,28 +629,15 @@ JSON; $apiUrl = 'https://gitlab.com/api/v4/projects/mygroup%2Fmyproject'; $url = 'git@gitlab.com:mygroup/myproject'; - $this->mockResponse($apiUrl, array(), $projectData) - ->shouldBeCalledTimes(1) - ; + $this->httpDownloader->expects( + [['url' => $apiUrl, 'body' => $projectData]], + true + ); $config = clone $this->config; $config->merge(array('config' => array('gitlab-protocol' => 'http'))); - $driver = new GitLabDriver(array('url' => $url), $this->io->reveal(), $config, $this->httpDownloader->reveal(), $this->process->reveal()); + $driver = new GitLabDriver(array('url' => $url), $this->io, $config, $this->httpDownloader, $this->process); $driver->initialize(); $this->assertEquals('https://gitlab.com/mygroup/myproject.git', $driver->getRepositoryUrl(), 'Repository URL matches config request for http not git'); } - - /** - * @param string $url - * @param mixed[] $options - * @param string|null $return - * - * @return \Prophecy\Prophecy\MethodProphecy - */ - private function mockResponse($url, $options, $return) - { - return $this->httpDownloader - ->get($url, $options) - ->willReturn(new Response(array('url' => $url), 200, array(), $return)); - } } diff --git a/tests/Composer/Test/Repository/Vcs/HgDriverTest.php b/tests/Composer/Test/Repository/Vcs/HgDriverTest.php index 2fcd27bdf..68b9c9e65 100644 --- a/tests/Composer/Test/Repository/Vcs/HgDriverTest.php +++ b/tests/Composer/Test/Repository/Vcs/HgDriverTest.php @@ -26,7 +26,7 @@ class HgDriverTest extends TestCase /** @var string */ private $home; - public function setUp() + public function setUp(): void { $this->io = $this->getMockBuilder('Composer\IO\IOInterface')->getMock(); $this->home = $this->getUniqueTmpDirectory(); @@ -38,8 +38,9 @@ class HgDriverTest extends TestCase )); } - public function tearDown() + protected function tearDown(): void { + parent::tearDown(); $fs = new Filesystem; $fs->removeDirectory($this->home); } diff --git a/tests/Composer/Test/Repository/Vcs/PerforceDriverTest.php b/tests/Composer/Test/Repository/Vcs/PerforceDriverTest.php index 6dfbc3f26..a918b7ff9 100644 --- a/tests/Composer/Test/Repository/Vcs/PerforceDriverTest.php +++ b/tests/Composer/Test/Repository/Vcs/PerforceDriverTest.php @@ -61,7 +61,7 @@ class PerforceDriverTest extends TestCase const TEST_DEPOT = 'TEST_DEPOT_CONFIG'; const TEST_BRANCH = 'TEST_BRANCH_CONFIG'; - protected function setUp() + protected function setUp(): void { $this->testPath = $this->getUniqueTmpDirectory(); $this->config = $this->getTestConfig($this->testPath); @@ -71,15 +71,16 @@ class PerforceDriverTest extends TestCase 'branch' => self::TEST_BRANCH, ); $this->io = $this->getMockIOInterface(); - $this->process = new ProcessExecutorMock; + $this->process = $this->getProcessExecutorMock(); $this->httpDownloader = $this->getMockHttpDownloader(); $this->perforce = $this->getMockPerforce(); $this->driver = new PerforceDriver($this->repoConfig, $this->io, $this->config, $this->httpDownloader, $this->process); $this->overrideDriverInternalPerforce($this->perforce); } - protected function tearDown() + protected function tearDown(): void { + parent::tearDown(); //cleanup directory under test path $fs = new Filesystem; $fs->removeDirectory($this->testPath); @@ -146,10 +147,10 @@ class PerforceDriverTest extends TestCase public function testInitializeLogsInAndConnectsClient() { - $this->perforce->expects($this->at(0))->method('p4Login'); - $this->perforce->expects($this->at(1))->method('checkStream'); - $this->perforce->expects($this->at(2))->method('writeP4ClientSpec'); - $this->perforce->expects($this->at(3))->method('connectClient'); + $this->perforce->expects($this->once())->method('p4Login'); + $this->perforce->expects($this->once())->method('checkStream'); + $this->perforce->expects($this->once())->method('writeP4ClientSpec'); + $this->perforce->expects($this->once())->method('connectClient'); $this->driver->initialize(); } diff --git a/tests/Composer/Test/Repository/Vcs/SvnDriverTest.php b/tests/Composer/Test/Repository/Vcs/SvnDriverTest.php index b99658ebf..17f9f3d7f 100644 --- a/tests/Composer/Test/Repository/Vcs/SvnDriverTest.php +++ b/tests/Composer/Test/Repository/Vcs/SvnDriverTest.php @@ -17,6 +17,7 @@ use Composer\Config; use Composer\Test\TestCase; use Composer\Util\Filesystem; use Composer\Test\Mock\ProcessExecutorMock; +use Composer\Util\ProcessExecutor; class SvnDriverTest extends TestCase { @@ -29,7 +30,7 @@ class SvnDriverTest extends TestCase */ protected $config; - public function setUp() + public function setUp(): void { $this->home = $this->getUniqueTmpDirectory(); $this->config = new Config(); @@ -40,15 +41,17 @@ class SvnDriverTest extends TestCase )); } - public function tearDown() + protected function tearDown(): void { + parent::tearDown(); $fs = new Filesystem(); $fs->removeDirectory($this->home); } public function testWrongCredentialsInUrl() { - $this->setExpectedException('RuntimeException'); + self::expectException('RuntimeException'); + self::expectExceptionMessage("Repository https://till:secret@corp.svn.local/repo could not be processed, wrong credentials provided (svn: OPTIONS of 'https://corp.svn.local/repo': authorization failed: Could not authenticate to server: rejected Basic challenge (https://corp.svn.local/))"); $console = $this->getMockBuilder('Composer\IO\IOInterface')->getMock(); $httpDownloader = $this->getMockBuilder('Composer\Util\HttpDownloader')->disableOriginalConstructor()->getMock(); @@ -57,10 +60,21 @@ class SvnDriverTest extends TestCase $output .= " authorization failed: Could not authenticate to server:"; $output .= " rejected Basic challenge (https://corp.svn.local/)"; - $process = new ProcessExecutorMock; + $process = $this->getProcessExecutorMock(); + $authedCommand = sprintf( + 'svn ls --verbose --non-interactive --username %s --password %s -- %s', + ProcessExecutor::escape('till'), + ProcessExecutor::escape('secret'), + ProcessExecutor::escape('https://till:secret@corp.svn.local/repo/trunk') + ); $process->expects(array( - 'svn --version', - array('cmd' => '', 'return' => 1, 'stderr' => $output), + array('cmd' => $authedCommand, 'return' => 1, 'stderr' => $output), + array('cmd' => $authedCommand, 'return' => 1, 'stderr' => $output), + array('cmd' => $authedCommand, 'return' => 1, 'stderr' => $output), + array('cmd' => $authedCommand, 'return' => 1, 'stderr' => $output), + array('cmd' => $authedCommand, 'return' => 1, 'stderr' => $output), + array('cmd' => $authedCommand, 'return' => 1, 'stderr' => $output), + array('cmd' => 'svn --version', 'return' => 0, 'stdout' => '1.2.3'), ), true); $repoConfig = array( @@ -69,8 +83,6 @@ class SvnDriverTest extends TestCase $svn = new SvnDriver($repoConfig, $console, $this->config, $httpDownloader, $process); $svn->initialize(); - - $process->assertComplete($this); } public static function supportProvider() diff --git a/tests/Composer/Test/Repository/VcsRepositoryTest.php b/tests/Composer/Test/Repository/VcsRepositoryTest.php index 1e0a541fe..470c9bced 100644 --- a/tests/Composer/Test/Repository/VcsRepositoryTest.php +++ b/tests/Composer/Test/Repository/VcsRepositoryTest.php @@ -130,7 +130,7 @@ class VcsRepositoryTest extends TestCase chdir($oldCwd); } - public function setUp() + public function setUp(): void { if (!self::$gitRepo) { $this->initialize(); @@ -140,7 +140,7 @@ class VcsRepositoryTest extends TestCase } } - public static function tearDownAfterClass() + public static function tearDownAfterClass(): void { $fs = new Filesystem; $fs->removeDirectory(self::$composerHome); diff --git a/tests/Composer/Test/TestCase.php b/tests/Composer/Test/TestCase.php index 5255b5066..cc6a34229 100644 --- a/tests/Composer/Test/TestCase.php +++ b/tests/Composer/Test/TestCase.php @@ -12,11 +12,15 @@ namespace Composer\Test; +use Composer\Config; +use Composer\IO\IOInterface; use Composer\Pcre\Preg; use Composer\Semver\VersionParser; use Composer\Package\RootPackageInterface; use Composer\Package\PackageInterface; use Composer\Semver\Constraint\Constraint; +use Composer\Test\Mock\HttpDownloaderMock; +use Composer\Test\Mock\ProcessExecutorMock; use Composer\Util\Filesystem; use Composer\Util\Platform; use Composer\Util\Silencer; @@ -31,7 +35,7 @@ use Composer\Package\CompleteAliasPackage; use Composer\Package\CompletePackageInterface; use Composer\Package\Package; -abstract class TestCase extends PolyfillTestCase +abstract class TestCase extends \PHPUnit\Framework\TestCase { /** * @var ?VersionParser @@ -42,6 +46,26 @@ abstract class TestCase extends PolyfillTestCase */ private static $executableCache = array(); + /** + * @var list + */ + private $httpDownloaderMocks = []; + /** + * @var list + */ + private $processExecutorMocks = []; + + protected function tearDown(): void + { + parent::tearDown(); + foreach ($this->httpDownloaderMocks as $mock) { + $mock->assertComplete(); + } + foreach ($this->processExecutorMocks as $mock) { + $mock->assertComplete(); + } + } + /** * @return string */ @@ -185,27 +209,6 @@ abstract class TestCase extends PolyfillTestCase } } - /** - * @param string $exception - * @param string|null $message - * @param int|null $code - * @return void - */ - public function setExpectedException($exception, $message = null, $code = null) - { - if (!class_exists('PHPUnit\Framework\Error\Notice')) { - $exception = str_replace('PHPUnit\\Framework\\Error\\', 'PHPUnit_Framework_Error_', $exception); - } - if (method_exists($this, 'expectException')) { - $this->expectException($exception); - if (null !== $message) { - $this->expectExceptionMessage($message); - } - } else { - parent::setExpectedException($exception, $message, $code); - } - } - /** * Transforms an escaped non-Windows command to match Windows escaping. * @@ -226,4 +229,29 @@ abstract class TestCase extends PolyfillTestCase return $cmd; } + + protected function getHttpDownloaderMock(IOInterface $io = null, Config $config = null): HttpDownloaderMock + { + $this->httpDownloaderMocks[] = $mock = new HttpDownloaderMock($io, $config); + + return $mock; + } + + protected function getProcessExecutorMock(): ProcessExecutorMock + { + $this->processExecutorMocks[] = $mock = new ProcessExecutorMock(); + + return $mock; + } + + protected function createTempFile(?string $dir = null): string + { + $dir = $dir ?? sys_get_temp_dir(); + $name = tempnam($dir, 'c'); + if ($name === false) { + throw new \UnexpectedValueException('tempnam failed to create a temporary file in '.$dir); + } + + return $name; + } } diff --git a/tests/Composer/Test/Util/AuthHelperTest.php b/tests/Composer/Test/Util/AuthHelperTest.php index d7018cd1c..a65d022c1 100644 --- a/tests/Composer/Test/Util/AuthHelperTest.php +++ b/tests/Composer/Test/Util/AuthHelperTest.php @@ -31,7 +31,7 @@ class AuthHelperTest extends TestCase /** @var AuthHelper */ private $authHelper; - protected function setUp() + protected function setUp(): void { $this->io = $this ->getMockBuilder('Composer\IO\IOInterface') @@ -475,7 +475,7 @@ class AuthHelperTest extends TestCase public function testStoreAuthWithPromptInvalidAnswer() { - $this->setExpectedException('RuntimeException'); + self::expectException('RuntimeException'); $origin = 'github.com'; $storeAuth = 'prompt'; diff --git a/tests/Composer/Test/Util/BitbucketTest.php b/tests/Composer/Test/Util/BitbucketTest.php index 47fdb4ea8..e7fbf4eed 100644 --- a/tests/Composer/Test/Util/BitbucketTest.php +++ b/tests/Composer/Test/Util/BitbucketTest.php @@ -48,7 +48,7 @@ class BitbucketTest extends TestCase /** @var int */ private $time; - protected function setUp() + protected function setUp(): void { $this->io = $this ->getMockBuilder('Composer\IO\ConsoleIO') @@ -270,7 +270,7 @@ class BitbucketTest extends TestCase public function testRequestAccessTokenWithUsernameAndPasswordWithNotFoundResponse() { - $this->setExpectedException('Composer\Downloader\TransportException'); + self::expectException('Composer\Downloader\TransportException'); $this->config->expects($this->once()) ->method('get') ->with('bitbucket-oauth') @@ -301,9 +301,9 @@ class BitbucketTest extends TestCase public function testUsernamePasswordAuthenticationFlow() { $this->io - ->expects($this->at(0)) + ->expects($this->atLeastOnce()) ->method('writeError') - ->with($this->message) + ->withConsecutive([$this->message]) ; $this->io->expects($this->exactly(2)) @@ -469,7 +469,7 @@ class BitbucketTest extends TestCase public function testAuthorizeOAuthWithoutAvailableGitConfigToken() { - $process = new ProcessExecutorMock; + $process = $this->getProcessExecutorMock(); $process->expects(array(), false, array('return' => -1)); $bitbucket = new Bitbucket($this->io, $this->config, $process, $this->httpDownloader, $this->time); @@ -479,7 +479,7 @@ class BitbucketTest extends TestCase public function testAuthorizeOAuthWithAvailableGitConfigToken() { - $process = new ProcessExecutorMock; + $process = $this->getProcessExecutorMock(); $bitbucket = new Bitbucket($this->io, $this->config, $process, $this->httpDownloader, $this->time); diff --git a/tests/Composer/Test/Util/ErrorHandlerTest.php b/tests/Composer/Test/Util/ErrorHandlerTest.php index 551daaa25..6dc0c8ec6 100644 --- a/tests/Composer/Test/Util/ErrorHandlerTest.php +++ b/tests/Composer/Test/Util/ErrorHandlerTest.php @@ -20,13 +20,14 @@ use Composer\Test\TestCase; */ class ErrorHandlerTest extends TestCase { - public function setUp() + public function setUp(): void { ErrorHandler::register(); } - public function tearDown() + protected function tearDown(): void { + parent::tearDown(); restore_error_handler(); } @@ -36,9 +37,11 @@ class ErrorHandlerTest extends TestCase public function testErrorHandlerCaptureNotice() { if (PHP_VERSION_ID >= 80000) { - $this->setExpectedException('\ErrorException', 'Undefined array key "baz"'); + self::expectException('\ErrorException'); + self::expectExceptionMessage('Undefined array key "baz"'); } else { - $this->setExpectedException('\ErrorException', 'Undefined index: baz'); + self::expectException('\ErrorException'); + self::expectExceptionMessage('Undefined index: baz'); } $array = array('foo' => 'bar'); @@ -52,9 +55,11 @@ class ErrorHandlerTest extends TestCase public function testErrorHandlerCaptureWarning() { if (PHP_VERSION_ID >= 80000) { - $this->setExpectedException('TypeError', 'array_merge'); + self::expectException('TypeError'); + self::expectExceptionMessage('array_merge'); } else { - $this->setExpectedException('ErrorException', 'array_merge'); + self::expectException('ErrorException'); + self::expectExceptionMessage('array_merge'); } // @phpstan-ignore-next-line diff --git a/tests/Composer/Test/Util/FilesystemTest.php b/tests/Composer/Test/Util/FilesystemTest.php index bdf6b7f16..2c7fa5657 100644 --- a/tests/Composer/Test/Util/FilesystemTest.php +++ b/tests/Composer/Test/Util/FilesystemTest.php @@ -32,15 +32,16 @@ class FilesystemTest extends TestCase */ private $testFile; - public function setUp() + public function setUp(): void { $this->fs = new Filesystem; $this->workingDir = $this->getUniqueTmpDirectory(); $this->testFile = $this->getUniqueTmpDirectory() . '/composer_test_file'; } - public function tearDown() + protected function tearDown(): void { + parent::tearDown(); if (is_dir($this->workingDir)) { $this->fs->removeDirectory($this->workingDir); } @@ -307,7 +308,8 @@ class FilesystemTest extends TestCase if (!defined('PHP_WINDOWS_VERSION_BUILD')) { $this->assertFalse($fs->isJunction($this->workingDir)); $this->assertFalse($fs->removeJunction($this->workingDir)); - $this->setExpectedException('LogicException', 'not available on non-Windows platform'); + self::expectException('LogicException'); + self::expectExceptionMessage('not available on non-Windows platform'); } $target = $this->workingDir . '/real/../real/nesting'; diff --git a/tests/Composer/Test/Util/GitHubTest.php b/tests/Composer/Test/Util/GitHubTest.php index ed605c3c7..b82b8e1d3 100644 --- a/tests/Composer/Test/Util/GitHubTest.php +++ b/tests/Composer/Test/Util/GitHubTest.php @@ -12,6 +12,7 @@ namespace Composer\Test\Util; +use _PHPStan_c862bb974\Symfony\Component\Console\Output\BufferedOutput; use Composer\Downloader\TransportException; use Composer\Util\GitHub; use Composer\Util\Http\Response; @@ -33,9 +34,9 @@ class GitHubTest extends TestCase { $io = $this->getIOMock(); $io - ->expects($this->at(0)) + ->expects($this->atLeastOnce()) ->method('writeError') - ->with($this->message) + ->withConsecutive([$this->message]) ; $io ->expects($this->once()) @@ -45,15 +46,10 @@ class GitHubTest extends TestCase ; $httpDownloader = $this->getHttpDownloaderMock(); - $httpDownloader - ->expects($this->once()) - ->method('get') - ->with( - $this->equalTo($url = sprintf('https://api.%s/', $this->origin)), - $this->anything() - ) - ->willReturn(new Response(array('url' => $url), 200, array(), '{}')) - ; + $httpDownloader->expects( + [['url' => sprintf('https://api.%s/', $this->origin), 'body' => '{}']], + true + ); $config = $this->getConfigMock(); $config @@ -83,11 +79,10 @@ class GitHubTest extends TestCase ; $httpDownloader = $this->getHttpDownloaderMock(); - $httpDownloader - ->expects($this->exactly(1)) - ->method('get') - ->will($this->throwException(new TransportException('', 401))) - ; + $httpDownloader->expects( + [['url' => sprintf('https://api.%s/', $this->origin), 'status' => 401]], + true + ); $config = $this->getConfigMock(); $config @@ -123,20 +118,6 @@ class GitHubTest extends TestCase return $this->getMockBuilder('Composer\Config')->getMock(); } - /** - * @return \PHPUnit\Framework\MockObject\MockObject&\Composer\Util\HttpDownloader - */ - private function getHttpDownloaderMock() - { - $httpDownloader = $this - ->getMockBuilder('Composer\Util\HttpDownloader') - ->disableOriginalConstructor() - ->getMock() - ; - - return $httpDownloader; - } - /** * @return \PHPUnit\Framework\MockObject\MockObject&\Composer\Config\JsonConfigSource */ diff --git a/tests/Composer/Test/Util/GitLabTest.php b/tests/Composer/Test/Util/GitLabTest.php index 6cbb34023..e7ef0b94b 100644 --- a/tests/Composer/Test/Util/GitLabTest.php +++ b/tests/Composer/Test/Util/GitLabTest.php @@ -13,6 +13,7 @@ namespace Composer\Test\Util; use Composer\Downloader\TransportException; +use Composer\Test\Mock\HttpDownloaderMock; use Composer\Util\GitLab; use Composer\Util\Http\Response; use Composer\Test\TestCase; @@ -37,9 +38,9 @@ class GitLabTest extends TestCase { $io = $this->getIOMock(); $io - ->expects($this->at(0)) + ->expects($this->atLeastOnce()) ->method('writeError') - ->with($this->message) + ->withConsecutive([$this->message]) ; $io ->expects($this->once()) @@ -55,15 +56,10 @@ class GitLabTest extends TestCase ; $httpDownloader = $this->getHttpDownloaderMock(); - $httpDownloader - ->expects($this->once()) - ->method('get') - ->with( - $this->equalTo($url = sprintf('http://%s/oauth/token', $this->origin)), - $this->anything() - ) - ->willReturn(new Response(array('url' => $url), 200, array(), sprintf('{"access_token": "%s", "token_type": "bearer", "expires_in": 7200}', $this->token))) - ; + $httpDownloader->expects( + [['url' => sprintf('http://%s/oauth/token', $this->origin), 'body' => sprintf('{"access_token": "%s", "token_type": "bearer", "expires_in": 7200}', $this->token)]], + true + ); $config = $this->getConfigMock(); $config @@ -79,7 +75,8 @@ class GitLabTest extends TestCase public function testUsernamePasswordFailure() { - $this->setExpectedException('RuntimeException', 'Invalid GitLab credentials 5 times in a row, aborting.'); + self::expectException('RuntimeException'); + self::expectExceptionMessage('Invalid GitLab credentials 5 times in a row, aborting.'); $io = $this->getIOMock(); $io ->expects($this->exactly(5)) @@ -95,12 +92,16 @@ class GitLabTest extends TestCase ; $httpDownloader = $this->getHttpDownloaderMock(); - $httpDownloader - ->expects($this->exactly(5)) - ->method('get') - ->will($this->throwException($e = new TransportException('', 401))) - ; - $e->setResponse('{}'); + $httpDownloader->expects( + [ + ['url' => 'https://gitlab.com/oauth/token', 'status' => 401, 'body' => '{}'], + ['url' => 'https://gitlab.com/oauth/token', 'status' => 401, 'body' => '{}'], + ['url' => 'https://gitlab.com/oauth/token', 'status' => 401, 'body' => '{}'], + ['url' => 'https://gitlab.com/oauth/token', 'status' => 401, 'body' => '{}'], + ['url' => 'https://gitlab.com/oauth/token', 'status' => 401, 'body' => '{}'], + ], + true + ); $config = $this->getConfigMock(); $config @@ -136,20 +137,6 @@ class GitLabTest extends TestCase return $this->getMockBuilder('Composer\Config')->getMock(); } - /** - * @return \PHPUnit\Framework\MockObject\MockObject&\Composer\Util\HttpDownloader - */ - private function getHttpDownloaderMock() - { - $httpDownloader = $this - ->getMockBuilder('Composer\Util\HttpDownloader') - ->disableOriginalConstructor() - ->getMock() - ; - - return $httpDownloader; - } - /** * @return \PHPUnit\Framework\MockObject\MockObject&\Composer\Config\JsonConfigSource */ diff --git a/tests/Composer/Test/Util/GitTest.php b/tests/Composer/Test/Util/GitTest.php index d6e74c7b5..8e3928a62 100644 --- a/tests/Composer/Test/Util/GitTest.php +++ b/tests/Composer/Test/Util/GitTest.php @@ -32,11 +32,11 @@ class GitTest extends TestCase /** @var Filesystem&\PHPUnit\Framework\MockObject\MockObject */ private $fs; - protected function setUp() + protected function setUp(): void { $this->io = $this->getMockBuilder('Composer\IO\IOInterface')->getMock(); $this->config = $this->getMockBuilder('Composer\Config')->disableOriginalConstructor()->getMock(); - $this->process = new ProcessExecutorMock; + $this->process = $this->getProcessExecutorMock(); $this->fs = $this->getMockBuilder('Composer\Util\Filesystem')->disableOriginalConstructor()->getMock(); $this->git = new Git($this->io, $this->config, $this->process, $this->fs); } @@ -61,8 +61,6 @@ class GitTest extends TestCase $this->process->expects(array('git command'), true); $this->git->runCommand($commandCallable, 'https://github.com/acme/repo', null, true); - - $this->process->assertComplete($this); } public function publicGithubNoCredentialsProvider() @@ -75,7 +73,7 @@ class GitTest extends TestCase public function testRunCommandPrivateGitHubRepositoryNotInitialCloneNotInteractiveWithoutAuthentication() { - $this->setExpectedException('RuntimeException'); + self::expectException('RuntimeException'); $that = $this; $commandCallable = function ($url) use ($that) { @@ -92,8 +90,6 @@ class GitTest extends TestCase ), true); $this->git->runCommand($commandCallable, 'https://github.com/acme/repo', null, true); - - $this->process->assertComplete($this); } /** @@ -139,8 +135,6 @@ class GitTest extends TestCase ->willReturn(array('username' => 'token', 'password' => $gitHubToken)); $this->git->runCommand($commandCallable, $gitUrl, null, true); - - $this->process->assertComplete($this); } public function privateGithubWithCredentialsProvider() diff --git a/tests/Composer/Test/Util/Http/ProxyHelperTest.php b/tests/Composer/Test/Util/Http/ProxyHelperTest.php index 81d1d33a8..72e1d2f6d 100644 --- a/tests/Composer/Test/Util/Http/ProxyHelperTest.php +++ b/tests/Composer/Test/Util/Http/ProxyHelperTest.php @@ -17,7 +17,7 @@ use Composer\Test\TestCase; class ProxyHelperTest extends TestCase { - protected function setUp() + protected function setUp(): void { unset( $_SERVER['HTTP_PROXY'], @@ -30,8 +30,9 @@ class ProxyHelperTest extends TestCase ); } - protected function tearDown() + protected function tearDown(): void { + parent::tearDown(); unset( $_SERVER['HTTP_PROXY'], $_SERVER['http_proxy'], @@ -52,7 +53,7 @@ class ProxyHelperTest extends TestCase { $_SERVER['http_proxy'] = $url; - $this->setExpectedException('RuntimeException'); + self::expectException('RuntimeException'); ProxyHelper::getProxyData(); } diff --git a/tests/Composer/Test/Util/Http/ProxyManagerTest.php b/tests/Composer/Test/Util/Http/ProxyManagerTest.php index 48e9914df..16d926039 100644 --- a/tests/Composer/Test/Util/Http/ProxyManagerTest.php +++ b/tests/Composer/Test/Util/Http/ProxyManagerTest.php @@ -17,7 +17,7 @@ use Composer\Test\TestCase; class ProxyManagerTest extends TestCase { - protected function setUp() + protected function setUp(): void { unset( $_SERVER['HTTP_PROXY'], @@ -31,8 +31,9 @@ class ProxyManagerTest extends TestCase ProxyManager::reset(); } - protected function tearDown() + protected function tearDown(): void { + parent::tearDown(); unset( $_SERVER['HTTP_PROXY'], $_SERVER['http_proxy'], @@ -62,7 +63,7 @@ class ProxyManagerTest extends TestCase { $_SERVER['http_proxy'] = 'localhost'; $proxyManager = ProxyManager::getInstance(); - $this->setExpectedException('Composer\Downloader\TransportException'); + self::expectException('Composer\Downloader\TransportException'); $proxyManager->getProxyForRequest('http://example.com'); } diff --git a/tests/Composer/Test/Util/IniHelperTest.php b/tests/Composer/Test/Util/IniHelperTest.php index 0856cd771..a6d83bb09 100644 --- a/tests/Composer/Test/Util/IniHelperTest.php +++ b/tests/Composer/Test/Util/IniHelperTest.php @@ -73,7 +73,7 @@ class IniHelperTest extends TestCase $this->assertEquals($paths, IniHelper::getAll()); } - public static function setUpBeforeClass() + public static function setUpBeforeClass(): void { // Register our name with XdebugHandler $xdebug = new XdebugHandler('composer'); @@ -81,7 +81,7 @@ class IniHelperTest extends TestCase self::$envOriginal = getenv('COMPOSER_ORIGINAL_INIS'); } - public static function tearDownAfterClass() + public static function tearDownAfterClass(): void { // Restore original state if (false !== self::$envOriginal) { diff --git a/tests/Composer/Test/Util/PerforceTest.php b/tests/Composer/Test/Util/PerforceTest.php index d8743f3d7..d7d2c416f 100644 --- a/tests/Composer/Test/Util/PerforceTest.php +++ b/tests/Composer/Test/Util/PerforceTest.php @@ -12,6 +12,8 @@ namespace Composer\Test\Util; +use Composer\Json\JsonFile; +use Composer\Test\Mock\ProcessExecutorMock; use Composer\Util\Perforce; use Composer\Test\TestCase; use Composer\Util\ProcessExecutor; @@ -23,7 +25,7 @@ class PerforceTest extends TestCase { /** @var Perforce */ protected $perforce; - /** @var \PHPUnit\Framework\MockObject\MockObject&\Composer\Util\ProcessExecutor */ + /** @var ProcessExecutorMock */ protected $processExecutor; /** @var array */ protected $repoConfig; @@ -37,9 +39,9 @@ class PerforceTest extends TestCase const TEST_PORT = 'port'; const TEST_PATH = 'path'; - protected function setUp() + protected function setUp(): void { - $this->processExecutor = $this->getMockBuilder('Composer\Util\ProcessExecutor')->getMock(); + $this->processExecutor = $this->getProcessExecutorMock(); $this->repoConfig = $this->getTestRepoConfig(); $this->io = $this->getMockIOInterface(); $this->createNewPerforceWithWindowsFlag(true); @@ -79,8 +81,6 @@ class PerforceTest extends TestCase public function testGetClientWithoutStream() { $client = $this->perforce->getClient(); - $hostname = gethostname(); - $timestamp = time(); $expected = 'composer_perforce_TEST_depot'; $this->assertEquals($expected, $client); @@ -147,16 +147,11 @@ class PerforceTest extends TestCase { $this->createNewPerforceWithWindowsFlag(true); $this->perforce->setUser(null); - $expectedCommand = 'p4 set'; - $callback = function ($command, &$output) { - $output = 'P4USER=TEST_P4VARIABLE_USER' . PHP_EOL; + $this->processExecutor->expects( + [['cmd' => 'p4 set', 'stdout' => 'P4USER=TEST_P4VARIABLE_USER' . PHP_EOL, 'return' => 0]], + true + ); - return true; - }; - $this->processExecutor->expects($this->at(0)) - ->method('execute') - ->with($this->equalTo($expectedCommand)) - ->will($this->returnCallback($callback)); $this->perforce->queryP4user(); $this->assertEquals('TEST_P4VARIABLE_USER', $this->perforce->getUser()); } @@ -165,16 +160,12 @@ class PerforceTest extends TestCase { $this->createNewPerforceWithWindowsFlag(false); $this->perforce->setUser(null); - $expectedCommand = 'echo $P4USER'; - $callback = function ($command, &$output) { - $output = 'TEST_P4VARIABLE_USER' . PHP_EOL; - return true; - }; - $this->processExecutor->expects($this->at(0)) - ->method('execute') - ->with($this->equalTo($expectedCommand)) - ->will($this->returnCallback($callback)); + $this->processExecutor->expects( + [['cmd' => 'echo $P4USER', 'stdout' => 'TEST_P4VARIABLE_USER' . PHP_EOL, 'return' => 0]], + true + ); + $this->perforce->queryP4user(); $this->assertEquals('TEST_P4VARIABLE_USER', $this->perforce->getUser()); } @@ -183,10 +174,9 @@ class PerforceTest extends TestCase { $this->perforce->setUser(null); $expectedQuestion = 'Enter P4 User:'; - $this->io->expects($this->at(0)) - ->method('ask') + $this->io->method('ask') ->with($this->equalTo($expectedQuestion)) - ->will($this->returnValue('TEST_QUERY_USER')); + ->willReturn('TEST_QUERY_USER'); $this->perforce->queryP4user(); $this->assertEquals('TEST_QUERY_USER', $this->perforce->getUser()); } @@ -197,14 +187,19 @@ class PerforceTest extends TestCase $this->perforce->setUser(null); $expectedQuestion = 'Enter P4 User:'; $expectedCommand = 'p4 set P4USER=TEST_QUERY_USER'; - $this->io->expects($this->at(0)) + $this->io->expects($this->once()) ->method('ask') ->with($this->equalTo($expectedQuestion)) - ->will($this->returnValue('TEST_QUERY_USER')); - $this->processExecutor->expects($this->at(1)) - ->method('execute') - ->with($this->equalTo($expectedCommand)) - ->will($this->returnValue(0)); + ->willReturn('TEST_QUERY_USER'); + + $this->processExecutor->expects( + [ + 'p4 set', + $expectedCommand + ], + true + ); + $this->perforce->queryP4user(); } @@ -214,14 +209,17 @@ class PerforceTest extends TestCase $this->perforce->setUser(null); $expectedQuestion = 'Enter P4 User:'; $expectedCommand = 'export P4USER=TEST_QUERY_USER'; - $this->io->expects($this->at(0)) + $this->io->expects($this->once()) ->method('ask') ->with($this->equalTo($expectedQuestion)) - ->will($this->returnValue('TEST_QUERY_USER')); - $this->processExecutor->expects($this->at(1)) - ->method('execute') - ->with($this->equalTo($expectedCommand)) - ->will($this->returnValue(0)); + ->willReturn('TEST_QUERY_USER'); + $this->processExecutor->expects( + [ + 'echo $P4USER', + $expectedCommand + ], + true + ); $this->perforce->queryP4user(); } @@ -241,16 +239,12 @@ class PerforceTest extends TestCase public function testQueryP4PasswordWithPasswordSetInP4VariablesWithWindowsOS() { $this->createNewPerforceWithWindowsFlag(true); - $expectedCommand = 'p4 set'; - $callback = function ($command, &$output) { - $output = 'P4PASSWD=TEST_P4VARIABLE_PASSWORD' . PHP_EOL; - return true; - }; - $this->processExecutor->expects($this->at(0)) - ->method('execute') - ->with($this->equalTo($expectedCommand)) - ->will($this->returnCallback($callback)); + $this->processExecutor->expects( + [['cmd' => 'p4 set', 'stdout' => 'P4PASSWD=TEST_P4VARIABLE_PASSWORD' . PHP_EOL, 'return' => 0]], + true + ); + $password = $this->perforce->queryP4Password(); $this->assertEquals('TEST_P4VARIABLE_PASSWORD', $password); } @@ -258,16 +252,11 @@ class PerforceTest extends TestCase public function testQueryP4PasswordWithPasswordSetInP4VariablesNotWindowsOS() { $this->createNewPerforceWithWindowsFlag(false); - $expectedCommand = 'echo $P4PASSWD'; - $callback = function ($command, &$output) { - $output = 'TEST_P4VARIABLE_PASSWORD' . PHP_EOL; - return true; - }; - $this->processExecutor->expects($this->at(0)) - ->method('execute') - ->with($this->equalTo($expectedCommand)) - ->will($this->returnCallback($callback)); + $this->processExecutor->expects( + [['cmd' => 'echo $P4PASSWD', 'stdout' => 'TEST_P4VARIABLE_PASSWORD' . PHP_EOL, 'return' => 0]], + true + ); $password = $this->perforce->queryP4Password(); $this->assertEquals('TEST_P4VARIABLE_PASSWORD', $password); @@ -276,10 +265,10 @@ class PerforceTest extends TestCase public function testQueryP4PasswordQueriesForPassword() { $expectedQuestion = 'Enter password for Perforce user user: '; - $this->io->expects($this->at(0)) + $this->io->expects($this->once()) ->method('askAndHideAnswer') ->with($this->equalTo($expectedQuestion)) - ->will($this->returnValue('TEST_QUERY_PASSWORD')); + ->willReturn('TEST_QUERY_PASSWORD'); $password = $this->perforce->queryP4Password(); $this->assertEquals('TEST_QUERY_PASSWORD', $password); @@ -288,6 +277,9 @@ class PerforceTest extends TestCase public function testWriteP4ClientSpecWithoutStream() { $stream = fopen('php://memory', 'w+'); + if (false === $stream) { + self::fail('Could not open memory stream'); + } $this->perforce->writeClientSpecToFile($stream); rewind($stream); @@ -309,6 +301,9 @@ class PerforceTest extends TestCase { $this->setPerforceToStream(); $stream = fopen('php://memory', 'w+'); + if (false === $stream) { + self::fail('Could not open memory stream'); + } $this->perforce->writeClientSpecToFile($stream); rewind($stream); @@ -328,22 +323,19 @@ class PerforceTest extends TestCase public function testIsLoggedIn() { - $expectedCommand = 'p4 -u user -p port login -s'; - $this->processExecutor->expects($this->at(0)) - ->method('execute') - ->with($this->equalTo($expectedCommand), $this->equalTo(null)) - ->will($this->returnValue(0)); - + $this->processExecutor->expects( + [['cmd' => 'p4 -u user -p port login -s']], + true + ); $this->perforce->isLoggedIn(); } public function testConnectClient() { - $expectedCommand = 'p4 -u user -c composer_perforce_TEST_depot -p port client -i < path/composer_perforce_TEST_depot.p4.spec'; - $this->processExecutor->expects($this->at(0)) - ->method('execute') - ->with($this->equalTo($expectedCommand), $this->equalTo(null)) - ->will($this->returnValue(0)); + $this->processExecutor->expects( + ['p4 -u user -c composer_perforce_TEST_depot -p port client -i < path/composer_perforce_TEST_depot.p4.spec'], + true + ); $this->perforce->connectClient(); } @@ -352,29 +344,19 @@ class PerforceTest extends TestCase { $this->setPerforceToStream(); - $expectedCommand = 'p4 -u user -c composer_perforce_TEST_depot_branch -p port streams '.ProcessExecutor::escape('//depot/...'); - $this->processExecutor->expects($this->at(0)) - ->method('execute') - ->with($this->equalTo($expectedCommand)) - ->will( - $this->returnCallback( - function ($command, &$output) { - $output = 'Stream //depot/branch mainline none \'branch\'' . PHP_EOL; - - return true; - } - ) - ); - $expectedCommand2 = 'p4 -u user -p port changes '.ProcessExecutor::escape('//depot/branch/...'); - $expectedCallback = function ($command, &$output) { - $output = 'Change 1234 on 2014/03/19 by Clark.Stuth@Clark.Stuth_test_client \'test changelist\''; - - return true; - }; - $this->processExecutor->expects($this->at(1)) - ->method('execute') - ->with($this->equalTo($expectedCommand2)) - ->will($this->returnCallback($expectedCallback)); + $this->processExecutor->expects( + [ + [ + 'cmd' => 'p4 -u user -c composer_perforce_TEST_depot_branch -p port streams '.ProcessExecutor::escape('//depot/...'), + 'stdout' => 'Stream //depot/branch mainline none \'branch\'' . PHP_EOL + ], + [ + 'cmd' => 'p4 -u user -p port changes '.ProcessExecutor::escape('//depot/branch/...'), + 'stdout' => 'Change 1234 on 2014/03/19 by Clark.Stuth@Clark.Stuth_test_client \'test changelist\'' + ], + ], + true + ); $branches = $this->perforce->getBranches(); $this->assertEquals('//depot/branch@1234', $branches['master']); @@ -382,35 +364,31 @@ class PerforceTest extends TestCase public function testGetBranchesWithoutStream() { - $expectedCommand = 'p4 -u user -p port changes '.ProcessExecutor::escape('//depot/...'); - $expectedCallback = function ($command, &$output) { - $output = 'Change 5678 on 2014/03/19 by Clark.Stuth@Clark.Stuth_test_client \'test changelist\''; + $this->processExecutor->expects( + [ + [ + 'cmd' => 'p4 -u user -p port changes '.ProcessExecutor::escape('//depot/...'), + 'stdout' => 'Change 5678 on 2014/03/19 by Clark.Stuth@Clark.Stuth_test_client \'test changelist\'' + ], + ], + true + ); - return true; - }; - $this->processExecutor->expects($this->once()) - ->method('execute') - ->with($this->equalTo($expectedCommand)) - ->will($this->returnCallback($expectedCallback)); $branches = $this->perforce->getBranches(); $this->assertEquals('//depot@5678', $branches['master']); } public function testGetTagsWithoutStream() { - $expectedCommand = 'p4 -u user -c composer_perforce_TEST_depot -p port labels'; - $this->processExecutor->expects($this->at(0)) - ->method('execute') - ->with($this->equalTo($expectedCommand)) - ->will( - $this->returnCallback( - function ($command, &$output) { - $output = 'Label 0.0.1 2013/07/31 \'First Label!\'' . PHP_EOL . 'Label 0.0.2 2013/08/01 \'Second Label!\'' . PHP_EOL; - - return true; - } - ) - ); + $this->processExecutor->expects( + [ + [ + 'cmd' => 'p4 -u user -c composer_perforce_TEST_depot -p port labels', + 'stdout' => 'Label 0.0.1 2013/07/31 \'First Label!\'' . PHP_EOL . 'Label 0.0.2 2013/08/01 \'Second Label!\'' . PHP_EOL + ], + ], + true + ); $tags = $this->perforce->getTags(); $this->assertEquals('//depot@0.0.1', $tags['0.0.1']); @@ -421,19 +399,15 @@ class PerforceTest extends TestCase { $this->setPerforceToStream(); - $expectedCommand = 'p4 -u user -c composer_perforce_TEST_depot_branch -p port labels'; - $this->processExecutor->expects($this->at(0)) - ->method('execute') - ->with($this->equalTo($expectedCommand)) - ->will( - $this->returnCallback( - function ($command, &$output) { - $output = 'Label 0.0.1 2013/07/31 \'First Label!\'' . PHP_EOL . 'Label 0.0.2 2013/08/01 \'Second Label!\'' . PHP_EOL; - - return true; - } - ) - ); + $this->processExecutor->expects( + [ + [ + 'cmd' => 'p4 -u user -c composer_perforce_TEST_depot_branch -p port labels', + 'stdout' => 'Label 0.0.1 2013/07/31 \'First Label!\'' . PHP_EOL . 'Label 0.0.2 2013/08/01 \'Second Label!\'' . PHP_EOL + ], + ], + true + ); $tags = $this->perforce->getTags(); $this->assertEquals('//depot/branch@0.0.1', $tags['0.0.1']); @@ -449,16 +423,16 @@ class PerforceTest extends TestCase public function testCheckStreamWithStream() { - $this->processExecutor->expects($this->any())->method('execute') - ->will( - $this->returnCallback( - function ($command, &$output) { - $output = 'Depot depot 2013/06/25 stream /p4/1/depots/depot/... \'Created by Me\''; + $this->processExecutor->expects( + [ + [ + 'cmd' => 'p4 -u user -p port depots', + 'stdout' => 'Depot depot 2013/06/25 stream /p4/1/depots/depot/... \'Created by Me\'' + ], + ], + true + ); - return true; - } - ) - ); $result = $this->perforce->checkStream(); $this->assertTrue($result); $this->assertTrue($this->perforce->isStream()); @@ -466,19 +440,15 @@ class PerforceTest extends TestCase public function testGetComposerInformationWithoutLabelWithoutStream() { - $expectedCommand = 'p4 -u user -c composer_perforce_TEST_depot -p port print '.ProcessExecutor::escape('//depot/composer.json'); - $this->processExecutor->expects($this->at(0)) - ->method('execute') - ->with($this->equalTo($expectedCommand)) - ->will( - $this->returnCallback( - function ($command, &$output) { - $output = PerforceTest::getComposerJson(); - - return true; - } - ) - ); + $this->processExecutor->expects( + [ + [ + 'cmd' => 'p4 -u user -c composer_perforce_TEST_depot -p port print '.ProcessExecutor::escape('//depot/composer.json'), + 'stdout' => PerforceTest::getComposerJson() + ], + ], + true + ); $result = $this->perforce->getComposerInformation('//depot'); $expected = array( @@ -492,33 +462,19 @@ class PerforceTest extends TestCase public function testGetComposerInformationWithLabelWithoutStream() { - $expectedCommand = 'p4 -u user -p port files '.ProcessExecutor::escape('//depot/composer.json@0.0.1'); - $this->processExecutor->expects($this->at(0)) - ->method('execute') - ->with($this->equalTo($expectedCommand)) - ->will( - $this->returnCallback( - function ($command, &$output) { - $output = '//depot/composer.json#1 - branch change 10001 (text)'; - - return true; - } - ) - ); - - $expectedCommand = 'p4 -u user -c composer_perforce_TEST_depot -p port print '.ProcessExecutor::escape('//depot/composer.json@10001'); - $this->processExecutor->expects($this->at(1)) - ->method('execute') - ->with($this->equalTo($expectedCommand)) - ->will( - $this->returnCallback( - function ($command, &$output) { - $output = PerforceTest::getComposerJson(); - - return true; - } - ) - ); + $this->processExecutor->expects( + [ + [ + 'cmd' => 'p4 -u user -p port files '.ProcessExecutor::escape('//depot/composer.json@0.0.1'), + 'stdout' => '//depot/composer.json#1 - branch change 10001 (text)' + ], + [ + 'cmd' => 'p4 -u user -c composer_perforce_TEST_depot -p port print '.ProcessExecutor::escape('//depot/composer.json@10001'), + 'stdout' => PerforceTest::getComposerJson() + ], + ], + true + ); $result = $this->perforce->getComposerInformation('//depot@0.0.1'); @@ -535,19 +491,15 @@ class PerforceTest extends TestCase { $this->setPerforceToStream(); - $expectedCommand = 'p4 -u user -c composer_perforce_TEST_depot_branch -p port print '.ProcessExecutor::escape('//depot/branch/composer.json'); - $this->processExecutor->expects($this->at(0)) - ->method('execute') - ->with($this->equalTo($expectedCommand)) - ->will( - $this->returnCallback( - function ($command, &$output) { - $output = PerforceTest::getComposerJson(); - - return true; - } - ) - ); + $this->processExecutor->expects( + [ + [ + 'cmd' => 'p4 -u user -c composer_perforce_TEST_depot_branch -p port print '.ProcessExecutor::escape('//depot/branch/composer.json'), + 'stdout' => PerforceTest::getComposerJson() + ], + ], + true + ); $result = $this->perforce->getComposerInformation('//depot/branch'); @@ -562,34 +514,21 @@ class PerforceTest extends TestCase public function testGetComposerInformationWithLabelWithStream() { + $this->processExecutor->expects( + [ + [ + 'cmd' => 'p4 -u user -p port files '.ProcessExecutor::escape('//depot/branch/composer.json@0.0.1'), + 'stdout' => '//depot/composer.json#1 - branch change 10001 (text)', + ], + [ + 'cmd' => 'p4 -u user -c composer_perforce_TEST_depot_branch -p port print '.ProcessExecutor::escape('//depot/branch/composer.json@10001'), + 'stdout' => PerforceTest::getComposerJson(), + ], + ], + true + ); + $this->setPerforceToStream(); - $expectedCommand = 'p4 -u user -p port files '.ProcessExecutor::escape('//depot/branch/composer.json@0.0.1'); - $this->processExecutor->expects($this->at(0)) - ->method('execute') - ->with($this->equalTo($expectedCommand)) - ->will( - $this->returnCallback( - function ($command, &$output) { - $output = '//depot/composer.json#1 - branch change 10001 (text)'; - - return true; - } - ) - ); - - $expectedCommand = 'p4 -u user -c composer_perforce_TEST_depot_branch -p port print '.ProcessExecutor::escape('//depot/branch/composer.json@10001'); - $this->processExecutor->expects($this->at(1)) - ->method('execute') - ->with($this->equalTo($expectedCommand)) - ->will( - $this->returnCallback( - function ($command, &$output) { - $output = PerforceTest::getComposerJson(); - - return true; - } - ) - ); $result = $this->perforce->getComposerInformation('//depot/branch@0.0.1'); @@ -604,11 +543,10 @@ class PerforceTest extends TestCase public function testSyncCodeBaseWithoutStream() { - $expectedCommand = 'p4 -u user -c composer_perforce_TEST_depot -p port sync -f @label'; - $this->processExecutor->expects($this->at(0)) - ->method('execute') - ->with($this->equalTo($expectedCommand), $this->equalTo(null)) - ->will($this->returnValue(0)); + $this->processExecutor->expects( + ['p4 -u user -c composer_perforce_TEST_depot -p port sync -f @label'], + true + ); $this->perforce->syncCodeBase('label'); } @@ -616,26 +554,23 @@ class PerforceTest extends TestCase public function testSyncCodeBaseWithStream() { $this->setPerforceToStream(); - $expectedCommand = 'p4 -u user -c composer_perforce_TEST_depot_branch -p port sync -f @label'; - $this->processExecutor->expects($this->at(0)) - ->method('execute') - ->with($this->equalTo($expectedCommand)) - ->will($this->returnValue(0)); + + $this->processExecutor->expects( + ['p4 -u user -c composer_perforce_TEST_depot_branch -p port sync -f @label'], + true + ); $this->perforce->syncCodeBase('label'); } public function testCheckServerExists() { - $processExecutor = $this->getMockBuilder('Composer\Util\ProcessExecutor')->getMock(); + $this->processExecutor->expects( + ['p4 -p '.ProcessExecutor::escape('perforce.does.exist:port').' info -s'], + true + ); - $expectedCommand = 'p4 -p '.ProcessExecutor::escape('perforce.does.exist:port').' info -s'; - $processExecutor->expects($this->at(0)) - ->method('execute') - ->with($this->equalTo($expectedCommand), $this->equalTo(null)) - ->will($this->returnValue(0)); - - $result = $this->perforce->checkServerExists('perforce.does.exist:port', $processExecutor); + $result = $this->perforce->checkServerExists('perforce.does.exist:port', $this->processExecutor); $this->assertTrue($result); } @@ -651,10 +586,10 @@ class PerforceTest extends TestCase $processExecutor = $this->getMockBuilder('Composer\Util\ProcessExecutor')->getMock(); $expectedCommand = 'p4 -p '.ProcessExecutor::escape('perforce.does.exist:port').' info -s'; - $processExecutor->expects($this->at(0)) + $processExecutor->expects($this->once()) ->method('execute') ->with($this->equalTo($expectedCommand), $this->equalTo(null)) - ->will($this->returnValue(127)); + ->willReturn(127); $result = $this->perforce->checkServerExists('perforce.does.exist:port', $processExecutor); $this->assertFalse($result); @@ -665,19 +600,14 @@ class PerforceTest extends TestCase */ public static function getComposerJson() { - $composer_json = array( - '{', - '"name": "test/perforce",', - '"description": "Basic project for testing",', - '"minimum-stability": "dev",', - '"autoload": {', - '"psr-0" : {', - '}', - '}', - '}', - ); - - return implode($composer_json); + return JsonFile::encode([ + 'name' => 'test/perforce', + 'description' => 'Basic project for testing', + 'minimum-stability' => 'dev', + 'autoload' => [ + 'psr-0' => [] + ] + ], JSON_FORCE_OBJECT); } /** @@ -731,8 +661,10 @@ class PerforceTest extends TestCase $this->perforce->setFilesystem($fs); $testClient = $this->perforce->getClient(); - $expectedCommand = 'p4 -u ' . self::TEST_P4USER . ' -p ' . self::TEST_PORT . ' client -d ' . ProcessExecutor::escape($testClient); - $this->processExecutor->expects($this->once())->method('execute')->with($this->equalTo($expectedCommand)); + $this->processExecutor->expects( + ['p4 -u ' . self::TEST_P4USER . ' -p ' . self::TEST_PORT . ' client -d ' . ProcessExecutor::escape($testClient)], + true + ); $fs->expects($this->once())->method('remove')->with($this->perforce->getP4ClientSpec()); diff --git a/tests/Composer/Test/Util/RemoteFilesystemTest.php b/tests/Composer/Test/Util/RemoteFilesystemTest.php index 4233dc948..570e06d83 100644 --- a/tests/Composer/Test/Util/RemoteFilesystemTest.php +++ b/tests/Composer/Test/Util/RemoteFilesystemTest.php @@ -163,7 +163,7 @@ class RemoteFilesystemTest extends TestCase { $fs = new RemoteFilesystem($this->getIOInterfaceMock(), $this->getConfigMock()); - $file = tempnam(sys_get_temp_dir(), 'c'); + $file = $this->createTempFile(); $this->assertTrue($fs->copy('http://example.org', 'file://'.__FILE__, $file)); $this->assertFileExists($file); $this->assertStringContainsString('testCopy', file_get_contents($file)); @@ -172,7 +172,7 @@ class RemoteFilesystemTest extends TestCase public function testCopyWithNoRetryOnFailure() { - $this->setExpectedException('Composer\Downloader\TransportException'); + self::expectException('Composer\Downloader\TransportException'); $fs = $this->getRemoteFilesystemWithMockedMethods(array('getRemoteContents')); $fs->expects($this->once())->method('getRemoteContents') @@ -182,7 +182,7 @@ class RemoteFilesystemTest extends TestCase return ''; }); - $file = tempnam(sys_get_temp_dir(), 'z'); + $file = $this->createTempFile(); unlink($file); $fs->copy( @@ -206,23 +206,22 @@ class RemoteFilesystemTest extends TestCase 'retry' => true, )); - $fs->expects($this->at(0)) + $counter = 0; + $fs->expects($this->exactly(2)) ->method('getRemoteContents') - ->willReturnCallback(function ($originUrl, $fileUrl, $ctx, &$http_response_header) { - $http_response_header = array('http/1.1 401 unauthorized'); + ->willReturnCallback(function ($originUrl, $fileUrl, $ctx, &$http_response_header) use (&$counter) { + if ($counter++ === 0) { + $http_response_header = array('http/1.1 401 unauthorized'); - return ''; + return ''; + } else { + $http_response_header = array('http/1.1 200 OK'); + + return 'expects($this->at(1)) - ->method('getRemoteContents') - ->willReturnCallback(function ($originUrl, $fileUrl, $ctx, &$http_response_header) { - $http_response_header = array('http/1.1 200 OK'); - - return 'createTempFile(); $copyResult = $fs->copy( 'http://example.org', @@ -324,8 +323,7 @@ class RemoteFilesystemTest extends TestCase return $arg === 'bitbucket.org'; }); $io - ->expects($this->at(1)) - ->method('getAuthentication') + ->method('getAuthentication') ->with('bitbucket.org') ->willReturn(array( 'username' => 'x-token-auth', @@ -449,7 +447,7 @@ class RemoteFilesystemTest extends TestCase false, $authHelper, )) - ->setMethods($mockedMethods) + ->onlyMethods($mockedMethods) ->getMock(); } @@ -465,7 +463,7 @@ class RemoteFilesystemTest extends TestCase $this->getIOInterfaceMock(), $this->getConfigMock(), )) - ->setMethods($mockedMethods) + ->onlyMethods($mockedMethods) ->getMock(); } } diff --git a/tests/Composer/Test/Util/SilencerTest.php b/tests/Composer/Test/Util/SilencerTest.php index 6e93c3c22..9072a7cda 100644 --- a/tests/Composer/Test/Util/SilencerTest.php +++ b/tests/Composer/Test/Util/SilencerTest.php @@ -52,7 +52,8 @@ class SilencerTest extends TestCase public function testSilencedException() { $verification = microtime(); - $this->setExpectedException('\RuntimeException', $verification); + self::expectException('RuntimeException'); + self::expectExceptionMessage($verification); Silencer::call(function () use ($verification) { throw new \RuntimeException($verification); }); diff --git a/tests/Composer/Test/Util/StreamContextFactoryTest.php b/tests/Composer/Test/Util/StreamContextFactoryTest.php index 7b2428ec1..ca86d16ce 100644 --- a/tests/Composer/Test/Util/StreamContextFactoryTest.php +++ b/tests/Composer/Test/Util/StreamContextFactoryTest.php @@ -18,14 +18,15 @@ use Composer\Test\TestCase; class StreamContextFactoryTest extends TestCase { - protected function setUp() + protected function setUp(): void { unset($_SERVER['HTTP_PROXY'], $_SERVER['http_proxy'], $_SERVER['HTTPS_PROXY'], $_SERVER['https_proxy'], $_SERVER['NO_PROXY'], $_SERVER['no_proxy']); ProxyManager::reset(); } - protected function tearDown() + protected function tearDown(): void { + parent::tearDown(); unset($_SERVER['HTTP_PROXY'], $_SERVER['http_proxy'], $_SERVER['HTTPS_PROXY'], $_SERVER['https_proxy'], $_SERVER['NO_PROXY'], $_SERVER['no_proxy']); ProxyManager::reset(); } @@ -156,7 +157,7 @@ class StreamContextFactoryTest extends TestCase $_SERVER['https_proxy'] = 'https://woopproxy.net'; // Pointless test replaced by ProxyHelperTest.php - $this->setExpectedException('Composer\Downloader\TransportException'); + self::expectException('Composer\Downloader\TransportException'); $context = StreamContextFactory::getContext('https://example.org', array('http' => array('method' => 'GET', 'header' => 'User-Agent: foo'))); } diff --git a/tests/Composer/Test/Util/TarTest.php b/tests/Composer/Test/Util/TarTest.php index 7079c7d43..c15470071 100644 --- a/tests/Composer/Test/Util/TarTest.php +++ b/tests/Composer/Test/Util/TarTest.php @@ -35,13 +35,13 @@ class TarTest extends TestCase public function testThrowsExceptionIfTheTarHasNoComposerJson() { - $this->setExpectedException('RuntimeException'); + self::expectException('RuntimeException'); Tar::getComposerJson(__DIR__.'/Fixtures/Tar/nojson.tar.gz'); } public function testThrowsExceptionIfTheComposerJsonIsInASubSubfolder() { - $this->setExpectedException('RuntimeException'); + self::expectException('RuntimeException'); Tar::getComposerJson(__DIR__.'/Fixtures/Tar/subfolders.tar.gz'); } @@ -59,7 +59,7 @@ class TarTest extends TestCase public function testMultipleTopLevelDirsIsInvalid() { - $this->setExpectedException('RuntimeException'); + self::expectException('RuntimeException'); Tar::getComposerJson(__DIR__.'/Fixtures/Tar/multiple.tar.gz'); } } diff --git a/tests/Composer/Test/Util/ZipTest.php b/tests/Composer/Test/Util/ZipTest.php index 32fff6a5c..b55208c3e 100644 --- a/tests/Composer/Test/Util/ZipTest.php +++ b/tests/Composer/Test/Util/ZipTest.php @@ -26,7 +26,8 @@ class ZipTest extends TestCase $this->markTestSkipped('The PHP zip extension is loaded.'); } - $this->setExpectedException('\RuntimeException', 'The Zip Util requires PHP\'s zip extension'); + self::expectException('RuntimeException'); + self::expectExceptionMessage('The Zip Util requires PHP\'s zip extension'); Zip::getComposerJson(''); } @@ -59,7 +60,8 @@ class ZipTest extends TestCase $this->markTestSkipped('The PHP zip extension is not loaded.'); } - $this->setExpectedException('\RuntimeException', 'No composer.json found either at the top level or within the topmost directory'); + self::expectException('RuntimeException'); + self::expectExceptionMessage('No composer.json found either at the top level or within the topmost directory'); Zip::getComposerJson(__DIR__.'/Fixtures/Zip/nojson.zip'); } @@ -70,7 +72,8 @@ class ZipTest extends TestCase $this->markTestSkipped('The PHP zip extension is not loaded.'); } - $this->setExpectedException('\RuntimeException', 'No composer.json found either at the top level or within the topmost directory'); + self::expectException('RuntimeException'); + self::expectExceptionMessage('No composer.json found either at the top level or within the topmost directory'); Zip::getComposerJson(__DIR__.'/Fixtures/Zip/subfolders.zip'); } @@ -102,7 +105,8 @@ class ZipTest extends TestCase $this->markTestSkipped('The PHP zip extension is not loaded.'); } - $this->setExpectedException('\RuntimeException', 'Archive has more than one top level directories, and no composer.json was found on the top level, so it\'s an invalid archive. Top level paths found were: folder1/,folder2/'); + self::expectException('RuntimeException'); + self::expectExceptionMessage('Archive has more than one top level directories, and no composer.json was found on the top level, so it\'s an invalid archive. Top level paths found were: folder1/,folder2/'); Zip::getComposerJson(__DIR__.'/Fixtures/Zip/multiple.zip'); } diff --git a/tests/complete.phpunit.xml b/tests/complete.phpunit.xml index e60a38d5b..14b2de093 100644 --- a/tests/complete.phpunit.xml +++ b/tests/complete.phpunit.xml @@ -16,7 +16,6 @@ > - diff --git a/tests/deprecations-8.1.json b/tests/deprecations-8.1.json deleted file mode 100644 index 50fe04397..000000000 --- a/tests/deprecations-8.1.json +++ /dev/null @@ -1,97 +0,0 @@ -[ - { - "location": "Composer\\Test\\AllFunctionalTest::getTestFiles", - "message": "Return type of Symfony\\Component\\Finder\\Finder::getIterator() should either be compatible with IteratorAggregate::getIterator(): Traversable, or the #[\\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice", - "count": 1 - }, - { - "location": "Composer\\Test\\AllFunctionalTest::getTestFiles", - "message": "Return type of Symfony\\Component\\Finder\\Finder::count() should either be compatible with Countable::count(): int, or the #[\\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice", - "count": 1 - }, - { - "location": "Composer\\Test\\AllFunctionalTest::getTestFiles", - "message": "Return type of Symfony\\Component\\Finder\\Iterator\\FilterIterator::rewind() should either be compatible with FilterIterator::rewind(): void, or the #[\\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice", - "count": 1 - }, - { - "location": "Composer\\Test\\AllFunctionalTest::getTestFiles", - "message": "Return type of Symfony\\Component\\Finder\\Iterator\\FileTypeFilterIterator::accept() should either be compatible with FilterIterator::accept(): bool, or the #[\\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice", - "count": 1 - }, - { - "location": "Composer\\Test\\AllFunctionalTest::getTestFiles", - "message": "Return type of Symfony\\Component\\Finder\\Iterator\\RecursiveDirectoryIterator::getChildren() should either be compatible with RecursiveDirectoryIterator::getChildren(): RecursiveDirectoryIterator, or the #[\\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice", - "count": 1 - }, - { - "location": "Composer\\Test\\AllFunctionalTest::getTestFiles", - "message": "Return type of Symfony\\Component\\Finder\\Iterator\\RecursiveDirectoryIterator::rewind() should either be compatible with FilesystemIterator::rewind(): void, or the #[\\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice", - "count": 1 - }, - { - "location": "Composer\\Test\\AllFunctionalTest::getTestFiles", - "message": "Return type of Symfony\\Component\\Finder\\Iterator\\RecursiveDirectoryIterator::current() should either be compatible with FilesystemIterator::current(): SplFileInfo|FilesystemIterator|string, or the #[\\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice", - "count": 1 - }, - { - "location": "Composer\\Test\\AllFunctionalTest::getTestFiles", - "message": "Return type of Symfony\\Component\\Finder\\Iterator\\ExcludeDirectoryFilterIterator::accept() should either be compatible with FilterIterator::accept(): bool, or the #[\\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice", - "count": 1 - }, - { - "location": "Composer\\Test\\AllFunctionalTest::getTestFiles", - "message": "Return type of Symfony\\Component\\Finder\\Iterator\\ExcludeDirectoryFilterIterator::hasChildren() should either be compatible with RecursiveIterator::hasChildren(): bool, or the #[\\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice", - "count": 1 - }, - { - "location": "Composer\\Test\\AllFunctionalTest::getTestFiles", - "message": "Return type of Symfony\\Component\\Finder\\Iterator\\ExcludeDirectoryFilterIterator::getChildren() should either be compatible with RecursiveIterator::getChildren(): ?RecursiveIterator, or the #[\\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice", - "count": 1 - }, - { - "location": "Composer\\Test\\AllFunctionalTest::getTestFiles", - "message": "Return type of Symfony\\Component\\Finder\\Iterator\\FilterIterator::rewind() should either be compatible with Iterator::rewind(): void, or the #[\\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice", - "count": 1 - }, - { - "location": "Composer\\Test\\AllFunctionalTest::getTestFiles", - "message": "Return type of Symfony\\Component\\Finder\\Iterator\\FilenameFilterIterator::accept() should either be compatible with FilterIterator::accept(): bool, or the #[\\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice", - "count": 1 - }, - { - "location": "Composer\\Test\\AllFunctionalTest::getTestFiles", - "message": "Return type of Symfony\\Component\\Finder\\Iterator\\PathFilterIterator::accept() should either be compatible with FilterIterator::accept(): bool, or the #[\\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice", - "count": 1 - }, - { - "location": "Composer\\Test\\ApplicationTest::testDevWarning", - "message": "Return type of Symfony\\Component\\Console\\Helper\\HelperSet::getIterator() should either be compatible with IteratorAggregate::getIterator(): Traversable, or the #[\\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice", - "count": 1 - }, - { - "location": "Composer\\Test\\Downloader\\XzDownloaderTest::testErrorMessages", - "message": "Return type of Symfony\\Component\\Finder\\Iterator\\DepthRangeFilterIterator::accept() should either be compatible with FilterIterator::accept(): bool, or the #[\\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice", - "count": 1 - }, - { - "location": "Composer\\Test\\InstallerTest::testIntegrationWithRawPool", - "message": "preg_match(): Passing null to parameter #4 ($flags) of type int is deprecated", - "count": 1820 - }, - { - "location": "Composer\\Test\\InstallerTest::testIntegrationWithPoolOptimizer", - "message": "preg_match(): Passing null to parameter #4 ($flags) of type int is deprecated", - "count": 1820 - }, - { - "location": "Composer\\Test\\Package\\Archiver\\ArchivableFilesFinderTest::testManualExcludes", - "message": "Return type of Symfony\\Component\\Finder\\Iterator\\CustomFilterIterator::accept() should either be compatible with FilterIterator::accept(): bool, or the #[\\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice", - "count": 1 - }, - { - "location": "Composer\\Test\\Package\\Archiver\\ArchivableFilesFinderTest::testManualExcludes", - "message": "Return type of Symfony\\Component\\Finder\\Iterator\\SortableIterator::getIterator() should either be compatible with IteratorAggregate::getIterator(): Traversable, or the #[\\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice", - "count": 1 - } -]