From a28dcd6dcc556bcf5d1eb352d64fbdcc1c8992ca Mon Sep 17 00:00:00 2001 From: George Steel Date: Tue, 8 Mar 2022 09:55:54 +0000 Subject: [PATCH 01/14] Adds configuration to trigger composer require checker qa job Signed-off-by: George Steel --- composer-require-checker.json | 1 + composer.json | 1 + composer.lock | 78 ++++++++++++++++++++++++++++++++++- 3 files changed, 79 insertions(+), 1 deletion(-) create mode 100644 composer-require-checker.json diff --git a/composer-require-checker.json b/composer-require-checker.json new file mode 100644 index 00000000..0967ef42 --- /dev/null +++ b/composer-require-checker.json @@ -0,0 +1 @@ +{} diff --git a/composer.json b/composer.json index b72ea339..0dd25186 100644 --- a/composer.json +++ b/composer.json @@ -32,6 +32,7 @@ }, "require-dev": { "laminas/laminas-coding-standard": "~2.3.0", + "maglnet/composer-require-checker": "^2.1", "phpunit/phpunit": "^9.3", "psalm/plugin-phpunit": "^0.12.2", "vimeo/psalm": "^3.16" diff --git a/composer.lock b/composer.lock index e73a6463..f5d643f8 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": "732ad72fed76d6237ce8c143cd48a55a", + "content-hash": "a5d830b1062e23a796de1d1ac6228e47", "packages": [], "packages-dev": [ { @@ -721,6 +721,82 @@ ], "time": "2021-05-29T15:53:59+00:00" }, + { + "name": "maglnet/composer-require-checker", + "version": "2.1.0", + "source": { + "type": "git", + "url": "https://github.com/maglnet/ComposerRequireChecker.git", + "reference": "0c66698d487fcb5c66cf07108e2180c818fb2e72" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/maglnet/ComposerRequireChecker/zipball/0c66698d487fcb5c66cf07108e2180c818fb2e72", + "reference": "0c66698d487fcb5c66cf07108e2180c818fb2e72", + "shasum": "" + }, + "require": { + "ext-json": "*", + "ext-phar": "*", + "nikic/php-parser": "^4.3", + "ocramius/package-versions": "^1.4.2", + "php": "^7.2", + "symfony/console": "^5.0", + "webmozart/glob": "^4.1" + }, + "require-dev": { + "ext-zend-opcache": "*", + "mikey179/vfsstream": "^1.6", + "phpstan/phpstan": "^0.12", + "phpunit/phpunit": "^8.4.3" + }, + "bin": [ + "bin/composer-require-checker" + ], + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "2.1-dev" + } + }, + "autoload": { + "psr-4": { + "ComposerRequireChecker\\": "src/ComposerRequireChecker" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Marco Pivetta", + "email": "ocramius@gmail.com", + "homepage": "http://ocramius.github.io/" + }, + { + "name": "Matthias Glaub", + "email": "magl@magl.net", + "homepage": "http://magl.net" + } + ], + "description": "CLI tool to analyze composer dependencies and verify that no unknown symbols are used in the sources of a package", + "homepage": "https://github.com/maglnet/ComposerRequireChecker", + "keywords": [ + "analysis", + "cli", + "composer", + "dependency", + "imports", + "require", + "requirements" + ], + "support": { + "issues": "https://github.com/maglnet/ComposerRequireChecker/issues", + "source": "https://github.com/maglnet/ComposerRequireChecker/tree/2.1.0" + }, + "time": "2019-12-28T13:49:20+00:00" + }, { "name": "myclabs/deep-copy", "version": "1.10.2", From 288cf001fd426a0ea46e5e7684006f73c5fff755 Mon Sep 17 00:00:00 2001 From: George Steel Date: Tue, 8 Mar 2022 10:07:29 +0000 Subject: [PATCH 02/14] Declares ctype as a required extension and lists permitted plugins Signed-off-by: George Steel --- composer.json | 7 +- composer.lock | 512 ++++++++++++++++++++++++++------------------------ 2 files changed, 275 insertions(+), 244 deletions(-) diff --git a/composer.json b/composer.json index 0dd25186..b41ac898 100644 --- a/composer.json +++ b/composer.json @@ -19,12 +19,17 @@ "sort-packages": true, "platform": { "php": "7.3.99" + }, + "allow-plugins": { + "dealerdirect/phpcodesniffer-composer-installer": true, + "composer/package-versions-deprecated": true } }, "extra": { }, "require": { - "php": "^7.3 || ~8.0.0 || ~8.1.0" + "php": "^7.3 || ~8.0.0 || ~8.1.0", + "ext-ctype": "*" }, "suggest": { "ext-iconv": "*", diff --git a/composer.lock b/composer.lock index f5d643f8..83a98730 100644 --- a/composer.lock +++ b/composer.lock @@ -4,21 +4,21 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "This file is @generated automatically" ], - "content-hash": "a5d830b1062e23a796de1d1ac6228e47", + "content-hash": "b1e04bbcfc39fe61da7cc84838900a03", "packages": [], "packages-dev": [ { "name": "amphp/amp", - "version": "v2.6.0", + "version": "v2.6.2", "source": { "type": "git", "url": "https://github.com/amphp/amp.git", - "reference": "caa95edeb1ca1bf7532e9118ede4a3c3126408cc" + "reference": "9d5100cebffa729aaffecd3ad25dc5aeea4f13bb" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/amphp/amp/zipball/caa95edeb1ca1bf7532e9118ede4a3c3126408cc", - "reference": "caa95edeb1ca1bf7532e9118ede4a3c3126408cc", + "url": "https://api.github.com/repos/amphp/amp/zipball/9d5100cebffa729aaffecd3ad25dc5aeea4f13bb", + "reference": "9d5100cebffa729aaffecd3ad25dc5aeea4f13bb", "shasum": "" }, "require": { @@ -71,7 +71,7 @@ } ], "description": "A non-blocking concurrency framework for PHP applications.", - "homepage": "http://amphp.org/amp", + "homepage": "https://amphp.org/amp", "keywords": [ "async", "asynchronous", @@ -86,7 +86,7 @@ "support": { "irc": "irc://irc.freenode.org/amphp", "issues": "https://github.com/amphp/amp/issues", - "source": "https://github.com/amphp/amp/tree/v2.6.0" + "source": "https://github.com/amphp/amp/tree/v2.6.2" }, "funding": [ { @@ -94,7 +94,7 @@ "type": "github" } ], - "time": "2021-07-16T20:06:06+00:00" + "time": "2022-02-20T17:52:18+00:00" }, { "name": "amphp/byte-stream", @@ -175,16 +175,16 @@ }, { "name": "composer/package-versions-deprecated", - "version": "1.11.99.3", + "version": "1.11.99.5", "source": { "type": "git", "url": "https://github.com/composer/package-versions-deprecated.git", - "reference": "fff576ac850c045158a250e7e27666e146e78d18" + "reference": "b4f54f74ef3453349c24a845d22392cd31e65f1d" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/composer/package-versions-deprecated/zipball/fff576ac850c045158a250e7e27666e146e78d18", - "reference": "fff576ac850c045158a250e7e27666e146e78d18", + "url": "https://api.github.com/repos/composer/package-versions-deprecated/zipball/b4f54f74ef3453349c24a845d22392cd31e65f1d", + "reference": "b4f54f74ef3453349c24a845d22392cd31e65f1d", "shasum": "" }, "require": { @@ -228,7 +228,7 @@ "description": "Composer plugin that provides efficient querying for installed package versions (no runtime IO)", "support": { "issues": "https://github.com/composer/package-versions-deprecated/issues", - "source": "https://github.com/composer/package-versions-deprecated/tree/1.11.99.3" + "source": "https://github.com/composer/package-versions-deprecated/tree/1.11.99.5" }, "funding": [ { @@ -244,27 +244,27 @@ "type": "tidelift" } ], - "time": "2021-08-17T13:49:14+00:00" + "time": "2022-01-17T14:14:24+00:00" }, { "name": "composer/semver", - "version": "3.2.5", + "version": "3.2.9", "source": { "type": "git", "url": "https://github.com/composer/semver.git", - "reference": "31f3ea725711245195f62e54ffa402d8ef2fdba9" + "reference": "a951f614bd64dcd26137bc9b7b2637ddcfc57649" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/composer/semver/zipball/31f3ea725711245195f62e54ffa402d8ef2fdba9", - "reference": "31f3ea725711245195f62e54ffa402d8ef2fdba9", + "url": "https://api.github.com/repos/composer/semver/zipball/a951f614bd64dcd26137bc9b7b2637ddcfc57649", + "reference": "a951f614bd64dcd26137bc9b7b2637ddcfc57649", "shasum": "" }, "require": { "php": "^5.3.2 || ^7.0 || ^8.0" }, "require-dev": { - "phpstan/phpstan": "^0.12.54", + "phpstan/phpstan": "^1.4", "symfony/phpunit-bridge": "^4.2 || ^5" }, "type": "library", @@ -309,7 +309,7 @@ "support": { "irc": "irc://irc.freenode.org/composer", "issues": "https://github.com/composer/semver/issues", - "source": "https://github.com/composer/semver/tree/3.2.5" + "source": "https://github.com/composer/semver/tree/3.2.9" }, "funding": [ { @@ -325,7 +325,7 @@ "type": "tidelift" } ], - "time": "2021-05-24T12:41:47+00:00" + "time": "2022-02-04T13:58:43+00:00" }, { "name": "composer/xdebug-handler", @@ -393,27 +393,27 @@ }, { "name": "dealerdirect/phpcodesniffer-composer-installer", - "version": "v0.7.1", + "version": "v0.7.2", "source": { "type": "git", "url": "https://github.com/Dealerdirect/phpcodesniffer-composer-installer.git", - "reference": "fe390591e0241955f22eb9ba327d137e501c771c" + "reference": "1c968e542d8843d7cd71de3c5c9c3ff3ad71a1db" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/Dealerdirect/phpcodesniffer-composer-installer/zipball/fe390591e0241955f22eb9ba327d137e501c771c", - "reference": "fe390591e0241955f22eb9ba327d137e501c771c", + "url": "https://api.github.com/repos/Dealerdirect/phpcodesniffer-composer-installer/zipball/1c968e542d8843d7cd71de3c5c9c3ff3ad71a1db", + "reference": "1c968e542d8843d7cd71de3c5c9c3ff3ad71a1db", "shasum": "" }, "require": { "composer-plugin-api": "^1.0 || ^2.0", "php": ">=5.3", - "squizlabs/php_codesniffer": "^2.0 || ^3.0 || ^4.0" + "squizlabs/php_codesniffer": "^2.0 || ^3.1.0 || ^4.0" }, "require-dev": { "composer/composer": "*", - "phpcompatibility/php-compatibility": "^9.0", - "sensiolabs/security-checker": "^4.1.0" + "php-parallel-lint/php-parallel-lint": "^1.3.1", + "phpcompatibility/php-compatibility": "^9.0" }, "type": "composer-plugin", "extra": { @@ -434,6 +434,10 @@ "email": "franck.nijhof@dealerdirect.com", "homepage": "http://www.frenck.nl", "role": "Developer / IT Manager" + }, + { + "name": "Contributors", + "homepage": "https://github.com/Dealerdirect/phpcodesniffer-composer-installer/graphs/contributors" } ], "description": "PHP_CodeSniffer Standards Composer Installer Plugin", @@ -445,6 +449,7 @@ "codesniffer", "composer", "installer", + "phpcbf", "phpcs", "plugin", "qa", @@ -459,7 +464,7 @@ "issues": "https://github.com/dealerdirect/phpcodesniffer-composer-installer/issues", "source": "https://github.com/dealerdirect/phpcodesniffer-composer-installer" }, - "time": "2020-12-07T18:04:37+00:00" + "time": "2022-02-04T12:51:07+00:00" }, { "name": "dnoegel/php-xdg-base-dir", @@ -500,29 +505,30 @@ }, { "name": "doctrine/instantiator", - "version": "1.4.0", + "version": "1.4.1", "source": { "type": "git", "url": "https://github.com/doctrine/instantiator.git", - "reference": "d56bf6102915de5702778fe20f2de3b2fe570b5b" + "reference": "10dcfce151b967d20fde1b34ae6640712c3891bc" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/doctrine/instantiator/zipball/d56bf6102915de5702778fe20f2de3b2fe570b5b", - "reference": "d56bf6102915de5702778fe20f2de3b2fe570b5b", + "url": "https://api.github.com/repos/doctrine/instantiator/zipball/10dcfce151b967d20fde1b34ae6640712c3891bc", + "reference": "10dcfce151b967d20fde1b34ae6640712c3891bc", "shasum": "" }, "require": { "php": "^7.1 || ^8.0" }, "require-dev": { - "doctrine/coding-standard": "^8.0", + "doctrine/coding-standard": "^9", "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" + "phpbench/phpbench": "^0.16 || ^1", + "phpstan/phpstan": "^1.4", + "phpstan/phpstan-phpunit": "^1", + "phpunit/phpunit": "^7.5 || ^8.5 || ^9.5", + "vimeo/psalm": "^4.22" }, "type": "library", "autoload": { @@ -549,7 +555,7 @@ ], "support": { "issues": "https://github.com/doctrine/instantiator/issues", - "source": "https://github.com/doctrine/instantiator/tree/1.4.0" + "source": "https://github.com/doctrine/instantiator/tree/1.4.1" }, "funding": [ { @@ -565,7 +571,7 @@ "type": "tidelift" } ], - "time": "2020-11-10T18:47:58+00:00" + "time": "2022-03-03T08:28:38+00:00" }, { "name": "felixfbecker/advanced-json-rpc", @@ -799,25 +805,29 @@ }, { "name": "myclabs/deep-copy", - "version": "1.10.2", + "version": "1.11.0", "source": { "type": "git", "url": "https://github.com/myclabs/DeepCopy.git", - "reference": "776f831124e9c62e1a2c601ecc52e776d8bb7220" + "reference": "14daed4296fae74d9e3201d2c4925d1acb7aa614" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/myclabs/DeepCopy/zipball/776f831124e9c62e1a2c601ecc52e776d8bb7220", - "reference": "776f831124e9c62e1a2c601ecc52e776d8bb7220", + "url": "https://api.github.com/repos/myclabs/DeepCopy/zipball/14daed4296fae74d9e3201d2c4925d1acb7aa614", + "reference": "14daed4296fae74d9e3201d2c4925d1acb7aa614", "shasum": "" }, "require": { "php": "^7.1 || ^8.0" }, + "conflict": { + "doctrine/collections": "<1.6.8", + "doctrine/common": "<2.13.3 || >=3,<3.2.2" + }, "require-dev": { - "doctrine/collections": "^1.0", - "doctrine/common": "^2.6", - "phpunit/phpunit": "^7.1" + "doctrine/collections": "^1.6.8", + "doctrine/common": "^2.13.3 || ^3.2.2", + "phpunit/phpunit": "^7.5.20 || ^8.5.23 || ^9.5.13" }, "type": "library", "autoload": { @@ -842,7 +852,7 @@ ], "support": { "issues": "https://github.com/myclabs/DeepCopy/issues", - "source": "https://github.com/myclabs/DeepCopy/tree/1.10.2" + "source": "https://github.com/myclabs/DeepCopy/tree/1.11.0" }, "funding": [ { @@ -850,7 +860,7 @@ "type": "tidelift" } ], - "time": "2020-11-13T09:40:50+00:00" + "time": "2022-03-03T13:19:32+00:00" }, { "name": "netresearch/jsonmapper", @@ -905,16 +915,16 @@ }, { "name": "nikic/php-parser", - "version": "v4.12.0", + "version": "v4.13.2", "source": { "type": "git", "url": "https://github.com/nikic/PHP-Parser.git", - "reference": "6608f01670c3cc5079e18c1dab1104e002579143" + "reference": "210577fe3cf7badcc5814d99455df46564f3c077" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/nikic/PHP-Parser/zipball/6608f01670c3cc5079e18c1dab1104e002579143", - "reference": "6608f01670c3cc5079e18c1dab1104e002579143", + "url": "https://api.github.com/repos/nikic/PHP-Parser/zipball/210577fe3cf7badcc5814d99455df46564f3c077", + "reference": "210577fe3cf7badcc5814d99455df46564f3c077", "shasum": "" }, "require": { @@ -955,9 +965,9 @@ ], "support": { "issues": "https://github.com/nikic/PHP-Parser/issues", - "source": "https://github.com/nikic/PHP-Parser/tree/v4.12.0" + "source": "https://github.com/nikic/PHP-Parser/tree/v4.13.2" }, - "time": "2021-07-21T10:44:31+00:00" + "time": "2021-11-30T19:35:32+00:00" }, { "name": "openlss/lib-array2xml", @@ -1074,16 +1084,16 @@ }, { "name": "phar-io/version", - "version": "3.1.0", + "version": "3.2.1", "source": { "type": "git", "url": "https://github.com/phar-io/version.git", - "reference": "bae7c545bef187884426f042434e561ab1ddb182" + "reference": "4f7fd7836c6f332bb2933569e566a0d6c4cbed74" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/phar-io/version/zipball/bae7c545bef187884426f042434e561ab1ddb182", - "reference": "bae7c545bef187884426f042434e561ab1ddb182", + "url": "https://api.github.com/repos/phar-io/version/zipball/4f7fd7836c6f332bb2933569e566a0d6c4cbed74", + "reference": "4f7fd7836c6f332bb2933569e566a0d6c4cbed74", "shasum": "" }, "require": { @@ -1119,9 +1129,9 @@ "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" + "source": "https://github.com/phar-io/version/tree/3.2.1" }, - "time": "2021-02-23T14:00:09+00:00" + "time": "2022-02-21T01:04:05+00:00" }, { "name": "phpdocumentor/reflection-common", @@ -1178,16 +1188,16 @@ }, { "name": "phpdocumentor/reflection-docblock", - "version": "5.2.2", + "version": "5.3.0", "source": { "type": "git", "url": "https://github.com/phpDocumentor/ReflectionDocBlock.git", - "reference": "069a785b2141f5bcf49f3e353548dc1cce6df556" + "reference": "622548b623e81ca6d78b721c5e029f4ce664f170" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/phpDocumentor/ReflectionDocBlock/zipball/069a785b2141f5bcf49f3e353548dc1cce6df556", - "reference": "069a785b2141f5bcf49f3e353548dc1cce6df556", + "url": "https://api.github.com/repos/phpDocumentor/ReflectionDocBlock/zipball/622548b623e81ca6d78b721c5e029f4ce664f170", + "reference": "622548b623e81ca6d78b721c5e029f4ce664f170", "shasum": "" }, "require": { @@ -1198,7 +1208,8 @@ "webmozart/assert": "^1.9.1" }, "require-dev": { - "mockery/mockery": "~1.3.2" + "mockery/mockery": "~1.3.2", + "psalm/phar": "^4.8" }, "type": "library", "extra": { @@ -1228,22 +1239,22 @@ "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/master" + "source": "https://github.com/phpDocumentor/ReflectionDocBlock/tree/5.3.0" }, - "time": "2020-09-03T19:13:55+00:00" + "time": "2021-10-19T17:43:47+00:00" }, { "name": "phpdocumentor/type-resolver", - "version": "1.4.0", + "version": "1.6.0", "source": { "type": "git", "url": "https://github.com/phpDocumentor/TypeResolver.git", - "reference": "6a467b8989322d92aa1c8bf2bebcc6e5c2ba55c0" + "reference": "93ebd0014cab80c4ea9f5e297ea48672f1b87706" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/phpDocumentor/TypeResolver/zipball/6a467b8989322d92aa1c8bf2bebcc6e5c2ba55c0", - "reference": "6a467b8989322d92aa1c8bf2bebcc6e5c2ba55c0", + "url": "https://api.github.com/repos/phpDocumentor/TypeResolver/zipball/93ebd0014cab80c4ea9f5e297ea48672f1b87706", + "reference": "93ebd0014cab80c4ea9f5e297ea48672f1b87706", "shasum": "" }, "require": { @@ -1251,7 +1262,8 @@ "phpdocumentor/reflection-common": "^2.0" }, "require-dev": { - "ext-tokenizer": "*" + "ext-tokenizer": "*", + "psalm/phar": "^4.8" }, "type": "library", "extra": { @@ -1277,39 +1289,39 @@ "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.4.0" + "source": "https://github.com/phpDocumentor/TypeResolver/tree/1.6.0" }, - "time": "2020-09-17T18:55:26+00:00" + "time": "2022-01-04T19:58:01+00:00" }, { "name": "phpspec/prophecy", - "version": "1.13.0", + "version": "v1.15.0", "source": { "type": "git", "url": "https://github.com/phpspec/prophecy.git", - "reference": "be1996ed8adc35c3fd795488a653f4b518be70ea" + "reference": "bbcd7380b0ebf3961ee21409db7b38bc31d69a13" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/phpspec/prophecy/zipball/be1996ed8adc35c3fd795488a653f4b518be70ea", - "reference": "be1996ed8adc35c3fd795488a653f4b518be70ea", + "url": "https://api.github.com/repos/phpspec/prophecy/zipball/bbcd7380b0ebf3961ee21409db7b38bc31d69a13", + "reference": "bbcd7380b0ebf3961ee21409db7b38bc31d69a13", "shasum": "" }, "require": { "doctrine/instantiator": "^1.2", - "php": "^7.2 || ~8.0, <8.1", + "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", + "phpspec/phpspec": "^6.0 || ^7.0", "phpunit/phpunit": "^8.0 || ^9.0" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "1.11.x-dev" + "dev-master": "1.x-dev" } }, "autoload": { @@ -1344,22 +1356,22 @@ ], "support": { "issues": "https://github.com/phpspec/prophecy/issues", - "source": "https://github.com/phpspec/prophecy/tree/1.13.0" + "source": "https://github.com/phpspec/prophecy/tree/v1.15.0" }, - "time": "2021-03-17T13:42:18+00:00" + "time": "2021-12-08T12:19:24+00:00" }, { "name": "phpstan/phpdoc-parser", - "version": "0.5.5", + "version": "1.2.0", "source": { "type": "git", "url": "https://github.com/phpstan/phpdoc-parser.git", - "reference": "ea0b17460ec38e20d7eb64e7ec49b5d44af5d28c" + "reference": "dbc093d7af60eff5cd575d2ed761b15ed40bd08e" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/phpstan/phpdoc-parser/zipball/ea0b17460ec38e20d7eb64e7ec49b5d44af5d28c", - "reference": "ea0b17460ec38e20d7eb64e7ec49b5d44af5d28c", + "url": "https://api.github.com/repos/phpstan/phpdoc-parser/zipball/dbc093d7af60eff5cd575d2ed761b15ed40bd08e", + "reference": "dbc093d7af60eff5cd575d2ed761b15ed40bd08e", "shasum": "" }, "require": { @@ -1368,15 +1380,15 @@ "require-dev": { "php-parallel-lint/php-parallel-lint": "^1.2", "phpstan/extension-installer": "^1.0", - "phpstan/phpstan": "^0.12.87", - "phpstan/phpstan-strict-rules": "^0.12.5", + "phpstan/phpstan": "^1.0", + "phpstan/phpstan-strict-rules": "^1.0", "phpunit/phpunit": "^9.5", "symfony/process": "^5.2" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "0.5-dev" + "dev-master": "1.0-dev" } }, "autoload": { @@ -1393,29 +1405,29 @@ "description": "PHPDoc parser with support for nullable, intersection and generic types", "support": { "issues": "https://github.com/phpstan/phpdoc-parser/issues", - "source": "https://github.com/phpstan/phpdoc-parser/tree/0.5.5" + "source": "https://github.com/phpstan/phpdoc-parser/tree/1.2.0" }, - "time": "2021-06-11T13:24:46+00:00" + "time": "2021-09-16T20:46:02+00:00" }, { "name": "phpunit/php-code-coverage", - "version": "9.2.6", + "version": "9.2.15", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/php-code-coverage.git", - "reference": "f6293e1b30a2354e8428e004689671b83871edde" + "reference": "2e9da11878c4202f97915c1cb4bb1ca318a63f5f" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/php-code-coverage/zipball/f6293e1b30a2354e8428e004689671b83871edde", - "reference": "f6293e1b30a2354e8428e004689671b83871edde", + "url": "https://api.github.com/repos/sebastianbergmann/php-code-coverage/zipball/2e9da11878c4202f97915c1cb4bb1ca318a63f5f", + "reference": "2e9da11878c4202f97915c1cb4bb1ca318a63f5f", "shasum": "" }, "require": { "ext-dom": "*", "ext-libxml": "*", "ext-xmlwriter": "*", - "nikic/php-parser": "^4.10.2", + "nikic/php-parser": "^4.13.0", "php": ">=7.3", "phpunit/php-file-iterator": "^3.0.3", "phpunit/php-text-template": "^2.0.2", @@ -1464,7 +1476,7 @@ ], "support": { "issues": "https://github.com/sebastianbergmann/php-code-coverage/issues", - "source": "https://github.com/sebastianbergmann/php-code-coverage/tree/9.2.6" + "source": "https://github.com/sebastianbergmann/php-code-coverage/tree/9.2.15" }, "funding": [ { @@ -1472,20 +1484,20 @@ "type": "github" } ], - "time": "2021-03-28T07:26:59+00:00" + "time": "2022-03-07T09:28:20+00:00" }, { "name": "phpunit/php-file-iterator", - "version": "3.0.5", + "version": "3.0.6", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/php-file-iterator.git", - "reference": "aa4be8575f26070b100fccb67faabb28f21f66f8" + "reference": "cf1c2e7c203ac650e352f4cc675a7021e7d1b3cf" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/php-file-iterator/zipball/aa4be8575f26070b100fccb67faabb28f21f66f8", - "reference": "aa4be8575f26070b100fccb67faabb28f21f66f8", + "url": "https://api.github.com/repos/sebastianbergmann/php-file-iterator/zipball/cf1c2e7c203ac650e352f4cc675a7021e7d1b3cf", + "reference": "cf1c2e7c203ac650e352f4cc675a7021e7d1b3cf", "shasum": "" }, "require": { @@ -1524,7 +1536,7 @@ ], "support": { "issues": "https://github.com/sebastianbergmann/php-file-iterator/issues", - "source": "https://github.com/sebastianbergmann/php-file-iterator/tree/3.0.5" + "source": "https://github.com/sebastianbergmann/php-file-iterator/tree/3.0.6" }, "funding": [ { @@ -1532,7 +1544,7 @@ "type": "github" } ], - "time": "2020-09-28T05:57:25+00:00" + "time": "2021-12-02T12:48:52+00:00" }, { "name": "phpunit/php-invoker", @@ -1717,16 +1729,16 @@ }, { "name": "phpunit/phpunit", - "version": "9.5.9", + "version": "9.5.18", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/phpunit.git", - "reference": "ea8c2dfb1065eb35a79b3681eee6e6fb0a6f273b" + "reference": "1b5856028273bfd855e60a887278857d872ec67a" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/ea8c2dfb1065eb35a79b3681eee6e6fb0a6f273b", - "reference": "ea8c2dfb1065eb35a79b3681eee6e6fb0a6f273b", + "url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/1b5856028273bfd855e60a887278857d872ec67a", + "reference": "1b5856028273bfd855e60a887278857d872ec67a", "shasum": "" }, "require": { @@ -1742,7 +1754,7 @@ "phar-io/version": "^3.0.2", "php": ">=7.3", "phpspec/prophecy": "^1.12.1", - "phpunit/php-code-coverage": "^9.2.3", + "phpunit/php-code-coverage": "^9.2.13", "phpunit/php-file-iterator": "^3.0.5", "phpunit/php-invoker": "^3.1.1", "phpunit/php-text-template": "^2.0.3", @@ -1804,11 +1816,11 @@ ], "support": { "issues": "https://github.com/sebastianbergmann/phpunit/issues", - "source": "https://github.com/sebastianbergmann/phpunit/tree/9.5.9" + "source": "https://github.com/sebastianbergmann/phpunit/tree/9.5.18" }, "funding": [ { - "url": "https://phpunit.de/donate.html", + "url": "https://phpunit.de/sponsors.html", "type": "custom" }, { @@ -1816,7 +1828,7 @@ "type": "github" } ], - "time": "2021-08-31T06:47:40+00:00" + "time": "2022-03-08T06:52:28+00:00" }, { "name": "psalm/plugin-phpunit", @@ -2401,16 +2413,16 @@ }, { "name": "sebastian/exporter", - "version": "4.0.3", + "version": "4.0.4", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/exporter.git", - "reference": "d89cc98761b8cb5a1a235a6b703ae50d34080e65" + "reference": "65e8b7db476c5dd267e65eea9cab77584d3cfff9" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/exporter/zipball/d89cc98761b8cb5a1a235a6b703ae50d34080e65", - "reference": "d89cc98761b8cb5a1a235a6b703ae50d34080e65", + "url": "https://api.github.com/repos/sebastianbergmann/exporter/zipball/65e8b7db476c5dd267e65eea9cab77584d3cfff9", + "reference": "65e8b7db476c5dd267e65eea9cab77584d3cfff9", "shasum": "" }, "require": { @@ -2459,14 +2471,14 @@ } ], "description": "Provides the functionality to export PHP variables for visualization", - "homepage": "http://www.github.com/sebastianbergmann/exporter", + "homepage": "https://www.github.com/sebastianbergmann/exporter", "keywords": [ "export", "exporter" ], "support": { "issues": "https://github.com/sebastianbergmann/exporter/issues", - "source": "https://github.com/sebastianbergmann/exporter/tree/4.0.3" + "source": "https://github.com/sebastianbergmann/exporter/tree/4.0.4" }, "funding": [ { @@ -2474,20 +2486,20 @@ "type": "github" } ], - "time": "2020-09-28T05:24:23+00:00" + "time": "2021-11-11T14:18:36+00:00" }, { "name": "sebastian/global-state", - "version": "5.0.3", + "version": "5.0.5", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/global-state.git", - "reference": "23bd5951f7ff26f12d4e3242864df3e08dec4e49" + "reference": "0ca8db5a5fc9c8646244e629625ac486fa286bf2" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/global-state/zipball/23bd5951f7ff26f12d4e3242864df3e08dec4e49", - "reference": "23bd5951f7ff26f12d4e3242864df3e08dec4e49", + "url": "https://api.github.com/repos/sebastianbergmann/global-state/zipball/0ca8db5a5fc9c8646244e629625ac486fa286bf2", + "reference": "0ca8db5a5fc9c8646244e629625ac486fa286bf2", "shasum": "" }, "require": { @@ -2530,7 +2542,7 @@ ], "support": { "issues": "https://github.com/sebastianbergmann/global-state/issues", - "source": "https://github.com/sebastianbergmann/global-state/tree/5.0.3" + "source": "https://github.com/sebastianbergmann/global-state/tree/5.0.5" }, "funding": [ { @@ -2538,7 +2550,7 @@ "type": "github" } ], - "time": "2021-06-11T13:31:12+00:00" + "time": "2022-02-14T08:28:10+00:00" }, { "name": "sebastian/lines-of-code", @@ -2938,32 +2950,32 @@ }, { "name": "slevomat/coding-standard", - "version": "7.0.14", + "version": "7.0.19", "source": { "type": "git", "url": "https://github.com/slevomat/coding-standard.git", - "reference": "15b2b4630c148775debea8e412bc7e128d9868a3" + "reference": "bef66a43815bbf9b5f49775e9ded3f7c6ba0cc37" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/slevomat/coding-standard/zipball/15b2b4630c148775debea8e412bc7e128d9868a3", - "reference": "15b2b4630c148775debea8e412bc7e128d9868a3", + "url": "https://api.github.com/repos/slevomat/coding-standard/zipball/bef66a43815bbf9b5f49775e9ded3f7c6ba0cc37", + "reference": "bef66a43815bbf9b5f49775e9ded3f7c6ba0cc37", "shasum": "" }, "require": { "dealerdirect/phpcodesniffer-composer-installer": "^0.6.2 || ^0.7", "php": "^7.1 || ^8.0", - "phpstan/phpdoc-parser": "0.5.1 - 0.5.5", - "squizlabs/php_codesniffer": "^3.6.0" + "phpstan/phpdoc-parser": "^1.0.0", + "squizlabs/php_codesniffer": "^3.6.2" }, "require-dev": { - "phing/phing": "2.16.4", - "php-parallel-lint/php-parallel-lint": "1.3.1", - "phpstan/phpstan": "0.12.96", - "phpstan/phpstan-deprecation-rules": "0.12.6", - "phpstan/phpstan-phpunit": "0.12.22", - "phpstan/phpstan-strict-rules": "0.12.11", - "phpunit/phpunit": "7.5.20|8.5.5|9.5.8" + "phing/phing": "2.17.2", + "php-parallel-lint/php-parallel-lint": "1.3.2", + "phpstan/phpstan": "1.4.6", + "phpstan/phpstan-deprecation-rules": "1.0.0", + "phpstan/phpstan-phpunit": "1.0.0", + "phpstan/phpstan-strict-rules": "1.1.0", + "phpunit/phpunit": "7.5.20|8.5.21|9.5.16" }, "type": "phpcodesniffer-standard", "extra": { @@ -2983,7 +2995,7 @@ "description": "Slevomat Coding Standard for PHP_CodeSniffer complements Consistence Coding Standard by providing sniffs with additional checks.", "support": { "issues": "https://github.com/slevomat/coding-standard/issues", - "source": "https://github.com/slevomat/coding-standard/tree/7.0.14" + "source": "https://github.com/slevomat/coding-standard/tree/7.0.19" }, "funding": [ { @@ -2995,20 +3007,20 @@ "type": "tidelift" } ], - "time": "2021-08-26T12:17:56+00:00" + "time": "2022-03-01T18:01:41+00:00" }, { "name": "squizlabs/php_codesniffer", - "version": "3.6.0", + "version": "3.6.2", "source": { "type": "git", "url": "https://github.com/squizlabs/PHP_CodeSniffer.git", - "reference": "ffced0d2c8fa8e6cdc4d695a743271fab6c38625" + "reference": "5e4e71592f69da17871dba6e80dd51bce74a351a" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/squizlabs/PHP_CodeSniffer/zipball/ffced0d2c8fa8e6cdc4d695a743271fab6c38625", - "reference": "ffced0d2c8fa8e6cdc4d695a743271fab6c38625", + "url": "https://api.github.com/repos/squizlabs/PHP_CodeSniffer/zipball/5e4e71592f69da17871dba6e80dd51bce74a351a", + "reference": "5e4e71592f69da17871dba6e80dd51bce74a351a", "shasum": "" }, "require": { @@ -3051,30 +3063,30 @@ "source": "https://github.com/squizlabs/PHP_CodeSniffer", "wiki": "https://github.com/squizlabs/PHP_CodeSniffer/wiki" }, - "time": "2021-04-09T00:54:41+00:00" + "time": "2021-12-12T21:44:58+00:00" }, { "name": "symfony/console", - "version": "v5.3.7", + "version": "v5.4.5", "source": { "type": "git", "url": "https://github.com/symfony/console.git", - "reference": "8b1008344647462ae6ec57559da166c2bfa5e16a" + "reference": "d8111acc99876953f52fe16d4c50eb60940d49ad" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/console/zipball/8b1008344647462ae6ec57559da166c2bfa5e16a", - "reference": "8b1008344647462ae6ec57559da166c2bfa5e16a", + "url": "https://api.github.com/repos/symfony/console/zipball/d8111acc99876953f52fe16d4c50eb60940d49ad", + "reference": "d8111acc99876953f52fe16d4c50eb60940d49ad", "shasum": "" }, "require": { "php": ">=7.2.5", - "symfony/deprecation-contracts": "^2.1", + "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", - "symfony/string": "^5.1" + "symfony/service-contracts": "^1.1|^2|^3", + "symfony/string": "^5.1|^6.0" }, "conflict": { "psr/log": ">=3", @@ -3089,12 +3101,12 @@ }, "require-dev": { "psr/log": "^1|^2", - "symfony/config": "^4.4|^5.0", - "symfony/dependency-injection": "^4.4|^5.0", - "symfony/event-dispatcher": "^4.4|^5.0", - "symfony/lock": "^4.4|^5.0", - "symfony/process": "^4.4|^5.0", - "symfony/var-dumper": "^4.4|^5.0" + "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": "For using the console logger", @@ -3134,7 +3146,7 @@ "terminal" ], "support": { - "source": "https://github.com/symfony/console/tree/v5.3.7" + "source": "https://github.com/symfony/console/tree/v5.4.5" }, "funding": [ { @@ -3150,20 +3162,20 @@ "type": "tidelift" } ], - "time": "2021-08-25T20:02:16+00:00" + "time": "2022-02-24T12:45:35+00:00" }, { "name": "symfony/deprecation-contracts", - "version": "v2.4.0", + "version": "v2.5.0", "source": { "type": "git", "url": "https://github.com/symfony/deprecation-contracts.git", - "reference": "5f38c8804a9e97d23e0c8d63341088cd8a22d627" + "reference": "6f981ee24cf69ee7ce9736146d1c57c2780598a8" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/deprecation-contracts/zipball/5f38c8804a9e97d23e0c8d63341088cd8a22d627", - "reference": "5f38c8804a9e97d23e0c8d63341088cd8a22d627", + "url": "https://api.github.com/repos/symfony/deprecation-contracts/zipball/6f981ee24cf69ee7ce9736146d1c57c2780598a8", + "reference": "6f981ee24cf69ee7ce9736146d1c57c2780598a8", "shasum": "" }, "require": { @@ -3172,7 +3184,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-main": "2.4-dev" + "dev-main": "2.5-dev" }, "thanks": { "name": "symfony/contracts", @@ -3201,7 +3213,7 @@ "description": "A generic function and convention to trigger deprecation notices", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/deprecation-contracts/tree/v2.4.0" + "source": "https://github.com/symfony/deprecation-contracts/tree/v2.5.0" }, "funding": [ { @@ -3217,25 +3229,28 @@ "type": "tidelift" } ], - "time": "2021-03-23T23:28:01+00:00" + "time": "2021-07-12T14:48:14+00:00" }, { "name": "symfony/polyfill-ctype", - "version": "v1.23.0", + "version": "v1.25.0", "source": { "type": "git", "url": "https://github.com/symfony/polyfill-ctype.git", - "reference": "46cd95797e9df938fdd2b03693b5fca5e64b01ce" + "reference": "30885182c981ab175d4d034db0f6f469898070ab" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-ctype/zipball/46cd95797e9df938fdd2b03693b5fca5e64b01ce", - "reference": "46cd95797e9df938fdd2b03693b5fca5e64b01ce", + "url": "https://api.github.com/repos/symfony/polyfill-ctype/zipball/30885182c981ab175d4d034db0f6f469898070ab", + "reference": "30885182c981ab175d4d034db0f6f469898070ab", "shasum": "" }, "require": { "php": ">=7.1" }, + "provide": { + "ext-ctype": "*" + }, "suggest": { "ext-ctype": "For best performance" }, @@ -3250,12 +3265,12 @@ } }, "autoload": { - "psr-4": { - "Symfony\\Polyfill\\Ctype\\": "" - }, "files": [ "bootstrap.php" - ] + ], + "psr-4": { + "Symfony\\Polyfill\\Ctype\\": "" + } }, "notification-url": "https://packagist.org/downloads/", "license": [ @@ -3280,7 +3295,7 @@ "portable" ], "support": { - "source": "https://github.com/symfony/polyfill-ctype/tree/v1.23.0" + "source": "https://github.com/symfony/polyfill-ctype/tree/v1.25.0" }, "funding": [ { @@ -3296,20 +3311,20 @@ "type": "tidelift" } ], - "time": "2021-02-19T12:13:01+00:00" + "time": "2021-10-20T20:35:02+00:00" }, { "name": "symfony/polyfill-intl-grapheme", - "version": "v1.23.1", + "version": "v1.25.0", "source": { "type": "git", "url": "https://github.com/symfony/polyfill-intl-grapheme.git", - "reference": "16880ba9c5ebe3642d1995ab866db29270b36535" + "reference": "81b86b50cf841a64252b439e738e97f4a34e2783" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-intl-grapheme/zipball/16880ba9c5ebe3642d1995ab866db29270b36535", - "reference": "16880ba9c5ebe3642d1995ab866db29270b36535", + "url": "https://api.github.com/repos/symfony/polyfill-intl-grapheme/zipball/81b86b50cf841a64252b439e738e97f4a34e2783", + "reference": "81b86b50cf841a64252b439e738e97f4a34e2783", "shasum": "" }, "require": { @@ -3361,7 +3376,7 @@ "shim" ], "support": { - "source": "https://github.com/symfony/polyfill-intl-grapheme/tree/v1.23.1" + "source": "https://github.com/symfony/polyfill-intl-grapheme/tree/v1.25.0" }, "funding": [ { @@ -3377,11 +3392,11 @@ "type": "tidelift" } ], - "time": "2021-05-27T12:26:48+00:00" + "time": "2021-11-23T21:10:46+00:00" }, { "name": "symfony/polyfill-intl-normalizer", - "version": "v1.23.0", + "version": "v1.25.0", "source": { "type": "git", "url": "https://github.com/symfony/polyfill-intl-normalizer.git", @@ -3445,7 +3460,7 @@ "shim" ], "support": { - "source": "https://github.com/symfony/polyfill-intl-normalizer/tree/v1.23.0" + "source": "https://github.com/symfony/polyfill-intl-normalizer/tree/v1.25.0" }, "funding": [ { @@ -3465,21 +3480,24 @@ }, { "name": "symfony/polyfill-mbstring", - "version": "v1.23.1", + "version": "v1.25.0", "source": { "type": "git", "url": "https://github.com/symfony/polyfill-mbstring.git", - "reference": "9174a3d80210dca8daa7f31fec659150bbeabfc6" + "reference": "0abb51d2f102e00a4eefcf46ba7fec406d245825" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-mbstring/zipball/9174a3d80210dca8daa7f31fec659150bbeabfc6", - "reference": "9174a3d80210dca8daa7f31fec659150bbeabfc6", + "url": "https://api.github.com/repos/symfony/polyfill-mbstring/zipball/0abb51d2f102e00a4eefcf46ba7fec406d245825", + "reference": "0abb51d2f102e00a4eefcf46ba7fec406d245825", "shasum": "" }, "require": { "php": ">=7.1" }, + "provide": { + "ext-mbstring": "*" + }, "suggest": { "ext-mbstring": "For best performance" }, @@ -3525,7 +3543,7 @@ "shim" ], "support": { - "source": "https://github.com/symfony/polyfill-mbstring/tree/v1.23.1" + "source": "https://github.com/symfony/polyfill-mbstring/tree/v1.25.0" }, "funding": [ { @@ -3541,20 +3559,20 @@ "type": "tidelift" } ], - "time": "2021-05-27T12:26:48+00:00" + "time": "2021-11-30T18:21:41+00:00" }, { "name": "symfony/polyfill-php73", - "version": "v1.23.0", + "version": "v1.25.0", "source": { "type": "git", "url": "https://github.com/symfony/polyfill-php73.git", - "reference": "fba8933c384d6476ab14fb7b8526e5287ca7e010" + "reference": "cc5db0e22b3cb4111010e48785a97f670b350ca5" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-php73/zipball/fba8933c384d6476ab14fb7b8526e5287ca7e010", - "reference": "fba8933c384d6476ab14fb7b8526e5287ca7e010", + "url": "https://api.github.com/repos/symfony/polyfill-php73/zipball/cc5db0e22b3cb4111010e48785a97f670b350ca5", + "reference": "cc5db0e22b3cb4111010e48785a97f670b350ca5", "shasum": "" }, "require": { @@ -3604,7 +3622,7 @@ "shim" ], "support": { - "source": "https://github.com/symfony/polyfill-php73/tree/v1.23.0" + "source": "https://github.com/symfony/polyfill-php73/tree/v1.25.0" }, "funding": [ { @@ -3620,20 +3638,20 @@ "type": "tidelift" } ], - "time": "2021-02-19T12:13:01+00:00" + "time": "2021-06-05T21:20:04+00:00" }, { "name": "symfony/polyfill-php80", - "version": "v1.23.1", + "version": "v1.25.0", "source": { "type": "git", "url": "https://github.com/symfony/polyfill-php80.git", - "reference": "1100343ed1a92e3a38f9ae122fc0eb21602547be" + "reference": "4407588e0d3f1f52efb65fbe92babe41f37fe50c" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-php80/zipball/1100343ed1a92e3a38f9ae122fc0eb21602547be", - "reference": "1100343ed1a92e3a38f9ae122fc0eb21602547be", + "url": "https://api.github.com/repos/symfony/polyfill-php80/zipball/4407588e0d3f1f52efb65fbe92babe41f37fe50c", + "reference": "4407588e0d3f1f52efb65fbe92babe41f37fe50c", "shasum": "" }, "require": { @@ -3687,7 +3705,7 @@ "shim" ], "support": { - "source": "https://github.com/symfony/polyfill-php80/tree/v1.23.1" + "source": "https://github.com/symfony/polyfill-php80/tree/v1.25.0" }, "funding": [ { @@ -3703,25 +3721,29 @@ "type": "tidelift" } ], - "time": "2021-07-28T13:41:28+00:00" + "time": "2022-03-04T08:16:47+00:00" }, { "name": "symfony/service-contracts", - "version": "v2.4.0", + "version": "v2.5.0", "source": { "type": "git", "url": "https://github.com/symfony/service-contracts.git", - "reference": "f040a30e04b57fbcc9c6cbcf4dbaa96bd318b9bb" + "reference": "1ab11b933cd6bc5464b08e81e2c5b07dec58b0fc" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/service-contracts/zipball/f040a30e04b57fbcc9c6cbcf4dbaa96bd318b9bb", - "reference": "f040a30e04b57fbcc9c6cbcf4dbaa96bd318b9bb", + "url": "https://api.github.com/repos/symfony/service-contracts/zipball/1ab11b933cd6bc5464b08e81e2c5b07dec58b0fc", + "reference": "1ab11b933cd6bc5464b08e81e2c5b07dec58b0fc", "shasum": "" }, "require": { "php": ">=7.2.5", - "psr/container": "^1.1" + "psr/container": "^1.1", + "symfony/deprecation-contracts": "^2.1" + }, + "conflict": { + "ext-psr": "<1.1|>=2" }, "suggest": { "symfony/service-implementation": "" @@ -3729,7 +3751,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-main": "2.4-dev" + "dev-main": "2.5-dev" }, "thanks": { "name": "symfony/contracts", @@ -3766,7 +3788,7 @@ "standards" ], "support": { - "source": "https://github.com/symfony/service-contracts/tree/v2.4.0" + "source": "https://github.com/symfony/service-contracts/tree/v2.5.0" }, "funding": [ { @@ -3782,20 +3804,20 @@ "type": "tidelift" } ], - "time": "2021-04-01T10:43:52+00:00" + "time": "2021-11-04T16:48:04+00:00" }, { "name": "symfony/string", - "version": "v5.3.7", + "version": "v5.4.3", "source": { "type": "git", "url": "https://github.com/symfony/string.git", - "reference": "8d224396e28d30f81969f083a58763b8b9ceb0a5" + "reference": "92043b7d8383e48104e411bc9434b260dbeb5a10" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/string/zipball/8d224396e28d30f81969f083a58763b8b9ceb0a5", - "reference": "8d224396e28d30f81969f083a58763b8b9ceb0a5", + "url": "https://api.github.com/repos/symfony/string/zipball/92043b7d8383e48104e411bc9434b260dbeb5a10", + "reference": "92043b7d8383e48104e411bc9434b260dbeb5a10", "shasum": "" }, "require": { @@ -3806,20 +3828,23 @@ "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", - "symfony/http-client": "^4.4|^5.0", + "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" + "symfony/var-exporter": "^4.4|^5.0|^6.0" }, "type": "library", "autoload": { - "psr-4": { - "Symfony\\Component\\String\\": "" - }, "files": [ "Resources/functions.php" ], + "psr-4": { + "Symfony\\Component\\String\\": "" + }, "exclude-from-classmap": [ "/Tests/" ] @@ -3849,7 +3874,7 @@ "utf8" ], "support": { - "source": "https://github.com/symfony/string/tree/v5.3.7" + "source": "https://github.com/symfony/string/tree/v5.4.3" }, "funding": [ { @@ -3865,7 +3890,7 @@ "type": "tidelift" } ], - "time": "2021-08-26T08:00:08+00:00" + "time": "2022-01-02T09:53:40+00:00" }, { "name": "theseer/tokenizer", @@ -4023,24 +4048,24 @@ }, { "name": "webimpress/coding-standard", - "version": "1.2.2", + "version": "1.2.4", "source": { "type": "git", "url": "https://github.com/webimpress/coding-standard.git", - "reference": "8f4a220de33f471a8101836f7ec72b852c3f9f03" + "reference": "cd0c4b0b97440c337c1f7da17b524674ca2f9ca9" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/webimpress/coding-standard/zipball/8f4a220de33f471a8101836f7ec72b852c3f9f03", - "reference": "8f4a220de33f471a8101836f7ec72b852c3f9f03", + "url": "https://api.github.com/repos/webimpress/coding-standard/zipball/cd0c4b0b97440c337c1f7da17b524674ca2f9ca9", + "reference": "cd0c4b0b97440c337c1f7da17b524674ca2f9ca9", "shasum": "" }, "require": { "php": "^7.3 || ^8.0", - "squizlabs/php_codesniffer": "^3.6" + "squizlabs/php_codesniffer": "^3.6.2" }, "require-dev": { - "phpunit/phpunit": "^9.5.4" + "phpunit/phpunit": "^9.5.13" }, "type": "phpcodesniffer-standard", "extra": { @@ -4066,7 +4091,7 @@ ], "support": { "issues": "https://github.com/webimpress/coding-standard/issues", - "source": "https://github.com/webimpress/coding-standard/tree/1.2.2" + "source": "https://github.com/webimpress/coding-standard/tree/1.2.4" }, "funding": [ { @@ -4074,7 +4099,7 @@ "type": "github" } ], - "time": "2021-04-12T12:51:27+00:00" + "time": "2022-02-15T19:52:12+00:00" }, { "name": "webmozart/assert", @@ -4131,16 +4156,16 @@ }, { "name": "webmozart/glob", - "version": "4.3.0", + "version": "4.4.0", "source": { "type": "git", "url": "https://github.com/webmozarts/glob.git", - "reference": "06358fafde0f32edb4513f4fd88fe113a40c90ee" + "reference": "539b5dbc10021d3f9242e7a9e9b6b37843179e83" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/webmozarts/glob/zipball/06358fafde0f32edb4513f4fd88fe113a40c90ee", - "reference": "06358fafde0f32edb4513f4fd88fe113a40c90ee", + "url": "https://api.github.com/repos/webmozarts/glob/zipball/539b5dbc10021d3f9242e7a9e9b6b37843179e83", + "reference": "539b5dbc10021d3f9242e7a9e9b6b37843179e83", "shasum": "" }, "require": { @@ -4148,8 +4173,8 @@ "webmozart/path-util": "^2.2" }, "require-dev": { - "phpunit/phpunit": "^8.0", - "symfony/filesystem": "^5.1" + "phpunit/phpunit": "^9.5", + "symfony/filesystem": "^5.3" }, "type": "library", "extra": { @@ -4175,9 +4200,9 @@ "description": "A PHP implementation of Ant's glob.", "support": { "issues": "https://github.com/webmozarts/glob/issues", - "source": "https://github.com/webmozarts/glob/tree/4.3.0" + "source": "https://github.com/webmozarts/glob/tree/4.4.0" }, - "time": "2021-01-21T06:17:15+00:00" + "time": "2021-10-07T16:13:08+00:00" }, { "name": "webmozart/path-util", @@ -4237,7 +4262,8 @@ "prefer-stable": false, "prefer-lowest": false, "platform": { - "php": "^7.3 || ~8.0.0 || ~8.1.0" + "php": "^7.3 || ~8.0.0 || ~8.1.0", + "ext-ctype": "*" }, "platform-dev": [], "platform-overrides": { From f9e22a294bc8d3eb56f7ca0a71d029950ceae647 Mon Sep 17 00:00:00 2001 From: George Steel Date: Tue, 8 Mar 2022 10:08:15 +0000 Subject: [PATCH 03/14] Adjust require checker configuration to whitelist iconv and mbstring which are tested prior to use Signed-off-by: George Steel --- composer-require-checker.json | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/composer-require-checker.json b/composer-require-checker.json index 0967ef42..2ff6bff6 100644 --- a/composer-require-checker.json +++ b/composer-require-checker.json @@ -1 +1,13 @@ -{} +{ + "php-core-extensions" : [ + "Core", + "date", + "pcre", + "Phar", + "Reflection", + "SPL", + "standard", + "iconv", + "mbstring" + ] +} From b18f9790a33ff70acbf2034512fe09b9cc5b0693 Mon Sep 17 00:00:00 2001 From: George Steel Date: Tue, 8 Mar 2022 10:14:54 +0000 Subject: [PATCH 04/14] Fixes markdown lint error causing CI to fail Signed-off-by: George Steel --- docs/book/intro.md | 1 + 1 file changed, 1 insertion(+) diff --git a/docs/book/intro.md b/docs/book/intro.md index 0b9cef03..92abf3f5 100644 --- a/docs/book/intro.md +++ b/docs/book/intro.md @@ -18,6 +18,7 @@ Several Laminas components provide integrations for consuming laminas-escaper, including [laminas-view](https://github.com/laminas/laminas-view), which provides a set of helpers that consume it. + > ### Security > > laminas-escaper is a security related component. As such, if you believe you have From 35a2099e22bb68d44ade73eac70d914b551de727 Mon Sep 17 00:00:00 2001 From: George Steel Date: Tue, 8 Mar 2022 11:40:23 +0000 Subject: [PATCH 05/14] Declares mbstring as a dependency and removes iconv usage. Bumps minimum PHP to 7.4 Signed-off-by: George Steel --- composer-require-checker.json | 14 +------------- composer.json | 9 +++------ composer.lock | 23 ++++++++++++----------- src/Escaper.php | 20 ++++---------------- 4 files changed, 20 insertions(+), 46 deletions(-) diff --git a/composer-require-checker.json b/composer-require-checker.json index 2ff6bff6..0967ef42 100644 --- a/composer-require-checker.json +++ b/composer-require-checker.json @@ -1,13 +1 @@ -{ - "php-core-extensions" : [ - "Core", - "date", - "pcre", - "Phar", - "Reflection", - "SPL", - "standard", - "iconv", - "mbstring" - ] -} +{} diff --git a/composer.json b/composer.json index b41ac898..912e4c63 100644 --- a/composer.json +++ b/composer.json @@ -18,7 +18,7 @@ "config": { "sort-packages": true, "platform": { - "php": "7.3.99" + "php": "7.4.99" }, "allow-plugins": { "dealerdirect/phpcodesniffer-composer-installer": true, @@ -28,11 +28,8 @@ "extra": { }, "require": { - "php": "^7.3 || ~8.0.0 || ~8.1.0", - "ext-ctype": "*" - }, - "suggest": { - "ext-iconv": "*", + "php": "^7.4 || ~8.0.0 || ~8.1.0", + "ext-ctype": "*", "ext-mbstring": "*" }, "require-dev": { diff --git a/composer.lock b/composer.lock index 83a98730..911e15e6 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": "b1e04bbcfc39fe61da7cc84838900a03", + "content-hash": "d8a3e185d0c0ffb620ba40bdd0f8910c", "packages": [], "packages-dev": [ { @@ -1888,20 +1888,20 @@ }, { "name": "psr/container", - "version": "1.1.1", + "version": "1.1.2", "source": { "type": "git", "url": "https://github.com/php-fig/container.git", - "reference": "8622567409010282b7aeebe4bb841fe98b58dcaf" + "reference": "513e0666f7216c7459170d56df27dfcefe1689ea" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/php-fig/container/zipball/8622567409010282b7aeebe4bb841fe98b58dcaf", - "reference": "8622567409010282b7aeebe4bb841fe98b58dcaf", + "url": "https://api.github.com/repos/php-fig/container/zipball/513e0666f7216c7459170d56df27dfcefe1689ea", + "reference": "513e0666f7216c7459170d56df27dfcefe1689ea", "shasum": "" }, "require": { - "php": ">=7.2.0" + "php": ">=7.4.0" }, "type": "library", "autoload": { @@ -1930,9 +1930,9 @@ ], "support": { "issues": "https://github.com/php-fig/container/issues", - "source": "https://github.com/php-fig/container/tree/1.1.1" + "source": "https://github.com/php-fig/container/tree/1.1.2" }, - "time": "2021-03-05T17:36:06+00:00" + "time": "2021-11-05T16:50:12+00:00" }, { "name": "psr/log", @@ -4262,12 +4262,13 @@ "prefer-stable": false, "prefer-lowest": false, "platform": { - "php": "^7.3 || ~8.0.0 || ~8.1.0", - "ext-ctype": "*" + "php": "^7.4 || ~8.0.0 || ~8.1.0", + "ext-ctype": "*", + "ext-mbstring": "*" }, "platform-dev": [], "platform-overrides": { - "php": "7.3.99" + "php": "7.4.99" }, "plugin-api-version": "2.2.0" } diff --git a/src/Escaper.php b/src/Escaper.php index ca0f1a9d..fff78051 100644 --- a/src/Escaper.php +++ b/src/Escaper.php @@ -6,10 +6,8 @@ use function bin2hex; use function ctype_digit; -use function function_exists; use function hexdec; use function htmlspecialchars; -use function iconv; use function in_array; use function mb_convert_encoding; use function ord; @@ -391,32 +389,22 @@ protected function isUtf8($string) } /** - * Encoding conversion helper which wraps iconv and mbstring where they exist or throws - * and exception where neither is available. + * Encoding conversion helper which wraps mb_convert_encoding * * @param string $string * @param string $to * @param array|string $from - * @throws Exception\RuntimeException * @return string */ protected function convertEncoding($string, $to, $from) { - if (function_exists('iconv')) { - $result = iconv($from, $to, $string); - } elseif (function_exists('mb_convert_encoding')) { - $result = mb_convert_encoding($string, $to, $from); - } else { - throw new Exception\RuntimeException( - static::class - . ' requires either the iconv or mbstring extension to be installed' - . ' when escaping for non UTF-8 strings.' - ); - } + /** @psalm-var string|false $result */ + $result = mb_convert_encoding($string, $to, $from); if ($result === false) { return ''; // return non-fatal blank string on encoding errors from users } + return $result; } } From cb83527a0668c65bb0d454cd283c86b7be3eb7f0 Mon Sep 17 00:00:00 2001 From: George Steel Date: Tue, 8 Mar 2022 11:45:23 +0000 Subject: [PATCH 06/14] Update dev dependencies and fix psalm low-hanging fruit Signed-off-by: George Steel --- composer.json | 8 +- composer.lock | 240 +++++++++++++++++++++++++++++-------------- psalm-baseline.xml | 48 +-------- psalm.xml | 1 - src/Escaper.php | 1 - test/EscaperTest.php | 20 ++-- 6 files changed, 179 insertions(+), 139 deletions(-) diff --git a/composer.json b/composer.json index 912e4c63..9f61eea9 100644 --- a/composer.json +++ b/composer.json @@ -34,10 +34,10 @@ }, "require-dev": { "laminas/laminas-coding-standard": "~2.3.0", - "maglnet/composer-require-checker": "^2.1", - "phpunit/phpunit": "^9.3", - "psalm/plugin-phpunit": "^0.12.2", - "vimeo/psalm": "^3.16" + "maglnet/composer-require-checker": "^3.8.0", + "phpunit/phpunit": "^9.5.18", + "psalm/plugin-phpunit": "^0.16.1", + "vimeo/psalm": "^4.22.0" }, "autoload": { "psr-4": { diff --git a/composer.lock b/composer.lock index 911e15e6..3feb4073 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": "d8a3e185d0c0ffb620ba40bdd0f8910c", + "content-hash": "416e1eef31b2d09c12e9b67155bed1ab", "packages": [], "packages-dev": [ { @@ -246,6 +246,77 @@ ], "time": "2022-01-17T14:14:24+00:00" }, + { + "name": "composer/pcre", + "version": "3.0.0", + "source": { + "type": "git", + "url": "https://github.com/composer/pcre.git", + "reference": "e300eb6c535192decd27a85bc72a9290f0d6b3bd" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/composer/pcre/zipball/e300eb6c535192decd27a85bc72a9290f0d6b3bd", + "reference": "e300eb6c535192decd27a85bc72a9290f0d6b3bd", + "shasum": "" + }, + "require": { + "php": "^7.4 || ^8.0" + }, + "require-dev": { + "phpstan/phpstan": "^1.3", + "phpstan/phpstan-strict-rules": "^1.1", + "symfony/phpunit-bridge": "^5" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-main": "3.x-dev" + } + }, + "autoload": { + "psr-4": { + "Composer\\Pcre\\": "src" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Jordi Boggiano", + "email": "j.boggiano@seld.be", + "homepage": "http://seld.be" + } + ], + "description": "PCRE wrapping library that offers type-safe preg_* replacements.", + "keywords": [ + "PCRE", + "preg", + "regex", + "regular expression" + ], + "support": { + "issues": "https://github.com/composer/pcre/issues", + "source": "https://github.com/composer/pcre/tree/3.0.0" + }, + "funding": [ + { + "url": "https://packagist.com", + "type": "custom" + }, + { + "url": "https://github.com/composer", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/composer/composer", + "type": "tidelift" + } + ], + "time": "2022-02-25T20:21:48+00:00" + }, { "name": "composer/semver", "version": "3.2.9", @@ -329,25 +400,27 @@ }, { "name": "composer/xdebug-handler", - "version": "1.4.6", + "version": "3.0.3", "source": { "type": "git", "url": "https://github.com/composer/xdebug-handler.git", - "reference": "f27e06cd9675801df441b3656569b328e04aa37c" + "reference": "ced299686f41dce890debac69273b47ffe98a40c" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/composer/xdebug-handler/zipball/f27e06cd9675801df441b3656569b328e04aa37c", - "reference": "f27e06cd9675801df441b3656569b328e04aa37c", + "url": "https://api.github.com/repos/composer/xdebug-handler/zipball/ced299686f41dce890debac69273b47ffe98a40c", + "reference": "ced299686f41dce890debac69273b47ffe98a40c", "shasum": "" }, "require": { - "php": "^5.3.2 || ^7.0 || ^8.0", - "psr/log": "^1.0" + "composer/pcre": "^1 || ^2 || ^3", + "php": "^7.2.5 || ^8.0", + "psr/log": "^1 || ^2 || ^3" }, "require-dev": { - "phpstan/phpstan": "^0.12.55", - "symfony/phpunit-bridge": "^4.2 || ^5" + "phpstan/phpstan": "^1.0", + "phpstan/phpstan-strict-rules": "^1.1", + "symfony/phpunit-bridge": "^6.0" }, "type": "library", "autoload": { @@ -373,7 +446,7 @@ "support": { "irc": "irc://irc.freenode.org/composer", "issues": "https://github.com/composer/xdebug-handler/issues", - "source": "https://github.com/composer/xdebug-handler/tree/1.4.6" + "source": "https://github.com/composer/xdebug-handler/tree/3.0.3" }, "funding": [ { @@ -389,7 +462,7 @@ "type": "tidelift" } ], - "time": "2021-03-25T17:01:18+00:00" + "time": "2022-02-25T21:32:43+00:00" }, { "name": "dealerdirect/phpcodesniffer-composer-installer", @@ -729,32 +802,36 @@ }, { "name": "maglnet/composer-require-checker", - "version": "2.1.0", + "version": "3.8.0", "source": { "type": "git", "url": "https://github.com/maglnet/ComposerRequireChecker.git", - "reference": "0c66698d487fcb5c66cf07108e2180c818fb2e72" + "reference": "537138b833ab0f9ad72b667a72bece2a765e88ab" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/maglnet/ComposerRequireChecker/zipball/0c66698d487fcb5c66cf07108e2180c818fb2e72", - "reference": "0c66698d487fcb5c66cf07108e2180c818fb2e72", + "url": "https://api.github.com/repos/maglnet/ComposerRequireChecker/zipball/537138b833ab0f9ad72b667a72bece2a765e88ab", + "reference": "537138b833ab0f9ad72b667a72bece2a765e88ab", "shasum": "" }, "require": { + "composer-runtime-api": "^2.0.0", "ext-json": "*", "ext-phar": "*", - "nikic/php-parser": "^4.3", - "ocramius/package-versions": "^1.4.2", - "php": "^7.2", - "symfony/console": "^5.0", - "webmozart/glob": "^4.1" + "nikic/php-parser": "^4.13.0", + "php": "^7.4 || ^8.0", + "symfony/console": "^5.4.0", + "webmozart/assert": "^1.9.1", + "webmozart/glob": "^4.4.0" }, "require-dev": { + "doctrine/coding-standard": "^9.0.0", "ext-zend-opcache": "*", - "mikey179/vfsstream": "^1.6", - "phpstan/phpstan": "^0.12", - "phpunit/phpunit": "^8.4.3" + "mikey179/vfsstream": "^1.6.10", + "phing/phing": "^2.17.0", + "phpstan/phpstan": "^1.2.0", + "phpunit/phpunit": "^9.5.10", + "vimeo/psalm": "^4.14.0" }, "bin": [ "bin/composer-require-checker" @@ -799,9 +876,9 @@ ], "support": { "issues": "https://github.com/maglnet/ComposerRequireChecker/issues", - "source": "https://github.com/maglnet/ComposerRequireChecker/tree/2.1.0" + "source": "https://github.com/maglnet/ComposerRequireChecker/tree/3.8.0" }, - "time": "2019-12-28T13:49:20+00:00" + "time": "2021-12-07T14:25:47+00:00" }, { "name": "myclabs/deep-copy", @@ -864,16 +941,16 @@ }, { "name": "netresearch/jsonmapper", - "version": "v3.1.1", + "version": "v4.0.0", "source": { "type": "git", "url": "https://github.com/cweiske/jsonmapper.git", - "reference": "ba09f0e456d4f00cef84e012da5715625594407c" + "reference": "8bbc021a8edb2e4a7ea2f8ad4fa9ec9dce2fcb8d" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/cweiske/jsonmapper/zipball/ba09f0e456d4f00cef84e012da5715625594407c", - "reference": "ba09f0e456d4f00cef84e012da5715625594407c", + "url": "https://api.github.com/repos/cweiske/jsonmapper/zipball/8bbc021a8edb2e4a7ea2f8ad4fa9ec9dce2fcb8d", + "reference": "8bbc021a8edb2e4a7ea2f8ad4fa9ec9dce2fcb8d", "shasum": "" }, "require": { @@ -881,10 +958,10 @@ "ext-pcre": "*", "ext-reflection": "*", "ext-spl": "*", - "php": ">=5.6" + "php": ">=7.1" }, "require-dev": { - "phpunit/phpunit": "~4.8.35 || ~5.7 || ~6.4 || ~7.0", + "phpunit/phpunit": "~7.5 || ~8.0 || ~9.0", "squizlabs/php_codesniffer": "~3.5" }, "type": "library", @@ -909,9 +986,9 @@ "support": { "email": "cweiske@cweiske.de", "issues": "https://github.com/cweiske/jsonmapper/issues", - "source": "https://github.com/cweiske/jsonmapper/tree/v3.1.1" + "source": "https://github.com/cweiske/jsonmapper/tree/v4.0.0" }, - "time": "2020-11-02T19:19:54+00:00" + "time": "2020-12-01T19:48:11+00:00" }, { "name": "nikic/php-parser", @@ -1832,30 +1909,34 @@ }, { "name": "psalm/plugin-phpunit", - "version": "0.12.2", + "version": "0.16.1", "source": { "type": "git", "url": "https://github.com/psalm/psalm-plugin-phpunit.git", - "reference": "85ee5a080a5281e63085d933b30a06b1b1680758" + "reference": "5dd3be04f37a857d52880ef6af2524a441dfef24" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/psalm/psalm-plugin-phpunit/zipball/85ee5a080a5281e63085d933b30a06b1b1680758", - "reference": "85ee5a080a5281e63085d933b30a06b1b1680758", + "url": "https://api.github.com/repos/psalm/psalm-plugin-phpunit/zipball/5dd3be04f37a857d52880ef6af2524a441dfef24", + "reference": "5dd3be04f37a857d52880ef6af2524a441dfef24", "shasum": "" }, "require": { "composer/package-versions-deprecated": "^1.10", "composer/semver": "^1.4 || ^2.0 || ^3.0", "ext-simplexml": "*", - "php": "^7.1.3 || ^8.0", - "phpunit/phpunit": "^7.5 || ^8.0 || ^9.0", - "vimeo/psalm": "^3.6.2 || dev-master || dev-4.x" + "php": "^7.1 || ^8.0", + "vimeo/psalm": "dev-master || dev-4.x || ^4.5" + }, + "conflict": { + "phpunit/phpunit": "<7.5" }, "require-dev": { "codeception/codeception": "^4.0.3", + "php": "^7.3 || ^8.0", + "phpunit/phpunit": "^7.5 || ^8.0 || ^9.0", "squizlabs/php_codesniffer": "^3.3.1", - "weirdan/codeception-psalm-module": "^0.7.1", + "weirdan/codeception-psalm-module": "^0.11.0", "weirdan/prophecy-shim": "^1.0 || ^2.0" }, "type": "psalm-plugin", @@ -1882,9 +1963,9 @@ "description": "Psalm plugin for PHPUnit", "support": { "issues": "https://github.com/psalm/psalm-plugin-phpunit/issues", - "source": "https://github.com/psalm/psalm-plugin-phpunit/tree/0.12.2" + "source": "https://github.com/psalm/psalm-plugin-phpunit/tree/0.16.1" }, - "time": "2020-09-28T17:25:39+00:00" + "time": "2021-06-18T23:56:46+00:00" }, { "name": "psr/container", @@ -3944,25 +4025,26 @@ }, { "name": "vimeo/psalm", - "version": "3.18.2", + "version": "4.22.0", "source": { "type": "git", "url": "https://github.com/vimeo/psalm.git", - "reference": "19aa905f7c3c7350569999a93c40ae91ae4e1626" + "reference": "fc2c6ab4d5fa5d644d8617089f012f3bb84b8703" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/vimeo/psalm/zipball/19aa905f7c3c7350569999a93c40ae91ae4e1626", - "reference": "19aa905f7c3c7350569999a93c40ae91ae4e1626", + "url": "https://api.github.com/repos/vimeo/psalm/zipball/fc2c6ab4d5fa5d644d8617089f012f3bb84b8703", + "reference": "fc2c6ab4d5fa5d644d8617089f012f3bb84b8703", "shasum": "" }, "require": { - "amphp/amp": "^2.1", + "amphp/amp": "^2.4.2", "amphp/byte-stream": "^1.5", "composer/package-versions-deprecated": "^1.8.0", "composer/semver": "^1.4 || ^2.0 || ^3.0", - "composer/xdebug-handler": "^1.1", + "composer/xdebug-handler": "^1.1 || ^2.0 || ^3.0", "dnoegel/php-xdg-base-dir": "^0.1.1", + "ext-ctype": "*", "ext-dom": "*", "ext-json": "*", "ext-libxml": "*", @@ -3970,36 +4052,36 @@ "ext-simplexml": "*", "ext-tokenizer": "*", "felixfbecker/advanced-json-rpc": "^3.0.3", - "felixfbecker/language-server-protocol": "^1.4", - "netresearch/jsonmapper": "^1.0 || ^2.0 || ^3.0", - "nikic/php-parser": "4.3.* || 4.4.* || 4.5.* || 4.6.* || ^4.8", + "felixfbecker/language-server-protocol": "^1.5", + "netresearch/jsonmapper": "^1.0 || ^2.0 || ^3.0 || ^4.0", + "nikic/php-parser": "^4.13", "openlss/lib-array2xml": "^1.0", - "php": "^7.1.3|^8", + "php": "^7.1|^8", "sebastian/diff": "^3.0 || ^4.0", - "symfony/console": "^3.4.17 || ^4.1.6 || ^5.0", - "webmozart/glob": "^4.1", + "symfony/console": "^3.4.17 || ^4.1.6 || ^5.0 || ^6.0", "webmozart/path-util": "^2.3" }, "provide": { "psalm/psalm": "self.version" }, "require-dev": { - "amphp/amp": "^2.4.2", "bamarni/composer-bin-plugin": "^1.2", - "brianium/paratest": "^4.0.0", + "brianium/paratest": "^4.0||^6.0", "ext-curl": "*", - "phpdocumentor/reflection-docblock": "^4.3.4 || ^5", - "phpmyadmin/sql-parser": "5.1.0", + "php-parallel-lint/php-parallel-lint": "^1.2", + "phpdocumentor/reflection-docblock": "^5", + "phpmyadmin/sql-parser": "5.1.0||dev-master", "phpspec/prophecy": ">=1.9.0", - "phpunit/phpunit": "^7.5.16 || ^8.5 || ^9.0", - "psalm/plugin-phpunit": "^0.11", - "slevomat/coding-standard": "^5.0", + "phpunit/phpunit": "^9.0", + "psalm/plugin-phpunit": "^0.16", + "slevomat/coding-standard": "^7.0", "squizlabs/php_codesniffer": "^3.5", - "symfony/process": "^4.3", + "symfony/process": "^4.3 || ^5.0 || ^6.0", "weirdan/prophecy-shim": "^1.0 || ^2.0" }, "suggest": { - "ext-igbinary": "^2.0.5" + "ext-curl": "In order to send data to shepherd", + "ext-igbinary": "^2.0.5 is required, used to serialize caching data" }, "bin": [ "psalm", @@ -4011,7 +4093,8 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "3.x-dev", + "dev-master": "4.x-dev", + "dev-3.x": "3.x-dev", "dev-2.x": "2.x-dev", "dev-1.x": "1.x-dev" } @@ -4042,9 +4125,9 @@ ], "support": { "issues": "https://github.com/vimeo/psalm/issues", - "source": "https://github.com/vimeo/psalm/tree/3.18.2" + "source": "https://github.com/vimeo/psalm/tree/4.22.0" }, - "time": "2020-10-20T13:48:22+00:00" + "time": "2022-02-24T20:34:05+00:00" }, { "name": "webimpress/coding-standard", @@ -4103,30 +4186,35 @@ }, { "name": "webmozart/assert", - "version": "1.9.1", + "version": "1.10.0", "source": { "type": "git", "url": "https://github.com/webmozarts/assert.git", - "reference": "bafc69caeb4d49c39fd0779086c03a3738cbb389" + "reference": "6964c76c7804814a842473e0c8fd15bab0f18e25" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/webmozarts/assert/zipball/bafc69caeb4d49c39fd0779086c03a3738cbb389", - "reference": "bafc69caeb4d49c39fd0779086c03a3738cbb389", + "url": "https://api.github.com/repos/webmozarts/assert/zipball/6964c76c7804814a842473e0c8fd15bab0f18e25", + "reference": "6964c76c7804814a842473e0c8fd15bab0f18e25", "shasum": "" }, "require": { - "php": "^5.3.3 || ^7.0 || ^8.0", + "php": "^7.2 || ^8.0", "symfony/polyfill-ctype": "^1.8" }, "conflict": { "phpstan/phpstan": "<0.12.20", - "vimeo/psalm": "<3.9.1" + "vimeo/psalm": "<4.6.1 || 4.6.2" }, "require-dev": { - "phpunit/phpunit": "^4.8.36 || ^7.5.13" + "phpunit/phpunit": "^8.5.13" }, "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.10-dev" + } + }, "autoload": { "psr-4": { "Webmozart\\Assert\\": "src/" @@ -4150,9 +4238,9 @@ ], "support": { "issues": "https://github.com/webmozarts/assert/issues", - "source": "https://github.com/webmozarts/assert/tree/1.9.1" + "source": "https://github.com/webmozarts/assert/tree/1.10.0" }, - "time": "2020-07-08T17:02:28+00:00" + "time": "2021-03-09T10:59:23+00:00" }, { "name": "webmozart/glob", diff --git a/psalm-baseline.xml b/psalm-baseline.xml index 03474eab..6928717a 100644 --- a/psalm-baseline.xml +++ b/psalm-baseline.xml @@ -1,35 +1,5 @@ - - - - $chr - $chr - $chr - $chr - $chr - $chr - $chr - $chr - $chr - $chr - - - $this->cssMatcher - $this->htmlAttrMatcher - $this->jsMatcher - - - $chr - $chr - $chr - - - static::$htmlNamedEntityMap[$ord] - - - $from - - + @@ -39,21 +9,5 @@ array<string, array{0: string, 1: string}> array<string, array{0: string}> - - testCssEscapingReturnsStringIfContainsOnlyDigits - testCssEscapingReturnsStringIfZeroLength - testHtmlAttributeEscapingEscapesOwaspRecommendedRanges - testJavascriptEscapingReturnsStringIfContainsOnlyDigits - testJavascriptEscapingReturnsStringIfZeroLength - testReturnsEncodingFromGetter - testSettingEncodingToEmptyStringShouldThrowException - testSettingEncodingToInvalidValueShouldThrowException - testUnicodeCodepointConversionToUtf8 - - - - - = - diff --git a/psalm.xml b/psalm.xml index 68b6d6b6..8d4c90ff 100644 --- a/psalm.xml +++ b/psalm.xml @@ -1,6 +1,5 @@ escaper = new Escaper('UTF-8'); } - public function testSettingEncodingToEmptyStringShouldThrowException() + public function testSettingEncodingToEmptyStringShouldThrowException(): void { $this->expectException(InvalidArgumentException::class); new Escaper(''); @@ -78,13 +78,13 @@ public function testSettingValidEncodingShouldNotThrowExceptions(string $encodin $this->assertSame($encoding, $escaper->getEncoding()); } - public function testSettingEncodingToInvalidValueShouldThrowException() + public function testSettingEncodingToInvalidValueShouldThrowException(): void { $this->expectException(InvalidArgumentException::class); new Escaper('invalid-encoding'); } - public function testReturnsEncodingFromGetter() + public function testReturnsEncodingFromGetter(): void { $this->assertEquals('utf-8', $this->escaper->getEncoding()); } @@ -201,12 +201,12 @@ public function testJavascriptEscapingConvertsSpecialChars(string $string, strin $this->assertEquals($encoded, $this->escaper->escapeJs($string), 'Failed to escape: ' . $string); } - public function testJavascriptEscapingReturnsStringIfZeroLength() + public function testJavascriptEscapingReturnsStringIfZeroLength(): void { $this->assertEquals('', $this->escaper->escapeJs('')); } - public function testJavascriptEscapingReturnsStringIfContainsOnlyDigits() + public function testJavascriptEscapingReturnsStringIfContainsOnlyDigits(): void { $this->assertEquals('123', $this->escaper->escapeJs('123')); } @@ -254,12 +254,12 @@ public function testCssEscapingConvertsSpecialChars(string $string, string $enco $this->assertEquals($encoded, $this->escaper->escapeCss($string), 'Failed to escape: ' . $string); } - public function testCssEscapingReturnsStringIfZeroLength() + public function testCssEscapingReturnsStringIfZeroLength(): void { $this->assertEquals('', $this->escaper->escapeCss('')); } - public function testCssEscapingReturnsStringIfContainsOnlyDigits() + public function testCssEscapingReturnsStringIfContainsOnlyDigits(): void { $this->assertEquals('123', $this->escaper->escapeCss('123')); } @@ -319,7 +319,7 @@ public function testUrlEscapingConvertsSpecialChars(string $string, string $enco * Only testing the first few 2 ranges on this prot. function as that's all these * other range tests require */ - public function testUnicodeCodepointConversionToUtf8() + public function testUnicodeCodepointConversionToUtf8(): void { $expected = " ~ޙ"; $codepoints = [0x20, 0x7e, 0x799]; @@ -337,7 +337,7 @@ public function testUnicodeCodepointConversionToUtf8() * @return string UTF-8 literal string * @throws Exception When codepoint requested is outside Unicode range. */ - protected function codepointToUtf8($codepoint) + protected function codepointToUtf8(int $codepoint): string { if ($codepoint < 0x80) { return chr($codepoint); @@ -393,7 +393,7 @@ public function testJavascriptEscapingEscapesOwaspRecommendedRanges(string $valu $this->$assertion($value, $this->escaper->escapeJs($value)); } - public function testHtmlAttributeEscapingEscapesOwaspRecommendedRanges() + public function testHtmlAttributeEscapingEscapesOwaspRecommendedRanges(): void { $immune = [',', '.', '-', '_']; // Exceptions to escaping ranges for ($chr = 0; $chr < 0xFF; $chr++) { From 646b805a564e79d861af9ed99ef2e9d4ea09d5ff Mon Sep 17 00:00:00 2001 From: George Steel Date: Tue, 8 Mar 2022 12:09:37 +0000 Subject: [PATCH 07/14] Modify data providers to solve XML code coverage generation errors due to unusual codepoints and enable infection Signed-off-by: George Steel --- composer.json | 4 +- composer.lock | 995 ++++++++++++++++++++++++++++++++++++++++++- infection.json.dist | 17 + test/EscaperTest.php | 36 +- 4 files changed, 1021 insertions(+), 31 deletions(-) create mode 100644 infection.json.dist diff --git a/composer.json b/composer.json index 9f61eea9..64513b6b 100644 --- a/composer.json +++ b/composer.json @@ -22,7 +22,8 @@ }, "allow-plugins": { "dealerdirect/phpcodesniffer-composer-installer": true, - "composer/package-versions-deprecated": true + "composer/package-versions-deprecated": true, + "infection/extension-installer": true } }, "extra": { @@ -33,6 +34,7 @@ "ext-mbstring": "*" }, "require-dev": { + "infection/infection": "^0.26.6", "laminas/laminas-coding-standard": "~2.3.0", "maglnet/composer-require-checker": "^3.8.0", "phpunit/phpunit": "^9.5.18", diff --git a/composer.lock b/composer.lock index 3feb4073..174a4ce8 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": "416e1eef31b2d09c12e9b67155bed1ab", + "content-hash": "36c2688d8dcb1e1c07970fea2d09b88d", "packages": [], "packages-dev": [ { @@ -747,6 +747,379 @@ }, "time": "2021-02-22T14:02:09+00:00" }, + { + "name": "infection/abstract-testframework-adapter", + "version": "0.5.0", + "source": { + "type": "git", + "url": "https://github.com/infection/abstract-testframework-adapter.git", + "reference": "18925e20d15d1a5995bb85c9dc09e8751e1e069b" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/infection/abstract-testframework-adapter/zipball/18925e20d15d1a5995bb85c9dc09e8751e1e069b", + "reference": "18925e20d15d1a5995bb85c9dc09e8751e1e069b", + "shasum": "" + }, + "require": { + "php": "^7.4 || ^8.0" + }, + "require-dev": { + "ergebnis/composer-normalize": "^2.8", + "friendsofphp/php-cs-fixer": "^2.17", + "phpunit/phpunit": "^9.5" + }, + "type": "library", + "autoload": { + "psr-4": { + "Infection\\AbstractTestFramework\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Maks Rafalko", + "email": "maks.rafalko@gmail.com" + } + ], + "description": "Abstract Test Framework Adapter for Infection", + "support": { + "issues": "https://github.com/infection/abstract-testframework-adapter/issues", + "source": "https://github.com/infection/abstract-testframework-adapter/tree/0.5.0" + }, + "funding": [ + { + "url": "https://github.com/infection", + "type": "github" + }, + { + "url": "https://opencollective.com/infection", + "type": "open_collective" + } + ], + "time": "2021-08-17T18:49:12+00:00" + }, + { + "name": "infection/extension-installer", + "version": "0.1.2", + "source": { + "type": "git", + "url": "https://github.com/infection/extension-installer.git", + "reference": "9b351d2910b9a23ab4815542e93d541e0ca0cdcf" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/infection/extension-installer/zipball/9b351d2910b9a23ab4815542e93d541e0ca0cdcf", + "reference": "9b351d2910b9a23ab4815542e93d541e0ca0cdcf", + "shasum": "" + }, + "require": { + "composer-plugin-api": "^1.1 || ^2.0" + }, + "require-dev": { + "composer/composer": "^1.9 || ^2.0", + "friendsofphp/php-cs-fixer": "^2.18, <2.19", + "infection/infection": "^0.15.2", + "php-coveralls/php-coveralls": "^2.4", + "phpstan/extension-installer": "^1.0", + "phpstan/phpstan": "^0.12.10", + "phpstan/phpstan-phpunit": "^0.12.6", + "phpstan/phpstan-strict-rules": "^0.12.2", + "phpstan/phpstan-webmozart-assert": "^0.12.2", + "phpunit/phpunit": "^9.5", + "vimeo/psalm": "^4.8" + }, + "type": "composer-plugin", + "extra": { + "class": "Infection\\ExtensionInstaller\\Plugin" + }, + "autoload": { + "psr-4": { + "Infection\\ExtensionInstaller\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Maks Rafalko", + "email": "maks.rafalko@gmail.com" + } + ], + "description": "Infection Extension Installer", + "support": { + "issues": "https://github.com/infection/extension-installer/issues", + "source": "https://github.com/infection/extension-installer/tree/0.1.2" + }, + "funding": [ + { + "url": "https://github.com/infection", + "type": "github" + }, + { + "url": "https://opencollective.com/infection", + "type": "open_collective" + } + ], + "time": "2021-10-20T22:08:34+00:00" + }, + { + "name": "infection/include-interceptor", + "version": "0.2.5", + "source": { + "type": "git", + "url": "https://github.com/infection/include-interceptor.git", + "reference": "0cc76d95a79d9832d74e74492b0a30139904bdf7" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/infection/include-interceptor/zipball/0cc76d95a79d9832d74e74492b0a30139904bdf7", + "reference": "0cc76d95a79d9832d74e74492b0a30139904bdf7", + "shasum": "" + }, + "require-dev": { + "friendsofphp/php-cs-fixer": "^2.16", + "infection/infection": "^0.15.0", + "phan/phan": "^2.4 || ^3", + "php-coveralls/php-coveralls": "^2.2", + "phpstan/phpstan": "^0.12.8", + "phpunit/phpunit": "^8.5", + "vimeo/psalm": "^3.8" + }, + "type": "library", + "autoload": { + "psr-4": { + "Infection\\StreamWrapper\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Maks Rafalko", + "email": "maks.rafalko@gmail.com" + } + ], + "description": "Stream Wrapper: Include Interceptor. Allows to replace included (autoloaded) file with another one.", + "support": { + "issues": "https://github.com/infection/include-interceptor/issues", + "source": "https://github.com/infection/include-interceptor/tree/0.2.5" + }, + "funding": [ + { + "url": "https://github.com/infection", + "type": "github" + }, + { + "url": "https://opencollective.com/infection", + "type": "open_collective" + } + ], + "time": "2021-08-09T10:03:57+00:00" + }, + { + "name": "infection/infection", + "version": "0.26.6", + "source": { + "type": "git", + "url": "https://github.com/infection/infection.git", + "reference": "de9b6b92f00ff1cb39decddf95797a4ebec3a1ee" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/infection/infection/zipball/de9b6b92f00ff1cb39decddf95797a4ebec3a1ee", + "reference": "de9b6b92f00ff1cb39decddf95797a4ebec3a1ee", + "shasum": "" + }, + "require": { + "composer-runtime-api": "^2.0", + "composer/xdebug-handler": "^2.0 || ^3.0", + "ext-dom": "*", + "ext-json": "*", + "ext-libxml": "*", + "infection/abstract-testframework-adapter": "^0.5.0", + "infection/extension-installer": "^0.1.0", + "infection/include-interceptor": "^0.2.5", + "justinrainbow/json-schema": "^5.2.10", + "nikic/php-parser": "^4.13.2", + "ondram/ci-detector": "^4.1.0", + "php": "^7.4.7 || ^8.0", + "sanmai/later": "^0.1.1", + "sanmai/pipeline": "^5.1 || ^6", + "sebastian/diff": "^3.0.2 || ^4.0", + "seld/jsonlint": "^1.7", + "symfony/console": "^3.4.29 || ^4.1.19 || ^5.0 || ^6.0", + "symfony/filesystem": "^3.4.29 || ^4.1.19 || ^5.0 || ^6.0", + "symfony/finder": "^3.4.29 || ^4.1.19 || ^5.0 || ^6.0", + "symfony/process": "^3.4.29 || ^4.1.19 || ^5.0 || ^6.0", + "thecodingmachine/safe": "^1.1.3", + "webmozart/assert": "^1.3", + "webmozart/path-util": "^2.3" + }, + "conflict": { + "dg/bypass-finals": "*", + "phpunit/php-code-coverage": ">9 <9.1.4" + }, + "require-dev": { + "brianium/paratest": "^6.3", + "ext-simplexml": "*", + "helmich/phpunit-json-assert": "^3.0", + "phpspec/prophecy-phpunit": "^2.0", + "phpstan/extension-installer": "^1.1.0", + "phpstan/phpstan": "^1.2.0", + "phpstan/phpstan-phpunit": "^1.0.0", + "phpstan/phpstan-strict-rules": "^1.1.0", + "phpstan/phpstan-webmozart-assert": "^1.0.2", + "phpunit/phpunit": "^9.3.11", + "symfony/phpunit-bridge": "^4.4.18 || ^5.1.10", + "symfony/yaml": "^5.0", + "thecodingmachine/phpstan-safe-rule": "^1.1.0" + }, + "bin": [ + "bin/infection" + ], + "type": "library", + "autoload": { + "psr-4": { + "Infection\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Maks Rafalko", + "email": "maks.rafalko@gmail.com", + "homepage": "https://twitter.com/maks_rafalko" + }, + { + "name": "Oleg Zhulnev", + "homepage": "https://github.com/sidz" + }, + { + "name": "Gert de Pagter", + "homepage": "https://github.com/BackEndTea" + }, + { + "name": "Théo FIDRY", + "email": "theo.fidry@gmail.com", + "homepage": "https://twitter.com/tfidry" + }, + { + "name": "Alexey Kopytko", + "email": "alexey@kopytko.com", + "homepage": "https://www.alexeykopytko.com" + }, + { + "name": "Andreas Möller", + "email": "am@localheinz.com", + "homepage": "https://localheinz.com" + } + ], + "description": "Infection is a Mutation Testing framework for PHP. The mutation adequacy score can be used to measure the effectiveness of a test set in terms of its ability to detect faults.", + "keywords": [ + "coverage", + "mutant", + "mutation framework", + "mutation testing", + "testing", + "unit testing" + ], + "support": { + "issues": "https://github.com/infection/infection/issues", + "source": "https://github.com/infection/infection/tree/0.26.6" + }, + "funding": [ + { + "url": "https://github.com/infection", + "type": "github" + }, + { + "url": "https://opencollective.com/infection", + "type": "open_collective" + } + ], + "time": "2022-03-07T11:40:30+00:00" + }, + { + "name": "justinrainbow/json-schema", + "version": "5.2.11", + "source": { + "type": "git", + "url": "https://github.com/justinrainbow/json-schema.git", + "reference": "2ab6744b7296ded80f8cc4f9509abbff393399aa" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/justinrainbow/json-schema/zipball/2ab6744b7296ded80f8cc4f9509abbff393399aa", + "reference": "2ab6744b7296ded80f8cc4f9509abbff393399aa", + "shasum": "" + }, + "require": { + "php": ">=5.3.3" + }, + "require-dev": { + "friendsofphp/php-cs-fixer": "~2.2.20||~2.15.1", + "json-schema/json-schema-test-suite": "1.2.0", + "phpunit/phpunit": "^4.8.35" + }, + "bin": [ + "bin/validate-json" + ], + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "5.0.x-dev" + } + }, + "autoload": { + "psr-4": { + "JsonSchema\\": "src/JsonSchema/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Bruno Prieto Reis", + "email": "bruno.p.reis@gmail.com" + }, + { + "name": "Justin Rainbow", + "email": "justin.rainbow@gmail.com" + }, + { + "name": "Igor Wiedler", + "email": "igor@wiedler.ch" + }, + { + "name": "Robert Schönthal", + "email": "seroscho@googlemail.com" + } + ], + "description": "A library to validate a json schema.", + "homepage": "https://github.com/justinrainbow/json-schema", + "keywords": [ + "json", + "schema" + ], + "support": { + "issues": "https://github.com/justinrainbow/json-schema/issues", + "source": "https://github.com/justinrainbow/json-schema/tree/5.2.11" + }, + "time": "2021-07-22T09:24:00+00:00" + }, { "name": "laminas/laminas-coding-standard", "version": "2.3.0", @@ -1046,6 +1419,84 @@ }, "time": "2021-11-30T19:35:32+00:00" }, + { + "name": "ondram/ci-detector", + "version": "4.1.0", + "source": { + "type": "git", + "url": "https://github.com/OndraM/ci-detector.git", + "reference": "8a4b664e916df82ff26a44709942dfd593fa6f30" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/OndraM/ci-detector/zipball/8a4b664e916df82ff26a44709942dfd593fa6f30", + "reference": "8a4b664e916df82ff26a44709942dfd593fa6f30", + "shasum": "" + }, + "require": { + "php": "^7.1 || ^8.0" + }, + "require-dev": { + "ergebnis/composer-normalize": "^2.2", + "lmc/coding-standard": "^1.3 || ^2.1", + "php-parallel-lint/php-parallel-lint": "^1.2", + "phpstan/extension-installer": "^1.0.5", + "phpstan/phpstan": "^0.12.58", + "phpstan/phpstan-phpunit": "^0.12.16", + "phpunit/phpunit": "^7.1 || ^8.0 || ^9.0" + }, + "type": "library", + "autoload": { + "psr-4": { + "OndraM\\CiDetector\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Ondřej Machulda", + "email": "ondrej.machulda@gmail.com" + } + ], + "description": "Detect continuous integration environment and provide unified access to properties of current build", + "keywords": [ + "CircleCI", + "Codeship", + "Wercker", + "adapter", + "appveyor", + "aws", + "aws codebuild", + "azure", + "azure devops", + "azure pipelines", + "bamboo", + "bitbucket", + "buddy", + "ci-info", + "codebuild", + "continuous integration", + "continuousphp", + "devops", + "drone", + "github", + "gitlab", + "interface", + "jenkins", + "pipelines", + "sourcehut", + "teamcity", + "travis" + ], + "support": { + "issues": "https://github.com/OndraM/ci-detector/issues", + "source": "https://github.com/OndraM/ci-detector/tree/4.1.0" + }, + "time": "2021-04-14T09:16:52+00:00" + }, { "name": "openlss/lib-array2xml", "version": "1.0.0", @@ -2035,35 +2486,158 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "1.1.x-dev" + "dev-master": "1.1.x-dev" + } + }, + "autoload": { + "psr-4": { + "Psr\\Log\\": "Psr/Log/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "PHP-FIG", + "homepage": "https://www.php-fig.org/" + } + ], + "description": "Common interface for logging libraries", + "homepage": "https://github.com/php-fig/log", + "keywords": [ + "log", + "psr", + "psr-3" + ], + "support": { + "source": "https://github.com/php-fig/log/tree/1.1.4" + }, + "time": "2021-05-03T11:20:27+00:00" + }, + { + "name": "sanmai/later", + "version": "0.1.2", + "source": { + "type": "git", + "url": "https://github.com/sanmai/later.git", + "reference": "9b659fecef2030193fd02402955bc39629d5606f" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sanmai/later/zipball/9b659fecef2030193fd02402955bc39629d5606f", + "reference": "9b659fecef2030193fd02402955bc39629d5606f", + "shasum": "" + }, + "require": { + "php": ">=7.1" + }, + "require-dev": { + "friendsofphp/php-cs-fixer": "^2.13", + "infection/infection": ">=0.10.5", + "phan/phan": ">=2", + "php-coveralls/php-coveralls": "^2.0", + "phpstan/phpstan": ">=0.10", + "phpunit/phpunit": ">=7.4", + "vimeo/psalm": ">=2" + }, + "type": "library", + "autoload": { + "files": [ + "src/functions.php" + ], + "psr-4": { + "Later\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "Apache-2.0" + ], + "authors": [ + { + "name": "Alexey Kopytko", + "email": "alexey@kopytko.com" + } + ], + "description": "Later: deferred wrapper object", + "support": { + "issues": "https://github.com/sanmai/later/issues", + "source": "https://github.com/sanmai/later/tree/0.1.2" + }, + "funding": [ + { + "url": "https://github.com/sanmai", + "type": "github" + } + ], + "time": "2021-01-02T10:26:44+00:00" + }, + { + "name": "sanmai/pipeline", + "version": "v6.1", + "source": { + "type": "git", + "url": "https://github.com/sanmai/pipeline.git", + "reference": "3a88f2617237e18d5cd2aa38ca3d4b22770306c2" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sanmai/pipeline/zipball/3a88f2617237e18d5cd2aa38ca3d4b22770306c2", + "reference": "3a88f2617237e18d5cd2aa38ca3d4b22770306c2", + "shasum": "" + }, + "require": { + "php": "^7.1 || ^8.0" + }, + "require-dev": { + "ergebnis/composer-normalize": "^2.8", + "friendsofphp/php-cs-fixer": "^3", + "infection/infection": ">=0.10.5", + "league/pipeline": "^1.0 || ^0.3", + "phan/phan": ">=1.1", + "php-coveralls/php-coveralls": "^2.4.1", + "phpstan/phpstan": ">=0.10", + "phpunit/phpunit": "^7.4 || ^8.1 || ^9.4", + "vimeo/psalm": ">=2" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-main": "v6.x-dev" } }, "autoload": { + "files": [ + "src/functions.php" + ], "psr-4": { - "Psr\\Log\\": "Psr/Log/" + "Pipeline\\": "src/" } }, "notification-url": "https://packagist.org/downloads/", "license": [ - "MIT" + "Apache-2.0" ], "authors": [ { - "name": "PHP-FIG", - "homepage": "https://www.php-fig.org/" + "name": "Alexey Kopytko", + "email": "alexey@kopytko.com" } ], - "description": "Common interface for logging libraries", - "homepage": "https://github.com/php-fig/log", - "keywords": [ - "log", - "psr", - "psr-3" - ], + "description": "General-purpose collections pipeline", "support": { - "source": "https://github.com/php-fig/log/tree/1.1.4" + "issues": "https://github.com/sanmai/pipeline/issues", + "source": "https://github.com/sanmai/pipeline/tree/v6.1" }, - "time": "2021-05-03T11:20:27+00:00" + "funding": [ + { + "url": "https://github.com/sanmai", + "type": "github" + } + ], + "time": "2022-01-30T08:15:59+00:00" }, { "name": "sebastian/cli-parser", @@ -3029,6 +3603,69 @@ ], "time": "2020-09-28T06:39:44+00:00" }, + { + "name": "seld/jsonlint", + "version": "1.8.3", + "source": { + "type": "git", + "url": "https://github.com/Seldaek/jsonlint.git", + "reference": "9ad6ce79c342fbd44df10ea95511a1b24dee5b57" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/Seldaek/jsonlint/zipball/9ad6ce79c342fbd44df10ea95511a1b24dee5b57", + "reference": "9ad6ce79c342fbd44df10ea95511a1b24dee5b57", + "shasum": "" + }, + "require": { + "php": "^5.3 || ^7.0 || ^8.0" + }, + "require-dev": { + "phpunit/phpunit": "^4.8.35 || ^5.7 || ^6.0" + }, + "bin": [ + "bin/jsonlint" + ], + "type": "library", + "autoload": { + "psr-4": { + "Seld\\JsonLint\\": "src/Seld/JsonLint/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Jordi Boggiano", + "email": "j.boggiano@seld.be", + "homepage": "http://seld.be" + } + ], + "description": "JSON Linter", + "keywords": [ + "json", + "linter", + "parser", + "validator" + ], + "support": { + "issues": "https://github.com/Seldaek/jsonlint/issues", + "source": "https://github.com/Seldaek/jsonlint/tree/1.8.3" + }, + "funding": [ + { + "url": "https://github.com/Seldaek", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/seld/jsonlint", + "type": "tidelift" + } + ], + "time": "2020-11-11T09:19:24+00:00" + }, { "name": "slevomat/coding-standard", "version": "7.0.19", @@ -3312,6 +3949,133 @@ ], "time": "2021-07-12T14:48:14+00:00" }, + { + "name": "symfony/filesystem", + "version": "v5.4.6", + "source": { + "type": "git", + "url": "https://github.com/symfony/filesystem.git", + "reference": "d53a45039974952af7f7ebc461ccdd4295e29440" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/filesystem/zipball/d53a45039974952af7f7ebc461ccdd4295e29440", + "reference": "d53a45039974952af7f7ebc461ccdd4295e29440", + "shasum": "" + }, + "require": { + "php": ">=7.2.5", + "symfony/polyfill-ctype": "~1.8", + "symfony/polyfill-mbstring": "~1.8", + "symfony/polyfill-php80": "^1.16" + }, + "type": "library", + "autoload": { + "psr-4": { + "Symfony\\Component\\Filesystem\\": "" + }, + "exclude-from-classmap": [ + "/Tests/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Fabien Potencier", + "email": "fabien@symfony.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Provides basic utilities for the filesystem", + "homepage": "https://symfony.com", + "support": { + "source": "https://github.com/symfony/filesystem/tree/v5.4.6" + }, + "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": "2022-03-02T12:42:23+00:00" + }, + { + "name": "symfony/finder", + "version": "v5.4.3", + "source": { + "type": "git", + "url": "https://github.com/symfony/finder.git", + "reference": "231313534dded84c7ecaa79d14bc5da4ccb69b7d" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/finder/zipball/231313534dded84c7ecaa79d14bc5da4ccb69b7d", + "reference": "231313534dded84c7ecaa79d14bc5da4ccb69b7d", + "shasum": "" + }, + "require": { + "php": ">=7.2.5", + "symfony/deprecation-contracts": "^2.1|^3", + "symfony/polyfill-php80": "^1.16" + }, + "type": "library", + "autoload": { + "psr-4": { + "Symfony\\Component\\Finder\\": "" + }, + "exclude-from-classmap": [ + "/Tests/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Fabien Potencier", + "email": "fabien@symfony.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Finds files and directories via an intuitive fluent interface", + "homepage": "https://symfony.com", + "support": { + "source": "https://github.com/symfony/finder/tree/v5.4.3" + }, + "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": "2022-01-26T16:34:36+00:00" + }, { "name": "symfony/polyfill-ctype", "version": "v1.25.0", @@ -3804,6 +4568,68 @@ ], "time": "2022-03-04T08:16:47+00:00" }, + { + "name": "symfony/process", + "version": "v5.4.5", + "source": { + "type": "git", + "url": "https://github.com/symfony/process.git", + "reference": "95440409896f90a5f85db07a32b517ecec17fa4c" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/process/zipball/95440409896f90a5f85db07a32b517ecec17fa4c", + "reference": "95440409896f90a5f85db07a32b517ecec17fa4c", + "shasum": "" + }, + "require": { + "php": ">=7.2.5", + "symfony/polyfill-php80": "^1.16" + }, + "type": "library", + "autoload": { + "psr-4": { + "Symfony\\Component\\Process\\": "" + }, + "exclude-from-classmap": [ + "/Tests/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Fabien Potencier", + "email": "fabien@symfony.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Executes commands in sub-processes", + "homepage": "https://symfony.com", + "support": { + "source": "https://github.com/symfony/process/tree/v5.4.5" + }, + "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": "2022-01-30T18:16:22+00:00" + }, { "name": "symfony/service-contracts", "version": "v2.5.0", @@ -3973,6 +4799,145 @@ ], "time": "2022-01-02T09:53:40+00:00" }, + { + "name": "thecodingmachine/safe", + "version": "v1.3.3", + "source": { + "type": "git", + "url": "https://github.com/thecodingmachine/safe.git", + "reference": "a8ab0876305a4cdaef31b2350fcb9811b5608dbc" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/thecodingmachine/safe/zipball/a8ab0876305a4cdaef31b2350fcb9811b5608dbc", + "reference": "a8ab0876305a4cdaef31b2350fcb9811b5608dbc", + "shasum": "" + }, + "require": { + "php": ">=7.2" + }, + "require-dev": { + "phpstan/phpstan": "^0.12", + "squizlabs/php_codesniffer": "^3.2", + "thecodingmachine/phpstan-strict-rules": "^0.12" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "0.1-dev" + } + }, + "autoload": { + "files": [ + "deprecated/apc.php", + "deprecated/libevent.php", + "deprecated/mssql.php", + "deprecated/stats.php", + "lib/special_cases.php", + "generated/apache.php", + "generated/apcu.php", + "generated/array.php", + "generated/bzip2.php", + "generated/calendar.php", + "generated/classobj.php", + "generated/com.php", + "generated/cubrid.php", + "generated/curl.php", + "generated/datetime.php", + "generated/dir.php", + "generated/eio.php", + "generated/errorfunc.php", + "generated/exec.php", + "generated/fileinfo.php", + "generated/filesystem.php", + "generated/filter.php", + "generated/fpm.php", + "generated/ftp.php", + "generated/funchand.php", + "generated/gmp.php", + "generated/gnupg.php", + "generated/hash.php", + "generated/ibase.php", + "generated/ibmDb2.php", + "generated/iconv.php", + "generated/image.php", + "generated/imap.php", + "generated/info.php", + "generated/ingres-ii.php", + "generated/inotify.php", + "generated/json.php", + "generated/ldap.php", + "generated/libxml.php", + "generated/lzf.php", + "generated/mailparse.php", + "generated/mbstring.php", + "generated/misc.php", + "generated/msql.php", + "generated/mysql.php", + "generated/mysqli.php", + "generated/mysqlndMs.php", + "generated/mysqlndQc.php", + "generated/network.php", + "generated/oci8.php", + "generated/opcache.php", + "generated/openssl.php", + "generated/outcontrol.php", + "generated/password.php", + "generated/pcntl.php", + "generated/pcre.php", + "generated/pdf.php", + "generated/pgsql.php", + "generated/posix.php", + "generated/ps.php", + "generated/pspell.php", + "generated/readline.php", + "generated/rpminfo.php", + "generated/rrd.php", + "generated/sem.php", + "generated/session.php", + "generated/shmop.php", + "generated/simplexml.php", + "generated/sockets.php", + "generated/sodium.php", + "generated/solr.php", + "generated/spl.php", + "generated/sqlsrv.php", + "generated/ssdeep.php", + "generated/ssh2.php", + "generated/stream.php", + "generated/strings.php", + "generated/swoole.php", + "generated/uodbc.php", + "generated/uopz.php", + "generated/url.php", + "generated/var.php", + "generated/xdiff.php", + "generated/xml.php", + "generated/xmlrpc.php", + "generated/yaml.php", + "generated/yaz.php", + "generated/zip.php", + "generated/zlib.php" + ], + "psr-4": { + "Safe\\": [ + "lib/", + "deprecated/", + "generated/" + ] + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "description": "PHP core functions that throw exceptions instead of returning FALSE on error", + "support": { + "issues": "https://github.com/thecodingmachine/safe/issues", + "source": "https://github.com/thecodingmachine/safe/tree/v1.3.3" + }, + "time": "2020-10-28T17:51:34+00:00" + }, { "name": "theseer/tokenizer", "version": "1.2.1", diff --git a/infection.json.dist b/infection.json.dist new file mode 100644 index 00000000..1655ee63 --- /dev/null +++ b/infection.json.dist @@ -0,0 +1,17 @@ +{ + "source": { + "directories": [ + "src" + ], + "excludes": [ + "test/**/*.php", + "vendor/**/*.php" + ] + }, + "logs": { + "text": "infection.log" + }, + "mutators": { + "@default": true + } +} diff --git a/test/EscaperTest.php b/test/EscaperTest.php index 3bf59723..d58e2afc 100644 --- a/test/EscaperTest.php +++ b/test/EscaperTest.php @@ -5,6 +5,7 @@ namespace LaminasTest\Escaper; use Exception; +use Generator; use Laminas\Escaper\Escaper; use Laminas\Escaper\Exception\InvalidArgumentException; use PHPUnit\Framework\TestCase; @@ -360,8 +361,8 @@ protected function codepointToUtf8(int $codepoint): string throw new Exception('Codepoint requested outside of Unicode range'); } - /** @psalm-return iterable */ - public function owaspJSRecommendedEscapeRangeProvider(): iterable + /** @psalm-return Generator */ + public function owaspJSRecommendedEscapeRangeProvider(): Generator { $immune = [',', '.', '_']; // Exceptions to escaping ranges for ($chr = 0; $chr < 0xFF; $chr++) { @@ -370,27 +371,28 @@ public function owaspJSRecommendedEscapeRangeProvider(): iterable || $chr >= 0x41 && $chr <= 0x5A || $chr >= 0x61 && $chr <= 0x7A ) { - $literal = $this->codepointToUtf8($chr); - yield $literal => [$literal, 'assertEquals']; + yield $chr => [$chr, 'assertEquals']; continue; } $literal = $this->codepointToUtf8($chr); if (in_array($literal, $immune)) { - yield $literal => [$literal, 'assertEquals']; + yield $chr => [$chr, 'assertEquals']; continue; } - yield $literal => [$literal, 'assertNotEquals']; + yield $chr => [$chr, 'assertNotEquals']; } } /** * @dataProvider owaspJSRecommendedEscapeRangeProvider */ - public function testJavascriptEscapingEscapesOwaspRecommendedRanges(string $value, string $assertion): void + public function testJavascriptEscapingEscapesOwaspRecommendedRanges(int $codepoint, string $assertion): void { - $this->$assertion($value, $this->escaper->escapeJs($value)); + $literal = $this->codepointToUtf8($codepoint); + + $this->$assertion($literal, $this->escaper->escapeJs($literal)); } public function testHtmlAttributeEscapingEscapesOwaspRecommendedRanges(): void @@ -419,30 +421,34 @@ public function testHtmlAttributeEscapingEscapesOwaspRecommendedRanges(): void } } - /** @psalm-return iterable */ + /** @psalm-return array */ public function owaspCSSRecommendedEscapeRangeProvider(): iterable { + $providerData = []; + for ($chr = 0; $chr < 0xFF; $chr++) { if ( $chr >= 0x30 && $chr <= 0x39 || $chr >= 0x41 && $chr <= 0x5A || $chr >= 0x61 && $chr <= 0x7A ) { - $literal = $this->codepointToUtf8($chr); - yield $literal => [$literal, 'assertEquals']; + $providerData[$chr] = [$chr, 'assertEquals']; continue; } - $literal = $this->codepointToUtf8($chr); - yield $literal => [$literal, 'assertNotEquals']; + $providerData[$chr] = [$chr, 'assertNotEquals']; } + + return $providerData; } /** * @dataProvider owaspCSSRecommendedEscapeRangeProvider */ - public function testCssEscapingEscapesOwaspRecommendedRanges(string $value, string $assertion): void + public function testCssEscapingEscapesOwaspRecommendedRanges(int $codePoint, string $assertion): void { - $this->$assertion($value, $this->escaper->escapeCss($value)); + $literal = $this->codepointToUtf8($codePoint); + + $this->$assertion($literal, $this->escaper->escapeCss($literal)); } } From 863f5c9267265d52301a1dcb4e04cfff965615d0 Mon Sep 17 00:00:00 2001 From: George Steel Date: Tue, 8 Mar 2022 14:25:38 +0000 Subject: [PATCH 08/14] Fix remaining psalm errors and update baseline Signed-off-by: George Steel --- psalm-baseline.xml | 13 +------------ psalm.xml | 1 + src/Escaper.php | 28 +++++++++++++++++++++------- test/EscaperTest.php | 20 ++++++++++---------- 4 files changed, 33 insertions(+), 29 deletions(-) diff --git a/psalm-baseline.xml b/psalm-baseline.xml index 6928717a..956e90d2 100644 --- a/psalm-baseline.xml +++ b/psalm-baseline.xml @@ -1,13 +1,2 @@ - - - - - array<string, array{0: string, 1: string}> - array<string, array{0: string, 1: string}> - array<string, array{0: string, 1: string}> - array<string, array{0: string, 1: string}> - array<string, array{0: string}> - - - + diff --git a/psalm.xml b/psalm.xml index 8d4c90ff..776bdf6a 100644 --- a/psalm.xml +++ b/psalm.xml @@ -4,6 +4,7 @@ xmlns="https://getpsalm.org/schema/config" xsi:schemaLocation="https://getpsalm.org/schema/config vendor/vimeo/psalm/config.xsd" errorBaseline="psalm-baseline.xml" + errorLevel="1" > diff --git a/src/Escaper.php b/src/Escaper.php index 4d3c1190..def46440 100644 --- a/src/Escaper.php +++ b/src/Escaper.php @@ -36,7 +36,7 @@ class Escaper * entities that XML supports. Using HTML entities would result in this error: * XML Parsing Error: undefined entity * - * @var array + * @var array */ protected static $htmlNamedEntityMap = [ 34 => 'quot', // quotation mark @@ -65,6 +65,7 @@ class Escaper * Static Matcher which escapes characters for HTML Attribute contexts * * @var callable + * @psalm-var callable(array):string */ protected $htmlAttrMatcher; @@ -72,6 +73,7 @@ class Escaper * Static Matcher which escapes characters for Javascript contexts * * @var callable + * @psalm-var callable(array):string */ protected $jsMatcher; @@ -79,6 +81,7 @@ class Escaper * Static Matcher which escapes characters for CSS Attribute contexts * * @var callable + * @psalm-var callable(array):string */ protected $cssMatcher; @@ -154,9 +157,20 @@ public function __construct(?string $encoding = null) $this->htmlSpecialCharsFlags = ENT_QUOTES | ENT_SUBSTITUTE; // set matcher callbacks - $this->htmlAttrMatcher = [$this, 'htmlAttrMatcher']; - $this->jsMatcher = [$this, 'jsMatcher']; - $this->cssMatcher = [$this, 'cssMatcher']; + + $this->htmlAttrMatcher = function (array $matches): string { + /** @psalm-var list $matches */ + return $this->htmlAttrMatcher($matches); + }; + + $this->jsMatcher = function (array $matches): string { + /** @psalm-var list $matches */ + return $this->jsMatcher($matches); + }; + $this->cssMatcher = function (array $matches): string { + /** @psalm-var list $matches */ + return $this->cssMatcher($matches); + }; } /** @@ -253,7 +267,7 @@ public function escapeCss(string $string) * Callback function for preg_replace_callback that applies HTML Attribute * escaping to all matches. * - * @param array $matches + * @param list $matches * @return string */ protected function htmlAttrMatcher($matches) @@ -300,7 +314,7 @@ protected function htmlAttrMatcher($matches) * Callback function for preg_replace_callback that applies Javascript * escaping to all matches. * - * @param array $matches + * @param list $matches * @return string */ protected function jsMatcher($matches) @@ -323,7 +337,7 @@ protected function jsMatcher($matches) * Callback function for preg_replace_callback that applies CSS * escaping to all matches. * - * @param array $matches + * @param list $matches * @return string */ protected function cssMatcher($matches) diff --git a/test/EscaperTest.php b/test/EscaperTest.php index d58e2afc..effce9c7 100644 --- a/test/EscaperTest.php +++ b/test/EscaperTest.php @@ -29,7 +29,7 @@ public function testSettingEncodingToEmptyStringShouldThrowException(): void new Escaper(''); } - /** @psalm-return array */ + /** @return array */ public function supportedEncodingsProvider(): array { return [ @@ -90,7 +90,7 @@ public function testReturnsEncodingFromGetter(): void $this->assertEquals('utf-8', $this->escaper->getEncoding()); } - /** @psalm-return array */ + /** @return array */ public function htmlSpecialCharsProvider(): array { return [ @@ -110,7 +110,7 @@ public function testHtmlEscapingConvertsSpecialChars(string $string, string $enc $this->assertEquals($encoded, $this->escaper->escapeHtml($string), 'Failed to escape: ' . $string); } - /** @psalm-return array */ + /** @return array */ public function htmlAttrSpecialCharsProvider(): array { return [ @@ -159,7 +159,7 @@ public function testHtmlAttributeEscapingConvertsSpecialChars(string $string, st $this->assertEquals($encoded, $this->escaper->escapeHtmlAttr($string), 'Failed to escape: ' . $string); } - /** @psalm-return array */ + /** @return array */ public function jsSpecialCharsProvider(): array { return [ @@ -177,7 +177,7 @@ public function jsSpecialCharsProvider(): array ',' => [',', ','], '.' => ['.', '.'], '_' => ['_', '_'], - /* Basic alnums exluded */ + /* Basic alnums excluded */ 'a' => ['a', 'a'], 'A' => ['A', 'A'], 'z' => ['z', 'z'], @@ -212,7 +212,7 @@ public function testJavascriptEscapingReturnsStringIfContainsOnlyDigits(): void $this->assertEquals('123', $this->escaper->escapeJs('123')); } - /** @psalm-return array */ + /** @return array */ public function cssSpecialCharsProvider(): array { return [ @@ -265,7 +265,7 @@ public function testCssEscapingReturnsStringIfContainsOnlyDigits(): void $this->assertEquals('123', $this->escaper->escapeCss('123')); } - /** @psalm-return array */ + /** @return array */ public function urlSpecialCharsProvider(): array { return [ @@ -361,7 +361,7 @@ protected function codepointToUtf8(int $codepoint): string throw new Exception('Codepoint requested outside of Unicode range'); } - /** @psalm-return Generator */ + /** @return Generator */ public function owaspJSRecommendedEscapeRangeProvider(): Generator { $immune = [',', '.', '_']; // Exceptions to escaping ranges @@ -421,8 +421,8 @@ public function testHtmlAttributeEscapingEscapesOwaspRecommendedRanges(): void } } - /** @psalm-return array */ - public function owaspCSSRecommendedEscapeRangeProvider(): iterable + /** @return array */ + public function owaspCSSRecommendedEscapeRangeProvider(): array { $providerData = []; From 7384651ba82db847d6f6c53cd6d5055561b2bb01 Mon Sep 17 00:00:00 2001 From: George Steel Date: Tue, 8 Mar 2022 14:27:49 +0000 Subject: [PATCH 09/14] Update .gitattributes to ignore dot-files and remove coveralls config Signed-off-by: George Steel --- .coveralls.yml | 2 -- .gitattributes | 14 +++++++++----- 2 files changed, 9 insertions(+), 7 deletions(-) delete mode 100644 .coveralls.yml diff --git a/.coveralls.yml b/.coveralls.yml deleted file mode 100644 index bc71b62f..00000000 --- a/.coveralls.yml +++ /dev/null @@ -1,2 +0,0 @@ -coverage_clover: clover.xml -json_path: coveralls-upload.json diff --git a/.gitattributes b/.gitattributes index af3dc9d0..0aab29a3 100644 --- a/.gitattributes +++ b/.gitattributes @@ -1,9 +1,13 @@ -/.coveralls.yml export-ignore +/.gitignore export-ignore +/.laminas-ci.json export-ignore +/composer-require-checker.json export-ignore +/infection.json.dist export-ignore +/phpcs.xml.dist export-ignore /.gitattributes export-ignore +/phpunit.xml.dist export-ignore +/psalm.xml export-ignore +/psalm-baseline.xml export-ignore +/mkdocs.yml export-ignore /.github/ export-ignore -/.gitignore export-ignore /docs/ export-ignore -/mkdocs.yml export-ignore -/phpcs.xml export-ignore -/phpunit.xml.dist export-ignore /test/ export-ignore From 30bbffb78ebc26aeca963be9c55aabb0709f9d74 Mon Sep 17 00:00:00 2001 From: George Steel Date: Tue, 8 Mar 2022 14:30:37 +0000 Subject: [PATCH 10/14] Remove irrelevant exclusions Signed-off-by: George Steel --- infection.json.dist | 4 ---- 1 file changed, 4 deletions(-) diff --git a/infection.json.dist b/infection.json.dist index 1655ee63..d8642982 100644 --- a/infection.json.dist +++ b/infection.json.dist @@ -2,10 +2,6 @@ "source": { "directories": [ "src" - ], - "excludes": [ - "test/**/*.php", - "vendor/**/*.php" ] }, "logs": { From 2d3454609b53d363166cd88ea1e20f2c2c66aece Mon Sep 17 00:00:00 2001 From: George Steel Date: Tue, 8 Mar 2022 14:43:02 +0000 Subject: [PATCH 11/14] Print infection logs to stdout and GitHub actions format Signed-off-by: George Steel --- infection.json.dist | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/infection.json.dist b/infection.json.dist index d8642982..d3edc927 100644 --- a/infection.json.dist +++ b/infection.json.dist @@ -5,7 +5,8 @@ ] }, "logs": { - "text": "infection.log" + "text": "php://stderr", + "github": true }, "mutators": { "@default": true From 898b7d1d891148121caad160c7971c0e250c4a46 Mon Sep 17 00:00:00 2001 From: George Steel Date: Tue, 8 Mar 2022 19:22:21 +0000 Subject: [PATCH 12/14] Revert function wrappers for psalm. Not required when types align correctly Signed-off-by: George Steel --- src/Escaper.php | 23 ++++++----------------- 1 file changed, 6 insertions(+), 17 deletions(-) diff --git a/src/Escaper.php b/src/Escaper.php index def46440..d6a02e14 100644 --- a/src/Escaper.php +++ b/src/Escaper.php @@ -157,20 +157,9 @@ public function __construct(?string $encoding = null) $this->htmlSpecialCharsFlags = ENT_QUOTES | ENT_SUBSTITUTE; // set matcher callbacks - - $this->htmlAttrMatcher = function (array $matches): string { - /** @psalm-var list $matches */ - return $this->htmlAttrMatcher($matches); - }; - - $this->jsMatcher = function (array $matches): string { - /** @psalm-var list $matches */ - return $this->jsMatcher($matches); - }; - $this->cssMatcher = function (array $matches): string { - /** @psalm-var list $matches */ - return $this->cssMatcher($matches); - }; + $this->htmlAttrMatcher = [$this, 'htmlAttrMatcher']; + $this->jsMatcher = [$this, 'jsMatcher']; + $this->cssMatcher = [$this, 'cssMatcher']; } /** @@ -267,7 +256,7 @@ public function escapeCss(string $string) * Callback function for preg_replace_callback that applies HTML Attribute * escaping to all matches. * - * @param list $matches + * @param array $matches * @return string */ protected function htmlAttrMatcher($matches) @@ -314,7 +303,7 @@ protected function htmlAttrMatcher($matches) * Callback function for preg_replace_callback that applies Javascript * escaping to all matches. * - * @param list $matches + * @param array $matches * @return string */ protected function jsMatcher($matches) @@ -337,7 +326,7 @@ protected function jsMatcher($matches) * Callback function for preg_replace_callback that applies CSS * escaping to all matches. * - * @param list $matches + * @param array $matches * @return string */ protected function cssMatcher($matches) From 01c382a18fa5638b9735d7c1007d2c4a524fb234 Mon Sep 17 00:00:00 2001 From: George Steel Date: Tue, 8 Mar 2022 19:23:57 +0000 Subject: [PATCH 13/14] Add stryker report config for infection Signed-off-by: George Steel --- infection.json.dist | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/infection.json.dist b/infection.json.dist index d3edc927..2684b215 100644 --- a/infection.json.dist +++ b/infection.json.dist @@ -6,7 +6,10 @@ }, "logs": { "text": "php://stderr", - "github": true + "github": true, + "stryker": { + "report": "/^\\d+\\.\\d+\\.x$/" + } }, "mutators": { "@default": true From 85ce59af3193d89d855d4f465fae210936006196 Mon Sep 17 00:00:00 2001 From: George Steel Date: Tue, 8 Mar 2022 19:34:01 +0000 Subject: [PATCH 14/14] Fix markdown lint errors for CI. Remove coverage badge Signed-off-by: George Steel --- README.md | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/README.md b/README.md index 7f735138..23832082 100644 --- a/README.md +++ b/README.md @@ -1,22 +1,21 @@ # laminas-escaper [![Build Status](https://github.com/laminas/laminas-escaper/actions/workflows/continuous-integration.yml/badge.svg)](https://github.com/laminas/laminas-escaper/actions/workflows/continuous-integration.yml) -[![Coverage Status](https://coveralls.io/repos/github/laminas/laminas-escaper/badge.svg?branch=master)](https://coveralls.io/github/laminas/laminas-escaper?branch=master) > ## 🇷🇺 Русским гражданам -> +> > Мы, участники Laminas, родились и живем в разных странах. У многих из нас есть друзья, родственники и коллеги как в России, так и в Украине. Некоторые из нас родились в России. Некоторые из нас живут в России. У некоторых бабушки и дедушки сражались с фашистами во Второй мировой войне. Здесь никто не поддерживает фашизм. -> +> > У одного из нас есть украинская родственница, которая спаслась из дома вместе с сыном. Поезд задержался из-за бомбежки на дороге впереди. У нас есть друзья, которые прячутся в бомбоубежищах. Мы с тревогой ждем весточки от них после воздушных налетов, которые беспорядочно наносят удары и попадают по больницам, школам, детским садам и домам. Мы не берем это из каких-либо СМИ. Мы наблюдаем это напрямую. -> +> > Вы доверяете нам достаточно, чтоб использовать наши программы, и мы просим вас довериться нам вновь. Мы нуждаемся в помощи. Выходите и протестуйте против этой бесполезной войны. Остановите кровопролитие. Скажите "Нет войне!" -> +> > ## 🇺🇸 To Citizens of Russia -> +> > We at Laminas come from all over the world. Many of us have friends, family and colleagues in both Russia and Ukraine. Some of us were born in Russia. Some of us currently live in Russia. Some have grandparents who fought Nazis in World War II. Nobody here supports fascism. -> +> > One team member has a Ukrainian relative who fled her home with her son. The train was delayed due to bombing on the road ahead. We have friends who are hiding in bomb shelters. We anxiously follow up on them after the air raids, which indiscriminately fire at hospitals, schools, kindergartens and houses. We're not taking this from any media. These are our actual experiences. -> +> > You trust us enough to use our software. We ask that you trust us to say the truth on this. We need your help. Go out and protest this unnecessary war. Stop the bloodshed. Say "stop the war!" The OWASP Top 10 web security risks study lists Cross-Site Scripting (XSS) in