From d2ede370be20aedfc74749bc87394a79ed4c1e52 Mon Sep 17 00:00:00 2001 From: Jordi Boggiano Date: Wed, 8 Dec 2021 16:13:33 +0100 Subject: [PATCH 01/17] Bump target version, bump PHP and dependency requirements to PHP 7.2+ --- .github/workflows/continuous-integration.yml | 28 +- .github/workflows/lint.yml | 2 +- composer.json | 18 +- composer.lock | 1337 ++++++++++++++---- src/Composer/Composer.php | 2 +- src/Composer/Plugin/PluginInterface.php | 2 +- 6 files changed, 1113 insertions(+), 276 deletions(-) diff --git a/.github/workflows/continuous-integration.yml b/.github/workflows/continuous-integration.yml index 4acf1f584..a01294506 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,28 +31,32 @@ 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 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/composer.json b/composer.json index b772f9546..6e32d992f 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", @@ -32,15 +32,15 @@ "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", + "symfony/console": "^5.4 || ^6.0", + "symfony/filesystem": "^5.4 || ^6.0", + "symfony/finder": "^5.4 || ^6.0", + "symfony/process": "^5.4 || ^6.0", + "react/promise": "^2.7", "composer/pcre": "^1.0" }, "require-dev": { - "symfony/phpunit-bridge": "^4.2 || ^5.0 || ^6.0", + "symfony/phpunit-bridge": "^5.4 || ^6.0", "phpspec/prophecy": "^1.10" }, "suggest": { @@ -50,13 +50,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": { diff --git a/composer.lock b/composer.lock index f0d3b0d95..9af4801bd 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": "807062e35c004cd0bb6dafb7ce9d0cd3", "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", @@ -730,39 +780,54 @@ }, { "name": "symfony/console", - "version": "v2.8.52", + "version": "v5.4.0", "source": { "type": "git", "url": "https://github.com/symfony/console.git", - "reference": "cbcf4b5e233af15cd2bbd50dee1ccc9b7927dc12" + "reference": "ec3661faca1d110d6c307e124b44f99ac54179e3" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/console/zipball/cbcf4b5e233af15cd2bbd50dee1ccc9b7927dc12", - "reference": "cbcf4b5e233af15cd2bbd50dee1ccc9b7927dc12", + "url": "https://api.github.com/repos/symfony/console/zipball/ec3661faca1d110d6c307e124b44f99ac54179e3", + "reference": "ec3661faca1d110d6c307e124b44f99ac54179e3", "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.8", + "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.0" }, - "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-11-29T15:30:56+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,45 +1598,225 @@ "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", + "version": "1.4.0", "source": { "type": "git", "url": "https://github.com/doctrine/instantiator.git", - "reference": "8e884e78f9f0eb1329e445619e04456e64d8051d" + "reference": "d56bf6102915de5702778fe20f2de3b2fe570b5b" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/doctrine/instantiator/zipball/8e884e78f9f0eb1329e445619e04456e64d8051d", - "reference": "8e884e78f9f0eb1329e445619e04456e64d8051d", + "url": "https://api.github.com/repos/doctrine/instantiator/zipball/d56bf6102915de5702778fe20f2de3b2fe570b5b", + "reference": "d56bf6102915de5702778fe20f2de3b2fe570b5b", "shasum": "" }, "require": { - "php": ">=5.3,<8.0-DEV" + "php": "^7.1 || ^8.0" }, "require-dev": { - "athletic/athletic": "~0.1.8", + "doctrine/coding-standard": "^8.0", "ext-pdo": "*", "ext-phar": "*", - "phpunit/phpunit": "~4.0", - "squizlabs/php_codesniffer": "~2.0" + "phpbench/phpbench": "^0.13 || 1.0.0-alpha2", + "phpstan/phpstan": "^0.12", + "phpstan/phpstan-phpunit": "^0.12", + "phpunit/phpunit": "^7.0 || ^8.0 || ^9.0" }, "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.0.x-dev" - } - }, "autoload": { "psr-4": { "Doctrine\\Instantiator\\": "src/Doctrine/Instantiator/" @@ -1213,56 +1830,122 @@ { "name": "Marco Pivetta", "email": "ocramius@gmail.com", - "homepage": "http://ocramius.github.com/" + "homepage": "https://ocramius.github.io/" } ], "description": "A small, lightweight utility to instantiate objects in PHP without invoking their constructors", - "homepage": "https://github.com/doctrine/instantiator", + "homepage": "https://www.doctrine-project.org/projects/instantiator.html", "keywords": [ "constructor", "instantiate" ], "support": { "issues": "https://github.com/doctrine/instantiator/issues", - "source": "https://github.com/doctrine/instantiator/tree/master" + "source": "https://github.com/doctrine/instantiator/tree/1.4.0" }, - "time": "2015-06-14T21:17:01+00:00" + "funding": [ + { + "url": "https://www.doctrine-project.org/sponsorship.html", + "type": "custom" + }, + { + "url": "https://www.patreon.com/phpdoctrine", + "type": "patreon" + }, + { + "url": "https://tidelift.com/funding/github/packagist/doctrine%2Finstantiator", + "type": "tidelift" + } + ], + "time": "2020-11-10T18:47:58+00:00" }, { - "name": "phpdocumentor/reflection-docblock", - "version": "2.0.5", + "name": "phpdocumentor/reflection-common", + "version": "2.2.0", "source": { "type": "git", - "url": "https://github.com/phpDocumentor/ReflectionDocBlock.git", - "reference": "e6a969a640b00d8daa3c66518b0405fb41ae0c4b" + "url": "https://github.com/phpDocumentor/ReflectionCommon.git", + "reference": "1d01c49d4ed62f25aa84a747ad35d5a16924662b" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/phpDocumentor/ReflectionDocBlock/zipball/e6a969a640b00d8daa3c66518b0405fb41ae0c4b", - "reference": "e6a969a640b00d8daa3c66518b0405fb41ae0c4b", + "url": "https://api.github.com/repos/phpDocumentor/ReflectionCommon/zipball/1d01c49d4ed62f25aa84a747ad35d5a16924662b", + "reference": "1d01c49d4ed62f25aa84a747ad35d5a16924662b", "shasum": "" }, "require": { - "php": ">=5.3.3" - }, - "require-dev": { - "phpunit/phpunit": "~4.0" - }, - "suggest": { - "dflydev/markdown": "~1.0", - "erusev/parsedown": "~1.0" + "php": "^7.2 || ^8.0" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "2.0.x-dev" + "dev-2.x": "2.x-dev" } }, "autoload": { - "psr-0": { - "phpDocumentor": [ - "src/" - ] + "psr-4": { + "phpDocumentor\\Reflection\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Jaap van Otterdijk", + "email": "opensource@ijaap.nl" + } + ], + "description": "Common reflection classes used by phpdocumentor to reflect the code structure", + "homepage": "http://www.phpdoc.org", + "keywords": [ + "FQSEN", + "phpDocumentor", + "phpdoc", + "reflection", + "static analysis" + ], + "support": { + "issues": "https://github.com/phpDocumentor/ReflectionCommon/issues", + "source": "https://github.com/phpDocumentor/ReflectionCommon/tree/2.x" + }, + "time": "2020-06-27T09:03:43+00:00" + }, + { + "name": "phpdocumentor/reflection-docblock", + "version": "5.3.0", + "source": { + "type": "git", + "url": "https://github.com/phpDocumentor/ReflectionDocBlock.git", + "reference": "622548b623e81ca6d78b721c5e029f4ce664f170" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/phpDocumentor/ReflectionDocBlock/zipball/622548b623e81ca6d78b721c5e029f4ce664f170", + "reference": "622548b623e81ca6d78b721c5e029f4ce664f170", + "shasum": "" + }, + "require": { + "ext-filter": "*", + "php": "^7.2 || ^8.0", + "phpdocumentor/reflection-common": "^2.2", + "phpdocumentor/type-resolver": "^1.3", + "webmozart/assert": "^1.9.1" + }, + "require-dev": { + "mockery/mockery": "~1.3.2", + "psalm/phar": "^4.8" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "5.x-dev" + } + }, + "autoload": { + "psr-4": { + "phpDocumentor\\Reflection\\": "src" } }, "notification-url": "https://packagist.org/downloads/", @@ -1272,44 +1955,99 @@ "authors": [ { "name": "Mike van Riel", - "email": "mike.vanriel@naenius.com" + "email": "me@mikevanriel.com" + }, + { + "name": "Jaap van Otterdijk", + "email": "account@ijaap.nl" } ], + "description": "With this component, a library can provide support for annotations via DocBlocks or otherwise retrieve information that is embedded in a DocBlock.", "support": { "issues": "https://github.com/phpDocumentor/ReflectionDocBlock/issues", - "source": "https://github.com/phpDocumentor/ReflectionDocBlock/tree/release/2.x" + "source": "https://github.com/phpDocumentor/ReflectionDocBlock/tree/5.3.0" }, - "time": "2016-01-25T08:17:30+00:00" + "time": "2021-10-19T17:43:47+00:00" }, { - "name": "phpspec/prophecy", - "version": "v1.10.3", + "name": "phpdocumentor/type-resolver", + "version": "1.5.1", "source": { "type": "git", - "url": "https://github.com/phpspec/prophecy.git", - "reference": "451c3cd1418cf640de218914901e51b064abb093" + "url": "https://github.com/phpDocumentor/TypeResolver.git", + "reference": "a12f7e301eb7258bb68acd89d4aefa05c2906cae" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/phpspec/prophecy/zipball/451c3cd1418cf640de218914901e51b064abb093", - "reference": "451c3cd1418cf640de218914901e51b064abb093", + "url": "https://api.github.com/repos/phpDocumentor/TypeResolver/zipball/a12f7e301eb7258bb68acd89d4aefa05c2906cae", + "reference": "a12f7e301eb7258bb68acd89d4aefa05c2906cae", "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.2 || ^8.0", + "phpdocumentor/reflection-common": "^2.0" }, "require-dev": { - "phpspec/phpspec": "^2.5 || ^3.2", - "phpunit/phpunit": "^4.8.35 || ^5.7 || ^6.5 || ^7.1" + "ext-tokenizer": "*", + "psalm/phar": "^4.8" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "1.10.x-dev" + "dev-1.x": "1.x-dev" + } + }, + "autoload": { + "psr-4": { + "phpDocumentor\\Reflection\\": "src" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Mike van Riel", + "email": "me@mikevanriel.com" + } + ], + "description": "A PSR-5 based resolver of Class names, Types and Structural Element Names", + "support": { + "issues": "https://github.com/phpDocumentor/TypeResolver/issues", + "source": "https://github.com/phpDocumentor/TypeResolver/tree/1.5.1" + }, + "time": "2021-10-02T14:08:47+00:00" + }, + { + "name": "phpspec/prophecy", + "version": "v1.15.0", + "source": { + "type": "git", + "url": "https://github.com/phpspec/prophecy.git", + "reference": "bbcd7380b0ebf3961ee21409db7b38bc31d69a13" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/phpspec/prophecy/zipball/bbcd7380b0ebf3961ee21409db7b38bc31d69a13", + "reference": "bbcd7380b0ebf3961ee21409db7b38bc31d69a13", + "shasum": "" + }, + "require": { + "doctrine/instantiator": "^1.2", + "php": "^7.2 || ~8.0, <8.2", + "phpdocumentor/reflection-docblock": "^5.2", + "sebastian/comparator": "^3.0 || ^4.0", + "sebastian/recursion-context": "^3.0 || ^4.0" + }, + "require-dev": { + "phpspec/phpspec": "^6.0 || ^7.0", + "phpunit/phpunit": "^8.0 || ^9.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.x-dev" } }, "autoload": { @@ -1344,36 +2082,36 @@ ], "support": { "issues": "https://github.com/phpspec/prophecy/issues", - "source": "https://github.com/phpspec/prophecy/tree/v1.10.3" + "source": "https://github.com/phpspec/prophecy/tree/v1.15.0" }, - "time": "2020-03-05T15:02:03+00:00" + "time": "2021-12-08T12:19:24+00:00" }, { "name": "sebastian/comparator", - "version": "1.2.4", + "version": "3.0.3", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/comparator.git", - "reference": "2b7424b55f5047b47ac6e5ccb20b2aea4011d9be" + "reference": "1071dfcef776a57013124ff35e1fc41ccd294758" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/comparator/zipball/2b7424b55f5047b47ac6e5ccb20b2aea4011d9be", - "reference": "2b7424b55f5047b47ac6e5ccb20b2aea4011d9be", + "url": "https://api.github.com/repos/sebastianbergmann/comparator/zipball/1071dfcef776a57013124ff35e1fc41ccd294758", + "reference": "1071dfcef776a57013124ff35e1fc41ccd294758", "shasum": "" }, "require": { - "php": ">=5.3.3", - "sebastian/diff": "~1.2", - "sebastian/exporter": "~1.2 || ~2.0" + "php": ">=7.1", + "sebastian/diff": "^3.0", + "sebastian/exporter": "^3.1" }, "require-dev": { - "phpunit/phpunit": "~4.4" + "phpunit/phpunit": "^8.5" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "1.2.x-dev" + "dev-master": "3.0-dev" } }, "autoload": { @@ -1386,6 +2124,10 @@ "BSD-3-Clause" ], "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de" + }, { "name": "Jeff Welch", "email": "whatthejeff@gmail.com" @@ -1397,14 +2139,10 @@ { "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", + "homepage": "https://github.com/sebastianbergmann/comparator", "keywords": [ "comparator", "compare", @@ -1412,34 +2150,41 @@ ], "support": { "issues": "https://github.com/sebastianbergmann/comparator/issues", - "source": "https://github.com/sebastianbergmann/comparator/tree/1.2" + "source": "https://github.com/sebastianbergmann/comparator/tree/3.0.3" }, - "time": "2017-01-29T09:50:25+00:00" + "funding": [ + { + "url": "https://github.com/sebastianbergmann", + "type": "github" + } + ], + "time": "2020-11-30T08:04:30+00:00" }, { "name": "sebastian/diff", - "version": "1.4.3", + "version": "3.0.3", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/diff.git", - "reference": "7f066a26a962dbe58ddea9f72a4e82874a3975a4" + "reference": "14f72dd46eaf2f2293cbe79c93cc0bc43161a211" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/diff/zipball/7f066a26a962dbe58ddea9f72a4e82874a3975a4", - "reference": "7f066a26a962dbe58ddea9f72a4e82874a3975a4", + "url": "https://api.github.com/repos/sebastianbergmann/diff/zipball/14f72dd46eaf2f2293cbe79c93cc0bc43161a211", + "reference": "14f72dd46eaf2f2293cbe79c93cc0bc43161a211", "shasum": "" }, "require": { - "php": "^5.3.3 || ^7.0" + "php": ">=7.1" }, "require-dev": { - "phpunit/phpunit": "^4.8.35 || ^5.7 || ^6.0" + "phpunit/phpunit": "^7.5 || ^8.0", + "symfony/process": "^2 || ^3.3 || ^4" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "1.4-dev" + "dev-master": "3.0-dev" } }, "autoload": { @@ -1452,52 +2197,61 @@ "BSD-3-Clause" ], "authors": [ - { - "name": "Kore Nordmann", - "email": "mail@kore-nordmann.de" - }, { "name": "Sebastian Bergmann", "email": "sebastian@phpunit.de" + }, + { + "name": "Kore Nordmann", + "email": "mail@kore-nordmann.de" } ], "description": "Diff implementation", "homepage": "https://github.com/sebastianbergmann/diff", "keywords": [ - "diff" + "diff", + "udiff", + "unidiff", + "unified diff" ], "support": { "issues": "https://github.com/sebastianbergmann/diff/issues", - "source": "https://github.com/sebastianbergmann/diff/tree/1.4" + "source": "https://github.com/sebastianbergmann/diff/tree/3.0.3" }, - "time": "2017-05-22T07:24:03+00:00" + "funding": [ + { + "url": "https://github.com/sebastianbergmann", + "type": "github" + } + ], + "time": "2020-11-30T07:59:04+00:00" }, { "name": "sebastian/exporter", - "version": "2.0.0", + "version": "3.1.4", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/exporter.git", - "reference": "ce474bdd1a34744d7ac5d6aad3a46d48d9bac4c4" + "reference": "0c32ea2e40dbf59de29f3b49bf375176ce7dd8db" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/exporter/zipball/ce474bdd1a34744d7ac5d6aad3a46d48d9bac4c4", - "reference": "ce474bdd1a34744d7ac5d6aad3a46d48d9bac4c4", + "url": "https://api.github.com/repos/sebastianbergmann/exporter/zipball/0c32ea2e40dbf59de29f3b49bf375176ce7dd8db", + "reference": "0c32ea2e40dbf59de29f3b49bf375176ce7dd8db", "shasum": "" }, "require": { - "php": ">=5.3.3", - "sebastian/recursion-context": "~2.0" + "php": ">=7.0", + "sebastian/recursion-context": "^3.0" }, "require-dev": { "ext-mbstring": "*", - "phpunit/phpunit": "~4.4" + "phpunit/phpunit": "^8.5" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "2.0.x-dev" + "dev-master": "3.1.x-dev" } }, "autoload": { @@ -1510,6 +2264,10 @@ "BSD-3-Clause" ], "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de" + }, { "name": "Jeff Welch", "email": "whatthejeff@gmail.com" @@ -1518,17 +2276,13 @@ "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" + }, + { + "name": "Bernhard Schussek", + "email": "bschussek@gmail.com" } ], "description": "Provides the functionality to export PHP variables for visualization", @@ -1539,34 +2293,40 @@ ], "support": { "issues": "https://github.com/sebastianbergmann/exporter/issues", - "source": "https://github.com/sebastianbergmann/exporter/tree/master" + "source": "https://github.com/sebastianbergmann/exporter/tree/3.1.4" }, - "time": "2016-11-19T08:54:04+00:00" + "funding": [ + { + "url": "https://github.com/sebastianbergmann", + "type": "github" + } + ], + "time": "2021-11-11T13:51:24+00:00" }, { "name": "sebastian/recursion-context", - "version": "2.0.0", + "version": "3.0.1", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/recursion-context.git", - "reference": "2c3ba150cbec723aa057506e73a8d33bdb286c9a" + "reference": "367dcba38d6e1977be014dc4b22f47a484dac7fb" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/recursion-context/zipball/2c3ba150cbec723aa057506e73a8d33bdb286c9a", - "reference": "2c3ba150cbec723aa057506e73a8d33bdb286c9a", + "url": "https://api.github.com/repos/sebastianbergmann/recursion-context/zipball/367dcba38d6e1977be014dc4b22f47a484dac7fb", + "reference": "367dcba38d6e1977be014dc4b22f47a484dac7fb", "shasum": "" }, "require": { - "php": ">=5.3.3" + "php": ">=7.0" }, "require-dev": { - "phpunit/phpunit": "~4.4" + "phpunit/phpunit": "^6.0" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "2.0.x-dev" + "dev-master": "3.0.x-dev" } }, "autoload": { @@ -1579,14 +2339,14 @@ "BSD-3-Clause" ], "authors": [ - { - "name": "Jeff Welch", - "email": "whatthejeff@gmail.com" - }, { "name": "Sebastian Bergmann", "email": "sebastian@phpunit.de" }, + { + "name": "Jeff Welch", + "email": "whatthejeff@gmail.com" + }, { "name": "Adam Harvey", "email": "aharvey@php.net" @@ -1596,41 +2356,48 @@ "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" + "source": "https://github.com/sebastianbergmann/recursion-context/tree/3.0.1" }, - "time": "2016-11-19T07:33:16+00:00" + "funding": [ + { + "url": "https://github.com/sebastianbergmann", + "type": "github" + } + ], + "time": "2020-11-30T07:34:24+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 +2428,84 @@ "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" + }, + { + "name": "webmozart/assert", + "version": "1.10.0", + "source": { + "type": "git", + "url": "https://github.com/webmozarts/assert.git", + "reference": "6964c76c7804814a842473e0c8fd15bab0f18e25" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/webmozarts/assert/zipball/6964c76c7804814a842473e0c8fd15bab0f18e25", + "reference": "6964c76c7804814a842473e0c8fd15bab0f18e25", + "shasum": "" + }, + "require": { + "php": "^7.2 || ^8.0", + "symfony/polyfill-ctype": "^1.8" + }, + "conflict": { + "phpstan/phpstan": "<0.12.20", + "vimeo/psalm": "<4.6.1 || 4.6.2" + }, + "require-dev": { + "phpunit/phpunit": "^8.5.13" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.10-dev" + } + }, + "autoload": { + "psr-4": { + "Webmozart\\Assert\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Bernhard Schussek", + "email": "bschussek@gmail.com" + } + ], + "description": "Assertions to validate method input/output with nice error messages.", + "keywords": [ + "assert", + "check", + "validate" + ], + "support": { + "issues": "https://github.com/webmozarts/assert/issues", + "source": "https://github.com/webmozarts/assert/tree/1.10.0" + }, + "time": "2021-03-09T10:59:23+00:00" } ], "aliases": [], @@ -1675,11 +2514,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/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/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 From 2a771dfb2d911754dd4d91aecb2f0778ef2a3f4c Mon Sep 17 00:00:00 2001 From: Jordi Boggiano Date: Wed, 8 Dec 2021 17:03:05 +0100 Subject: [PATCH 02/17] Update PHPUnit to 8.5 --- .github/workflows/continuous-integration.yml | 22 +- .github/workflows/phpstan.yml | 6 +- composer.json | 17 +- composer.lock | 1281 ++++++++++++++++- tests/Composer/Test/AllFunctionalTest.php | 8 +- tests/Composer/Test/ApplicationTest.php | 2 +- .../Test/Autoload/AutoloadGeneratorTest.php | 12 +- tests/Composer/Test/CacheTest.php | 4 +- .../Test/Config/JsonConfigSourceTest.php | 4 +- .../DependencyResolver/DefaultPolicyTest.php | 2 +- .../RuleSetIteratorTest.php | 2 +- .../Test/DependencyResolver/SolverTest.php | 2 +- .../DependencyResolver/TransactionTest.php | 2 +- .../Test/Downloader/DownloadManagerTest.php | 2 +- .../Test/Downloader/FileDownloaderTest.php | 2 +- .../Test/Downloader/FossilDownloaderTest.php | 4 +- .../Test/Downloader/GitDownloaderTest.php | 4 +- .../Test/Downloader/HgDownloaderTest.php | 4 +- .../Downloader/PerforceDownloaderTest.php | 2 +- .../Test/Downloader/XzDownloaderTest.php | 4 +- .../Test/Downloader/ZipDownloaderTest.php | 4 +- tests/Composer/Test/InstalledVersionsTest.php | 6 +- .../Test/Installer/BinaryInstallerTest.php | 4 +- .../Installer/InstallationManagerTest.php | 2 +- .../Test/Installer/LibraryInstallerTest.php | 4 +- .../Installer/MetapackageInstallerTest.php | 2 +- .../SuggestedPackagesReporterTest.php | 2 +- tests/Composer/Test/InstallerTest.php | 4 +- .../Archiver/ArchivableFilesFinderTest.php | 4 +- .../Package/Archiver/ArchiveManagerTest.php | 2 +- .../Test/Package/Archiver/ArchiverTest.php | 4 +- .../Test/Package/Dumper/ArrayDumperTest.php | 4 +- .../Test/Package/Loader/ArrayLoaderTest.php | 2 +- .../Package/Version/VersionGuesserTest.php | 2 +- .../Test/Platform/HhvmDetectorTest.php | 2 +- .../Test/Plugin/PluginInstallerTest.php | 4 +- tests/Composer/Test/PolyfillTestCase.php | 624 +------- .../Repository/ArtifactRepositoryTest.php | 2 +- .../Test/Repository/FilterRepositoryTest.php | 2 +- .../Test/Repository/RepositoryManagerTest.php | 4 +- .../Test/Repository/Vcs/FossilDriverTest.php | 4 +- .../Repository/Vcs/GitBitbucketDriverTest.php | 4 +- .../Test/Repository/Vcs/GitHubDriverTest.php | 4 +- .../Test/Repository/Vcs/GitLabDriverTest.php | 4 +- .../Test/Repository/Vcs/HgDriverTest.php | 4 +- .../Repository/Vcs/PerforceDriverTest.php | 4 +- .../Test/Repository/Vcs/SvnDriverTest.php | 4 +- .../Test/Repository/VcsRepositoryTest.php | 4 +- tests/Composer/Test/Util/AuthHelperTest.php | 2 +- tests/Composer/Test/Util/BitbucketTest.php | 2 +- tests/Composer/Test/Util/ErrorHandlerTest.php | 4 +- tests/Composer/Test/Util/FilesystemTest.php | 4 +- tests/Composer/Test/Util/GitTest.php | 2 +- .../Test/Util/Http/ProxyHelperTest.php | 4 +- .../Test/Util/Http/ProxyManagerTest.php | 4 +- tests/Composer/Test/Util/IniHelperTest.php | 4 +- tests/Composer/Test/Util/PerforceTest.php | 2 +- .../Test/Util/StreamContextFactoryTest.php | 4 +- 58 files changed, 1385 insertions(+), 749 deletions(-) diff --git a/.github/workflows/continuous-integration.yml b/.github/workflows/continuous-integration.yml index a01294506..0ae292782 100644 --- a/.github/workflows/continuous-integration.yml +++ b/.github/workflows/continuous-integration.yml @@ -97,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 }}" @@ -123,11 +105,11 @@ jobs: - name: "Run tests" if: "matrix.php-version != '7.3'" - run: "vendor/bin/simple-phpunit --verbose" + run: "SYMFONY_PHPUNIT_VERSION=8.5 vendor/bin/simple-phpunit --verbose" - name: "Run complete test suite on 7.3" if: "matrix.php-version == '7.3'" - run: "vendor/bin/simple-phpunit --configuration tests/complete.phpunit.xml" + run: "SYMFONY_PHPUNIT_VERSION=8.5 vendor/bin/simple-phpunit --configuration tests/complete.phpunit.xml" validation: name: "Composer validation" diff --git a/.github/workflows/phpstan.yml b/.github/workflows/phpstan.yml index 40877dc5a..cc40f0163 100644 --- a/.github/workflows/phpstan.yml +++ b/.github/workflows/phpstan.yml @@ -49,9 +49,5 @@ jobs: - name: "Install highest dependencies from composer.json using composer binary provided by system" 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: "Run PHPStan" - run: "vendor/bin/phpstan analyse --configuration=phpstan/config.neon" + run: "composer phpstan" diff --git a/composer.json b/composer.json index 6e32d992f..d4cb8e9a3 100644 --- a/composer.json +++ b/composer.json @@ -41,7 +41,12 @@ }, "require-dev": { "symfony/phpunit-bridge": "^5.4 || ^6.0", - "phpspec/prophecy": "^1.10" + "phpspec/prophecy": "^1.10", + "phpstan/phpstan": "^1.0", + "phpstan/phpstan-phpunit": "^1.0", + "phpstan/phpstan-deprecation-rules": "^1", + "phpstan/phpstan-strict-rules": "^1", + "phpunit/phpunit": "^8.5" }, "suggest": { "ext-openssl": "Enabling the openssl extension allows you to access https URLs for repositories and packages", @@ -79,19 +84,15 @@ ], "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" + "test": [ + "@putenv SYMFONY_PHPUNIT_VERSION=8.5", + "@php simple-phpunit" ], "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 9af4801bd..3b94b9783 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": "807062e35c004cd0bb6dafb7ce9d0cd3", + "content-hash": "b75018840aa186f02f947abb15a39369", "packages": [ { "name": "composer/ca-bundle", @@ -1859,6 +1859,172 @@ ], "time": "2020-11-10T18:47:58+00:00" }, + { + "name": "myclabs/deep-copy", + "version": "1.10.2", + "source": { + "type": "git", + "url": "https://github.com/myclabs/DeepCopy.git", + "reference": "776f831124e9c62e1a2c601ecc52e776d8bb7220" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/myclabs/DeepCopy/zipball/776f831124e9c62e1a2c601ecc52e776d8bb7220", + "reference": "776f831124e9c62e1a2c601ecc52e776d8bb7220", + "shasum": "" + }, + "require": { + "php": "^7.1 || ^8.0" + }, + "require-dev": { + "doctrine/collections": "^1.0", + "doctrine/common": "^2.6", + "phpunit/phpunit": "^7.1" + }, + "type": "library", + "autoload": { + "psr-4": { + "DeepCopy\\": "src/DeepCopy/" + }, + "files": [ + "src/DeepCopy/deep_copy.php" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "description": "Create deep copies (clones) of your objects", + "keywords": [ + "clone", + "copy", + "duplicate", + "object", + "object graph" + ], + "support": { + "issues": "https://github.com/myclabs/DeepCopy/issues", + "source": "https://github.com/myclabs/DeepCopy/tree/1.10.2" + }, + "funding": [ + { + "url": "https://tidelift.com/funding/github/packagist/myclabs/deep-copy", + "type": "tidelift" + } + ], + "time": "2020-11-13T09:40:50+00:00" + }, + { + "name": "phar-io/manifest", + "version": "2.0.3", + "source": { + "type": "git", + "url": "https://github.com/phar-io/manifest.git", + "reference": "97803eca37d319dfa7826cc2437fc020857acb53" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/phar-io/manifest/zipball/97803eca37d319dfa7826cc2437fc020857acb53", + "reference": "97803eca37d319dfa7826cc2437fc020857acb53", + "shasum": "" + }, + "require": { + "ext-dom": "*", + "ext-phar": "*", + "ext-xmlwriter": "*", + "phar-io/version": "^3.0.1", + "php": "^7.2 || ^8.0" + }, + "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": "Arne Blankerts", + "email": "arne@blankerts.de", + "role": "Developer" + }, + { + "name": "Sebastian Heuer", + "email": "sebastian@phpeople.de", + "role": "Developer" + }, + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de", + "role": "Developer" + } + ], + "description": "Component for reading phar.io manifest information from a PHP Archive (PHAR)", + "support": { + "issues": "https://github.com/phar-io/manifest/issues", + "source": "https://github.com/phar-io/manifest/tree/2.0.3" + }, + "time": "2021-07-20T11:28:43+00:00" + }, + { + "name": "phar-io/version", + "version": "3.1.0", + "source": { + "type": "git", + "url": "https://github.com/phar-io/version.git", + "reference": "bae7c545bef187884426f042434e561ab1ddb182" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/phar-io/version/zipball/bae7c545bef187884426f042434e561ab1ddb182", + "reference": "bae7c545bef187884426f042434e561ab1ddb182", + "shasum": "" + }, + "require": { + "php": "^7.2 || ^8.0" + }, + "type": "library", + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Arne Blankerts", + "email": "arne@blankerts.de", + "role": "Developer" + }, + { + "name": "Sebastian Heuer", + "email": "sebastian@phpeople.de", + "role": "Developer" + }, + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de", + "role": "Developer" + } + ], + "description": "Library for handling version information and constraints", + "support": { + "issues": "https://github.com/phar-io/version/issues", + "source": "https://github.com/phar-io/version/tree/3.1.0" + }, + "time": "2021-02-23T14:00:09+00:00" + }, { "name": "phpdocumentor/reflection-common", "version": "2.2.0", @@ -2086,6 +2252,675 @@ }, "time": "2021-12-08T12:19:24+00:00" }, + { + "name": "phpstan/phpstan", + "version": "1.2.0", + "source": { + "type": "git", + "url": "https://github.com/phpstan/phpstan.git", + "reference": "cbe085f9fdead5b6d62e4c022ca52dc9427a10ee" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/phpstan/phpstan/zipball/cbe085f9fdead5b6d62e4c022ca52dc9427a10ee", + "reference": "cbe085f9fdead5b6d62e4c022ca52dc9427a10ee", + "shasum": "" + }, + "require": { + "php": "^7.1|^8.0" + }, + "conflict": { + "phpstan/phpstan-shim": "*" + }, + "bin": [ + "phpstan", + "phpstan.phar" + ], + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.2-dev" + } + }, + "autoload": { + "files": [ + "bootstrap.php" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "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": [ + { + "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" + } + ], + "time": "2021-11-18T14:09:01+00:00" + }, + { + "name": "phpstan/phpstan-deprecation-rules", + "version": "1.0.0", + "source": { + "type": "git", + "url": "https://github.com/phpstan/phpstan-deprecation-rules.git", + "reference": "e5ccafb0dd8d835dd65d8d7a1a0d2b1b75414682" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/phpstan/phpstan-deprecation-rules/zipball/e5ccafb0dd8d835dd65d8d7a1a0d2b1b75414682", + "reference": "e5ccafb0dd8d835dd65d8d7a1a0d2b1b75414682", + "shasum": "" + }, + "require": { + "php": "^7.1 || ^8.0", + "phpstan/phpstan": "^1.0" + }, + "require-dev": { + "php-parallel-lint/php-parallel-lint": "^1.2", + "phpstan/phpstan-phpunit": "^1.0", + "phpunit/phpunit": "^9.5" + }, + "type": "phpstan-extension", + "extra": { + "branch-alias": { + "dev-master": "1.0-dev" + }, + "phpstan": { + "includes": [ + "rules.neon" + ] + } + }, + "autoload": { + "psr-4": { + "PHPStan\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "description": "PHPStan rules for detecting usage of deprecated classes, methods, properties, constants and traits.", + "support": { + "issues": "https://github.com/phpstan/phpstan-deprecation-rules/issues", + "source": "https://github.com/phpstan/phpstan-deprecation-rules/tree/1.0.0" + }, + "time": "2021-09-23T11:02:21+00:00" + }, + { + "name": "phpstan/phpstan-phpunit", + "version": "1.0.0", + "source": { + "type": "git", + "url": "https://github.com/phpstan/phpstan-phpunit.git", + "reference": "9eb88c9f689003a8a2a5ae9e010338ee94dc39b3" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/phpstan/phpstan-phpunit/zipball/9eb88c9f689003a8a2a5ae9e010338ee94dc39b3", + "reference": "9eb88c9f689003a8a2a5ae9e010338ee94dc39b3", + "shasum": "" + }, + "require": { + "php": "^7.1 || ^8.0", + "phpstan/phpstan": "^1.0" + }, + "conflict": { + "phpunit/phpunit": "<7.0" + }, + "require-dev": { + "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": "phpstan-extension", + "extra": { + "branch-alias": { + "dev-master": "1.0-dev" + }, + "phpstan": { + "includes": [ + "extension.neon", + "rules.neon" + ] + } + }, + "autoload": { + "psr-4": { + "PHPStan\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "description": "PHPUnit extensions and rules for PHPStan", + "support": { + "issues": "https://github.com/phpstan/phpstan-phpunit/issues", + "source": "https://github.com/phpstan/phpstan-phpunit/tree/1.0.0" + }, + "time": "2021-10-14T08:03:54+00:00" + }, + { + "name": "phpstan/phpstan-strict-rules", + "version": "1.1.0", + "source": { + "type": "git", + "url": "https://github.com/phpstan/phpstan-strict-rules.git", + "reference": "e12d55f74a8cca18c6e684c6450767e055ba7717" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/phpstan/phpstan-strict-rules/zipball/e12d55f74a8cca18c6e684c6450767e055ba7717", + "reference": "e12d55f74a8cca18c6e684c6450767e055ba7717", + "shasum": "" + }, + "require": { + "php": "^7.1 || ^8.0", + "phpstan/phpstan": "^1.2.0" + }, + "require-dev": { + "nikic/php-parser": "^4.13.0", + "php-parallel-lint/php-parallel-lint": "^1.2", + "phpstan/phpstan-phpunit": "^1.0", + "phpunit/phpunit": "^9.5" + }, + "type": "phpstan-extension", + "extra": { + "branch-alias": { + "dev-master": "1.0-dev" + }, + "phpstan": { + "includes": [ + "rules.neon" + ] + } + }, + "autoload": { + "psr-4": { + "PHPStan\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "description": "Extra strict and opinionated rules for PHPStan", + "support": { + "issues": "https://github.com/phpstan/phpstan-strict-rules/issues", + "source": "https://github.com/phpstan/phpstan-strict-rules/tree/1.1.0" + }, + "time": "2021-11-18T09:30:29+00:00" + }, + { + "name": "phpunit/php-code-coverage", + "version": "7.0.15", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/php-code-coverage.git", + "reference": "819f92bba8b001d4363065928088de22f25a3a48" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/php-code-coverage/zipball/819f92bba8b001d4363065928088de22f25a3a48", + "reference": "819f92bba8b001d4363065928088de22f25a3a48", + "shasum": "" + }, + "require": { + "ext-dom": "*", + "ext-xmlwriter": "*", + "php": ">=7.2", + "phpunit/php-file-iterator": "^2.0.2", + "phpunit/php-text-template": "^1.2.1", + "phpunit/php-token-stream": "^3.1.3 || ^4.0", + "sebastian/code-unit-reverse-lookup": "^1.0.1", + "sebastian/environment": "^4.2.2", + "sebastian/version": "^2.0.1", + "theseer/tokenizer": "^1.1.3" + }, + "require-dev": { + "phpunit/phpunit": "^8.2.2" + }, + "suggest": { + "ext-xdebug": "^2.7.2" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "7.0-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de", + "role": "lead" + } + ], + "description": "Library that provides collection, processing, and rendering functionality for PHP code coverage information.", + "homepage": "https://github.com/sebastianbergmann/php-code-coverage", + "keywords": [ + "coverage", + "testing", + "xunit" + ], + "support": { + "issues": "https://github.com/sebastianbergmann/php-code-coverage/issues", + "source": "https://github.com/sebastianbergmann/php-code-coverage/tree/7.0.15" + }, + "funding": [ + { + "url": "https://github.com/sebastianbergmann", + "type": "github" + } + ], + "time": "2021-07-26T12:20:09+00:00" + }, + { + "name": "phpunit/php-file-iterator", + "version": "2.0.5", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/php-file-iterator.git", + "reference": "42c5ba5220e6904cbfe8b1a1bda7c0cfdc8c12f5" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/php-file-iterator/zipball/42c5ba5220e6904cbfe8b1a1bda7c0cfdc8c12f5", + "reference": "42c5ba5220e6904cbfe8b1a1bda7c0cfdc8c12f5", + "shasum": "" + }, + "require": { + "php": ">=7.1" + }, + "require-dev": { + "phpunit/phpunit": "^8.5" + }, + "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": "Sebastian Bergmann", + "email": "sebastian@phpunit.de", + "role": "lead" + } + ], + "description": "FilterIterator implementation that filters files based on a list of suffixes.", + "homepage": "https://github.com/sebastianbergmann/php-file-iterator/", + "keywords": [ + "filesystem", + "iterator" + ], + "support": { + "issues": "https://github.com/sebastianbergmann/php-file-iterator/issues", + "source": "https://github.com/sebastianbergmann/php-file-iterator/tree/2.0.5" + }, + "funding": [ + { + "url": "https://github.com/sebastianbergmann", + "type": "github" + } + ], + "time": "2021-12-02T12:42:26+00:00" + }, + { + "name": "phpunit/php-text-template", + "version": "1.2.1", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/php-text-template.git", + "reference": "31f8b717e51d9a2afca6c9f046f5d69fc27c8686" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/php-text-template/zipball/31f8b717e51d9a2afca6c9f046f5d69fc27c8686", + "reference": "31f8b717e51d9a2afca6c9f046f5d69fc27c8686", + "shasum": "" + }, + "require": { + "php": ">=5.3.3" + }, + "type": "library", + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de", + "role": "lead" + } + ], + "description": "Simple template engine.", + "homepage": "https://github.com/sebastianbergmann/php-text-template/", + "keywords": [ + "template" + ], + "support": { + "issues": "https://github.com/sebastianbergmann/php-text-template/issues", + "source": "https://github.com/sebastianbergmann/php-text-template/tree/1.2.1" + }, + "time": "2015-06-21T13:50:34+00:00" + }, + { + "name": "phpunit/php-timer", + "version": "2.1.3", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/php-timer.git", + "reference": "2454ae1765516d20c4ffe103d85a58a9a3bd5662" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/php-timer/zipball/2454ae1765516d20c4ffe103d85a58a9a3bd5662", + "reference": "2454ae1765516d20c4ffe103d85a58a9a3bd5662", + "shasum": "" + }, + "require": { + "php": ">=7.1" + }, + "require-dev": { + "phpunit/phpunit": "^8.5" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "2.1-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de", + "role": "lead" + } + ], + "description": "Utility class for timing", + "homepage": "https://github.com/sebastianbergmann/php-timer/", + "keywords": [ + "timer" + ], + "support": { + "issues": "https://github.com/sebastianbergmann/php-timer/issues", + "source": "https://github.com/sebastianbergmann/php-timer/tree/2.1.3" + }, + "funding": [ + { + "url": "https://github.com/sebastianbergmann", + "type": "github" + } + ], + "time": "2020-11-30T08:20:02+00:00" + }, + { + "name": "phpunit/php-token-stream", + "version": "3.1.3", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/php-token-stream.git", + "reference": "9c1da83261628cb24b6a6df371b6e312b3954768" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/php-token-stream/zipball/9c1da83261628cb24b6a6df371b6e312b3954768", + "reference": "9c1da83261628cb24b6a6df371b6e312b3954768", + "shasum": "" + }, + "require": { + "ext-tokenizer": "*", + "php": ">=7.1" + }, + "require-dev": { + "phpunit/phpunit": "^7.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "3.1-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de" + } + ], + "description": "Wrapper around PHP's tokenizer extension.", + "homepage": "https://github.com/sebastianbergmann/php-token-stream/", + "keywords": [ + "tokenizer" + ], + "support": { + "issues": "https://github.com/sebastianbergmann/php-token-stream/issues", + "source": "https://github.com/sebastianbergmann/php-token-stream/tree/3.1.3" + }, + "funding": [ + { + "url": "https://github.com/sebastianbergmann", + "type": "github" + } + ], + "abandoned": true, + "time": "2021-07-26T12:15:06+00:00" + }, + { + "name": "phpunit/phpunit", + "version": "8.5.21", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/phpunit.git", + "reference": "50a58a60b85947b0bee4c8ecfe0f4bbdcf20e984" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/50a58a60b85947b0bee4c8ecfe0f4bbdcf20e984", + "reference": "50a58a60b85947b0bee4c8ecfe0f4bbdcf20e984", + "shasum": "" + }, + "require": { + "doctrine/instantiator": "^1.3.1", + "ext-dom": "*", + "ext-json": "*", + "ext-libxml": "*", + "ext-mbstring": "*", + "ext-xml": "*", + "ext-xmlwriter": "*", + "myclabs/deep-copy": "^1.10.0", + "phar-io/manifest": "^2.0.3", + "phar-io/version": "^3.0.2", + "php": ">=7.2", + "phpspec/prophecy": "^1.10.3", + "phpunit/php-code-coverage": "^7.0.12", + "phpunit/php-file-iterator": "^2.0.4", + "phpunit/php-text-template": "^1.2.1", + "phpunit/php-timer": "^2.1.2", + "sebastian/comparator": "^3.0.2", + "sebastian/diff": "^3.0.2", + "sebastian/environment": "^4.2.3", + "sebastian/exporter": "^3.1.2", + "sebastian/global-state": "^3.0.0", + "sebastian/object-enumerator": "^3.0.3", + "sebastian/resource-operations": "^2.0.1", + "sebastian/type": "^1.1.3", + "sebastian/version": "^2.0.1" + }, + "require-dev": { + "ext-pdo": "*" + }, + "suggest": { + "ext-soap": "*", + "ext-xdebug": "*", + "phpunit/php-invoker": "^2.0.0" + }, + "bin": [ + "phpunit" + ], + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "8.5-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de", + "role": "lead" + } + ], + "description": "The PHP Unit Testing framework.", + "homepage": "https://phpunit.de/", + "keywords": [ + "phpunit", + "testing", + "xunit" + ], + "support": { + "issues": "https://github.com/sebastianbergmann/phpunit/issues", + "source": "https://github.com/sebastianbergmann/phpunit/tree/8.5.21" + }, + "funding": [ + { + "url": "https://phpunit.de/donate.html", + "type": "custom" + }, + { + "url": "https://github.com/sebastianbergmann", + "type": "github" + } + ], + "time": "2021-09-25T07:37:20+00:00" + }, + { + "name": "sebastian/code-unit-reverse-lookup", + "version": "1.0.2", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/code-unit-reverse-lookup.git", + "reference": "1de8cd5c010cb153fcd68b8d0f64606f523f7619" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/code-unit-reverse-lookup/zipball/1de8cd5c010cb153fcd68b8d0f64606f523f7619", + "reference": "1de8cd5c010cb153fcd68b8d0f64606f523f7619", + "shasum": "" + }, + "require": { + "php": ">=5.6" + }, + "require-dev": { + "phpunit/phpunit": "^8.5" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.0.x-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de" + } + ], + "description": "Looks up which function or method a line of code belongs to", + "homepage": "https://github.com/sebastianbergmann/code-unit-reverse-lookup/", + "support": { + "issues": "https://github.com/sebastianbergmann/code-unit-reverse-lookup/issues", + "source": "https://github.com/sebastianbergmann/code-unit-reverse-lookup/tree/1.0.2" + }, + "funding": [ + { + "url": "https://github.com/sebastianbergmann", + "type": "github" + } + ], + "time": "2020-11-30T08:15:22+00:00" + }, { "name": "sebastian/comparator", "version": "3.0.3", @@ -2226,6 +3061,69 @@ ], "time": "2020-11-30T07:59:04+00:00" }, + { + "name": "sebastian/environment", + "version": "4.2.4", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/environment.git", + "reference": "d47bbbad83711771f167c72d4e3f25f7fcc1f8b0" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/environment/zipball/d47bbbad83711771f167c72d4e3f25f7fcc1f8b0", + "reference": "d47bbbad83711771f167c72d4e3f25f7fcc1f8b0", + "shasum": "" + }, + "require": { + "php": ">=7.1" + }, + "require-dev": { + "phpunit/phpunit": "^7.5" + }, + "suggest": { + "ext-posix": "*" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "4.2-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de" + } + ], + "description": "Provides functionality to handle HHVM/PHP environments", + "homepage": "http://www.github.com/sebastianbergmann/environment", + "keywords": [ + "Xdebug", + "environment", + "hhvm" + ], + "support": { + "issues": "https://github.com/sebastianbergmann/environment/issues", + "source": "https://github.com/sebastianbergmann/environment/tree/4.2.4" + }, + "funding": [ + { + "url": "https://github.com/sebastianbergmann", + "type": "github" + } + ], + "time": "2020-11-30T07:53:42+00:00" + }, { "name": "sebastian/exporter", "version": "3.1.4", @@ -2303,6 +3201,182 @@ ], "time": "2021-11-11T13:51:24+00:00" }, + { + "name": "sebastian/global-state", + "version": "3.0.1", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/global-state.git", + "reference": "474fb9edb7ab891665d3bfc6317f42a0a150454b" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/global-state/zipball/474fb9edb7ab891665d3bfc6317f42a0a150454b", + "reference": "474fb9edb7ab891665d3bfc6317f42a0a150454b", + "shasum": "" + }, + "require": { + "php": ">=7.2", + "sebastian/object-reflector": "^1.1.1", + "sebastian/recursion-context": "^3.0" + }, + "require-dev": { + "ext-dom": "*", + "phpunit/phpunit": "^8.0" + }, + "suggest": { + "ext-uopz": "*" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "3.0-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de" + } + ], + "description": "Snapshotting of global state", + "homepage": "http://www.github.com/sebastianbergmann/global-state", + "keywords": [ + "global state" + ], + "support": { + "issues": "https://github.com/sebastianbergmann/global-state/issues", + "source": "https://github.com/sebastianbergmann/global-state/tree/3.0.1" + }, + "funding": [ + { + "url": "https://github.com/sebastianbergmann", + "type": "github" + } + ], + "time": "2020-11-30T07:43:24+00:00" + }, + { + "name": "sebastian/object-enumerator", + "version": "3.0.4", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/object-enumerator.git", + "reference": "e67f6d32ebd0c749cf9d1dbd9f226c727043cdf2" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/object-enumerator/zipball/e67f6d32ebd0c749cf9d1dbd9f226c727043cdf2", + "reference": "e67f6d32ebd0c749cf9d1dbd9f226c727043cdf2", + "shasum": "" + }, + "require": { + "php": ">=7.0", + "sebastian/object-reflector": "^1.1.1", + "sebastian/recursion-context": "^3.0" + }, + "require-dev": { + "phpunit/phpunit": "^6.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "3.0.x-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de" + } + ], + "description": "Traverses array structures and object graphs to enumerate all referenced objects", + "homepage": "https://github.com/sebastianbergmann/object-enumerator/", + "support": { + "issues": "https://github.com/sebastianbergmann/object-enumerator/issues", + "source": "https://github.com/sebastianbergmann/object-enumerator/tree/3.0.4" + }, + "funding": [ + { + "url": "https://github.com/sebastianbergmann", + "type": "github" + } + ], + "time": "2020-11-30T07:40:27+00:00" + }, + { + "name": "sebastian/object-reflector", + "version": "1.1.2", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/object-reflector.git", + "reference": "9b8772b9cbd456ab45d4a598d2dd1a1bced6363d" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/object-reflector/zipball/9b8772b9cbd456ab45d4a598d2dd1a1bced6363d", + "reference": "9b8772b9cbd456ab45d4a598d2dd1a1bced6363d", + "shasum": "" + }, + "require": { + "php": ">=7.0" + }, + "require-dev": { + "phpunit/phpunit": "^6.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.1-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de" + } + ], + "description": "Allows reflection of object attributes, including inherited and non-public ones", + "homepage": "https://github.com/sebastianbergmann/object-reflector/", + "support": { + "issues": "https://github.com/sebastianbergmann/object-reflector/issues", + "source": "https://github.com/sebastianbergmann/object-reflector/tree/1.1.2" + }, + "funding": [ + { + "url": "https://github.com/sebastianbergmann", + "type": "github" + } + ], + "time": "2020-11-30T07:37:18+00:00" + }, { "name": "sebastian/recursion-context", "version": "3.0.1", @@ -2366,6 +3440,161 @@ ], "time": "2020-11-30T07:34:24+00:00" }, + { + "name": "sebastian/resource-operations", + "version": "2.0.2", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/resource-operations.git", + "reference": "31d35ca87926450c44eae7e2611d45a7a65ea8b3" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/resource-operations/zipball/31d35ca87926450c44eae7e2611d45a7a65ea8b3", + "reference": "31d35ca87926450c44eae7e2611d45a7a65ea8b3", + "shasum": "" + }, + "require": { + "php": ">=7.1" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "2.0-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de" + } + ], + "description": "Provides a list of PHP built-in functions that operate on resources", + "homepage": "https://www.github.com/sebastianbergmann/resource-operations", + "support": { + "issues": "https://github.com/sebastianbergmann/resource-operations/issues", + "source": "https://github.com/sebastianbergmann/resource-operations/tree/2.0.2" + }, + "funding": [ + { + "url": "https://github.com/sebastianbergmann", + "type": "github" + } + ], + "time": "2020-11-30T07:30:19+00:00" + }, + { + "name": "sebastian/type", + "version": "1.1.4", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/type.git", + "reference": "0150cfbc4495ed2df3872fb31b26781e4e077eb4" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/type/zipball/0150cfbc4495ed2df3872fb31b26781e4e077eb4", + "reference": "0150cfbc4495ed2df3872fb31b26781e4e077eb4", + "shasum": "" + }, + "require": { + "php": ">=7.2" + }, + "require-dev": { + "phpunit/phpunit": "^8.2" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.1-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de", + "role": "lead" + } + ], + "description": "Collection of value objects that represent the types of the PHP type system", + "homepage": "https://github.com/sebastianbergmann/type", + "support": { + "issues": "https://github.com/sebastianbergmann/type/issues", + "source": "https://github.com/sebastianbergmann/type/tree/1.1.4" + }, + "funding": [ + { + "url": "https://github.com/sebastianbergmann", + "type": "github" + } + ], + "time": "2020-11-30T07:25:11+00:00" + }, + { + "name": "sebastian/version", + "version": "2.0.1", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/version.git", + "reference": "99732be0ddb3361e16ad77b68ba41efc8e979019" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/version/zipball/99732be0ddb3361e16ad77b68ba41efc8e979019", + "reference": "99732be0ddb3361e16ad77b68ba41efc8e979019", + "shasum": "" + }, + "require": { + "php": ">=5.6" + }, + "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": "Sebastian Bergmann", + "email": "sebastian@phpunit.de", + "role": "lead" + } + ], + "description": "Library that helps with managing the version number of Git-hosted PHP projects", + "homepage": "https://github.com/sebastianbergmann/version", + "support": { + "issues": "https://github.com/sebastianbergmann/version/issues", + "source": "https://github.com/sebastianbergmann/version/tree/master" + }, + "time": "2016-10-03T07:35:21+00:00" + }, { "name": "symfony/phpunit-bridge", "version": "v6.0.0", @@ -2449,6 +3678,56 @@ ], "time": "2021-11-29T15:32:57+00:00" }, + { + "name": "theseer/tokenizer", + "version": "1.2.1", + "source": { + "type": "git", + "url": "https://github.com/theseer/tokenizer.git", + "reference": "34a41e998c2183e22995f158c581e7b5e755ab9e" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/theseer/tokenizer/zipball/34a41e998c2183e22995f158c581e7b5e755ab9e", + "reference": "34a41e998c2183e22995f158c581e7b5e755ab9e", + "shasum": "" + }, + "require": { + "ext-dom": "*", + "ext-tokenizer": "*", + "ext-xmlwriter": "*", + "php": "^7.2 || ^8.0" + }, + "type": "library", + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Arne Blankerts", + "email": "arne@blankerts.de", + "role": "Developer" + } + ], + "description": "A small library for converting tokenized PHP source code into XML and potentially other formats", + "support": { + "issues": "https://github.com/theseer/tokenizer/issues", + "source": "https://github.com/theseer/tokenizer/tree/1.2.1" + }, + "funding": [ + { + "url": "https://github.com/theseer", + "type": "github" + } + ], + "time": "2021-07-28T10:34:58+00:00" + }, { "name": "webmozart/assert", "version": "1.10.0", diff --git a/tests/Composer/Test/AllFunctionalTest.php b/tests/Composer/Test/AllFunctionalTest.php index aefea3312..bec795821 100644 --- a/tests/Composer/Test/AllFunctionalTest.php +++ b/tests/Composer/Test/AllFunctionalTest.php @@ -31,14 +31,14 @@ class AllFunctionalTest extends TestCase */ private static $pharPath; - public function setUp() + public function setUp(): void { $this->oldcwd = getcwd(); chdir(__DIR__.'/Fixtures/functional'); } - public function tearDown() + public function tearDown(): void { if ($this->oldcwd) { chdir($this->oldcwd); @@ -51,12 +51,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)); diff --git a/tests/Composer/Test/ApplicationTest.php b/tests/Composer/Test/ApplicationTest.php index d24024e73..59b6f1465 100644 --- a/tests/Composer/Test/ApplicationTest.php +++ b/tests/Composer/Test/ApplicationTest.php @@ -18,7 +18,7 @@ use Symfony\Component\Console\Output\OutputInterface; class ApplicationTest extends TestCase { - public function tearDown() + public function tearDown(): void { parent::tearDown(); diff --git a/tests/Composer/Test/Autoload/AutoloadGeneratorTest.php b/tests/Composer/Test/Autoload/AutoloadGeneratorTest.php index 0a801ad63..396477e7a 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,7 +148,7 @@ class AutoloadGeneratorTest extends TestCase $this->generator = new AutoloadGenerator($this->eventDispatcher); } - protected function tearDown() + protected function tearDown(): void { chdir($this->origDir); diff --git a/tests/Composer/Test/CacheTest.php b/tests/Composer/Test/CacheTest.php index 2d2fba28c..2429c303f 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(); @@ -53,7 +53,7 @@ class CacheTest extends TestCase ->will($this->returnValue($this->finder)); } - protected function tearDown() + protected function tearDown(): void { if (is_dir($this->root)) { $fs = new Filesystem; diff --git a/tests/Composer/Test/Config/JsonConfigSourceTest.php b/tests/Composer/Test/Config/JsonConfigSourceTest.php index 4e1000b5e..1f725004f 100644 --- a/tests/Composer/Test/Config/JsonConfigSourceTest.php +++ b/tests/Composer/Test/Config/JsonConfigSourceTest.php @@ -34,13 +34,13 @@ 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 { if (is_dir($this->workingDir)) { $this->fs->removeDirectory($this->workingDir); 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/SolverTest.php b/tests/Composer/Test/DependencyResolver/SolverTest.php index 7afb38c2e..f62d5230f 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; 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..eca909696 100644 --- a/tests/Composer/Test/Downloader/DownloadManagerTest.php +++ b/tests/Composer/Test/Downloader/DownloadManagerTest.php @@ -23,7 +23,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(); diff --git a/tests/Composer/Test/Downloader/FileDownloaderTest.php b/tests/Composer/Test/Downloader/FileDownloaderTest.php index 7ad59b30d..047b2c8db 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(); diff --git a/tests/Composer/Test/Downloader/FossilDownloaderTest.php b/tests/Composer/Test/Downloader/FossilDownloaderTest.php index 05978d4db..dd15eff91 100644 --- a/tests/Composer/Test/Downloader/FossilDownloaderTest.php +++ b/tests/Composer/Test/Downloader/FossilDownloaderTest.php @@ -22,12 +22,12 @@ 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 { if (is_dir($this->workingDir)) { $fs = new Filesystem; diff --git a/tests/Composer/Test/Downloader/GitDownloaderTest.php b/tests/Composer/Test/Downloader/GitDownloaderTest.php index d3b046406..e9629338c 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,7 +37,7 @@ class GitDownloaderTest extends TestCase $this->workingDir = $this->getUniqueTmpDirectory(); } - protected function tearDown() + protected function tearDown(): void { if (is_dir($this->workingDir)) { $this->fs->removeDirectory($this->workingDir); diff --git a/tests/Composer/Test/Downloader/HgDownloaderTest.php b/tests/Composer/Test/Downloader/HgDownloaderTest.php index 3c3015a23..c36ec247b 100644 --- a/tests/Composer/Test/Downloader/HgDownloaderTest.php +++ b/tests/Composer/Test/Downloader/HgDownloaderTest.php @@ -22,12 +22,12 @@ 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 { if (is_dir($this->workingDir)) { $fs = new Filesystem; diff --git a/tests/Composer/Test/Downloader/PerforceDownloaderTest.php b/tests/Composer/Test/Downloader/PerforceDownloaderTest.php index 95bf048d3..a5c8e2e3f 100644 --- a/tests/Composer/Test/Downloader/PerforceDownloaderTest.php +++ b/tests/Composer/Test/Downloader/PerforceDownloaderTest.php @@ -43,7 +43,7 @@ class PerforceDownloaderTest extends TestCase /** @var string */ protected $testPath; - protected function setUp() + protected function setUp(): void { $this->testPath = $this->getUniqueTmpDirectory(); $this->repoConfig = $this->getRepoConfig(); diff --git a/tests/Composer/Test/Downloader/XzDownloaderTest.php b/tests/Composer/Test/Downloader/XzDownloaderTest.php index 1b28e707a..7032004e1 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,7 +39,7 @@ class XzDownloaderTest extends TestCase $this->testDir = $this->getUniqueTmpDirectory(); } - public function tearDown() + public function tearDown(): void { $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..7e1f33119 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,7 +42,7 @@ class ZipDownloaderTest extends TestCase $this->package = $this->getMockBuilder('Composer\Package\PackageInterface')->getMock(); } - public function tearDown() + public function tearDown(): void { $fs = new Filesystem; $fs->removeDirectory($this->testDir); diff --git a/tests/Composer/Test/InstalledVersionsTest.php b/tests/Composer/Test/InstalledVersionsTest.php index d66005b54..b0317e6c4 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(); diff --git a/tests/Composer/Test/Installer/BinaryInstallerTest.php b/tests/Composer/Test/Installer/BinaryInstallerTest.php index b862556de..2a15903ef 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,7 +60,7 @@ class BinaryInstallerTest extends TestCase $this->io = $this->getMockBuilder('Composer\IO\IOInterface')->getMock(); } - protected function tearDown() + protected function tearDown(): void { $this->fs->removeDirectory($this->rootDir); } diff --git a/tests/Composer/Test/Installer/InstallationManagerTest.php b/tests/Composer/Test/Installer/InstallationManagerTest.php index 687094a74..ba4c07071 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(); diff --git a/tests/Composer/Test/Installer/LibraryInstallerTest.php b/tests/Composer/Test/Installer/LibraryInstallerTest.php index ee66ce65b..1e7f0ee17 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,7 +96,7 @@ class LibraryInstallerTest extends TestCase $this->io = $this->getMockBuilder('Composer\IO\IOInterface')->getMock(); } - protected function tearDown() + protected function tearDown(): void { $this->fs->removeDirectory($this->rootDir); } diff --git a/tests/Composer/Test/Installer/MetapackageInstallerTest.php b/tests/Composer/Test/Installer/MetapackageInstallerTest.php index 9eedcbe70..6972519e5 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(); diff --git a/tests/Composer/Test/Installer/SuggestedPackagesReporterTest.php b/tests/Composer/Test/Installer/SuggestedPackagesReporterTest.php index c6f5b8721..beb4685eb 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(); diff --git a/tests/Composer/Test/InstallerTest.php b/tests/Composer/Test/InstallerTest.php index 46d2f625f..8d15e0e5a 100644 --- a/tests/Composer/Test/InstallerTest.php +++ b/tests/Composer/Test/InstallerTest.php @@ -50,13 +50,13 @@ class InstallerTest extends TestCase /** @var ?string */ protected $tempComposerHome; - public function setUp() + public function setUp(): void { $this->prevCwd = getcwd(); chdir(__DIR__); } - public function tearDown() + public function tearDown(): void { Platform::clearEnv('COMPOSER_POOL_OPTIMIZER'); diff --git a/tests/Composer/Test/Package/Archiver/ArchivableFilesFinderTest.php b/tests/Composer/Test/Package/Archiver/ArchivableFilesFinderTest.php index 6aad38c2c..2cd274e11 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,7 +95,7 @@ class ArchivableFilesFinderTest extends TestCase } } - protected function tearDown() + protected function tearDown(): void { $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..d54bb3339 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(); diff --git a/tests/Composer/Test/Package/Archiver/ArchiverTest.php b/tests/Composer/Test/Package/Archiver/ArchiverTest.php index 62e62cce0..fa09813c6 100644 --- a/tests/Composer/Test/Package/Archiver/ArchiverTest.php +++ b/tests/Composer/Test/Package/Archiver/ArchiverTest.php @@ -34,14 +34,14 @@ 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() + public function tearDown(): void { $this->filesystem->removeDirectory($this->testDir); } 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/Version/VersionGuesserTest.php b/tests/Composer/Test/Package/Version/VersionGuesserTest.php index 292c78946..64e20fbd0 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'); 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..9d526fd1f 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,7 +127,7 @@ class PluginInstallerTest extends TestCase $this->composer->setPluginManager($this->pm); } - protected function tearDown() + protected function tearDown(): void { $filesystem = new Filesystem(); $filesystem->removeDirectory($this->directory); diff --git a/tests/Composer/Test/PolyfillTestCase.php b/tests/Composer/Test/PolyfillTestCase.php index dd40a196b..da8aa3e99 100644 --- a/tests/Composer/Test/PolyfillTestCase.php +++ b/tests/Composer/Test/PolyfillTestCase.php @@ -12,10 +12,8 @@ namespace Composer\Test { use PHPUnit\Framework\TestCase; - use PHPUnit\Framework\Constraint\LogicalNot; - use PHPUnit\Framework\Constraint\StringContains; - if (method_exists('PHPUnit\Framework\TestCase', 'assertStringContainsString')) { + if (method_exists('PHPUnit\Framework\TestCase', 'assertFileDoesNotExist')) { abstract class PolyfillTestCase extends TestCase { } @@ -23,196 +21,6 @@ namespace Composer\Test { 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 @@ -224,30 +32,6 @@ namespace Composer\Test { 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 @@ -259,30 +43,6 @@ namespace Composer\Test { 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 @@ -294,30 +54,6 @@ namespace Composer\Test { 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 @@ -329,30 +65,6 @@ namespace Composer\Test { 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 @@ -364,30 +76,6 @@ namespace Composer\Test { 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 @@ -399,30 +87,6 @@ namespace Composer\Test { 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 @@ -434,30 +98,6 @@ namespace Composer\Test { 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 @@ -495,265 +135,3 @@ namespace Composer\Test { } } } - -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/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/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/RepositoryManagerTest.php b/tests/Composer/Test/Repository/RepositoryManagerTest.php index a7f07c85a..6a7df6be8 100644 --- a/tests/Composer/Test/Repository/RepositoryManagerTest.php +++ b/tests/Composer/Test/Repository/RepositoryManagerTest.php @@ -21,12 +21,12 @@ class RepositoryManagerTest extends TestCase /** @var string */ protected $tmpdir; - public function setUp() + public function setUp(): void { $this->tmpdir = $this->getUniqueTmpDirectory(); } - public function tearDown() + public function tearDown(): void { if (is_dir($this->tmpdir)) { $fs = new Filesystem(); diff --git a/tests/Composer/Test/Repository/Vcs/FossilDriverTest.php b/tests/Composer/Test/Repository/Vcs/FossilDriverTest.php index 501893cbf..462047a7b 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,7 +39,7 @@ class FossilDriverTest extends TestCase )); } - public function tearDown() + public function tearDown(): void { $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..1e1116107 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,7 +51,7 @@ class GitBitbucketDriverTest extends TestCase ->getMock(); } - public function tearDown() + public function tearDown(): void { $fs = new Filesystem; $fs->removeDirectory($this->home); diff --git a/tests/Composer/Test/Repository/Vcs/GitHubDriverTest.php b/tests/Composer/Test/Repository/Vcs/GitHubDriverTest.php index d48a8fd1c..6e3728a7a 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,7 +39,7 @@ class GitHubDriverTest extends TestCase )); } - public function tearDown() + public function tearDown(): void { $fs = new Filesystem; $fs->removeDirectory($this->home); diff --git a/tests/Composer/Test/Repository/Vcs/GitLabDriverTest.php b/tests/Composer/Test/Repository/Vcs/GitLabDriverTest.php index fd6f2936d..4b832030f 100644 --- a/tests/Composer/Test/Repository/Vcs/GitLabDriverTest.php +++ b/tests/Composer/Test/Repository/Vcs/GitLabDriverTest.php @@ -45,7 +45,7 @@ class GitLabDriverTest extends TestCase */ private $httpDownloader; - public function setUp() + public function setUp(): void { $this->home = $this->getUniqueTmpDirectory(); $this->config = new Config(); @@ -66,7 +66,7 @@ class GitLabDriverTest extends TestCase $this->httpDownloader = $this->prophesize('Composer\Util\HttpDownloader'); } - public function tearDown() + public function tearDown(): void { $fs = new Filesystem(); $fs->removeDirectory($this->home); diff --git a/tests/Composer/Test/Repository/Vcs/HgDriverTest.php b/tests/Composer/Test/Repository/Vcs/HgDriverTest.php index 2fcd27bdf..93c10f27e 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,7 +38,7 @@ class HgDriverTest extends TestCase )); } - public function tearDown() + public function tearDown(): void { $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..df810bcee 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); @@ -78,7 +78,7 @@ class PerforceDriverTest extends TestCase $this->overrideDriverInternalPerforce($this->perforce); } - protected function tearDown() + protected function tearDown(): void { //cleanup directory under test path $fs = new Filesystem; diff --git a/tests/Composer/Test/Repository/Vcs/SvnDriverTest.php b/tests/Composer/Test/Repository/Vcs/SvnDriverTest.php index b99658ebf..e67e275fe 100644 --- a/tests/Composer/Test/Repository/Vcs/SvnDriverTest.php +++ b/tests/Composer/Test/Repository/Vcs/SvnDriverTest.php @@ -29,7 +29,7 @@ class SvnDriverTest extends TestCase */ protected $config; - public function setUp() + public function setUp(): void { $this->home = $this->getUniqueTmpDirectory(); $this->config = new Config(); @@ -40,7 +40,7 @@ class SvnDriverTest extends TestCase )); } - public function tearDown() + public function tearDown(): void { $fs = new Filesystem(); $fs->removeDirectory($this->home); 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/Util/AuthHelperTest.php b/tests/Composer/Test/Util/AuthHelperTest.php index d7018cd1c..0129868eb 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') diff --git a/tests/Composer/Test/Util/BitbucketTest.php b/tests/Composer/Test/Util/BitbucketTest.php index 47fdb4ea8..eece02ab5 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') diff --git a/tests/Composer/Test/Util/ErrorHandlerTest.php b/tests/Composer/Test/Util/ErrorHandlerTest.php index 551daaa25..45bb198de 100644 --- a/tests/Composer/Test/Util/ErrorHandlerTest.php +++ b/tests/Composer/Test/Util/ErrorHandlerTest.php @@ -20,12 +20,12 @@ use Composer\Test\TestCase; */ class ErrorHandlerTest extends TestCase { - public function setUp() + public function setUp(): void { ErrorHandler::register(); } - public function tearDown() + public function tearDown(): void { restore_error_handler(); } diff --git a/tests/Composer/Test/Util/FilesystemTest.php b/tests/Composer/Test/Util/FilesystemTest.php index bdf6b7f16..fa514cfae 100644 --- a/tests/Composer/Test/Util/FilesystemTest.php +++ b/tests/Composer/Test/Util/FilesystemTest.php @@ -32,14 +32,14 @@ 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() + public function tearDown(): void { if (is_dir($this->workingDir)) { $this->fs->removeDirectory($this->workingDir); diff --git a/tests/Composer/Test/Util/GitTest.php b/tests/Composer/Test/Util/GitTest.php index d6e74c7b5..279a15af9 100644 --- a/tests/Composer/Test/Util/GitTest.php +++ b/tests/Composer/Test/Util/GitTest.php @@ -32,7 +32,7 @@ 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(); diff --git a/tests/Composer/Test/Util/Http/ProxyHelperTest.php b/tests/Composer/Test/Util/Http/ProxyHelperTest.php index 81d1d33a8..41ff3fe45 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,7 +30,7 @@ class ProxyHelperTest extends TestCase ); } - protected function tearDown() + protected function tearDown(): void { unset( $_SERVER['HTTP_PROXY'], diff --git a/tests/Composer/Test/Util/Http/ProxyManagerTest.php b/tests/Composer/Test/Util/Http/ProxyManagerTest.php index 48e9914df..6cb5d6bf2 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,7 +31,7 @@ class ProxyManagerTest extends TestCase ProxyManager::reset(); } - protected function tearDown() + protected function tearDown(): void { unset( $_SERVER['HTTP_PROXY'], 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..3f23024df 100644 --- a/tests/Composer/Test/Util/PerforceTest.php +++ b/tests/Composer/Test/Util/PerforceTest.php @@ -37,7 +37,7 @@ 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->repoConfig = $this->getTestRepoConfig(); diff --git a/tests/Composer/Test/Util/StreamContextFactoryTest.php b/tests/Composer/Test/Util/StreamContextFactoryTest.php index 7b2428ec1..d17b9b7cc 100644 --- a/tests/Composer/Test/Util/StreamContextFactoryTest.php +++ b/tests/Composer/Test/Util/StreamContextFactoryTest.php @@ -18,13 +18,13 @@ 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 { unset($_SERVER['HTTP_PROXY'], $_SERVER['http_proxy'], $_SERVER['HTTPS_PROXY'], $_SERVER['https_proxy'], $_SERVER['NO_PROXY'], $_SERVER['no_proxy']); ProxyManager::reset(); From bf72afec44152315afcbb55438417aa783c1177a Mon Sep 17 00:00:00 2001 From: Jordi Boggiano Date: Wed, 8 Dec 2021 22:06:17 +0100 Subject: [PATCH 03/17] Fix Symfony6 compat --- composer.json | 7 +-- composer.lock | 4 +- src/Composer/Command/GlobalCommand.php | 3 +- src/Composer/Console/Application.php | 27 +++-------- src/Composer/Console/HtmlOutputFormatter.php | 7 +-- src/Composer/IO/BaseIO.php | 45 ++++--------------- .../Test/Downloader/ZipDownloaderTest.php | 6 +-- 7 files changed, 24 insertions(+), 75 deletions(-) diff --git a/composer.json b/composer.json index d4cb8e9a3..2cbbc6aac 100644 --- a/composer.json +++ b/composer.json @@ -40,7 +40,7 @@ "composer/pcre": "^1.0" }, "require-dev": { - "symfony/phpunit-bridge": "^5.4 || ^6.0", + "symfony/phpunit-bridge": "^6.0", "phpspec/prophecy": "^1.10", "phpstan/phpstan": "^1.0", "phpstan/phpstan-phpunit": "^1.0", @@ -84,10 +84,7 @@ ], "scripts": { "compile": "@php -dphar.readonly=0 bin/compile", - "test": [ - "@putenv SYMFONY_PHPUNIT_VERSION=8.5", - "@php simple-phpunit" - ], + "test": "@php simple-phpunit", "phpstan": "@php vendor/bin/phpstan analyse --configuration=phpstan/config.neon" }, "scripts-descriptions": { diff --git a/composer.lock b/composer.lock index 3b94b9783..a8a5857b0 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": "b75018840aa186f02f947abb15a39369", + "content-hash": "84679af67d11fbadffda53328d7fe1b7", "packages": [ { "name": "composer/ca-bundle", @@ -3799,5 +3799,5 @@ "platform-overrides": { "php": "7.2.5" }, - "plugin-api-version": "2.3.0" + "plugin-api-version": "2.1.0" } 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/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/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/tests/Composer/Test/Downloader/ZipDownloaderTest.php b/tests/Composer/Test/Downloader/ZipDownloaderTest.php index 7e1f33119..3885a33e6 100644 --- a/tests/Composer/Test/Downloader/ZipDownloaderTest.php +++ b/tests/Composer/Test/Downloader/ZipDownloaderTest.php @@ -114,11 +114,11 @@ 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 = $this->getMockBuilder('ZipArchive')->onlyMethods(['open', 'extractTo'])->getMock(); + $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)); From 59603a357a438e16b4680c399c014693bffb3c58 Mon Sep 17 00:00:00 2001 From: Jordi Boggiano Date: Thu, 9 Dec 2021 11:35:09 +0100 Subject: [PATCH 04/17] Remove PHPUnit direct require again --- .github/workflows/continuous-integration.yml | 4 +- .github/workflows/phpstan.yml | 13 +- composer.json | 11 +- composer.lock | 1063 +----------------- phpstan/config.neon | 1 + phpstan/locate-phpunit-autoloader.php | 22 + 6 files changed, 45 insertions(+), 1069 deletions(-) create mode 100644 phpstan/locate-phpunit-autoloader.php diff --git a/.github/workflows/continuous-integration.yml b/.github/workflows/continuous-integration.yml index 0ae292782..4040da8c3 100644 --- a/.github/workflows/continuous-integration.yml +++ b/.github/workflows/continuous-integration.yml @@ -105,11 +105,11 @@ jobs: - name: "Run tests" if: "matrix.php-version != '7.3'" - run: "SYMFONY_PHPUNIT_VERSION=8.5 vendor/bin/simple-phpunit --verbose" + run: "vendor/bin/simple-phpunit --verbose" - name: "Run complete test suite on 7.3" if: "matrix.php-version == '7.3'" - run: "SYMFONY_PHPUNIT_VERSION=8.5 vendor/bin/simple-phpunit --configuration tests/complete.phpunit.xml" + run: "vendor/bin/simple-phpunit --configuration tests/complete.phpunit.xml" validation: name: "Composer validation" diff --git a/.github/workflows/phpstan.yml b/.github/workflows/phpstan.yml index cc40f0163..0488fa089 100644 --- a/.github/workflows/phpstan.yml +++ b/.github/workflows/phpstan.yml @@ -21,7 +21,8 @@ jobs: strategy: matrix: php-version: - - "7.4" + - "7.2" + - "8.1" steps: - name: "Checkout" @@ -46,8 +47,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.php-version != '7.2'" run: "composer config platform --unset && composer update ${{ env.COMPOSER_FLAGS }}" + - name: "Install locked dependencies" + if: "matrix.php-version == '7.2'" + 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: "composer phpstan" diff --git a/composer.json b/composer.json index 2cbbc6aac..f9e24e15b 100644 --- a/composer.json +++ b/composer.json @@ -21,6 +21,9 @@ "homepage": "https://seld.be" } ], + "_comment": [ + "symfony/polyfill-php73 sould be removed once https://github.com/symfony/symfony/pull/44523 is released and the symfony/console requirement bumped to match that release" + ], "require": { "php": "^7.2.5 || ^8.0", "composer/ca-bundle": "^1.0", @@ -36,8 +39,9 @@ "symfony/filesystem": "^5.4 || ^6.0", "symfony/finder": "^5.4 || ^6.0", "symfony/process": "^5.4 || ^6.0", - "react/promise": "^2.7", - "composer/pcre": "^1.0" + "react/promise": "^2.8", + "composer/pcre": "^1.0", + "symfony/polyfill-php73": "^1.9" }, "require-dev": { "symfony/phpunit-bridge": "^6.0", @@ -45,8 +49,7 @@ "phpstan/phpstan": "^1.0", "phpstan/phpstan-phpunit": "^1.0", "phpstan/phpstan-deprecation-rules": "^1", - "phpstan/phpstan-strict-rules": "^1", - "phpunit/phpunit": "^8.5" + "phpstan/phpstan-strict-rules": "^1" }, "suggest": { "ext-openssl": "Enabling the openssl extension allows you to access https URLs for repositories and packages", diff --git a/composer.lock b/composer.lock index a8a5857b0..5c34ed2ce 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": "84679af67d11fbadffda53328d7fe1b7", + "content-hash": "21b7ce031989ab306ee91098fa461436", "packages": [ { "name": "composer/ca-bundle", @@ -1859,172 +1859,6 @@ ], "time": "2020-11-10T18:47:58+00:00" }, - { - "name": "myclabs/deep-copy", - "version": "1.10.2", - "source": { - "type": "git", - "url": "https://github.com/myclabs/DeepCopy.git", - "reference": "776f831124e9c62e1a2c601ecc52e776d8bb7220" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/myclabs/DeepCopy/zipball/776f831124e9c62e1a2c601ecc52e776d8bb7220", - "reference": "776f831124e9c62e1a2c601ecc52e776d8bb7220", - "shasum": "" - }, - "require": { - "php": "^7.1 || ^8.0" - }, - "require-dev": { - "doctrine/collections": "^1.0", - "doctrine/common": "^2.6", - "phpunit/phpunit": "^7.1" - }, - "type": "library", - "autoload": { - "psr-4": { - "DeepCopy\\": "src/DeepCopy/" - }, - "files": [ - "src/DeepCopy/deep_copy.php" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "description": "Create deep copies (clones) of your objects", - "keywords": [ - "clone", - "copy", - "duplicate", - "object", - "object graph" - ], - "support": { - "issues": "https://github.com/myclabs/DeepCopy/issues", - "source": "https://github.com/myclabs/DeepCopy/tree/1.10.2" - }, - "funding": [ - { - "url": "https://tidelift.com/funding/github/packagist/myclabs/deep-copy", - "type": "tidelift" - } - ], - "time": "2020-11-13T09:40:50+00:00" - }, - { - "name": "phar-io/manifest", - "version": "2.0.3", - "source": { - "type": "git", - "url": "https://github.com/phar-io/manifest.git", - "reference": "97803eca37d319dfa7826cc2437fc020857acb53" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/phar-io/manifest/zipball/97803eca37d319dfa7826cc2437fc020857acb53", - "reference": "97803eca37d319dfa7826cc2437fc020857acb53", - "shasum": "" - }, - "require": { - "ext-dom": "*", - "ext-phar": "*", - "ext-xmlwriter": "*", - "phar-io/version": "^3.0.1", - "php": "^7.2 || ^8.0" - }, - "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": "Arne Blankerts", - "email": "arne@blankerts.de", - "role": "Developer" - }, - { - "name": "Sebastian Heuer", - "email": "sebastian@phpeople.de", - "role": "Developer" - }, - { - "name": "Sebastian Bergmann", - "email": "sebastian@phpunit.de", - "role": "Developer" - } - ], - "description": "Component for reading phar.io manifest information from a PHP Archive (PHAR)", - "support": { - "issues": "https://github.com/phar-io/manifest/issues", - "source": "https://github.com/phar-io/manifest/tree/2.0.3" - }, - "time": "2021-07-20T11:28:43+00:00" - }, - { - "name": "phar-io/version", - "version": "3.1.0", - "source": { - "type": "git", - "url": "https://github.com/phar-io/version.git", - "reference": "bae7c545bef187884426f042434e561ab1ddb182" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/phar-io/version/zipball/bae7c545bef187884426f042434e561ab1ddb182", - "reference": "bae7c545bef187884426f042434e561ab1ddb182", - "shasum": "" - }, - "require": { - "php": "^7.2 || ^8.0" - }, - "type": "library", - "autoload": { - "classmap": [ - "src/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause" - ], - "authors": [ - { - "name": "Arne Blankerts", - "email": "arne@blankerts.de", - "role": "Developer" - }, - { - "name": "Sebastian Heuer", - "email": "sebastian@phpeople.de", - "role": "Developer" - }, - { - "name": "Sebastian Bergmann", - "email": "sebastian@phpunit.de", - "role": "Developer" - } - ], - "description": "Library for handling version information and constraints", - "support": { - "issues": "https://github.com/phar-io/version/issues", - "source": "https://github.com/phar-io/version/tree/3.1.0" - }, - "time": "2021-02-23T14:00:09+00:00" - }, { "name": "phpdocumentor/reflection-common", "version": "2.2.0", @@ -2472,455 +2306,6 @@ }, "time": "2021-11-18T09:30:29+00:00" }, - { - "name": "phpunit/php-code-coverage", - "version": "7.0.15", - "source": { - "type": "git", - "url": "https://github.com/sebastianbergmann/php-code-coverage.git", - "reference": "819f92bba8b001d4363065928088de22f25a3a48" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/php-code-coverage/zipball/819f92bba8b001d4363065928088de22f25a3a48", - "reference": "819f92bba8b001d4363065928088de22f25a3a48", - "shasum": "" - }, - "require": { - "ext-dom": "*", - "ext-xmlwriter": "*", - "php": ">=7.2", - "phpunit/php-file-iterator": "^2.0.2", - "phpunit/php-text-template": "^1.2.1", - "phpunit/php-token-stream": "^3.1.3 || ^4.0", - "sebastian/code-unit-reverse-lookup": "^1.0.1", - "sebastian/environment": "^4.2.2", - "sebastian/version": "^2.0.1", - "theseer/tokenizer": "^1.1.3" - }, - "require-dev": { - "phpunit/phpunit": "^8.2.2" - }, - "suggest": { - "ext-xdebug": "^2.7.2" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "7.0-dev" - } - }, - "autoload": { - "classmap": [ - "src/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause" - ], - "authors": [ - { - "name": "Sebastian Bergmann", - "email": "sebastian@phpunit.de", - "role": "lead" - } - ], - "description": "Library that provides collection, processing, and rendering functionality for PHP code coverage information.", - "homepage": "https://github.com/sebastianbergmann/php-code-coverage", - "keywords": [ - "coverage", - "testing", - "xunit" - ], - "support": { - "issues": "https://github.com/sebastianbergmann/php-code-coverage/issues", - "source": "https://github.com/sebastianbergmann/php-code-coverage/tree/7.0.15" - }, - "funding": [ - { - "url": "https://github.com/sebastianbergmann", - "type": "github" - } - ], - "time": "2021-07-26T12:20:09+00:00" - }, - { - "name": "phpunit/php-file-iterator", - "version": "2.0.5", - "source": { - "type": "git", - "url": "https://github.com/sebastianbergmann/php-file-iterator.git", - "reference": "42c5ba5220e6904cbfe8b1a1bda7c0cfdc8c12f5" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/php-file-iterator/zipball/42c5ba5220e6904cbfe8b1a1bda7c0cfdc8c12f5", - "reference": "42c5ba5220e6904cbfe8b1a1bda7c0cfdc8c12f5", - "shasum": "" - }, - "require": { - "php": ">=7.1" - }, - "require-dev": { - "phpunit/phpunit": "^8.5" - }, - "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": "Sebastian Bergmann", - "email": "sebastian@phpunit.de", - "role": "lead" - } - ], - "description": "FilterIterator implementation that filters files based on a list of suffixes.", - "homepage": "https://github.com/sebastianbergmann/php-file-iterator/", - "keywords": [ - "filesystem", - "iterator" - ], - "support": { - "issues": "https://github.com/sebastianbergmann/php-file-iterator/issues", - "source": "https://github.com/sebastianbergmann/php-file-iterator/tree/2.0.5" - }, - "funding": [ - { - "url": "https://github.com/sebastianbergmann", - "type": "github" - } - ], - "time": "2021-12-02T12:42:26+00:00" - }, - { - "name": "phpunit/php-text-template", - "version": "1.2.1", - "source": { - "type": "git", - "url": "https://github.com/sebastianbergmann/php-text-template.git", - "reference": "31f8b717e51d9a2afca6c9f046f5d69fc27c8686" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/php-text-template/zipball/31f8b717e51d9a2afca6c9f046f5d69fc27c8686", - "reference": "31f8b717e51d9a2afca6c9f046f5d69fc27c8686", - "shasum": "" - }, - "require": { - "php": ">=5.3.3" - }, - "type": "library", - "autoload": { - "classmap": [ - "src/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause" - ], - "authors": [ - { - "name": "Sebastian Bergmann", - "email": "sebastian@phpunit.de", - "role": "lead" - } - ], - "description": "Simple template engine.", - "homepage": "https://github.com/sebastianbergmann/php-text-template/", - "keywords": [ - "template" - ], - "support": { - "issues": "https://github.com/sebastianbergmann/php-text-template/issues", - "source": "https://github.com/sebastianbergmann/php-text-template/tree/1.2.1" - }, - "time": "2015-06-21T13:50:34+00:00" - }, - { - "name": "phpunit/php-timer", - "version": "2.1.3", - "source": { - "type": "git", - "url": "https://github.com/sebastianbergmann/php-timer.git", - "reference": "2454ae1765516d20c4ffe103d85a58a9a3bd5662" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/php-timer/zipball/2454ae1765516d20c4ffe103d85a58a9a3bd5662", - "reference": "2454ae1765516d20c4ffe103d85a58a9a3bd5662", - "shasum": "" - }, - "require": { - "php": ">=7.1" - }, - "require-dev": { - "phpunit/phpunit": "^8.5" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "2.1-dev" - } - }, - "autoload": { - "classmap": [ - "src/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause" - ], - "authors": [ - { - "name": "Sebastian Bergmann", - "email": "sebastian@phpunit.de", - "role": "lead" - } - ], - "description": "Utility class for timing", - "homepage": "https://github.com/sebastianbergmann/php-timer/", - "keywords": [ - "timer" - ], - "support": { - "issues": "https://github.com/sebastianbergmann/php-timer/issues", - "source": "https://github.com/sebastianbergmann/php-timer/tree/2.1.3" - }, - "funding": [ - { - "url": "https://github.com/sebastianbergmann", - "type": "github" - } - ], - "time": "2020-11-30T08:20:02+00:00" - }, - { - "name": "phpunit/php-token-stream", - "version": "3.1.3", - "source": { - "type": "git", - "url": "https://github.com/sebastianbergmann/php-token-stream.git", - "reference": "9c1da83261628cb24b6a6df371b6e312b3954768" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/php-token-stream/zipball/9c1da83261628cb24b6a6df371b6e312b3954768", - "reference": "9c1da83261628cb24b6a6df371b6e312b3954768", - "shasum": "" - }, - "require": { - "ext-tokenizer": "*", - "php": ">=7.1" - }, - "require-dev": { - "phpunit/phpunit": "^7.0" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "3.1-dev" - } - }, - "autoload": { - "classmap": [ - "src/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause" - ], - "authors": [ - { - "name": "Sebastian Bergmann", - "email": "sebastian@phpunit.de" - } - ], - "description": "Wrapper around PHP's tokenizer extension.", - "homepage": "https://github.com/sebastianbergmann/php-token-stream/", - "keywords": [ - "tokenizer" - ], - "support": { - "issues": "https://github.com/sebastianbergmann/php-token-stream/issues", - "source": "https://github.com/sebastianbergmann/php-token-stream/tree/3.1.3" - }, - "funding": [ - { - "url": "https://github.com/sebastianbergmann", - "type": "github" - } - ], - "abandoned": true, - "time": "2021-07-26T12:15:06+00:00" - }, - { - "name": "phpunit/phpunit", - "version": "8.5.21", - "source": { - "type": "git", - "url": "https://github.com/sebastianbergmann/phpunit.git", - "reference": "50a58a60b85947b0bee4c8ecfe0f4bbdcf20e984" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/50a58a60b85947b0bee4c8ecfe0f4bbdcf20e984", - "reference": "50a58a60b85947b0bee4c8ecfe0f4bbdcf20e984", - "shasum": "" - }, - "require": { - "doctrine/instantiator": "^1.3.1", - "ext-dom": "*", - "ext-json": "*", - "ext-libxml": "*", - "ext-mbstring": "*", - "ext-xml": "*", - "ext-xmlwriter": "*", - "myclabs/deep-copy": "^1.10.0", - "phar-io/manifest": "^2.0.3", - "phar-io/version": "^3.0.2", - "php": ">=7.2", - "phpspec/prophecy": "^1.10.3", - "phpunit/php-code-coverage": "^7.0.12", - "phpunit/php-file-iterator": "^2.0.4", - "phpunit/php-text-template": "^1.2.1", - "phpunit/php-timer": "^2.1.2", - "sebastian/comparator": "^3.0.2", - "sebastian/diff": "^3.0.2", - "sebastian/environment": "^4.2.3", - "sebastian/exporter": "^3.1.2", - "sebastian/global-state": "^3.0.0", - "sebastian/object-enumerator": "^3.0.3", - "sebastian/resource-operations": "^2.0.1", - "sebastian/type": "^1.1.3", - "sebastian/version": "^2.0.1" - }, - "require-dev": { - "ext-pdo": "*" - }, - "suggest": { - "ext-soap": "*", - "ext-xdebug": "*", - "phpunit/php-invoker": "^2.0.0" - }, - "bin": [ - "phpunit" - ], - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "8.5-dev" - } - }, - "autoload": { - "classmap": [ - "src/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause" - ], - "authors": [ - { - "name": "Sebastian Bergmann", - "email": "sebastian@phpunit.de", - "role": "lead" - } - ], - "description": "The PHP Unit Testing framework.", - "homepage": "https://phpunit.de/", - "keywords": [ - "phpunit", - "testing", - "xunit" - ], - "support": { - "issues": "https://github.com/sebastianbergmann/phpunit/issues", - "source": "https://github.com/sebastianbergmann/phpunit/tree/8.5.21" - }, - "funding": [ - { - "url": "https://phpunit.de/donate.html", - "type": "custom" - }, - { - "url": "https://github.com/sebastianbergmann", - "type": "github" - } - ], - "time": "2021-09-25T07:37:20+00:00" - }, - { - "name": "sebastian/code-unit-reverse-lookup", - "version": "1.0.2", - "source": { - "type": "git", - "url": "https://github.com/sebastianbergmann/code-unit-reverse-lookup.git", - "reference": "1de8cd5c010cb153fcd68b8d0f64606f523f7619" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/code-unit-reverse-lookup/zipball/1de8cd5c010cb153fcd68b8d0f64606f523f7619", - "reference": "1de8cd5c010cb153fcd68b8d0f64606f523f7619", - "shasum": "" - }, - "require": { - "php": ">=5.6" - }, - "require-dev": { - "phpunit/phpunit": "^8.5" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.0.x-dev" - } - }, - "autoload": { - "classmap": [ - "src/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause" - ], - "authors": [ - { - "name": "Sebastian Bergmann", - "email": "sebastian@phpunit.de" - } - ], - "description": "Looks up which function or method a line of code belongs to", - "homepage": "https://github.com/sebastianbergmann/code-unit-reverse-lookup/", - "support": { - "issues": "https://github.com/sebastianbergmann/code-unit-reverse-lookup/issues", - "source": "https://github.com/sebastianbergmann/code-unit-reverse-lookup/tree/1.0.2" - }, - "funding": [ - { - "url": "https://github.com/sebastianbergmann", - "type": "github" - } - ], - "time": "2020-11-30T08:15:22+00:00" - }, { "name": "sebastian/comparator", "version": "3.0.3", @@ -3061,69 +2446,6 @@ ], "time": "2020-11-30T07:59:04+00:00" }, - { - "name": "sebastian/environment", - "version": "4.2.4", - "source": { - "type": "git", - "url": "https://github.com/sebastianbergmann/environment.git", - "reference": "d47bbbad83711771f167c72d4e3f25f7fcc1f8b0" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/environment/zipball/d47bbbad83711771f167c72d4e3f25f7fcc1f8b0", - "reference": "d47bbbad83711771f167c72d4e3f25f7fcc1f8b0", - "shasum": "" - }, - "require": { - "php": ">=7.1" - }, - "require-dev": { - "phpunit/phpunit": "^7.5" - }, - "suggest": { - "ext-posix": "*" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "4.2-dev" - } - }, - "autoload": { - "classmap": [ - "src/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause" - ], - "authors": [ - { - "name": "Sebastian Bergmann", - "email": "sebastian@phpunit.de" - } - ], - "description": "Provides functionality to handle HHVM/PHP environments", - "homepage": "http://www.github.com/sebastianbergmann/environment", - "keywords": [ - "Xdebug", - "environment", - "hhvm" - ], - "support": { - "issues": "https://github.com/sebastianbergmann/environment/issues", - "source": "https://github.com/sebastianbergmann/environment/tree/4.2.4" - }, - "funding": [ - { - "url": "https://github.com/sebastianbergmann", - "type": "github" - } - ], - "time": "2020-11-30T07:53:42+00:00" - }, { "name": "sebastian/exporter", "version": "3.1.4", @@ -3201,182 +2523,6 @@ ], "time": "2021-11-11T13:51:24+00:00" }, - { - "name": "sebastian/global-state", - "version": "3.0.1", - "source": { - "type": "git", - "url": "https://github.com/sebastianbergmann/global-state.git", - "reference": "474fb9edb7ab891665d3bfc6317f42a0a150454b" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/global-state/zipball/474fb9edb7ab891665d3bfc6317f42a0a150454b", - "reference": "474fb9edb7ab891665d3bfc6317f42a0a150454b", - "shasum": "" - }, - "require": { - "php": ">=7.2", - "sebastian/object-reflector": "^1.1.1", - "sebastian/recursion-context": "^3.0" - }, - "require-dev": { - "ext-dom": "*", - "phpunit/phpunit": "^8.0" - }, - "suggest": { - "ext-uopz": "*" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "3.0-dev" - } - }, - "autoload": { - "classmap": [ - "src/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause" - ], - "authors": [ - { - "name": "Sebastian Bergmann", - "email": "sebastian@phpunit.de" - } - ], - "description": "Snapshotting of global state", - "homepage": "http://www.github.com/sebastianbergmann/global-state", - "keywords": [ - "global state" - ], - "support": { - "issues": "https://github.com/sebastianbergmann/global-state/issues", - "source": "https://github.com/sebastianbergmann/global-state/tree/3.0.1" - }, - "funding": [ - { - "url": "https://github.com/sebastianbergmann", - "type": "github" - } - ], - "time": "2020-11-30T07:43:24+00:00" - }, - { - "name": "sebastian/object-enumerator", - "version": "3.0.4", - "source": { - "type": "git", - "url": "https://github.com/sebastianbergmann/object-enumerator.git", - "reference": "e67f6d32ebd0c749cf9d1dbd9f226c727043cdf2" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/object-enumerator/zipball/e67f6d32ebd0c749cf9d1dbd9f226c727043cdf2", - "reference": "e67f6d32ebd0c749cf9d1dbd9f226c727043cdf2", - "shasum": "" - }, - "require": { - "php": ">=7.0", - "sebastian/object-reflector": "^1.1.1", - "sebastian/recursion-context": "^3.0" - }, - "require-dev": { - "phpunit/phpunit": "^6.0" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "3.0.x-dev" - } - }, - "autoload": { - "classmap": [ - "src/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause" - ], - "authors": [ - { - "name": "Sebastian Bergmann", - "email": "sebastian@phpunit.de" - } - ], - "description": "Traverses array structures and object graphs to enumerate all referenced objects", - "homepage": "https://github.com/sebastianbergmann/object-enumerator/", - "support": { - "issues": "https://github.com/sebastianbergmann/object-enumerator/issues", - "source": "https://github.com/sebastianbergmann/object-enumerator/tree/3.0.4" - }, - "funding": [ - { - "url": "https://github.com/sebastianbergmann", - "type": "github" - } - ], - "time": "2020-11-30T07:40:27+00:00" - }, - { - "name": "sebastian/object-reflector", - "version": "1.1.2", - "source": { - "type": "git", - "url": "https://github.com/sebastianbergmann/object-reflector.git", - "reference": "9b8772b9cbd456ab45d4a598d2dd1a1bced6363d" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/object-reflector/zipball/9b8772b9cbd456ab45d4a598d2dd1a1bced6363d", - "reference": "9b8772b9cbd456ab45d4a598d2dd1a1bced6363d", - "shasum": "" - }, - "require": { - "php": ">=7.0" - }, - "require-dev": { - "phpunit/phpunit": "^6.0" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.1-dev" - } - }, - "autoload": { - "classmap": [ - "src/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause" - ], - "authors": [ - { - "name": "Sebastian Bergmann", - "email": "sebastian@phpunit.de" - } - ], - "description": "Allows reflection of object attributes, including inherited and non-public ones", - "homepage": "https://github.com/sebastianbergmann/object-reflector/", - "support": { - "issues": "https://github.com/sebastianbergmann/object-reflector/issues", - "source": "https://github.com/sebastianbergmann/object-reflector/tree/1.1.2" - }, - "funding": [ - { - "url": "https://github.com/sebastianbergmann", - "type": "github" - } - ], - "time": "2020-11-30T07:37:18+00:00" - }, { "name": "sebastian/recursion-context", "version": "3.0.1", @@ -3440,161 +2586,6 @@ ], "time": "2020-11-30T07:34:24+00:00" }, - { - "name": "sebastian/resource-operations", - "version": "2.0.2", - "source": { - "type": "git", - "url": "https://github.com/sebastianbergmann/resource-operations.git", - "reference": "31d35ca87926450c44eae7e2611d45a7a65ea8b3" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/resource-operations/zipball/31d35ca87926450c44eae7e2611d45a7a65ea8b3", - "reference": "31d35ca87926450c44eae7e2611d45a7a65ea8b3", - "shasum": "" - }, - "require": { - "php": ">=7.1" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "2.0-dev" - } - }, - "autoload": { - "classmap": [ - "src/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause" - ], - "authors": [ - { - "name": "Sebastian Bergmann", - "email": "sebastian@phpunit.de" - } - ], - "description": "Provides a list of PHP built-in functions that operate on resources", - "homepage": "https://www.github.com/sebastianbergmann/resource-operations", - "support": { - "issues": "https://github.com/sebastianbergmann/resource-operations/issues", - "source": "https://github.com/sebastianbergmann/resource-operations/tree/2.0.2" - }, - "funding": [ - { - "url": "https://github.com/sebastianbergmann", - "type": "github" - } - ], - "time": "2020-11-30T07:30:19+00:00" - }, - { - "name": "sebastian/type", - "version": "1.1.4", - "source": { - "type": "git", - "url": "https://github.com/sebastianbergmann/type.git", - "reference": "0150cfbc4495ed2df3872fb31b26781e4e077eb4" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/type/zipball/0150cfbc4495ed2df3872fb31b26781e4e077eb4", - "reference": "0150cfbc4495ed2df3872fb31b26781e4e077eb4", - "shasum": "" - }, - "require": { - "php": ">=7.2" - }, - "require-dev": { - "phpunit/phpunit": "^8.2" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.1-dev" - } - }, - "autoload": { - "classmap": [ - "src/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause" - ], - "authors": [ - { - "name": "Sebastian Bergmann", - "email": "sebastian@phpunit.de", - "role": "lead" - } - ], - "description": "Collection of value objects that represent the types of the PHP type system", - "homepage": "https://github.com/sebastianbergmann/type", - "support": { - "issues": "https://github.com/sebastianbergmann/type/issues", - "source": "https://github.com/sebastianbergmann/type/tree/1.1.4" - }, - "funding": [ - { - "url": "https://github.com/sebastianbergmann", - "type": "github" - } - ], - "time": "2020-11-30T07:25:11+00:00" - }, - { - "name": "sebastian/version", - "version": "2.0.1", - "source": { - "type": "git", - "url": "https://github.com/sebastianbergmann/version.git", - "reference": "99732be0ddb3361e16ad77b68ba41efc8e979019" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/version/zipball/99732be0ddb3361e16ad77b68ba41efc8e979019", - "reference": "99732be0ddb3361e16ad77b68ba41efc8e979019", - "shasum": "" - }, - "require": { - "php": ">=5.6" - }, - "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": "Sebastian Bergmann", - "email": "sebastian@phpunit.de", - "role": "lead" - } - ], - "description": "Library that helps with managing the version number of Git-hosted PHP projects", - "homepage": "https://github.com/sebastianbergmann/version", - "support": { - "issues": "https://github.com/sebastianbergmann/version/issues", - "source": "https://github.com/sebastianbergmann/version/tree/master" - }, - "time": "2016-10-03T07:35:21+00:00" - }, { "name": "symfony/phpunit-bridge", "version": "v6.0.0", @@ -3678,56 +2669,6 @@ ], "time": "2021-11-29T15:32:57+00:00" }, - { - "name": "theseer/tokenizer", - "version": "1.2.1", - "source": { - "type": "git", - "url": "https://github.com/theseer/tokenizer.git", - "reference": "34a41e998c2183e22995f158c581e7b5e755ab9e" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/theseer/tokenizer/zipball/34a41e998c2183e22995f158c581e7b5e755ab9e", - "reference": "34a41e998c2183e22995f158c581e7b5e755ab9e", - "shasum": "" - }, - "require": { - "ext-dom": "*", - "ext-tokenizer": "*", - "ext-xmlwriter": "*", - "php": "^7.2 || ^8.0" - }, - "type": "library", - "autoload": { - "classmap": [ - "src/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause" - ], - "authors": [ - { - "name": "Arne Blankerts", - "email": "arne@blankerts.de", - "role": "Developer" - } - ], - "description": "A small library for converting tokenized PHP source code into XML and potentially other formats", - "support": { - "issues": "https://github.com/theseer/tokenizer/issues", - "source": "https://github.com/theseer/tokenizer/tree/1.2.1" - }, - "funding": [ - { - "url": "https://github.com/theseer", - "type": "github" - } - ], - "time": "2021-07-28T10:34:58+00:00" - }, { "name": "webmozart/assert", "version": "1.10.0", @@ -3799,5 +2740,5 @@ "platform-overrides": { "php": "7.2.5" }, - "plugin-api-version": "2.1.0" + "plugin-api-version": "2.3.0" } diff --git a/phpstan/config.neon b/phpstan/config.neon index 457123ae3..916cc915f 100644 --- a/phpstan/config.neon +++ b/phpstan/config.neon @@ -52,6 +52,7 @@ parameters: - '~Dynamic call to static method PHPUnit\\Framework\\TestCase::(once|at|exactly|will|exactly|returnValue|returnCallback|any|atLeastOnce|throwException|onConsecutiveCalls|never|returnValueMap)\(\)~' bootstrapFiles: + - ./locate-phpunit-autoloader.php - ../tests/bootstrap.php paths: diff --git a/phpstan/locate-phpunit-autoloader.php b/phpstan/locate-phpunit-autoloader.php new file mode 100644 index 000000000..ec8251bb7 --- /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'; From 095c36ecf857a99f77fad4e33423d54d5a00740b Mon Sep 17 00:00:00 2001 From: Jordi Boggiano Date: Thu, 9 Dec 2021 13:02:20 +0100 Subject: [PATCH 05/17] Fix some PHPStan errors/.. --- .github/workflows/continuous-integration.yml | 2 +- .github/workflows/phpstan.yml | 1 + src/Composer/Compiler.php | 4 +-- .../Installer/InstallationManager.php | 2 +- .../Test/Downloader/ZipDownloaderTest.php | 26 +++++++++---------- 5 files changed, 18 insertions(+), 17 deletions(-) diff --git a/.github/workflows/continuous-integration.yml b/.github/workflows/continuous-integration.yml index 4040da8c3..26a92fdb3 100644 --- a/.github/workflows/continuous-integration.yml +++ b/.github/workflows/continuous-integration.yml @@ -58,7 +58,7 @@ jobs: - php-version: "8.2" dependencies: highest-ignore os: ubuntu-latest - experimental: false + experimental: true steps: - name: "Checkout" diff --git a/.github/workflows/phpstan.yml b/.github/workflows/phpstan.yml index 0488fa089..a3c9dc084 100644 --- a/.github/workflows/phpstan.yml +++ b/.github/workflows/phpstan.yml @@ -23,6 +23,7 @@ jobs: php-version: - "7.2" - "8.1" + fail-fast: false steps: - name: "Checkout" diff --git a/src/Composer/Compiler.php b/src/Composer/Compiler.php index 622965076..9bb3e8543 100644 --- a/src/Composer/Compiler.php +++ b/src/Composer/Compiler.php @@ -174,10 +174,10 @@ 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)); + 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)); + 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 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/tests/Composer/Test/Downloader/ZipDownloaderTest.php b/tests/Composer/Test/Downloader/ZipDownloaderTest.php index 3885a33e6..eec37356a 100644 --- a/tests/Composer/Test/Downloader/ZipDownloaderTest.php +++ b/tests/Composer/Test/Downloader/ZipDownloaderTest.php @@ -114,7 +114,7 @@ class ZipDownloaderTest extends TestCase $this->setPrivateProperty('hasZipArchive', true); $downloader = new MockedZipDownloader($this->io, $this->config, $this->httpDownloader); - $zipArchive = $this->getMockBuilder('ZipArchive')->onlyMethods(['open', 'extractTo'])->getMock(); + $zipArchive = $this->getMockBuilder('ZipArchive')->getMock(); $zipArchive->expects($this->once()) ->method('open') ->will($this->returnValue(true)); @@ -137,10 +137,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 +158,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)); @@ -189,7 +189,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 +216,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 +246,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)); @@ -286,15 +286,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)); From ffd62795bc673bea61bf7773ea674085d0ddee2b Mon Sep 17 00:00:00 2001 From: Jordi Boggiano Date: Thu, 9 Dec 2021 17:09:07 +0100 Subject: [PATCH 06/17] Get rid of all the ->at() mock invocations --- composer.json | 8 +- composer.lock | 16 +- phpstan/locate-phpunit-autoloader.php | 2 +- phpunit.xml.dist | 1 - src/Composer/Util/Http/Response.php | 4 +- src/Composer/Util/Svn.php | 2 +- tests/Composer/Test/AllFunctionalTest.php | 3 +- tests/Composer/Test/ApplicationTest.php | 86 +++---- .../Test/Autoload/AutoloadGeneratorTest.php | 29 +-- tests/Composer/Test/CacheTest.php | 1 + .../Test/Config/JsonConfigSourceTest.php | 1 + .../Test/Downloader/DownloadManagerTest.php | 23 +- .../Test/Downloader/FileDownloaderTest.php | 28 +-- .../Test/Downloader/FossilDownloaderTest.php | 15 +- .../Test/Downloader/GitDownloaderTest.php | 60 ++--- .../Test/Downloader/HgDownloaderTest.php | 15 +- .../Downloader/PerforceDownloaderTest.php | 30 +-- .../Test/Downloader/XzDownloaderTest.php | 3 +- .../Test/Downloader/ZipDownloaderTest.php | 3 +- .../EventDispatcher/EventDispatcherTest.php | 56 ++--- tests/Composer/Test/IO/ConsoleIOTest.php | 40 ++-- .../Test/Installer/BinaryInstallerTest.php | 1 + .../Test/Installer/LibraryInstallerTest.php | 1 + .../SuggestedPackagesReporterTest.php | 80 +++---- tests/Composer/Test/InstallerTest.php | 3 +- .../Composer/Test/Mock/HttpDownloaderMock.php | 107 ++++++++- .../Test/Mock/ProcessExecutorMock.php | 22 +- .../Archiver/ArchivableFilesFinderTest.php | 1 + .../Test/Package/Archiver/ArchiverTest.php | 3 +- .../Package/Loader/RootPackageLoaderTest.php | 10 +- .../Package/Version/VersionGuesserTest.php | 56 ++--- .../Package/Version/VersionSelectorTest.php | 12 +- .../Test/Plugin/PluginInstallerTest.php | 1 + tests/Composer/Test/PolyfillTestCase.php | 137 ----------- .../Repository/ComposerRepositoryTest.php | 64 +++-- .../Test/Repository/RepositoryManagerTest.php | 3 +- .../Test/Repository/Vcs/FossilDriverTest.php | 3 +- .../Repository/Vcs/GitBitbucketDriverTest.php | 3 +- .../Test/Repository/Vcs/GitHubDriverTest.php | 136 ++++------- .../Test/Repository/Vcs/GitLabDriverTest.php | 168 +++++++------- .../Test/Repository/Vcs/HgDriverTest.php | 3 +- .../Repository/Vcs/PerforceDriverTest.php | 11 +- .../Test/Repository/Vcs/SvnDriverTest.php | 18 +- tests/Composer/Test/TestCase.php | 40 +++- tests/Composer/Test/Util/BitbucketTest.php | 8 +- tests/Composer/Test/Util/ErrorHandlerTest.php | 3 +- tests/Composer/Test/Util/FilesystemTest.php | 3 +- tests/Composer/Test/Util/GitHubTest.php | 41 +--- tests/Composer/Test/Util/GitLabTest.php | 48 ++-- tests/Composer/Test/Util/GitTest.php | 8 +- .../Test/Util/Http/ProxyHelperTest.php | 1 + .../Test/Util/Http/ProxyManagerTest.php | 1 + tests/Composer/Test/Util/PerforceTest.php | 219 ++++++++---------- .../Test/Util/RemoteFilesystemTest.php | 24 +- .../Test/Util/StreamContextFactoryTest.php | 1 + tests/complete.phpunit.xml | 1 - 56 files changed, 746 insertions(+), 921 deletions(-) delete mode 100644 tests/Composer/Test/PolyfillTestCase.php diff --git a/composer.json b/composer.json index f9e24e15b..3141e0ad8 100644 --- a/composer.json +++ b/composer.json @@ -21,9 +21,6 @@ "homepage": "https://seld.be" } ], - "_comment": [ - "symfony/polyfill-php73 sould be removed once https://github.com/symfony/symfony/pull/44523 is released and the symfony/console requirement bumped to match that release" - ], "require": { "php": "^7.2.5 || ^8.0", "composer/ca-bundle": "^1.0", @@ -35,13 +32,12 @@ "psr/log": "^1.0 || ^2.0", "seld/jsonlint": "^1.4", "seld/phar-utils": "^1.0", - "symfony/console": "^5.4 || ^6.0", + "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", - "symfony/polyfill-php73": "^1.9" + "composer/pcre": "^1.0" }, "require-dev": { "symfony/phpunit-bridge": "^6.0", diff --git a/composer.lock b/composer.lock index 5c34ed2ce..1ddfc319d 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": "21b7ce031989ab306ee91098fa461436", + "content-hash": "274d271909468b2a6c06b562724a1662", "packages": [ { "name": "composer/ca-bundle", @@ -780,23 +780,23 @@ }, { "name": "symfony/console", - "version": "v5.4.0", + "version": "v5.4.1", "source": { "type": "git", "url": "https://github.com/symfony/console.git", - "reference": "ec3661faca1d110d6c307e124b44f99ac54179e3" + "reference": "9130e1a0fc93cb0faadca4ee917171bd2ca9e5f4" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/console/zipball/ec3661faca1d110d6c307e124b44f99ac54179e3", - "reference": "ec3661faca1d110d6c307e124b44f99ac54179e3", + "url": "https://api.github.com/repos/symfony/console/zipball/9130e1a0fc93cb0faadca4ee917171bd2ca9e5f4", + "reference": "9130e1a0fc93cb0faadca4ee917171bd2ca9e5f4", "shasum": "" }, "require": { "php": ">=7.2.5", "symfony/deprecation-contracts": "^2.1|^3", "symfony/polyfill-mbstring": "~1.0", - "symfony/polyfill-php73": "^1.8", + "symfony/polyfill-php73": "^1.9", "symfony/polyfill-php80": "^1.16", "symfony/service-contracts": "^1.1|^2|^3", "symfony/string": "^5.1|^6.0" @@ -859,7 +859,7 @@ "terminal" ], "support": { - "source": "https://github.com/symfony/console/tree/v5.4.0" + "source": "https://github.com/symfony/console/tree/v5.4.1" }, "funding": [ { @@ -875,7 +875,7 @@ "type": "tidelift" } ], - "time": "2021-11-29T15:30:56+00:00" + "time": "2021-12-09T11:22:43+00:00" }, { "name": "symfony/deprecation-contracts", diff --git a/phpstan/locate-phpunit-autoloader.php b/phpstan/locate-phpunit-autoloader.php index ec8251bb7..93a179389 100644 --- a/phpstan/locate-phpunit-autoloader.php +++ b/phpstan/locate-phpunit-autoloader.php @@ -1,7 +1,7 @@ - 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/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/tests/Composer/Test/AllFunctionalTest.php b/tests/Composer/Test/AllFunctionalTest.php index bec795821..07fcbf7a6 100644 --- a/tests/Composer/Test/AllFunctionalTest.php +++ b/tests/Composer/Test/AllFunctionalTest.php @@ -38,8 +38,9 @@ class AllFunctionalTest extends TestCase chdir(__DIR__.'/Fixtures/functional'); } - public function tearDown(): void + protected function tearDown(): void { + parent::tearDown(); if ($this->oldcwd) { chdir($this->oldcwd); } diff --git a/tests/Composer/Test/ApplicationTest.php b/tests/Composer/Test/ApplicationTest.php index 59b6f1465..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(): void + 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 396477e7a..dc6561d70 100644 --- a/tests/Composer/Test/Autoload/AutoloadGeneratorTest.php +++ b/tests/Composer/Test/Autoload/AutoloadGeneratorTest.php @@ -150,6 +150,7 @@ class AutoloadGeneratorTest extends TestCase 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/'))); diff --git a/tests/Composer/Test/CacheTest.php b/tests/Composer/Test/CacheTest.php index 2429c303f..4d0ede656 100644 --- a/tests/Composer/Test/CacheTest.php +++ b/tests/Composer/Test/CacheTest.php @@ -55,6 +55,7 @@ class CacheTest extends TestCase protected function tearDown(): void { + parent::tearDown(); if (is_dir($this->root)) { $fs = new Filesystem; $fs->removeDirectory($this->root); diff --git a/tests/Composer/Test/Config/JsonConfigSourceTest.php b/tests/Composer/Test/Config/JsonConfigSourceTest.php index 1f725004f..3d9e68980 100644 --- a/tests/Composer/Test/Config/JsonConfigSourceTest.php +++ b/tests/Composer/Test/Config/JsonConfigSourceTest.php @@ -42,6 +42,7 @@ class JsonConfigSourceTest extends TestCase protected function tearDown(): void { + parent::tearDown(); if (is_dir($this->workingDir)) { $this->fs->removeDirectory($this->workingDir); } diff --git a/tests/Composer/Test/Downloader/DownloadManagerTest.php b/tests/Composer/Test/Downloader/DownloadManagerTest.php index eca909696..d2f03aa3f 100644 --- a/tests/Composer/Test/Downloader/DownloadManagerTest.php +++ b/tests/Composer/Test/Downloader/DownloadManagerTest.php @@ -254,13 +254,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 @@ -280,15 +279,13 @@ class DownloadManagerTest extends TestCase ->setMethods(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'); } diff --git a/tests/Composer/Test/Downloader/FileDownloaderTest.php b/tests/Composer/Test/Downloader/FileDownloaderTest.php index 047b2c8db..f8e617f0b 100644 --- a/tests/Composer/Test/Downloader/FileDownloaderTest.php +++ b/tests/Composer/Test/Downloader/FileDownloaderTest.php @@ -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 dd15eff91..db26b9d8c 100644 --- a/tests/Composer/Test/Downloader/FossilDownloaderTest.php +++ b/tests/Composer/Test/Downloader/FossilDownloaderTest.php @@ -29,6 +29,7 @@ class FossilDownloaderTest extends TestCase 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); @@ -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() @@ -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 e9629338c..442978080 100644 --- a/tests/Composer/Test/Downloader/GitDownloaderTest.php +++ b/tests/Composer/Test/Downloader/GitDownloaderTest.php @@ -39,6 +39,7 @@ class GitDownloaderTest extends TestCase 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); @@ -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)) { @@ -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 c36ec247b..decf69854 100644 --- a/tests/Composer/Test/Downloader/HgDownloaderTest.php +++ b/tests/Composer/Test/Downloader/HgDownloaderTest.php @@ -29,6 +29,7 @@ class HgDownloaderTest extends TestCase 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); @@ -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() @@ -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 a5c8e2e3f..6cdc76275 100644 --- a/tests/Composer/Test/Downloader/PerforceDownloaderTest.php +++ b/tests/Composer/Test/Downloader/PerforceDownloaderTest.php @@ -49,7 +49,7 @@ class PerforceDownloaderTest extends TestCase $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); @@ -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 7032004e1..ee9d48c10 100644 --- a/tests/Composer/Test/Downloader/XzDownloaderTest.php +++ b/tests/Composer/Test/Downloader/XzDownloaderTest.php @@ -39,8 +39,9 @@ class XzDownloaderTest extends TestCase $this->testDir = $this->getUniqueTmpDirectory(); } - public function tearDown(): void + protected function tearDown(): void { + 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 eec37356a..bd5b06c8b 100644 --- a/tests/Composer/Test/Downloader/ZipDownloaderTest.php +++ b/tests/Composer/Test/Downloader/ZipDownloaderTest.php @@ -42,8 +42,9 @@ class ZipDownloaderTest extends TestCase $this->package = $this->getMockBuilder('Composer\Package\PackageInterface')->getMock(); } - public function tearDown(): void + protected function tearDown(): void { + parent::tearDown(); $fs = new Filesystem; $fs->removeDirectory($this->testDir); $this->setPrivateProperty('hasZipArchive', null); diff --git a/tests/Composer/Test/EventDispatcher/EventDispatcherTest.php b/tests/Composer/Test/EventDispatcher/EventDispatcherTest.php index 9065c61ec..fc3c3df0b 100644 --- a/tests/Composer/Test/EventDispatcher/EventDispatcherTest.php +++ b/tests/Composer/Test/EventDispatcher/EventDispatcherTest.php @@ -38,17 +38,16 @@ class EventDispatcherTest extends TestCase '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); @@ -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') @@ -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', @@ -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,7 +264,7 @@ class EventDispatcherTest extends TestCase ->setConstructorArgs(array( $this->createComposerInstance(), $io = new BufferIO('', OutputInterface::VERBOSITY_VERBOSE), - new ProcessExecutorMock, + $this->getProcessExecutorMock(), )) ->setMethods(array( 'getListeners', @@ -302,7 +297,7 @@ class EventDispatcherTest extends TestCase $dispatcher = $this->getMockBuilder('Composer\EventDispatcher\EventDispatcher')->setConstructorArgs(array( $this->createComposerInstance(), $io = new BufferIO('', OutputInterface::VERBOSITY_VERBOSE), - new ProcessExecutorMock, + $this->getProcessExecutorMock(), ))->setMethods(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', @@ -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); @@ -452,8 +445,6 @@ class EventDispatcherTest extends TestCase "> hello: echo Hello " .$this->getCmd("'World'").PHP_EOL; $this->assertEquals($expected, $io->getOutput()); - - $process->assertComplete($this); } public function testDispatcherDetectInfiniteRecursion() @@ -464,7 +455,7 @@ class EventDispatcherTest extends TestCase ->setConstructorArgs(array( $composer = $this->createComposerInstance(), $io = $this->getMockBuilder('Composer\IO\IOInterface')->getMock(), - new ProcessExecutorMock, + $this->getProcessExecutorMock(), )) ->setMethods(array( 'getListeners', @@ -563,22 +554,21 @@ 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'); $dispatcher->dispatchScript(ScriptEvents::POST_INSTALL_CMD, false); } @@ -589,7 +579,7 @@ class EventDispatcherTest extends TestCase ->setConstructorArgs(array( $this->createComposerInstance(), $this->getMockBuilder('Composer\IO\IOInterface')->getMock(), - new ProcessExecutorMock, + $this->getProcessExecutorMock(), )) ->setMethods(array('getListeners')) ->getMock(); 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/Installer/BinaryInstallerTest.php b/tests/Composer/Test/Installer/BinaryInstallerTest.php index 2a15903ef..da7a8c477 100644 --- a/tests/Composer/Test/Installer/BinaryInstallerTest.php +++ b/tests/Composer/Test/Installer/BinaryInstallerTest.php @@ -62,6 +62,7 @@ class BinaryInstallerTest extends TestCase protected function tearDown(): void { + parent::tearDown(); $this->fs->removeDirectory($this->rootDir); } diff --git a/tests/Composer/Test/Installer/LibraryInstallerTest.php b/tests/Composer/Test/Installer/LibraryInstallerTest.php index 1e7f0ee17..6d0e1f5a9 100644 --- a/tests/Composer/Test/Installer/LibraryInstallerTest.php +++ b/tests/Composer/Test/Installer/LibraryInstallerTest.php @@ -98,6 +98,7 @@ class LibraryInstallerTest extends TestCase protected function tearDown(): void { + parent::tearDown(); $this->fs->removeDirectory($this->rootDir); } diff --git a/tests/Composer/Test/Installer/SuggestedPackagesReporterTest.php b/tests/Composer/Test/Installer/SuggestedPackagesReporterTest.php index beb4685eb..8416c1e75 100644 --- a/tests/Composer/Test/Installer/SuggestedPackagesReporterTest.php +++ b/tests/Composer/Test/Installer/SuggestedPackagesReporterTest.php @@ -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 8d15e0e5a..667aa9f96 100644 --- a/tests/Composer/Test/InstallerTest.php +++ b/tests/Composer/Test/InstallerTest.php @@ -56,8 +56,9 @@ class InstallerTest extends TestCase chdir(__DIR__); } - public function tearDown(): void + protected function tearDown(): void { + parent::tearDown(); Platform::clearEnv('COMPOSER_POOL_OPTIMIZER'); chdir($this->prevCwd); diff --git a/tests/Composer/Test/Mock/HttpDownloaderMock.php b/tests/Composer/Test/Mock/HttpDownloaderMock.php index b58a9628a..99ba2892e 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('return' => 0, 'stdout' => '', 'stderr' => '')): void { - $this->contentMap = $contentMap; + $default = ['url' => '', 'options' => null, 'status' => 200, 'body' => '', 'headers' => ['']]; + $this->expectations = array_map(function (array $expect) use ($default): array { + if ($diff = array_diff_key(array_merge($default, $expect), $default)) { + 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); + } + + 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..da54b3c3d 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); } 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 2cd274e11..ca77abb31 100644 --- a/tests/Composer/Test/Package/Archiver/ArchivableFilesFinderTest.php +++ b/tests/Composer/Test/Package/Archiver/ArchivableFilesFinderTest.php @@ -97,6 +97,7 @@ class ArchivableFilesFinderTest extends TestCase protected function tearDown(): void { + parent::tearDown(); $fs = new Filesystem; $fs->removeDirectory($this->sources); } diff --git a/tests/Composer/Test/Package/Archiver/ArchiverTest.php b/tests/Composer/Test/Package/Archiver/ArchiverTest.php index fa09813c6..9601fa1c6 100644 --- a/tests/Composer/Test/Package/Archiver/ArchiverTest.php +++ b/tests/Composer/Test/Package/Archiver/ArchiverTest.php @@ -41,8 +41,9 @@ abstract class ArchiverTest extends TestCase $this->testDir = $this->getUniqueTmpDirectory(); } - public function tearDown(): void + protected function tearDown(): void { + parent::tearDown(); $this->filesystem->removeDirectory($this->testDir); } diff --git a/tests/Composer/Test/Package/Loader/RootPackageLoaderTest.php b/tests/Composer/Test/Package/Loader/RootPackageLoaderTest.php index d523debc0..d99fcd110 100644 --- a/tests/Composer/Test/Package/Loader/RootPackageLoaderTest.php +++ b/tests/Composer/Test/Package/Loader/RootPackageLoaderTest.php @@ -81,7 +81,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()); @@ -121,7 +121,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 +136,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 +149,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 +163,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/Version/VersionGuesserTest.php b/tests/Composer/Test/Package/Version/VersionGuesserTest.php index 64e20fbd0..6bb2df0f9 100644 --- a/tests/Composer/Test/Package/Version/VersionGuesserTest.php +++ b/tests/Composer/Test/Package/Version/VersionGuesserTest.php @@ -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/Plugin/PluginInstallerTest.php b/tests/Composer/Test/Plugin/PluginInstallerTest.php index 9d526fd1f..a08f45daf 100644 --- a/tests/Composer/Test/Plugin/PluginInstallerTest.php +++ b/tests/Composer/Test/Plugin/PluginInstallerTest.php @@ -129,6 +129,7 @@ class PluginInstallerTest extends TestCase protected function tearDown(): void { + parent::tearDown(); $filesystem = new Filesystem(); $filesystem->removeDirectory($this->directory); } diff --git a/tests/Composer/Test/PolyfillTestCase.php b/tests/Composer/Test/PolyfillTestCase.php deleted file mode 100644 index da8aa3e99..000000000 --- a/tests/Composer/Test/PolyfillTestCase.php +++ /dev/null @@ -1,137 +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; - - if (method_exists('PHPUnit\Framework\TestCase', 'assertFileDoesNotExist')) { - 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 $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 assertIsNotWritable($filename, $message = '') - { - static::assertNotIsWritable($filename, $message); - } - - /** - * @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 assertDirectoryIsNotReadable($directory, $message = '') - { - static::assertDirectoryNotIsReadable($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 assertFileDoesNotExist($filename, $message = '') - { - static::assertFileNotExists($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 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); - } - } - } -} diff --git a/tests/Composer/Test/Repository/ComposerRepositoryTest.php b/tests/Composer/Test/Repository/ComposerRepositoryTest.php index d2f1ca8ed..49a1af387 100644 --- a/tests/Composer/Test/Repository/ComposerRepositoryTest.php +++ b/tests/Composer/Test/Repository/ComposerRepositoryTest.php @@ -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)); @@ -181,16 +181,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 +211,7 @@ class ComposerRepositoryTest extends TestCase public function testSearchWithAbandonedPackages() { $repoConfig = array( - 'url' => 'http://2.example.org', + 'url' => 'http://example.org', ); $result = array( @@ -223,15 +229,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 +326,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/RepositoryManagerTest.php b/tests/Composer/Test/Repository/RepositoryManagerTest.php index 6a7df6be8..59f23dff1 100644 --- a/tests/Composer/Test/Repository/RepositoryManagerTest.php +++ b/tests/Composer/Test/Repository/RepositoryManagerTest.php @@ -26,8 +26,9 @@ class RepositoryManagerTest extends TestCase $this->tmpdir = $this->getUniqueTmpDirectory(); } - public function tearDown(): void + protected function tearDown(): void { + parent::tearDown(); if (is_dir($this->tmpdir)) { $fs = new Filesystem(); $fs->removeDirectory($this->tmpdir); diff --git a/tests/Composer/Test/Repository/Vcs/FossilDriverTest.php b/tests/Composer/Test/Repository/Vcs/FossilDriverTest.php index 462047a7b..06c6bd5b6 100644 --- a/tests/Composer/Test/Repository/Vcs/FossilDriverTest.php +++ b/tests/Composer/Test/Repository/Vcs/FossilDriverTest.php @@ -39,8 +39,9 @@ class FossilDriverTest extends TestCase )); } - public function tearDown(): void + 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 1e1116107..50e89f52b 100644 --- a/tests/Composer/Test/Repository/Vcs/GitBitbucketDriverTest.php +++ b/tests/Composer/Test/Repository/Vcs/GitBitbucketDriverTest.php @@ -51,8 +51,9 @@ class GitBitbucketDriverTest extends TestCase ->getMock(); } - public function tearDown(): void + protected function tearDown(): void { + parent::tearDown(); $fs = new Filesystem; $fs->removeDirectory($this->home); } diff --git a/tests/Composer/Test/Repository/Vcs/GitHubDriverTest.php b/tests/Composer/Test/Repository/Vcs/GitHubDriverTest.php index 6e3728a7a..efafa0626 100644 --- a/tests/Composer/Test/Repository/Vcs/GitHubDriverTest.php +++ b/tests/Composer/Test/Repository/Vcs/GitHubDriverTest.php @@ -39,8 +39,9 @@ class GitHubDriverTest extends TestCase )); } - public function tearDown(): void + 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 4b832030f..696d0b8f5 100644 --- a/tests/Composer/Test/Repository/Vcs/GitLabDriverTest.php +++ b/tests/Composer/Test/Repository/Vcs/GitLabDriverTest.php @@ -12,10 +12,14 @@ namespace Composer\Test\Repository\Vcs; +use Composer\IO\IOInterface; 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,15 +37,15 @@ 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; @@ -61,13 +65,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(): void + protected function tearDown(): void { + parent::tearDown(); $fs = new Filesystem(); $fs->removeDirectory($this->home); } @@ -108,11 +113,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 +154,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 +194,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 +235,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 +318,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 +337,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( @@ -359,20 +367,23 @@ JSON; $branchData = json_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 +421,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 +446,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 +494,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 +526,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 +558,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 +592,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 +628,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 93c10f27e..68b9c9e65 100644 --- a/tests/Composer/Test/Repository/Vcs/HgDriverTest.php +++ b/tests/Composer/Test/Repository/Vcs/HgDriverTest.php @@ -38,8 +38,9 @@ class HgDriverTest extends TestCase )); } - public function tearDown(): void + 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 df810bcee..a918b7ff9 100644 --- a/tests/Composer/Test/Repository/Vcs/PerforceDriverTest.php +++ b/tests/Composer/Test/Repository/Vcs/PerforceDriverTest.php @@ -71,7 +71,7 @@ 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); @@ -80,6 +80,7 @@ class PerforceDriverTest extends TestCase 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 e67e275fe..440d2e35a 100644 --- a/tests/Composer/Test/Repository/Vcs/SvnDriverTest.php +++ b/tests/Composer/Test/Repository/Vcs/SvnDriverTest.php @@ -40,15 +40,16 @@ class SvnDriverTest extends TestCase )); } - public function tearDown(): void + protected function tearDown(): void { + parent::tearDown(); $fs = new Filesystem(); $fs->removeDirectory($this->home); } public function testWrongCredentialsInUrl() { - $this->setExpectedException('RuntimeException'); + $this->setExpectedException('RuntimeException', "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 +58,15 @@ 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(); $process->expects(array( - 'svn --version', - array('cmd' => '', 'return' => 1, 'stderr' => $output), + array('cmd' => "svn ls --verbose --non-interactive --username 'till' --password 'secret' -- 'https://till:secret@corp.svn.local/repo/trunk'", 'return' => 1, 'stderr' => $output), + array('cmd' => "svn ls --verbose --non-interactive --username 'till' --password 'secret' -- 'https://till:secret@corp.svn.local/repo/trunk'", 'return' => 1, 'stderr' => $output), + array('cmd' => "svn ls --verbose --non-interactive --username 'till' --password 'secret' -- 'https://till:secret@corp.svn.local/repo/trunk'", 'return' => 1, 'stderr' => $output), + array('cmd' => "svn ls --verbose --non-interactive --username 'till' --password 'secret' -- 'https://till:secret@corp.svn.local/repo/trunk'", 'return' => 1, 'stderr' => $output), + array('cmd' => "svn ls --verbose --non-interactive --username 'till' --password 'secret' -- 'https://till:secret@corp.svn.local/repo/trunk'", 'return' => 1, 'stderr' => $output), + array('cmd' => "svn ls --verbose --non-interactive --username 'till' --password 'secret' -- 'https://till:secret@corp.svn.local/repo/trunk'", 'return' => 1, 'stderr' => $output), + array('cmd' => 'svn --version', 'return' => 0, 'stdout' => '1.2.3'), ), true); $repoConfig = array( @@ -69,8 +75,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/TestCase.php b/tests/Composer/Test/TestCase.php index 5255b5066..8640a946a 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 */ @@ -226,4 +250,18 @@ 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; + } } diff --git a/tests/Composer/Test/Util/BitbucketTest.php b/tests/Composer/Test/Util/BitbucketTest.php index eece02ab5..4f40f6ed2 100644 --- a/tests/Composer/Test/Util/BitbucketTest.php +++ b/tests/Composer/Test/Util/BitbucketTest.php @@ -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 45bb198de..8e082ecb4 100644 --- a/tests/Composer/Test/Util/ErrorHandlerTest.php +++ b/tests/Composer/Test/Util/ErrorHandlerTest.php @@ -25,8 +25,9 @@ class ErrorHandlerTest extends TestCase ErrorHandler::register(); } - public function tearDown(): void + protected function tearDown(): void { + parent::tearDown(); restore_error_handler(); } diff --git a/tests/Composer/Test/Util/FilesystemTest.php b/tests/Composer/Test/Util/FilesystemTest.php index fa514cfae..6123b95f7 100644 --- a/tests/Composer/Test/Util/FilesystemTest.php +++ b/tests/Composer/Test/Util/FilesystemTest.php @@ -39,8 +39,9 @@ class FilesystemTest extends TestCase $this->testFile = $this->getUniqueTmpDirectory() . '/composer_test_file'; } - public function tearDown(): void + protected function tearDown(): void { + parent::tearDown(); if (is_dir($this->workingDir)) { $this->fs->removeDirectory($this->workingDir); } 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..cd2a85dad 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 @@ -95,12 +91,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 +136,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 279a15af9..8b7b90770 100644 --- a/tests/Composer/Test/Util/GitTest.php +++ b/tests/Composer/Test/Util/GitTest.php @@ -36,7 +36,7 @@ class GitTest extends TestCase { $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() @@ -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 41ff3fe45..e8c00a827 100644 --- a/tests/Composer/Test/Util/Http/ProxyHelperTest.php +++ b/tests/Composer/Test/Util/Http/ProxyHelperTest.php @@ -32,6 +32,7 @@ class ProxyHelperTest extends TestCase protected function tearDown(): void { + parent::tearDown(); unset( $_SERVER['HTTP_PROXY'], $_SERVER['http_proxy'], diff --git a/tests/Composer/Test/Util/Http/ProxyManagerTest.php b/tests/Composer/Test/Util/Http/ProxyManagerTest.php index 6cb5d6bf2..84365aa9b 100644 --- a/tests/Composer/Test/Util/Http/ProxyManagerTest.php +++ b/tests/Composer/Test/Util/Http/ProxyManagerTest.php @@ -33,6 +33,7 @@ class ProxyManagerTest extends TestCase protected function tearDown(): void { + parent::tearDown(); unset( $_SERVER['HTTP_PROXY'], $_SERVER['http_proxy'], diff --git a/tests/Composer/Test/Util/PerforceTest.php b/tests/Composer/Test/Util/PerforceTest.php index 3f23024df..223747301 100644 --- a/tests/Composer/Test/Util/PerforceTest.php +++ b/tests/Composer/Test/Util/PerforceTest.php @@ -12,6 +12,7 @@ namespace Composer\Test\Util; +use Composer\Json\JsonFile; use Composer\Util\Perforce; use Composer\Test\TestCase; use Composer\Util\ProcessExecutor; @@ -153,10 +154,9 @@ class PerforceTest extends TestCase return true; }; - $this->processExecutor->expects($this->at(0)) - ->method('execute') + $this->processExecutor->method('execute') ->with($this->equalTo($expectedCommand)) - ->will($this->returnCallback($callback)); + ->willReturnCallback($callback); $this->perforce->queryP4user(); $this->assertEquals('TEST_P4VARIABLE_USER', $this->perforce->getUser()); } @@ -171,10 +171,9 @@ class PerforceTest extends TestCase return true; }; - $this->processExecutor->expects($this->at(0)) - ->method('execute') + $this->processExecutor->method('execute') ->with($this->equalTo($expectedCommand)) - ->will($this->returnCallback($callback)); + ->willReturnCallback($callback); $this->perforce->queryP4user(); $this->assertEquals('TEST_P4VARIABLE_USER', $this->perforce->getUser()); } @@ -183,10 +182,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 +195,16 @@ 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)) + ->willReturn('TEST_QUERY_USER'); + $this->processExecutor->expects($this->exactly(2)) ->method('execute') - ->with($this->equalTo($expectedCommand)) - ->will($this->returnValue(0)); + ->willReturnMap([ + ['p4 set', 0], + [$expectedCommand, 0], + ]); $this->perforce->queryP4user(); } @@ -214,14 +214,16 @@ 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)) + ->willReturn('TEST_QUERY_USER'); + $this->processExecutor->expects($this->exactly(2)) ->method('execute') - ->with($this->equalTo($expectedCommand)) - ->will($this->returnValue(0)); + ->willReturnMap([ + ['echo $P4USER', 0], + $expectedCommand => 0, + ]); $this->perforce->queryP4user(); } @@ -247,10 +249,9 @@ class PerforceTest extends TestCase return true; }; - $this->processExecutor->expects($this->at(0)) - ->method('execute') + $this->processExecutor->method('execute') ->with($this->equalTo($expectedCommand)) - ->will($this->returnCallback($callback)); + ->willReturnCallback($callback); $password = $this->perforce->queryP4Password(); $this->assertEquals('TEST_P4VARIABLE_PASSWORD', $password); } @@ -264,10 +265,9 @@ class PerforceTest extends TestCase return true; }; - $this->processExecutor->expects($this->at(0)) - ->method('execute') + $this->processExecutor->method('execute') ->with($this->equalTo($expectedCommand)) - ->will($this->returnCallback($callback)); + ->willReturnCallback($callback); $password = $this->perforce->queryP4Password(); $this->assertEquals('TEST_P4VARIABLE_PASSWORD', $password); @@ -276,10 +276,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); @@ -329,10 +329,10 @@ class PerforceTest extends TestCase public function testIsLoggedIn() { $expectedCommand = 'p4 -u user -p port login -s'; - $this->processExecutor->expects($this->at(0)) + $this->processExecutor->expects($this->once()) ->method('execute') ->with($this->equalTo($expectedCommand), $this->equalTo(null)) - ->will($this->returnValue(0)); + ->willReturn(0); $this->perforce->isLoggedIn(); } @@ -340,10 +340,10 @@ class PerforceTest extends TestCase 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)) + $this->processExecutor->expects($this->once()) ->method('execute') ->with($this->equalTo($expectedCommand), $this->equalTo(null)) - ->will($this->returnValue(0)); + ->willReturn(0); $this->perforce->connectClient(); } @@ -352,29 +352,26 @@ 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)) + $expectations = [ + ['p4 -u user -c composer_perforce_TEST_depot_branch -p port streams '.ProcessExecutor::escape('//depot/...'), 'Stream //depot/branch mainline none \'branch\'' . PHP_EOL], + ['p4 -u user -p port changes '.ProcessExecutor::escape('//depot/branch/...'), 'Change 1234 on 2014/03/19 by Clark.Stuth@Clark.Stuth_test_client \'test changelist\''], + ]; + $count = 0; + $this->processExecutor->expects($this->exactly(2)) ->method('execute') - ->with($this->equalTo($expectedCommand)) ->will( $this->returnCallback( - function ($command, &$output) { - $output = 'Stream //depot/branch mainline none \'branch\'' . PHP_EOL; + function ($command, &$output) use ($expectations, &$count) { + $index = $count++; + if ($command !== $expectations[$index][0]) { + throw new \InvalidArgumentException('Expected '.$expectations[$index][0].' and got '.$command); + } + $output = $expectations[$index][1]; - return true; + return 0; } ) ); - $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)); $branches = $this->perforce->getBranches(); $this->assertEquals('//depot/branch@1234', $branches['master']); @@ -391,7 +388,7 @@ class PerforceTest extends TestCase $this->processExecutor->expects($this->once()) ->method('execute') ->with($this->equalTo($expectedCommand)) - ->will($this->returnCallback($expectedCallback)); + ->willReturnCallback($expectedCallback); $branches = $this->perforce->getBranches(); $this->assertEquals('//depot@5678', $branches['master']); } @@ -399,7 +396,7 @@ class PerforceTest extends TestCase public function testGetTagsWithoutStream() { $expectedCommand = 'p4 -u user -c composer_perforce_TEST_depot -p port labels'; - $this->processExecutor->expects($this->at(0)) + $this->processExecutor->expects($this->once()) ->method('execute') ->with($this->equalTo($expectedCommand)) ->will( @@ -422,7 +419,7 @@ 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)) + $this->processExecutor->expects($this->once()) ->method('execute') ->with($this->equalTo($expectedCommand)) ->will( @@ -467,7 +464,7 @@ 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)) + $this->processExecutor->expects($this->once()) ->method('execute') ->with($this->equalTo($expectedCommand)) ->will( @@ -492,30 +489,23 @@ 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)) + $expectations = [ + ['p4 -u user -p port files '.ProcessExecutor::escape('//depot/composer.json@0.0.1'), '//depot/composer.json#1 - branch change 10001 (text)'], + ['p4 -u user -c composer_perforce_TEST_depot -p port print '.ProcessExecutor::escape('//depot/composer.json@10001'), PerforceTest::getComposerJson()], + ]; + $count = 0; + $this->processExecutor->expects($this->exactly(2)) ->method('execute') - ->with($this->equalTo($expectedCommand)) ->will( $this->returnCallback( - function ($command, &$output) { - $output = '//depot/composer.json#1 - branch change 10001 (text)'; + function ($command, &$output) use ($expectations, &$count) { + $index = $count++; + if ($command !== $expectations[$index][0]) { + throw new \InvalidArgumentException('Expected '.$expectations[$index][0].' and got '.$command); + } + $output = $expectations[$index][1]; - 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; + return 0; } ) ); @@ -536,7 +526,7 @@ 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)) + $this->processExecutor->expects($this->once()) ->method('execute') ->with($this->equalTo($expectedCommand)) ->will( @@ -562,34 +552,28 @@ class PerforceTest extends TestCase public function testGetComposerInformationWithLabelWithStream() { + $expectations = [ + [ 'p4 -u user -p port files '.ProcessExecutor::escape('//depot/branch/composer.json@0.0.1'), '//depot/composer.json#1 - branch change 10001 (text)'], + ['p4 -u user -c composer_perforce_TEST_depot_branch -p port print '.ProcessExecutor::escape('//depot/branch/composer.json@10001'), PerforceTest::getComposerJson()], + ]; + $count = 0; + $this->processExecutor->expects($this->exactly(2)) + ->method('execute') + ->will( + $this->returnCallback( + function ($command, &$output) use ($expectations, &$count) { + $index = $count++; + if ($command !== $expectations[$index][0]) { + throw new \InvalidArgumentException('Expected '.$expectations[$index][0].' and got '.$command); + } + $output = $expectations[$index][1]; + + return 0; + } + ) + ); + $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'); @@ -605,10 +589,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)) + $this->processExecutor->expects($this->once()) ->method('execute') ->with($this->equalTo($expectedCommand), $this->equalTo(null)) - ->will($this->returnValue(0)); + ->willReturn(0); $this->perforce->syncCodeBase('label'); } @@ -617,10 +601,10 @@ class PerforceTest extends TestCase { $this->setPerforceToStream(); $expectedCommand = 'p4 -u user -c composer_perforce_TEST_depot_branch -p port sync -f @label'; - $this->processExecutor->expects($this->at(0)) + $this->processExecutor->expects($this->once()) ->method('execute') ->with($this->equalTo($expectedCommand)) - ->will($this->returnValue(0)); + ->willReturn(0); $this->perforce->syncCodeBase('label'); } @@ -630,10 +614,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(0)); + ->willReturn(0); $result = $this->perforce->checkServerExists('perforce.does.exist:port', $processExecutor); $this->assertTrue($result); @@ -651,10 +635,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 +649,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); } /** diff --git a/tests/Composer/Test/Util/RemoteFilesystemTest.php b/tests/Composer/Test/Util/RemoteFilesystemTest.php index 4233dc948..1fd35cffd 100644 --- a/tests/Composer/Test/Util/RemoteFilesystemTest.php +++ b/tests/Composer/Test/Util/RemoteFilesystemTest.php @@ -206,20 +206,19 @@ 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'); - $fs->expects($this->at(1)) - ->method('getRemoteContents') - ->willReturnCallback(function ($originUrl, $fileUrl, $ctx, &$http_response_header) { - $http_response_header = array('http/1.1 200 OK'); - - return 'expects($this->at(1)) - ->method('getAuthentication') + ->method('getAuthentication') ->with('bitbucket.org') ->willReturn(array( 'username' => 'x-token-auth', diff --git a/tests/Composer/Test/Util/StreamContextFactoryTest.php b/tests/Composer/Test/Util/StreamContextFactoryTest.php index d17b9b7cc..4a4c8b50c 100644 --- a/tests/Composer/Test/Util/StreamContextFactoryTest.php +++ b/tests/Composer/Test/Util/StreamContextFactoryTest.php @@ -26,6 +26,7 @@ class StreamContextFactoryTest extends TestCase 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(); } 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 @@ > - From 32dcb93f244a8fe3ca9fd4c90ad5ef6e7a8b3cb7 Mon Sep 17 00:00:00 2001 From: Jordi Boggiano Date: Thu, 9 Dec 2021 20:40:12 +0100 Subject: [PATCH 07/17] Update extra files for latest polyfill lib --- src/Composer/Compiler.php | 19 ++++++++++++------- 1 file changed, 12 insertions(+), 7 deletions(-) diff --git a/src/Composer/Compiler.php b/src/Composer/Compiler.php index 9bb3e8543..942d81199 100644 --- a/src/Composer/Compiler.php +++ b/src/Composer/Compiler.php @@ -150,13 +150,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) { From 6ed3aeb343fe1c83af7d9a3b3c6f4e49f756ce27 Mon Sep 17 00:00:00 2001 From: Jordi Boggiano Date: Thu, 9 Dec 2021 20:55:26 +0100 Subject: [PATCH 08/17] Remove setExpectedException wrapper --- .../Test/Autoload/ClassMapGeneratorTest.php | 6 ++++-- .../Composer/Test/Command/InitCommandTest.php | 4 ++-- tests/Composer/Test/ConfigTest.php | 6 ++---- .../Test/DependencyResolver/RuleSetTest.php | 2 +- .../Test/DependencyResolver/SolverTest.php | 6 +++--- .../Test/Downloader/DownloadManagerTest.php | 12 +++++------ .../Test/Downloader/FileDownloaderTest.php | 2 +- .../Test/Downloader/FossilDownloaderTest.php | 4 ++-- .../Test/Downloader/GitDownloaderTest.php | 4 ++-- .../Test/Downloader/HgDownloaderTest.php | 4 ++-- .../Test/Downloader/ZipDownloaderTest.php | 12 +++++++---- .../EventDispatcher/EventDispatcherTest.php | 6 +++--- .../PlatformRequirementFilterFactoryTest.php | 3 ++- tests/Composer/Test/IO/BufferIOTest.php | 3 ++- tests/Composer/Test/InstalledVersionsTest.php | 2 +- .../Installer/InstallationManagerTest.php | 2 +- .../Test/Installer/LibraryInstallerTest.php | 4 ++-- .../Installer/MetapackageInstallerTest.php | 4 ++-- tests/Composer/Test/InstallerTest.php | 5 +++-- .../Package/Archiver/ArchiveManagerTest.php | 2 +- .../Composer/Test/Package/BasePackageTest.php | 2 +- tests/Composer/Test/Package/LockerTest.php | 4 ++-- .../Test/Plugin/PluginInstallerTest.php | 4 ++-- .../StrictConfirmationQuestionTest.php | 3 ++- .../Repository/FilesystemRepositoryTest.php | 2 +- .../Repository/InstalledRepositoryTest.php | 2 +- .../Test/Repository/PathRepositoryTest.php | 2 +- .../Test/Repository/RepositoryManagerTest.php | 4 ++-- .../Repository/Vcs/GitBitbucketDriverTest.php | 6 ++---- .../Test/Repository/Vcs/SvnDriverTest.php | 3 ++- tests/Composer/Test/TestCase.php | 21 ------------------- tests/Composer/Test/Util/AuthHelperTest.php | 2 +- tests/Composer/Test/Util/BitbucketTest.php | 2 +- tests/Composer/Test/Util/ErrorHandlerTest.php | 12 +++++++---- tests/Composer/Test/Util/FilesystemTest.php | 3 ++- tests/Composer/Test/Util/GitLabTest.php | 3 ++- tests/Composer/Test/Util/GitTest.php | 2 +- .../Test/Util/Http/ProxyHelperTest.php | 2 +- .../Test/Util/Http/ProxyManagerTest.php | 2 +- .../Test/Util/RemoteFilesystemTest.php | 2 +- tests/Composer/Test/Util/SilencerTest.php | 3 ++- .../Test/Util/StreamContextFactoryTest.php | 2 +- tests/Composer/Test/Util/TarTest.php | 6 +++--- tests/Composer/Test/Util/ZipTest.php | 12 +++++++---- 44 files changed, 98 insertions(+), 101 deletions(-) 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/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/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/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 f62d5230f..e6e51c2fb 100644 --- a/tests/Composer/Test/DependencyResolver/SolverTest.php +++ b/tests/Composer/Test/DependencyResolver/SolverTest.php @@ -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/Downloader/DownloadManagerTest.php b/tests/Composer/Test/Downloader/DownloadManagerTest.php index d2f03aa3f..345a74b76 100644 --- a/tests/Composer/Test/Downloader/DownloadManagerTest.php +++ b/tests/Composer/Test/Downloader/DownloadManagerTest.php @@ -37,7 +37,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 +51,7 @@ class DownloadManagerTest extends TestCase $manager = new DownloadManager($this->io, false, $this->filesystem); - $this->setExpectedException('InvalidArgumentException'); + self::expectException('InvalidArgumentException'); $manager->getDownloaderForPackage($package); } @@ -117,7 +117,7 @@ class DownloadManagerTest extends TestCase ->with('git') ->will($this->returnValue($downloader)); - $this->setExpectedException('LogicException'); + self::expectException('LogicException'); $manager->getDownloaderForPackage($package); } @@ -183,7 +183,7 @@ class DownloadManagerTest extends TestCase ->with('pear') ->will($this->returnValue($downloader)); - $this->setExpectedException('LogicException'); + self::expectException('LogicException'); $manager->getDownloaderForPackage($package); } @@ -304,7 +304,7 @@ class DownloadManagerTest extends TestCase $manager = new DownloadManager($this->io, false, $this->filesystem); - $this->setExpectedException('InvalidArgumentException'); + self::expectException('InvalidArgumentException'); $manager->download($package, 'target_dir'); } @@ -536,7 +536,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'); } diff --git a/tests/Composer/Test/Downloader/FileDownloaderTest.php b/tests/Composer/Test/Downloader/FileDownloaderTest.php index f8e617f0b..0cd7856f6 100644 --- a/tests/Composer/Test/Downloader/FileDownloaderTest.php +++ b/tests/Composer/Test/Downloader/FileDownloaderTest.php @@ -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'); diff --git a/tests/Composer/Test/Downloader/FossilDownloaderTest.php b/tests/Composer/Test/Downloader/FossilDownloaderTest.php index db26b9d8c..da9b04c5d 100644 --- a/tests/Composer/Test/Downloader/FossilDownloaderTest.php +++ b/tests/Composer/Test/Downloader/FossilDownloaderTest.php @@ -60,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'); @@ -95,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); diff --git a/tests/Composer/Test/Downloader/GitDownloaderTest.php b/tests/Composer/Test/Downloader/GitDownloaderTest.php index 442978080..d5494564d 100644 --- a/tests/Composer/Test/Downloader/GitDownloaderTest.php +++ b/tests/Composer/Test/Downloader/GitDownloaderTest.php @@ -100,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'); @@ -322,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); diff --git a/tests/Composer/Test/Downloader/HgDownloaderTest.php b/tests/Composer/Test/Downloader/HgDownloaderTest.php index decf69854..dbe816bd2 100644 --- a/tests/Composer/Test/Downloader/HgDownloaderTest.php +++ b/tests/Composer/Test/Downloader/HgDownloaderTest.php @@ -60,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'); @@ -94,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); diff --git a/tests/Composer/Test/Downloader/ZipDownloaderTest.php b/tests/Composer/Test/Downloader/ZipDownloaderTest.php index bd5b06c8b..8ecb2719f 100644 --- a/tests/Composer/Test/Downloader/ZipDownloaderTest.php +++ b/tests/Composer/Test/Downloader/ZipDownloaderTest.php @@ -108,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'); } @@ -130,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'); } @@ -173,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'))); @@ -267,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'); } diff --git a/tests/Composer/Test/EventDispatcher/EventDispatcherTest.php b/tests/Composer/Test/EventDispatcher/EventDispatcherTest.php index fc3c3df0b..78d1fdd91 100644 --- a/tests/Composer/Test/EventDispatcher/EventDispatcherTest.php +++ b/tests/Composer/Test/EventDispatcher/EventDispatcherTest.php @@ -31,7 +31,7 @@ class EventDispatcherTest extends TestCase { public function testListenerExceptionsAreCaught() { - $this->setExpectedException('RuntimeException'); + self::expectException('RuntimeException'); $io = $this->getMockBuilder('Composer\IO\IOInterface')->getMock(); $dispatcher = $this->getDispatcherStubForListenersTest(array( @@ -449,7 +449,7 @@ class EventDispatcherTest extends TestCase public function testDispatcherDetectInfiniteRecursion() { - $this->setExpectedException('RuntimeException'); + self::expectException('RuntimeException'); $dispatcher = $this->getMockBuilder('Composer\EventDispatcher\EventDispatcher') ->setConstructorArgs(array( @@ -569,7 +569,7 @@ class EventDispatcherTest extends TestCase ->method('isInteractive') ->willReturn(1); - $this->setExpectedException('RuntimeException'); + self::expectException('RuntimeException'); $dispatcher->dispatchScript(ScriptEvents::POST_INSTALL_CMD, false); } 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/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/InstalledVersionsTest.php b/tests/Composer/Test/InstalledVersionsTest.php index b0317e6c4..e5ead9f65 100644 --- a/tests/Composer/Test/InstalledVersionsTest.php +++ b/tests/Composer/Test/InstalledVersionsTest.php @@ -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/InstallationManagerTest.php b/tests/Composer/Test/Installer/InstallationManagerTest.php index ba4c07071..4fe32e989 100644 --- a/tests/Composer/Test/Installer/InstallationManagerTest.php +++ b/tests/Composer/Test/Installer/InstallationManagerTest.php @@ -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'); } diff --git a/tests/Composer/Test/Installer/LibraryInstallerTest.php b/tests/Composer/Test/Installer/LibraryInstallerTest.php index 6d0e1f5a9..a302c0b90 100644 --- a/tests/Composer/Test/Installer/LibraryInstallerTest.php +++ b/tests/Composer/Test/Installer/LibraryInstallerTest.php @@ -223,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); } @@ -260,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 6972519e5..e66bf28d3 100644 --- a/tests/Composer/Test/Installer/MetapackageInstallerTest.php +++ b/tests/Composer/Test/Installer/MetapackageInstallerTest.php @@ -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/InstallerTest.php b/tests/Composer/Test/InstallerTest.php index 667aa9f96..e6f4eb677 100644 --- a/tests/Composer/Test/InstallerTest.php +++ b/tests/Composer/Test/InstallerTest.php @@ -302,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) @@ -319,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 diff --git a/tests/Composer/Test/Package/Archiver/ArchiveManagerTest.php b/tests/Composer/Test/Package/Archiver/ArchiveManagerTest.php index d54bb3339..9d1aff56e 100644 --- a/tests/Composer/Test/Package/Archiver/ArchiveManagerTest.php +++ b/tests/Composer/Test/Package/Archiver/ArchiveManagerTest.php @@ -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/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/LockerTest.php b/tests/Composer/Test/Package/LockerTest.php index bf8957bbe..ea7d96750 100644 --- a/tests/Composer/Test/Package/LockerTest.php +++ b/tests/Composer/Test/Package/LockerTest.php @@ -53,7 +53,7 @@ class LockerTest extends TestCase ->method('exists') ->will($this->returnValue(false)); - $this->setExpectedException('LogicException'); + self::expectException('LogicException'); $locker->getLockedRepository(); } @@ -170,7 +170,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()); } diff --git a/tests/Composer/Test/Plugin/PluginInstallerTest.php b/tests/Composer/Test/Plugin/PluginInstallerTest.php index a08f45daf..1ef0a6047 100644 --- a/tests/Composer/Test/Plugin/PluginInstallerTest.php +++ b/tests/Composer/Test/Plugin/PluginInstallerTest.php @@ -432,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/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/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/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/RepositoryManagerTest.php b/tests/Composer/Test/Repository/RepositoryManagerTest.php index 59f23dff1..e89a36599 100644 --- a/tests/Composer/Test/Repository/RepositoryManagerTest.php +++ b/tests/Composer/Test/Repository/RepositoryManagerTest.php @@ -57,12 +57,12 @@ 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) { if ($exception) { - $this->setExpectedException($exception); + self::expectException($exception); } $rm = new RepositoryManager( diff --git a/tests/Composer/Test/Repository/Vcs/GitBitbucketDriverTest.php b/tests/Composer/Test/Repository/Vcs/GitBitbucketDriverTest.php index 50e89f52b..a8ee520f0 100644 --- a/tests/Composer/Test/Repository/Vcs/GitBitbucketDriverTest.php +++ b/tests/Composer/Test/Repository/Vcs/GitBitbucketDriverTest.php @@ -81,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/SvnDriverTest.php b/tests/Composer/Test/Repository/Vcs/SvnDriverTest.php index 440d2e35a..84e3df046 100644 --- a/tests/Composer/Test/Repository/Vcs/SvnDriverTest.php +++ b/tests/Composer/Test/Repository/Vcs/SvnDriverTest.php @@ -49,7 +49,8 @@ class SvnDriverTest extends TestCase public function testWrongCredentialsInUrl() { - $this->setExpectedException('RuntimeException', "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/))"); + 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(); diff --git a/tests/Composer/Test/TestCase.php b/tests/Composer/Test/TestCase.php index 8640a946a..a815f5446 100644 --- a/tests/Composer/Test/TestCase.php +++ b/tests/Composer/Test/TestCase.php @@ -209,27 +209,6 @@ abstract class TestCase extends \PHPUnit\Framework\TestCase } } - /** - * @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. * diff --git a/tests/Composer/Test/Util/AuthHelperTest.php b/tests/Composer/Test/Util/AuthHelperTest.php index 0129868eb..a65d022c1 100644 --- a/tests/Composer/Test/Util/AuthHelperTest.php +++ b/tests/Composer/Test/Util/AuthHelperTest.php @@ -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 4f40f6ed2..e7fbf4eed 100644 --- a/tests/Composer/Test/Util/BitbucketTest.php +++ b/tests/Composer/Test/Util/BitbucketTest.php @@ -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') diff --git a/tests/Composer/Test/Util/ErrorHandlerTest.php b/tests/Composer/Test/Util/ErrorHandlerTest.php index 8e082ecb4..6dc0c8ec6 100644 --- a/tests/Composer/Test/Util/ErrorHandlerTest.php +++ b/tests/Composer/Test/Util/ErrorHandlerTest.php @@ -37,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'); @@ -53,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 6123b95f7..2c7fa5657 100644 --- a/tests/Composer/Test/Util/FilesystemTest.php +++ b/tests/Composer/Test/Util/FilesystemTest.php @@ -308,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/GitLabTest.php b/tests/Composer/Test/Util/GitLabTest.php index cd2a85dad..e7ef0b94b 100644 --- a/tests/Composer/Test/Util/GitLabTest.php +++ b/tests/Composer/Test/Util/GitLabTest.php @@ -75,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)) diff --git a/tests/Composer/Test/Util/GitTest.php b/tests/Composer/Test/Util/GitTest.php index 8b7b90770..8e3928a62 100644 --- a/tests/Composer/Test/Util/GitTest.php +++ b/tests/Composer/Test/Util/GitTest.php @@ -73,7 +73,7 @@ class GitTest extends TestCase public function testRunCommandPrivateGitHubRepositoryNotInitialCloneNotInteractiveWithoutAuthentication() { - $this->setExpectedException('RuntimeException'); + self::expectException('RuntimeException'); $that = $this; $commandCallable = function ($url) use ($that) { diff --git a/tests/Composer/Test/Util/Http/ProxyHelperTest.php b/tests/Composer/Test/Util/Http/ProxyHelperTest.php index e8c00a827..72e1d2f6d 100644 --- a/tests/Composer/Test/Util/Http/ProxyHelperTest.php +++ b/tests/Composer/Test/Util/Http/ProxyHelperTest.php @@ -53,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 84365aa9b..16d926039 100644 --- a/tests/Composer/Test/Util/Http/ProxyManagerTest.php +++ b/tests/Composer/Test/Util/Http/ProxyManagerTest.php @@ -63,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/RemoteFilesystemTest.php b/tests/Composer/Test/Util/RemoteFilesystemTest.php index 1fd35cffd..6073e9e59 100644 --- a/tests/Composer/Test/Util/RemoteFilesystemTest.php +++ b/tests/Composer/Test/Util/RemoteFilesystemTest.php @@ -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') 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 4a4c8b50c..ca86d16ce 100644 --- a/tests/Composer/Test/Util/StreamContextFactoryTest.php +++ b/tests/Composer/Test/Util/StreamContextFactoryTest.php @@ -157,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'); } From 96486d81cb0243368415059bc1cb8b66269cefc4 Mon Sep 17 00:00:00 2001 From: Jordi Boggiano Date: Thu, 9 Dec 2021 22:14:04 +0100 Subject: [PATCH 09/17] Fix many PHPStan issues and update baseline --- phpstan/baseline.neon | 96 ++--- phpstan/config.neon | 2 +- src/Composer/Compiler.php | 4 +- src/Composer/Util/Perforce.php | 4 +- tests/Composer/Test/CacheTest.php | 2 +- .../Test/Command/ArchiveCommandTest.php | 10 +- .../Test/Command/RunScriptCommandTest.php | 8 +- .../Test/Downloader/DownloadManagerTest.php | 46 +-- .../Downloader/PerforceDownloaderTest.php | 2 +- .../EventDispatcher/EventDispatcherTest.php | 26 +- .../Installer/InstallationManagerTest.php | 2 +- tests/Composer/Test/InstallerTest.php | 6 +- .../Composer/Test/Mock/HttpDownloaderMock.php | 6 +- .../Test/Mock/ProcessExecutorMock.php | 4 +- .../Test/Plugin/PluginInstallerTest.php | 2 +- .../Repository/ComposerRepositoryTest.php | 4 +- .../Repository/PlatformRepositoryTest.php | 9 +- .../Test/Repository/RepositoryManagerTest.php | 8 +- .../Test/Repository/Vcs/GitLabDriverTest.php | 3 +- tests/Composer/Test/Util/PerforceTest.php | 365 ++++++++---------- .../Test/Util/RemoteFilesystemTest.php | 4 +- 21 files changed, 252 insertions(+), 361 deletions(-) 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 916cc915f..5b8431607 100644 --- a/phpstan/config.neon +++ b/phpstan/config.neon @@ -49,7 +49,7 @@ parameters: # 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 diff --git a/src/Composer/Compiler.php b/src/Composer/Compiler.php index 942d81199..7490eb576 100644 --- a/src/Composer/Compiler.php +++ b/src/Composer/Compiler.php @@ -178,10 +178,10 @@ class Compiler } } - if ($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) { + 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)); } 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/tests/Composer/Test/CacheTest.php b/tests/Composer/Test/CacheTest.php index 4d0ede656..4bc0c3994 100644 --- a/tests/Composer/Test/CacheTest.php +++ b/tests/Composer/Test/CacheTest.php @@ -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 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/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/Downloader/DownloadManagerTest.php b/tests/Composer/Test/Downloader/DownloadManagerTest.php index 345a74b76..d689c4f58 100644 --- a/tests/Composer/Test/Downloader/DownloadManagerTest.php +++ b/tests/Composer/Test/Downloader/DownloadManagerTest.php @@ -76,7 +76,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 +108,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 @@ -142,7 +142,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 +174,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 @@ -226,7 +226,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()) @@ -276,7 +276,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)) @@ -333,7 +333,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()) @@ -369,7 +369,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()) @@ -399,7 +399,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()) @@ -435,7 +435,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()) @@ -472,7 +472,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()) @@ -509,7 +509,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()) @@ -685,7 +685,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)) @@ -708,7 +708,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()) @@ -725,7 +725,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()) @@ -768,7 +768,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()) @@ -811,7 +811,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()) @@ -857,7 +857,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()) @@ -904,7 +904,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()) @@ -951,7 +951,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()) @@ -998,7 +998,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()) @@ -1041,7 +1041,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()) @@ -1084,7 +1084,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/PerforceDownloaderTest.php b/tests/Composer/Test/Downloader/PerforceDownloaderTest.php index 6cdc76275..9590e3133 100644 --- a/tests/Composer/Test/Downloader/PerforceDownloaderTest.php +++ b/tests/Composer/Test/Downloader/PerforceDownloaderTest.php @@ -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)); diff --git a/tests/Composer/Test/EventDispatcher/EventDispatcherTest.php b/tests/Composer/Test/EventDispatcher/EventDispatcherTest.php index 78d1fdd91..6b164781a 100644 --- a/tests/Composer/Test/EventDispatcher/EventDispatcherTest.php +++ b/tests/Composer/Test/EventDispatcher/EventDispatcherTest.php @@ -70,7 +70,7 @@ class EventDispatcherTest extends TestCase $this->getMockBuilder('Composer\IO\IOInterface')->getMock(), $process, )) - ->setMethods(array('getListeners')) + ->onlyMethods(array('getListeners')) ->getMock(); $listener = array($command); @@ -136,7 +136,7 @@ class EventDispatcherTest extends TestCase { $generator = $this->getMockBuilder('Composer\Autoload\AutoloadGenerator') ->disableOriginalConstructor() - ->setMethods(array( + ->onlyMethods(array( 'buildPackageMap', 'parseAutoloads', 'createLoader', @@ -163,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(); @@ -235,7 +235,7 @@ class EventDispatcherTest extends TestCase $io = new BufferIO('', OutputInterface::VERBOSITY_VERBOSE), $process, )) - ->setMethods(array( + ->onlyMethods(array( 'getListeners', )) ->getMock(); @@ -266,7 +266,7 @@ class EventDispatcherTest extends TestCase $io = new BufferIO('', OutputInterface::VERBOSITY_VERBOSE), $this->getProcessExecutorMock(), )) - ->setMethods(array( + ->onlyMethods(array( 'getListeners', )) ->getMock(); @@ -298,7 +298,7 @@ class EventDispatcherTest extends TestCase $this->createComposerInstance(), $io = new BufferIO('', OutputInterface::VERBOSITY_VERBOSE), $this->getProcessExecutorMock(), - ))->setMethods(array( + ))->onlyMethods(array( 'getListeners', ))->getMock(); @@ -376,7 +376,7 @@ class EventDispatcherTest extends TestCase $io = new BufferIO('', OutputInterface::VERBOSITY_VERBOSE), $process, )) - ->setMethods(array( + ->onlyMethods(array( 'getListeners', )) ->getMock(); @@ -421,7 +421,7 @@ class EventDispatcherTest extends TestCase $io = new BufferIO('', OutputInterface::VERBOSITY_VERBOSE), $process, )) - ->setMethods(array( + ->onlyMethods(array( 'getListeners', )) ->getMock(); @@ -457,7 +457,7 @@ class EventDispatcherTest extends TestCase $io = $this->getMockBuilder('Composer\IO\IOInterface')->getMock(), $this->getProcessExecutorMock(), )) - ->setMethods(array( + ->onlyMethods(array( 'getListeners', )) ->getMock(); @@ -491,7 +491,7 @@ class EventDispatcherTest extends TestCase $this->createComposerInstance(), $io, )) - ->setMethods(array('getListeners')) + ->onlyMethods(array('getListeners')) ->getMock(); $dispatcher->expects($this->atLeastOnce()) @@ -518,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'); @@ -545,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'; @@ -581,7 +581,7 @@ class EventDispatcherTest extends TestCase $this->getMockBuilder('Composer\IO\IOInterface')->getMock(), $this->getProcessExecutorMock(), )) - ->setMethods(array('getListeners')) + ->onlyMethods(array('getListeners')) ->getMock(); $dispatcher->expects($this->atLeastOnce()) diff --git a/tests/Composer/Test/Installer/InstallationManagerTest.php b/tests/Composer/Test/Installer/InstallationManagerTest.php index 4fe32e989..4447919a3 100644 --- a/tests/Composer/Test/Installer/InstallationManagerTest.php +++ b/tests/Composer/Test/Installer/InstallationManagerTest.php @@ -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/InstallerTest.php b/tests/Composer/Test/InstallerTest.php index e6f4eb677..6d5b1a433 100644 --- a/tests/Composer/Test/InstallerTest.php +++ b/tests/Composer/Test/InstallerTest.php @@ -235,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) { @@ -258,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) { @@ -281,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) { diff --git a/tests/Composer/Test/Mock/HttpDownloaderMock.php b/tests/Composer/Test/Mock/HttpDownloaderMock.php index 99ba2892e..fe482ee67 100644 --- a/tests/Composer/Test/Mock/HttpDownloaderMock.php +++ b/tests/Composer/Test/Mock/HttpDownloaderMock.php @@ -56,11 +56,11 @@ class HttpDownloaderMock extends HttpDownloader * @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 expects(array $expectations, bool $strict = false, array $defaultHandler = array('return' => 0, 'stdout' => '', 'stderr' => '')): void + public function expects(array $expectations, bool $strict = false, array $defaultHandler = array('status' => 200, 'body' => '', 'headers' => [])): void { $default = ['url' => '', 'options' => null, 'status' => 200, 'body' => '', 'headers' => ['']]; $this->expectations = array_map(function (array $expect) use ($default): array { - if ($diff = array_diff_key(array_merge($default, $expect), $default)) { + 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))); } @@ -89,7 +89,7 @@ class HttpDownloaderMock extends HttpDownloader } // dummy assertion to ensure the test is not marked as having no assertions - Assert::assertTrue(true); + Assert::assertTrue(true); // @phpstan-ignore-line } public function get($fileUrl, $options = array()): Response diff --git a/tests/Composer/Test/Mock/ProcessExecutorMock.php b/tests/Composer/Test/Mock/ProcessExecutorMock.php index da54b3c3d..61adeca70 100644 --- a/tests/Composer/Test/Mock/ProcessExecutorMock.php +++ b/tests/Composer/Test/Mock/ProcessExecutorMock.php @@ -26,7 +26,7 @@ use React\Promise\Promise; class ProcessExecutorMock extends ProcessExecutor { /** - * @var array|null + * @var array|null */ private $expectations = null; /** @@ -84,7 +84,7 @@ class ProcessExecutorMock extends ProcessExecutor } // dummy assertion to ensure the test is not marked as having no assertions - Assert::assertTrue(true); + Assert::assertTrue(true); // @phpstan-ignore-line } public function execute($command, &$output = null, $cwd = null) diff --git a/tests/Composer/Test/Plugin/PluginInstallerTest.php b/tests/Composer/Test/Plugin/PluginInstallerTest.php index 1ef0a6047..b1db2df42 100644 --- a/tests/Composer/Test/Plugin/PluginInstallerTest.php +++ b/tests/Composer/Test/Plugin/PluginInstallerTest.php @@ -283,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(); diff --git a/tests/Composer/Test/Repository/ComposerRepositoryTest.php b/tests/Composer/Test/Repository/ComposerRepositoryTest.php index 49a1af387..633acaf23 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, @@ -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(); 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 e89a36599..1596c0a40 100644 --- a/tests/Composer/Test/Repository/RepositoryManagerTest.php +++ b/tests/Composer/Test/Repository/RepositoryManagerTest.php @@ -59,15 +59,15 @@ class RepositoryManagerTest extends TestCase * @param array $options * @param class-string<\Throwable>|null $exception */ - public function testRepoCreation($type, $options, $exception = null) + public function testRepoCreation($type, $options, ?string $exception = null) { - if ($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() ); @@ -119,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/GitLabDriverTest.php b/tests/Composer/Test/Repository/Vcs/GitLabDriverTest.php index 696d0b8f5..26df3a4e7 100644 --- a/tests/Composer/Test/Repository/Vcs/GitLabDriverTest.php +++ b/tests/Composer/Test/Repository/Vcs/GitLabDriverTest.php @@ -13,6 +13,7 @@ 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; @@ -365,7 +366,7 @@ JSON; ); } - $branchData = json_encode($branchData); + $branchData = JsonFile::encode($branchData); $this->httpDownloader->expects( [ diff --git a/tests/Composer/Test/Util/PerforceTest.php b/tests/Composer/Test/Util/PerforceTest.php index 223747301..0f552a08b 100644 --- a/tests/Composer/Test/Util/PerforceTest.php +++ b/tests/Composer/Test/Util/PerforceTest.php @@ -13,6 +13,7 @@ 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; @@ -24,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; @@ -40,7 +41,7 @@ class PerforceTest extends TestCase 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); @@ -80,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); @@ -148,15 +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->method('execute') - ->with($this->equalTo($expectedCommand)) - ->willReturnCallback($callback); $this->perforce->queryP4user(); $this->assertEquals('TEST_P4VARIABLE_USER', $this->perforce->getUser()); } @@ -165,15 +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->method('execute') - ->with($this->equalTo($expectedCommand)) - ->willReturnCallback($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()); } @@ -199,12 +191,15 @@ class PerforceTest extends TestCase ->method('ask') ->with($this->equalTo($expectedQuestion)) ->willReturn('TEST_QUERY_USER'); - $this->processExecutor->expects($this->exactly(2)) - ->method('execute') - ->willReturnMap([ - ['p4 set', 0], - [$expectedCommand, 0], - ]); + + $this->processExecutor->expects( + [ + 'p4 set', + $expectedCommand + ], + true + ); + $this->perforce->queryP4user(); } @@ -218,12 +213,13 @@ class PerforceTest extends TestCase ->method('ask') ->with($this->equalTo($expectedQuestion)) ->willReturn('TEST_QUERY_USER'); - $this->processExecutor->expects($this->exactly(2)) - ->method('execute') - ->willReturnMap([ - ['echo $P4USER', 0], - $expectedCommand => 0, - ]); + $this->processExecutor->expects( + [ + 'echo $P4USER', + $expectedCommand + ], + true + ); $this->perforce->queryP4user(); } @@ -243,15 +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->method('execute') - ->with($this->equalTo($expectedCommand)) - ->willReturnCallback($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); } @@ -259,15 +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->method('execute') - ->with($this->equalTo($expectedCommand)) - ->willReturnCallback($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); @@ -328,22 +317,19 @@ class PerforceTest extends TestCase public function testIsLoggedIn() { - $expectedCommand = 'p4 -u user -p port login -s'; - $this->processExecutor->expects($this->once()) - ->method('execute') - ->with($this->equalTo($expectedCommand), $this->equalTo(null)) - ->willReturn(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->once()) - ->method('execute') - ->with($this->equalTo($expectedCommand), $this->equalTo(null)) - ->willReturn(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,26 +338,19 @@ class PerforceTest extends TestCase { $this->setPerforceToStream(); - $expectations = [ - ['p4 -u user -c composer_perforce_TEST_depot_branch -p port streams '.ProcessExecutor::escape('//depot/...'), 'Stream //depot/branch mainline none \'branch\'' . PHP_EOL], - ['p4 -u user -p port changes '.ProcessExecutor::escape('//depot/branch/...'), 'Change 1234 on 2014/03/19 by Clark.Stuth@Clark.Stuth_test_client \'test changelist\''], - ]; - $count = 0; - $this->processExecutor->expects($this->exactly(2)) - ->method('execute') - ->will( - $this->returnCallback( - function ($command, &$output) use ($expectations, &$count) { - $index = $count++; - if ($command !== $expectations[$index][0]) { - throw new \InvalidArgumentException('Expected '.$expectations[$index][0].' and got '.$command); - } - $output = $expectations[$index][1]; - - return 0; - } - ) - ); + $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']); @@ -379,35 +358,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)) - ->willReturnCallback($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->once()) - ->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']); @@ -418,19 +393,15 @@ class PerforceTest extends TestCase { $this->setPerforceToStream(); - $expectedCommand = 'p4 -u user -c composer_perforce_TEST_depot_branch -p port labels'; - $this->processExecutor->expects($this->once()) - ->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']); @@ -446,16 +417,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()); @@ -463,19 +434,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->once()) - ->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( @@ -489,26 +456,19 @@ class PerforceTest extends TestCase public function testGetComposerInformationWithLabelWithoutStream() { - $expectations = [ - ['p4 -u user -p port files '.ProcessExecutor::escape('//depot/composer.json@0.0.1'), '//depot/composer.json#1 - branch change 10001 (text)'], - ['p4 -u user -c composer_perforce_TEST_depot -p port print '.ProcessExecutor::escape('//depot/composer.json@10001'), PerforceTest::getComposerJson()], - ]; - $count = 0; - $this->processExecutor->expects($this->exactly(2)) - ->method('execute') - ->will( - $this->returnCallback( - function ($command, &$output) use ($expectations, &$count) { - $index = $count++; - if ($command !== $expectations[$index][0]) { - throw new \InvalidArgumentException('Expected '.$expectations[$index][0].' and got '.$command); - } - $output = $expectations[$index][1]; - - return 0; - } - ) - ); + $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'); @@ -525,19 +485,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->once()) - ->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'); @@ -552,26 +508,19 @@ class PerforceTest extends TestCase public function testGetComposerInformationWithLabelWithStream() { - $expectations = [ - [ 'p4 -u user -p port files '.ProcessExecutor::escape('//depot/branch/composer.json@0.0.1'), '//depot/composer.json#1 - branch change 10001 (text)'], - ['p4 -u user -c composer_perforce_TEST_depot_branch -p port print '.ProcessExecutor::escape('//depot/branch/composer.json@10001'), PerforceTest::getComposerJson()], - ]; - $count = 0; - $this->processExecutor->expects($this->exactly(2)) - ->method('execute') - ->will( - $this->returnCallback( - function ($command, &$output) use ($expectations, &$count) { - $index = $count++; - if ($command !== $expectations[$index][0]) { - throw new \InvalidArgumentException('Expected '.$expectations[$index][0].' and got '.$command); - } - $output = $expectations[$index][1]; - - return 0; - } - ) - ); + $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(); @@ -588,11 +537,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->once()) - ->method('execute') - ->with($this->equalTo($expectedCommand), $this->equalTo(null)) - ->willReturn(0); + $this->processExecutor->expects( + ['p4 -u user -c composer_perforce_TEST_depot -p port sync -f @label'], + true + ); $this->perforce->syncCodeBase('label'); } @@ -600,26 +548,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->once()) - ->method('execute') - ->with($this->equalTo($expectedCommand)) - ->willReturn(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->once()) - ->method('execute') - ->with($this->equalTo($expectedCommand), $this->equalTo(null)) - ->willReturn(0); - - $result = $this->perforce->checkServerExists('perforce.does.exist:port', $processExecutor); + $result = $this->perforce->checkServerExists('perforce.does.exist:port', $this->processExecutor); $this->assertTrue($result); } @@ -710,8 +655,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 6073e9e59..e91b28c3c 100644 --- a/tests/Composer/Test/Util/RemoteFilesystemTest.php +++ b/tests/Composer/Test/Util/RemoteFilesystemTest.php @@ -447,7 +447,7 @@ class RemoteFilesystemTest extends TestCase false, $authHelper, )) - ->setMethods($mockedMethods) + ->onlyMethods($mockedMethods) ->getMock(); } @@ -463,7 +463,7 @@ class RemoteFilesystemTest extends TestCase $this->getIOInterfaceMock(), $this->getConfigMock(), )) - ->setMethods($mockedMethods) + ->onlyMethods($mockedMethods) ->getMock(); } } From ed08c40ab51abb6b4118be9600c0e8f1cda12ae6 Mon Sep 17 00:00:00 2001 From: Jordi Boggiano Date: Thu, 9 Dec 2021 22:19:03 +0100 Subject: [PATCH 10/17] Fix phar build --- composer.json | 2 +- composer.lock | 14 +++++++------- src/Composer/Compiler.php | 28 +++++++++++----------------- 3 files changed, 19 insertions(+), 25 deletions(-) diff --git a/composer.json b/composer.json index 3141e0ad8..432509098 100644 --- a/composer.json +++ b/composer.json @@ -31,7 +31,7 @@ "justinrainbow/json-schema": "^5.2.11", "psr/log": "^1.0 || ^2.0", "seld/jsonlint": "^1.4", - "seld/phar-utils": "^1.0", + "seld/phar-utils": "^1.2", "symfony/console": "^5.4.1 || ^6.0", "symfony/filesystem": "^5.4 || ^6.0", "symfony/finder": "^5.4 || ^6.0", diff --git a/composer.lock b/composer.lock index 1ddfc319d..90a10ba80 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": "274d271909468b2a6c06b562724a1662", + "content-hash": "9c8e9d945b0cbc11f0600b7f0224ac91", "packages": [ { "name": "composer/ca-bundle", @@ -732,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": { @@ -774,9 +774,9 @@ ], "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", diff --git a/src/Composer/Compiler.php b/src/Composer/Compiler.php index 7490eb576..5b5e740b3 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') @@ -205,7 +193,13 @@ 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/service-contracts/Attribute/SubscribedService.php', + ]); } /** From 22fed0d445e935d7ebc775d61e64461a28c970c8 Mon Sep 17 00:00:00 2001 From: Jordi Boggiano Date: Fri, 10 Dec 2021 12:57:08 +0100 Subject: [PATCH 11/17] Get rid of prophecy usage --- composer.json | 1 - composer.lock | 636 +----------------- phpstan/config.neon | 7 - .../Test/Downloader/DownloadManagerTest.php | 27 +- .../Package/Loader/RootPackageLoaderTest.php | 11 +- .../Test/Package/RootAliasPackageTest.php | 98 ++- 6 files changed, 88 insertions(+), 692 deletions(-) diff --git a/composer.json b/composer.json index 432509098..92bbfdc8c 100644 --- a/composer.json +++ b/composer.json @@ -41,7 +41,6 @@ }, "require-dev": { "symfony/phpunit-bridge": "^6.0", - "phpspec/prophecy": "^1.10", "phpstan/phpstan": "^1.0", "phpstan/phpstan-phpunit": "^1.0", "phpstan/phpstan-deprecation-rules": "^1", diff --git a/composer.lock b/composer.lock index 90a10ba80..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": "9c8e9d945b0cbc11f0600b7f0224ac91", + "content-hash": "982b74a5ea81168a1ef177278da9cb88", "packages": [ { "name": "composer/ca-bundle", @@ -1790,302 +1790,6 @@ } ], "packages-dev": [ - { - "name": "doctrine/instantiator", - "version": "1.4.0", - "source": { - "type": "git", - "url": "https://github.com/doctrine/instantiator.git", - "reference": "d56bf6102915de5702778fe20f2de3b2fe570b5b" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/doctrine/instantiator/zipball/d56bf6102915de5702778fe20f2de3b2fe570b5b", - "reference": "d56bf6102915de5702778fe20f2de3b2fe570b5b", - "shasum": "" - }, - "require": { - "php": "^7.1 || ^8.0" - }, - "require-dev": { - "doctrine/coding-standard": "^8.0", - "ext-pdo": "*", - "ext-phar": "*", - "phpbench/phpbench": "^0.13 || 1.0.0-alpha2", - "phpstan/phpstan": "^0.12", - "phpstan/phpstan-phpunit": "^0.12", - "phpunit/phpunit": "^7.0 || ^8.0 || ^9.0" - }, - "type": "library", - "autoload": { - "psr-4": { - "Doctrine\\Instantiator\\": "src/Doctrine/Instantiator/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Marco Pivetta", - "email": "ocramius@gmail.com", - "homepage": "https://ocramius.github.io/" - } - ], - "description": "A small, lightweight utility to instantiate objects in PHP without invoking their constructors", - "homepage": "https://www.doctrine-project.org/projects/instantiator.html", - "keywords": [ - "constructor", - "instantiate" - ], - "support": { - "issues": "https://github.com/doctrine/instantiator/issues", - "source": "https://github.com/doctrine/instantiator/tree/1.4.0" - }, - "funding": [ - { - "url": "https://www.doctrine-project.org/sponsorship.html", - "type": "custom" - }, - { - "url": "https://www.patreon.com/phpdoctrine", - "type": "patreon" - }, - { - "url": "https://tidelift.com/funding/github/packagist/doctrine%2Finstantiator", - "type": "tidelift" - } - ], - "time": "2020-11-10T18:47:58+00:00" - }, - { - "name": "phpdocumentor/reflection-common", - "version": "2.2.0", - "source": { - "type": "git", - "url": "https://github.com/phpDocumentor/ReflectionCommon.git", - "reference": "1d01c49d4ed62f25aa84a747ad35d5a16924662b" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/phpDocumentor/ReflectionCommon/zipball/1d01c49d4ed62f25aa84a747ad35d5a16924662b", - "reference": "1d01c49d4ed62f25aa84a747ad35d5a16924662b", - "shasum": "" - }, - "require": { - "php": "^7.2 || ^8.0" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-2.x": "2.x-dev" - } - }, - "autoload": { - "psr-4": { - "phpDocumentor\\Reflection\\": "src/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Jaap van Otterdijk", - "email": "opensource@ijaap.nl" - } - ], - "description": "Common reflection classes used by phpdocumentor to reflect the code structure", - "homepage": "http://www.phpdoc.org", - "keywords": [ - "FQSEN", - "phpDocumentor", - "phpdoc", - "reflection", - "static analysis" - ], - "support": { - "issues": "https://github.com/phpDocumentor/ReflectionCommon/issues", - "source": "https://github.com/phpDocumentor/ReflectionCommon/tree/2.x" - }, - "time": "2020-06-27T09:03:43+00:00" - }, - { - "name": "phpdocumentor/reflection-docblock", - "version": "5.3.0", - "source": { - "type": "git", - "url": "https://github.com/phpDocumentor/ReflectionDocBlock.git", - "reference": "622548b623e81ca6d78b721c5e029f4ce664f170" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/phpDocumentor/ReflectionDocBlock/zipball/622548b623e81ca6d78b721c5e029f4ce664f170", - "reference": "622548b623e81ca6d78b721c5e029f4ce664f170", - "shasum": "" - }, - "require": { - "ext-filter": "*", - "php": "^7.2 || ^8.0", - "phpdocumentor/reflection-common": "^2.2", - "phpdocumentor/type-resolver": "^1.3", - "webmozart/assert": "^1.9.1" - }, - "require-dev": { - "mockery/mockery": "~1.3.2", - "psalm/phar": "^4.8" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "5.x-dev" - } - }, - "autoload": { - "psr-4": { - "phpDocumentor\\Reflection\\": "src" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Mike van Riel", - "email": "me@mikevanriel.com" - }, - { - "name": "Jaap van Otterdijk", - "email": "account@ijaap.nl" - } - ], - "description": "With this component, a library can provide support for annotations via DocBlocks or otherwise retrieve information that is embedded in a DocBlock.", - "support": { - "issues": "https://github.com/phpDocumentor/ReflectionDocBlock/issues", - "source": "https://github.com/phpDocumentor/ReflectionDocBlock/tree/5.3.0" - }, - "time": "2021-10-19T17:43:47+00:00" - }, - { - "name": "phpdocumentor/type-resolver", - "version": "1.5.1", - "source": { - "type": "git", - "url": "https://github.com/phpDocumentor/TypeResolver.git", - "reference": "a12f7e301eb7258bb68acd89d4aefa05c2906cae" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/phpDocumentor/TypeResolver/zipball/a12f7e301eb7258bb68acd89d4aefa05c2906cae", - "reference": "a12f7e301eb7258bb68acd89d4aefa05c2906cae", - "shasum": "" - }, - "require": { - "php": "^7.2 || ^8.0", - "phpdocumentor/reflection-common": "^2.0" - }, - "require-dev": { - "ext-tokenizer": "*", - "psalm/phar": "^4.8" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-1.x": "1.x-dev" - } - }, - "autoload": { - "psr-4": { - "phpDocumentor\\Reflection\\": "src" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Mike van Riel", - "email": "me@mikevanriel.com" - } - ], - "description": "A PSR-5 based resolver of Class names, Types and Structural Element Names", - "support": { - "issues": "https://github.com/phpDocumentor/TypeResolver/issues", - "source": "https://github.com/phpDocumentor/TypeResolver/tree/1.5.1" - }, - "time": "2021-10-02T14:08:47+00:00" - }, - { - "name": "phpspec/prophecy", - "version": "v1.15.0", - "source": { - "type": "git", - "url": "https://github.com/phpspec/prophecy.git", - "reference": "bbcd7380b0ebf3961ee21409db7b38bc31d69a13" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/phpspec/prophecy/zipball/bbcd7380b0ebf3961ee21409db7b38bc31d69a13", - "reference": "bbcd7380b0ebf3961ee21409db7b38bc31d69a13", - "shasum": "" - }, - "require": { - "doctrine/instantiator": "^1.2", - "php": "^7.2 || ~8.0, <8.2", - "phpdocumentor/reflection-docblock": "^5.2", - "sebastian/comparator": "^3.0 || ^4.0", - "sebastian/recursion-context": "^3.0 || ^4.0" - }, - "require-dev": { - "phpspec/phpspec": "^6.0 || ^7.0", - "phpunit/phpunit": "^8.0 || ^9.0" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.x-dev" - } - }, - "autoload": { - "psr-4": { - "Prophecy\\": "src/Prophecy" - } - }, - "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" - ], - "support": { - "issues": "https://github.com/phpspec/prophecy/issues", - "source": "https://github.com/phpspec/prophecy/tree/v1.15.0" - }, - "time": "2021-12-08T12:19:24+00:00" - }, { "name": "phpstan/phpstan", "version": "1.2.0", @@ -2306,286 +2010,6 @@ }, "time": "2021-11-18T09:30:29+00:00" }, - { - "name": "sebastian/comparator", - "version": "3.0.3", - "source": { - "type": "git", - "url": "https://github.com/sebastianbergmann/comparator.git", - "reference": "1071dfcef776a57013124ff35e1fc41ccd294758" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/comparator/zipball/1071dfcef776a57013124ff35e1fc41ccd294758", - "reference": "1071dfcef776a57013124ff35e1fc41ccd294758", - "shasum": "" - }, - "require": { - "php": ">=7.1", - "sebastian/diff": "^3.0", - "sebastian/exporter": "^3.1" - }, - "require-dev": { - "phpunit/phpunit": "^8.5" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "3.0-dev" - } - }, - "autoload": { - "classmap": [ - "src/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause" - ], - "authors": [ - { - "name": "Sebastian Bergmann", - "email": "sebastian@phpunit.de" - }, - { - "name": "Jeff Welch", - "email": "whatthejeff@gmail.com" - }, - { - "name": "Volker Dusch", - "email": "github@wallbash.com" - }, - { - "name": "Bernhard Schussek", - "email": "bschussek@2bepublished.at" - } - ], - "description": "Provides the functionality to compare PHP values for equality", - "homepage": "https://github.com/sebastianbergmann/comparator", - "keywords": [ - "comparator", - "compare", - "equality" - ], - "support": { - "issues": "https://github.com/sebastianbergmann/comparator/issues", - "source": "https://github.com/sebastianbergmann/comparator/tree/3.0.3" - }, - "funding": [ - { - "url": "https://github.com/sebastianbergmann", - "type": "github" - } - ], - "time": "2020-11-30T08:04:30+00:00" - }, - { - "name": "sebastian/diff", - "version": "3.0.3", - "source": { - "type": "git", - "url": "https://github.com/sebastianbergmann/diff.git", - "reference": "14f72dd46eaf2f2293cbe79c93cc0bc43161a211" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/diff/zipball/14f72dd46eaf2f2293cbe79c93cc0bc43161a211", - "reference": "14f72dd46eaf2f2293cbe79c93cc0bc43161a211", - "shasum": "" - }, - "require": { - "php": ">=7.1" - }, - "require-dev": { - "phpunit/phpunit": "^7.5 || ^8.0", - "symfony/process": "^2 || ^3.3 || ^4" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "3.0-dev" - } - }, - "autoload": { - "classmap": [ - "src/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause" - ], - "authors": [ - { - "name": "Sebastian Bergmann", - "email": "sebastian@phpunit.de" - }, - { - "name": "Kore Nordmann", - "email": "mail@kore-nordmann.de" - } - ], - "description": "Diff implementation", - "homepage": "https://github.com/sebastianbergmann/diff", - "keywords": [ - "diff", - "udiff", - "unidiff", - "unified diff" - ], - "support": { - "issues": "https://github.com/sebastianbergmann/diff/issues", - "source": "https://github.com/sebastianbergmann/diff/tree/3.0.3" - }, - "funding": [ - { - "url": "https://github.com/sebastianbergmann", - "type": "github" - } - ], - "time": "2020-11-30T07:59:04+00:00" - }, - { - "name": "sebastian/exporter", - "version": "3.1.4", - "source": { - "type": "git", - "url": "https://github.com/sebastianbergmann/exporter.git", - "reference": "0c32ea2e40dbf59de29f3b49bf375176ce7dd8db" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/exporter/zipball/0c32ea2e40dbf59de29f3b49bf375176ce7dd8db", - "reference": "0c32ea2e40dbf59de29f3b49bf375176ce7dd8db", - "shasum": "" - }, - "require": { - "php": ">=7.0", - "sebastian/recursion-context": "^3.0" - }, - "require-dev": { - "ext-mbstring": "*", - "phpunit/phpunit": "^8.5" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "3.1.x-dev" - } - }, - "autoload": { - "classmap": [ - "src/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause" - ], - "authors": [ - { - "name": "Sebastian Bergmann", - "email": "sebastian@phpunit.de" - }, - { - "name": "Jeff Welch", - "email": "whatthejeff@gmail.com" - }, - { - "name": "Volker Dusch", - "email": "github@wallbash.com" - }, - { - "name": "Adam Harvey", - "email": "aharvey@php.net" - }, - { - "name": "Bernhard Schussek", - "email": "bschussek@gmail.com" - } - ], - "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/3.1.4" - }, - "funding": [ - { - "url": "https://github.com/sebastianbergmann", - "type": "github" - } - ], - "time": "2021-11-11T13:51:24+00:00" - }, - { - "name": "sebastian/recursion-context", - "version": "3.0.1", - "source": { - "type": "git", - "url": "https://github.com/sebastianbergmann/recursion-context.git", - "reference": "367dcba38d6e1977be014dc4b22f47a484dac7fb" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/recursion-context/zipball/367dcba38d6e1977be014dc4b22f47a484dac7fb", - "reference": "367dcba38d6e1977be014dc4b22f47a484dac7fb", - "shasum": "" - }, - "require": { - "php": ">=7.0" - }, - "require-dev": { - "phpunit/phpunit": "^6.0" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "3.0.x-dev" - } - }, - "autoload": { - "classmap": [ - "src/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause" - ], - "authors": [ - { - "name": "Sebastian Bergmann", - "email": "sebastian@phpunit.de" - }, - { - "name": "Jeff Welch", - "email": "whatthejeff@gmail.com" - }, - { - "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/3.0.1" - }, - "funding": [ - { - "url": "https://github.com/sebastianbergmann", - "type": "github" - } - ], - "time": "2020-11-30T07:34:24+00:00" - }, { "name": "symfony/phpunit-bridge", "version": "v6.0.0", @@ -2668,64 +2092,6 @@ } ], "time": "2021-11-29T15:32:57+00:00" - }, - { - "name": "webmozart/assert", - "version": "1.10.0", - "source": { - "type": "git", - "url": "https://github.com/webmozarts/assert.git", - "reference": "6964c76c7804814a842473e0c8fd15bab0f18e25" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/webmozarts/assert/zipball/6964c76c7804814a842473e0c8fd15bab0f18e25", - "reference": "6964c76c7804814a842473e0c8fd15bab0f18e25", - "shasum": "" - }, - "require": { - "php": "^7.2 || ^8.0", - "symfony/polyfill-ctype": "^1.8" - }, - "conflict": { - "phpstan/phpstan": "<0.12.20", - "vimeo/psalm": "<4.6.1 || 4.6.2" - }, - "require-dev": { - "phpunit/phpunit": "^8.5.13" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.10-dev" - } - }, - "autoload": { - "psr-4": { - "Webmozart\\Assert\\": "src/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Bernhard Schussek", - "email": "bschussek@gmail.com" - } - ], - "description": "Assertions to validate method input/output with nice error messages.", - "keywords": [ - "assert", - "check", - "validate" - ], - "support": { - "issues": "https://github.com/webmozarts/assert/issues", - "source": "https://github.com/webmozarts/assert/tree/1.10.0" - }, - "time": "2021-03-09T10:59:23+00:00" } ], "aliases": [], diff --git a/phpstan/config.neon b/phpstan/config.neon index 5b8431607..ecc222e0b 100644 --- a/phpstan/config.neon +++ b/phpstan/config.neon @@ -36,13 +36,6 @@ 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.~' diff --git a/tests/Composer/Test/Downloader/DownloadManagerTest.php b/tests/Composer/Test/Downloader/DownloadManagerTest.php index d689c4f58..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 @@ -639,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() diff --git a/tests/Composer/Test/Package/Loader/RootPackageLoaderTest.php b/tests/Composer/Test/Package/Loader/RootPackageLoaderTest.php index d99fcd110..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 { @@ -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()); 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; } From e4e0e0d1548d5d75c7346757f6714ea94797e6c2 Mon Sep 17 00:00:00 2001 From: Jordi Boggiano Date: Fri, 10 Dec 2021 13:05:25 +0100 Subject: [PATCH 12/17] Remove deprecations baseline --- src/Composer/Compiler.php | 1 + tests/deprecations-8.1.json | 97 ------------------------------------- 2 files changed, 1 insertion(+), 97 deletions(-) delete mode 100644 tests/deprecations-8.1.json diff --git a/src/Composer/Compiler.php b/src/Composer/Compiler.php index 5b5e740b3..b0aafa74c 100644 --- a/src/Composer/Compiler.php +++ b/src/Composer/Compiler.php @@ -198,6 +198,7 @@ class Compiler '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/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 - } -] From 4f7d06e2a7eb4bd63cf11ed30e29b7640b9e6c68 Mon Sep 17 00:00:00 2001 From: Jordi Boggiano Date: Fri, 10 Dec 2021 13:13:53 +0100 Subject: [PATCH 13/17] Mark PHP8.1 phpstan build experimental --- .github/workflows/phpstan.yml | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/.github/workflows/phpstan.yml b/.github/workflows/phpstan.yml index a3c9dc084..7f0cfd529 100644 --- a/.github/workflows/phpstan.yml +++ b/.github/workflows/phpstan.yml @@ -17,12 +17,15 @@ jobs: name: "PHPStan" runs-on: ubuntu-latest + continue-on-error: ${{ matrix.experimental }} strategy: matrix: - php-version: - - "7.2" - - "8.1" + include: + - php-version: "7.2" + experimental: false + - php-version: "8.1" + experimental: true fail-fast: false steps: @@ -49,11 +52,11 @@ jobs: restore-keys: "php-${{ matrix.php-version }}-symfony-php-unit-version-${{ env.SYMFONY_PHPUNIT_VERSION }}" - name: "Install highest dependencies" - if: "matrix.php-version != '7.2'" + if: "matrix.experimental == true" run: "composer config platform --unset && composer update ${{ env.COMPOSER_FLAGS }}" - name: "Install locked dependencies" - if: "matrix.php-version == '7.2'" + if: "matrix.experimental == false" run: "composer config platform --unset && composer update ${{ env.COMPOSER_FLAGS }}" - name: "Initialize PHPUnit sources" From ccd87c479ce6662aafdf9e78576696109be24f63 Mon Sep 17 00:00:00 2001 From: Jordi Boggiano Date: Fri, 10 Dec 2021 13:14:04 +0100 Subject: [PATCH 14/17] Test fixes --- tests/Composer/Test/AllFunctionalTest.php | 22 ++++-------- .../Test/Autoload/AutoloadGeneratorTest.php | 34 ++++--------------- .../Test/Downloader/FileDownloaderTest.php | 2 +- .../functional/installed-versions.test | 8 ++--- .../functional/installed-versions2.test | 12 +++---- tests/Composer/Test/Json/JsonFileTest.php | 14 ++++---- tests/Composer/Test/Package/LockerTest.php | 10 +++--- tests/Composer/Test/TestCase.php | 11 ++++++ .../Test/Util/RemoteFilesystemTest.php | 6 ++-- 9 files changed, 49 insertions(+), 70 deletions(-) diff --git a/tests/Composer/Test/AllFunctionalTest.php b/tests/Composer/Test/AllFunctionalTest.php index 07fcbf7a6..b693dc2c6 100644 --- a/tests/Composer/Test/AllFunctionalTest.php +++ b/tests/Composer/Test/AllFunctionalTest.php @@ -124,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; }); @@ -177,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); } } @@ -205,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) { @@ -262,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/Autoload/AutoloadGeneratorTest.php b/tests/Composer/Test/Autoload/AutoloadGeneratorTest.php index dc6561d70..40046caec 100644 --- a/tests/Composer/Test/Autoload/AutoloadGeneratorTest.php +++ b/tests/Composer/Test/Autoload/AutoloadGeneratorTest.php @@ -1861,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/Downloader/FileDownloaderTest.php b/tests/Composer/Test/Downloader/FileDownloaderTest.php index 0cd7856f6..0a7e05c60 100644 --- a/tests/Composer/Test/Downloader/FileDownloaderTest.php +++ b/tests/Composer/Test/Downloader/FileDownloaderTest.php @@ -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 { 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/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/Package/LockerTest.php b/tests/Composer/Test/Package/LockerTest.php index ea7d96750..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; @@ -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/TestCase.php b/tests/Composer/Test/TestCase.php index a815f5446..cc6a34229 100644 --- a/tests/Composer/Test/TestCase.php +++ b/tests/Composer/Test/TestCase.php @@ -243,4 +243,15 @@ abstract class TestCase extends \PHPUnit\Framework\TestCase 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/RemoteFilesystemTest.php b/tests/Composer/Test/Util/RemoteFilesystemTest.php index e91b28c3c..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)); @@ -182,7 +182,7 @@ class RemoteFilesystemTest extends TestCase return ''; }); - $file = tempnam(sys_get_temp_dir(), 'z'); + $file = $this->createTempFile(); unlink($file); $fs->copy( @@ -221,7 +221,7 @@ class RemoteFilesystemTest extends TestCase } }); - $file = tempnam(sys_get_temp_dir(), 'z'); + $file = $this->createTempFile(); $copyResult = $fs->copy( 'http://example.org', From a4a2b6da876ca6aca7bd12843ca772c1fa4509e8 Mon Sep 17 00:00:00 2001 From: Jordi Boggiano Date: Fri, 31 Dec 2021 17:08:31 +0100 Subject: [PATCH 15/17] Make SvnDriverTest and XzDownloaderTest more portable on Windows --- .../Test/Downloader/XzDownloaderTest.php | 3 +++ .../Test/Repository/Vcs/SvnDriverTest.php | 19 +++++++++++++------ 2 files changed, 16 insertions(+), 6 deletions(-) diff --git a/tests/Composer/Test/Downloader/XzDownloaderTest.php b/tests/Composer/Test/Downloader/XzDownloaderTest.php index ee9d48c10..cae7bf299 100644 --- a/tests/Composer/Test/Downloader/XzDownloaderTest.php +++ b/tests/Composer/Test/Downloader/XzDownloaderTest.php @@ -41,6 +41,9 @@ class XzDownloaderTest extends TestCase 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/Repository/Vcs/SvnDriverTest.php b/tests/Composer/Test/Repository/Vcs/SvnDriverTest.php index 84e3df046..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 { @@ -60,13 +61,19 @@ class SvnDriverTest extends TestCase $output .= " rejected Basic challenge (https://corp.svn.local/)"; $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( - array('cmd' => "svn ls --verbose --non-interactive --username 'till' --password 'secret' -- 'https://till:secret@corp.svn.local/repo/trunk'", 'return' => 1, 'stderr' => $output), - array('cmd' => "svn ls --verbose --non-interactive --username 'till' --password 'secret' -- 'https://till:secret@corp.svn.local/repo/trunk'", 'return' => 1, 'stderr' => $output), - array('cmd' => "svn ls --verbose --non-interactive --username 'till' --password 'secret' -- 'https://till:secret@corp.svn.local/repo/trunk'", 'return' => 1, 'stderr' => $output), - array('cmd' => "svn ls --verbose --non-interactive --username 'till' --password 'secret' -- 'https://till:secret@corp.svn.local/repo/trunk'", 'return' => 1, 'stderr' => $output), - array('cmd' => "svn ls --verbose --non-interactive --username 'till' --password 'secret' -- 'https://till:secret@corp.svn.local/repo/trunk'", 'return' => 1, 'stderr' => $output), - array('cmd' => "svn ls --verbose --non-interactive --username 'till' --password 'secret' -- 'https://till:secret@corp.svn.local/repo/trunk'", '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); From 0b3adc84da1936d72508734e946448ac85b8edf7 Mon Sep 17 00:00:00 2001 From: Jordi Boggiano Date: Sat, 1 Jan 2022 14:39:32 +0100 Subject: [PATCH 16/17] Fix a few phpstan errors and add a php8+ baseline for the rest --- phpstan/baseline-8.1.neon | 8875 +++++++++++++++++ phpstan/config.neon | 1 + phpstan/ignore-by-php-version.neon.php | 14 + src/Composer/Autoload/ClassMapGenerator.php | 5 +- src/Composer/Cache.php | 2 +- src/Composer/Command/SelfUpdateCommand.php | 4 + src/Composer/Package/Locker.php | 4 +- src/Composer/Util/TlsHelper.php | 6 +- tests/Composer/Test/InstallerTest.php | 5 +- .../Repository/ComposerRepositoryTest.php | 1 - .../Repository/CompositeRepositoryTest.php | 2 +- tests/Composer/Test/Util/PerforceTest.php | 6 + 12 files changed, 8916 insertions(+), 9 deletions(-) create mode 100644 phpstan/baseline-8.1.neon create mode 100644 phpstan/ignore-by-php-version.neon.php 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/config.neon b/phpstan/config.neon index ecc222e0b..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 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/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/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/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/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/InstallerTest.php b/tests/Composer/Test/InstallerTest.php index 6d5b1a433..6381a5fe7 100644 --- a/tests/Composer/Test/InstallerTest.php +++ b/tests/Composer/Test/InstallerTest.php @@ -453,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)); @@ -555,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/Repository/ComposerRepositoryTest.php b/tests/Composer/Test/Repository/ComposerRepositoryTest.php index 633acaf23..3460ec2d8 100644 --- a/tests/Composer/Test/Repository/ComposerRepositoryTest.php +++ b/tests/Composer/Test/Repository/ComposerRepositoryTest.php @@ -156,7 +156,6 @@ class ComposerRepositoryTest extends TestCase ), ))); - $versionParser = new VersionParser(); $reflMethod = new \ReflectionMethod($repo, 'whatProvides'); $reflMethod->setAccessible(true); $packages = $reflMethod->invoke($repo, 'a'); 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/Util/PerforceTest.php b/tests/Composer/Test/Util/PerforceTest.php index 0f552a08b..d7d2c416f 100644 --- a/tests/Composer/Test/Util/PerforceTest.php +++ b/tests/Composer/Test/Util/PerforceTest.php @@ -277,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); @@ -298,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); From 7e27a25070464267bdd927b0ff9781940b171a90 Mon Sep 17 00:00:00 2001 From: Jordi Boggiano Date: Sat, 1 Jan 2022 15:38:47 +0100 Subject: [PATCH 17/17] Get rid of RetutnTypeWillChange where possible, fixes #10014 --- src/Composer/DependencyResolver/Decisions.php | 30 ++++--------------- src/Composer/DependencyResolver/Pool.php | 4 +-- src/Composer/DependencyResolver/RuleSet.php | 12 ++------ .../DependencyResolver/RuleSetIterator.php | 27 ++++------------- .../Archiver/ArchivableFilesFilter.php | 3 +- .../Archiver/ArchivableFilesFinder.php | 3 +- src/Composer/Repository/ArrayRepository.php | 3 +- .../Repository/CompositeRepository.php | 3 +- src/Composer/Repository/FilterRepository.php | 3 +- src/Composer/Util/ErrorHandler.php | 9 ------ 10 files changed, 18 insertions(+), 79 deletions(-) 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/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/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:');