From 5b56f97fecca6d039faddb10c9d654d948c7d9ea Mon Sep 17 00:00:00 2001 From: Tomas Votruba Date: Tue, 11 Jun 2024 22:11:13 +0000 Subject: [PATCH] Updated Rector to commit 459843b1617a401d02e8cf5e6a1054f43f069f0d https://github.com/rectorphp/rector-src/commit/459843b1617a401d02e8cf5e6a1054f43f069f0d [DeadCode] Use PHPStan $functionReflection->hasSideEffects()->yes() early when possible on PureFunctionDetector (#5962) --- .../SideEffect/PureFunctionDetector.php | 5 +++++ src/Application/VersionResolver.php | 4 ++-- vendor/composer/installed.json | 16 ++++++++-------- vendor/composer/installed.php | 2 +- vendor/react/stream/CHANGELOG.md | 11 +++++++++++ vendor/react/stream/README.md | 2 +- vendor/react/stream/composer.json | 2 +- .../react/stream/src/DuplexResourceStream.php | 16 +++++++++++++++- .../react/stream/src/ReadableResourceStream.php | 11 ++++++++++- vendor/react/stream/src/ThroughStream.php | 17 ++++++++++------- .../react/stream/src/WritableResourceStream.php | 12 +++++++++++- 11 files changed, 75 insertions(+), 23 deletions(-) diff --git a/rules/DeadCode/SideEffect/PureFunctionDetector.php b/rules/DeadCode/SideEffect/PureFunctionDetector.php index 7ddedb83794..f5dd3273eb0 100644 --- a/rules/DeadCode/SideEffect/PureFunctionDetector.php +++ b/rules/DeadCode/SideEffect/PureFunctionDetector.php @@ -258,6 +258,11 @@ final class PureFunctionDetector if (!$functionReflection instanceof NativeFunctionReflection) { return \false; } + // use PHPStan first check + if ($functionReflection->hasSideEffects()->yes()) { + return \false; + } + // otherwise, use added defined here return !\in_array($funcCallName, self::IMPURE_FUNCTIONS, \true); } } diff --git a/src/Application/VersionResolver.php b/src/Application/VersionResolver.php index 0893f336a22..d053efb6674 100644 --- a/src/Application/VersionResolver.php +++ b/src/Application/VersionResolver.php @@ -19,12 +19,12 @@ final class VersionResolver * @api * @var string */ - public const PACKAGE_VERSION = '324bf249b01745819521490f3066f3a51a8f6249'; + public const PACKAGE_VERSION = '459843b1617a401d02e8cf5e6a1054f43f069f0d'; /** * @api * @var string */ - public const RELEASE_DATE = '2024-06-11 16:37:24'; + public const RELEASE_DATE = '2024-06-12 05:07:48'; /** * @var int */ diff --git a/vendor/composer/installed.json b/vendor/composer/installed.json index 5e1545bbcb1..219d0bb86a7 100644 --- a/vendor/composer/installed.json +++ b/vendor/composer/installed.json @@ -1541,17 +1541,17 @@ }, { "name": "react\/stream", - "version": "v1.3.0", - "version_normalized": "1.3.0.0", + "version": "v1.4.0", + "version_normalized": "1.4.0.0", "source": { "type": "git", "url": "https:\/\/github.com\/reactphp\/stream.git", - "reference": "6fbc9672905c7d5a885f2da2fc696f65840f4a66" + "reference": "1e5b0acb8fe55143b5b426817155190eb6f5b18d" }, "dist": { "type": "zip", - "url": "https:\/\/api.github.com\/repos\/reactphp\/stream\/zipball\/6fbc9672905c7d5a885f2da2fc696f65840f4a66", - "reference": "6fbc9672905c7d5a885f2da2fc696f65840f4a66", + "url": "https:\/\/api.github.com\/repos\/reactphp\/stream\/zipball\/1e5b0acb8fe55143b5b426817155190eb6f5b18d", + "reference": "1e5b0acb8fe55143b5b426817155190eb6f5b18d", "shasum": "" }, "require": { @@ -1561,9 +1561,9 @@ }, "require-dev": { "clue\/stream-filter": "~1.2", - "phpunit\/phpunit": "^9.5 || ^5.7 || ^4.8.35" + "phpunit\/phpunit": "^9.6 || ^5.7 || ^4.8.36" }, - "time": "2023-06-16T10:52:11+00:00", + "time": "2024-06-11T12:45:25+00:00", "type": "library", "installation-source": "dist", "autoload": { @@ -1610,7 +1610,7 @@ ], "support": { "issues": "https:\/\/github.com\/reactphp\/stream\/issues", - "source": "https:\/\/github.com\/reactphp\/stream\/tree\/v1.3.0" + "source": "https:\/\/github.com\/reactphp\/stream\/tree\/v1.4.0" }, "funding": [ { diff --git a/vendor/composer/installed.php b/vendor/composer/installed.php index 06f4887dc73..6ff7be0c1b5 100644 --- a/vendor/composer/installed.php +++ b/vendor/composer/installed.php @@ -2,4 +2,4 @@ namespace RectorPrefix202406; -return array('root' => array('name' => 'rector/rector-src', 'pretty_version' => 'dev-main', 'version' => 'dev-main', 'reference' => null, 'type' => 'library', 'install_path' => __DIR__ . '/../../', 'aliases' => array(), 'dev' => \false), 'versions' => array('clue/ndjson-react' => array('pretty_version' => 'v1.3.0', 'version' => '1.3.0.0', 'reference' => '392dc165fce93b5bb5c637b67e59619223c931b0', 'type' => 'library', 'install_path' => __DIR__ . '/../clue/ndjson-react', 'aliases' => array(), 'dev_requirement' => \false), 'composer/pcre' => array('pretty_version' => '3.1.4', 'version' => '3.1.4.0', 'reference' => '04229f163664973f68f38f6f73d917799168ef24', 'type' => 'library', 'install_path' => __DIR__ . '/./pcre', 'aliases' => array(), 'dev_requirement' => \false), 'composer/semver' => array('pretty_version' => '3.4.0', 'version' => '3.4.0.0', 'reference' => '35e8d0af4486141bc745f23a29cc2091eb624a32', 'type' => 'library', 'install_path' => __DIR__ . '/./semver', 'aliases' => array(), 'dev_requirement' => \false), 'composer/xdebug-handler' => array('pretty_version' => '3.0.5', 'version' => '3.0.5.0', 'reference' => '6c1925561632e83d60a44492e0b344cf48ab85ef', 'type' => 'library', 'install_path' => __DIR__ . '/./xdebug-handler', 'aliases' => array(), 'dev_requirement' => \false), 'doctrine/inflector' => array('pretty_version' => '2.0.10', 'version' => '2.0.10.0', 'reference' => '5817d0659c5b50c9b950feb9af7b9668e2c436bc', 'type' => 'library', 'install_path' => __DIR__ . '/../doctrine/inflector', 'aliases' => array(), 'dev_requirement' => \false), 'evenement/evenement' => array('pretty_version' => 'v3.0.2', 'version' => '3.0.2.0', 'reference' => '0a16b0d71ab13284339abb99d9d2bd813640efbc', 'type' => 'library', 'install_path' => __DIR__ . '/../evenement/evenement', 'aliases' => array(), 'dev_requirement' => \false), 'fidry/cpu-core-counter' => array('pretty_version' => '1.1.0', 'version' => '1.1.0.0', 'reference' => 'f92996c4d5c1a696a6a970e20f7c4216200fcc42', 'type' => 'library', 'install_path' => __DIR__ . '/../fidry/cpu-core-counter', 'aliases' => array(), 'dev_requirement' => \false), 'illuminate/container' => array('pretty_version' => 'v10.48.12', 'version' => '10.48.12.0', 'reference' => 'ddc26273085fad3c471b2602ad820e0097ff7939', 'type' => 'library', 'install_path' => __DIR__ . '/../illuminate/container', 'aliases' => array(), 'dev_requirement' => \false), 'illuminate/contracts' => array('pretty_version' => 'v10.48.12', 'version' => '10.48.12.0', 'reference' => '8d7152c4a1f5d9cf7da3e8b71f23e4556f6138ac', 'type' => 'library', 'install_path' => __DIR__ . '/../illuminate/contracts', 'aliases' => array(), 'dev_requirement' => \false), 'nette/utils' => array('pretty_version' => 'v4.0.4', 'version' => '4.0.4.0', 'reference' => 'd3ad0aa3b9f934602cb3e3902ebccf10be34d218', 'type' => 'library', 'install_path' => __DIR__ . '/../nette/utils', 'aliases' => array(), 'dev_requirement' => \false), 'nikic/php-parser' => array('pretty_version' => 'v4.19.1', 'version' => '4.19.1.0', 'reference' => '4e1b88d21c69391150ace211e9eaf05810858d0b', 'type' => 'library', 'install_path' => __DIR__ . '/../nikic/php-parser', 'aliases' => array(), 'dev_requirement' => \false), 'ondram/ci-detector' => array('pretty_version' => '4.2.0', 'version' => '4.2.0.0', 'reference' => '8b0223b5ed235fd377c75fdd1bfcad05c0f168b8', 'type' => 'library', 'install_path' => __DIR__ . '/../ondram/ci-detector', 'aliases' => array(), 'dev_requirement' => \false), 'phpstan/phpdoc-parser' => array('pretty_version' => '1.29.1', 'version' => '1.29.1.0', 'reference' => 'fcaefacf2d5c417e928405b71b400d4ce10daaf4', 'type' => 'library', 'install_path' => __DIR__ . '/../phpstan/phpdoc-parser', 'aliases' => array(), 'dev_requirement' => \false), 'phpstan/phpstan' => array('dev_requirement' => \false, 'replaced' => array(0 => '^1.11')), 'psr/container' => array('pretty_version' => '2.0.2', 'version' => '2.0.2.0', 'reference' => 'c71ecc56dfe541dbd90c5360474fbc405f8d5963', 'type' => 'library', 'install_path' => __DIR__ . '/../psr/container', 'aliases' => array(), 'dev_requirement' => \false), 'psr/container-implementation' => array('dev_requirement' => \false, 'provided' => array(0 => '1.1|2.0')), 'psr/log' => array('pretty_version' => '3.0.0', 'version' => '3.0.0.0', 'reference' => 'fe5ea303b0887d5caefd3d431c3e61ad47037001', 'type' => 'library', 'install_path' => __DIR__ . '/../psr/log', 'aliases' => array(), 'dev_requirement' => \false), 'psr/log-implementation' => array('dev_requirement' => \false, 'provided' => array(0 => '1.0|2.0|3.0')), 'psr/simple-cache' => array('pretty_version' => '3.0.0', 'version' => '3.0.0.0', 'reference' => '764e0b3939f5ca87cb904f570ef9be2d78a07865', 'type' => 'library', 'install_path' => __DIR__ . '/../psr/simple-cache', 'aliases' => array(), 'dev_requirement' => \false), 'react/cache' => array('pretty_version' => 'v1.2.0', 'version' => '1.2.0.0', 'reference' => 'd47c472b64aa5608225f47965a484b75c7817d5b', 'type' => 'library', 'install_path' => __DIR__ . '/../react/cache', 'aliases' => array(), 'dev_requirement' => \false), 'react/child-process' => array('pretty_version' => 'v0.6.5', 'version' => '0.6.5.0', 'reference' => 'e71eb1aa55f057c7a4a0d08d06b0b0a484bead43', 'type' => 'library', 'install_path' => __DIR__ . '/../react/child-process', 'aliases' => array(), 'dev_requirement' => \false), 'react/dns' => array('pretty_version' => 'v1.12.0', 'version' => '1.12.0.0', 'reference' => 'c134600642fa615b46b41237ef243daa65bb64ec', 'type' => 'library', 'install_path' => __DIR__ . '/../react/dns', 'aliases' => array(), 'dev_requirement' => \false), 'react/event-loop' => array('pretty_version' => 'v1.5.0', 'version' => '1.5.0.0', 'reference' => 'bbe0bd8c51ffc05ee43f1729087ed3bdf7d53354', 'type' => 'library', 'install_path' => __DIR__ . '/../react/event-loop', 'aliases' => array(), 'dev_requirement' => \false), 'react/promise' => array('pretty_version' => 'v3.2.0', 'version' => '3.2.0.0', 'reference' => '8a164643313c71354582dc850b42b33fa12a4b63', 'type' => 'library', 'install_path' => __DIR__ . '/../react/promise', 'aliases' => array(), 'dev_requirement' => \false), 'react/socket' => array('pretty_version' => 'v1.15.0', 'version' => '1.15.0.0', 'reference' => '216d3aec0b87f04a40ca04f481e6af01bdd1d038', 'type' => 'library', 'install_path' => __DIR__ . '/../react/socket', 'aliases' => array(), 'dev_requirement' => \false), 'react/stream' => array('pretty_version' => 'v1.3.0', 'version' => '1.3.0.0', 'reference' => '6fbc9672905c7d5a885f2da2fc696f65840f4a66', 'type' => 'library', 'install_path' => __DIR__ . '/../react/stream', 'aliases' => array(), 'dev_requirement' => \false), 'rector/extension-installer' => array('pretty_version' => '0.11.2', 'version' => '0.11.2.0', 'reference' => '05544e9b195863b8571ae2a3b903cbec7fa062e0', 'type' => 'composer-plugin', 'install_path' => __DIR__ . '/../rector/extension-installer', 'aliases' => array(), 'dev_requirement' => \false), 'rector/rector' => array('dev_requirement' => \false, 'replaced' => array(0 => 'dev-main')), 'rector/rector-doctrine' => array('pretty_version' => 'dev-main', 'version' => 'dev-main', 'reference' => '6eb8de836a52701d15ab3fd020052a1843fad992', 'type' => 'rector-extension', 'install_path' => __DIR__ . '/../rector/rector-doctrine', 'aliases' => array(0 => '9999999-dev'), 'dev_requirement' => \false), 'rector/rector-downgrade-php' => array('pretty_version' => 'dev-main', 'version' => 'dev-main', 'reference' => 'efef745bb033afb891455bf13ed2f519fe70ef6e', 'type' => 'rector-extension', 'install_path' => __DIR__ . '/../rector/rector-downgrade-php', 'aliases' => array(0 => '9999999-dev'), 'dev_requirement' => \false), 'rector/rector-phpunit' => array('pretty_version' => 'dev-main', 'version' => 'dev-main', 'reference' => '6816002a8c3f7b9b5773f8c59d00bdf29956f86c', 'type' => 'rector-extension', 'install_path' => __DIR__ . '/../rector/rector-phpunit', 'aliases' => array(0 => '0.11.x-dev'), 'dev_requirement' => \false), 'rector/rector-src' => array('pretty_version' => 'dev-main', 'version' => 'dev-main', 'reference' => null, 'type' => 'library', 'install_path' => __DIR__ . '/../../', 'aliases' => array(), 'dev_requirement' => \false), 'rector/rector-symfony' => array('pretty_version' => 'dev-main', 'version' => 'dev-main', 'reference' => '9596a9185373995023b6dab5b3f95f14a2c6626f', 'type' => 'rector-extension', 'install_path' => __DIR__ . '/../rector/rector-symfony', 'aliases' => array(0 => '9999999-dev'), 'dev_requirement' => \false), 'sebastian/diff' => array('pretty_version' => '5.1.1', 'version' => '5.1.1.0', 'reference' => 'c41e007b4b62af48218231d6c2275e4c9b975b2e', 'type' => 'library', 'install_path' => __DIR__ . '/../sebastian/diff', 'aliases' => array(), 'dev_requirement' => \false), 'symfony/console' => array('pretty_version' => 'v6.4.8', 'version' => '6.4.8.0', 'reference' => 'be5854cee0e8c7b110f00d695d11debdfa1a2a91', 'type' => 'library', 'install_path' => __DIR__ . '/../symfony/console', 'aliases' => array(), 'dev_requirement' => \false), 'symfony/deprecation-contracts' => array('pretty_version' => 'v3.5.0', 'version' => '3.5.0.0', 'reference' => '0e0d29ce1f20deffb4ab1b016a7257c4f1e789a1', 'type' => 'library', 'install_path' => __DIR__ . '/../symfony/deprecation-contracts', 'aliases' => array(), 'dev_requirement' => \false), 'symfony/filesystem' => array('pretty_version' => 'v6.4.8', 'version' => '6.4.8.0', 'reference' => '4d37529150e7081c51b3c5d5718c55a04a9503f3', 'type' => 'library', 'install_path' => __DIR__ . '/../symfony/filesystem', 'aliases' => array(), 'dev_requirement' => \false), 'symfony/finder' => array('pretty_version' => 'v6.4.8', 'version' => '6.4.8.0', 'reference' => '3ef977a43883215d560a2cecb82ec8e62131471c', 'type' => 'library', 'install_path' => __DIR__ . '/../symfony/finder', 'aliases' => array(), 'dev_requirement' => \false), 'symfony/polyfill-ctype' => array('dev_requirement' => \false, 'replaced' => array(0 => '*')), 'symfony/polyfill-intl-grapheme' => array('dev_requirement' => \false, 'replaced' => array(0 => '*')), 'symfony/polyfill-mbstring' => array('pretty_version' => 'v1.29.0', 'version' => '1.29.0.0', 'reference' => '9773676c8a1bb1f8d4340a62efe641cf76eda7ec', 'type' => 'library', 'install_path' => __DIR__ . '/../symfony/polyfill-mbstring', 'aliases' => array(), 'dev_requirement' => \false), 'symfony/process' => array('pretty_version' => 'v6.4.8', 'version' => '6.4.8.0', 'reference' => '8d92dd79149f29e89ee0f480254db595f6a6a2c5', 'type' => 'library', 'install_path' => __DIR__ . '/../symfony/process', 'aliases' => array(), 'dev_requirement' => \false), 'symfony/service-contracts' => array('pretty_version' => 'v3.5.0', 'version' => '3.5.0.0', 'reference' => 'bd1d9e59a81d8fa4acdcea3f617c581f7475a80f', 'type' => 'library', 'install_path' => __DIR__ . '/../symfony/service-contracts', 'aliases' => array(), 'dev_requirement' => \false), 'symfony/string' => array('dev_requirement' => \false, 'replaced' => array(0 => '*')), 'symfony/yaml' => array('pretty_version' => 'v6.4.8', 'version' => '6.4.8.0', 'reference' => '52903de178d542850f6f341ba92995d3d63e60c9', 'type' => 'library', 'install_path' => __DIR__ . '/../symfony/yaml', 'aliases' => array(), 'dev_requirement' => \false), 'symplify/easy-parallel' => array('pretty_version' => '11.2.2', 'version' => '11.2.2.0', 'reference' => '8586c18bb8efb31cd192a4e5cc94ae7813f72ed9', 'type' => 'library', 'install_path' => __DIR__ . '/../symplify/easy-parallel', 'aliases' => array(), 'dev_requirement' => \false), 'symplify/rule-doc-generator-contracts' => array('pretty_version' => '11.2.0', 'version' => '11.2.0.0', 'reference' => '479cfcfd46047f80624aba931d9789e50475b5c6', 'type' => 'library', 'install_path' => __DIR__ . '/../symplify/rule-doc-generator-contracts', 'aliases' => array(), 'dev_requirement' => \false), 'webmozart/assert' => array('pretty_version' => '1.11.0', 'version' => '1.11.0.0', 'reference' => '11cb2199493b2f8a3b53e7f19068fc6aac760991', 'type' => 'library', 'install_path' => __DIR__ . '/../webmozart/assert', 'aliases' => array(), 'dev_requirement' => \false))); +return array('root' => array('name' => 'rector/rector-src', 'pretty_version' => 'dev-main', 'version' => 'dev-main', 'reference' => null, 'type' => 'library', 'install_path' => __DIR__ . '/../../', 'aliases' => array(), 'dev' => \false), 'versions' => array('clue/ndjson-react' => array('pretty_version' => 'v1.3.0', 'version' => '1.3.0.0', 'reference' => '392dc165fce93b5bb5c637b67e59619223c931b0', 'type' => 'library', 'install_path' => __DIR__ . '/../clue/ndjson-react', 'aliases' => array(), 'dev_requirement' => \false), 'composer/pcre' => array('pretty_version' => '3.1.4', 'version' => '3.1.4.0', 'reference' => '04229f163664973f68f38f6f73d917799168ef24', 'type' => 'library', 'install_path' => __DIR__ . '/./pcre', 'aliases' => array(), 'dev_requirement' => \false), 'composer/semver' => array('pretty_version' => '3.4.0', 'version' => '3.4.0.0', 'reference' => '35e8d0af4486141bc745f23a29cc2091eb624a32', 'type' => 'library', 'install_path' => __DIR__ . '/./semver', 'aliases' => array(), 'dev_requirement' => \false), 'composer/xdebug-handler' => array('pretty_version' => '3.0.5', 'version' => '3.0.5.0', 'reference' => '6c1925561632e83d60a44492e0b344cf48ab85ef', 'type' => 'library', 'install_path' => __DIR__ . '/./xdebug-handler', 'aliases' => array(), 'dev_requirement' => \false), 'doctrine/inflector' => array('pretty_version' => '2.0.10', 'version' => '2.0.10.0', 'reference' => '5817d0659c5b50c9b950feb9af7b9668e2c436bc', 'type' => 'library', 'install_path' => __DIR__ . '/../doctrine/inflector', 'aliases' => array(), 'dev_requirement' => \false), 'evenement/evenement' => array('pretty_version' => 'v3.0.2', 'version' => '3.0.2.0', 'reference' => '0a16b0d71ab13284339abb99d9d2bd813640efbc', 'type' => 'library', 'install_path' => __DIR__ . '/../evenement/evenement', 'aliases' => array(), 'dev_requirement' => \false), 'fidry/cpu-core-counter' => array('pretty_version' => '1.1.0', 'version' => '1.1.0.0', 'reference' => 'f92996c4d5c1a696a6a970e20f7c4216200fcc42', 'type' => 'library', 'install_path' => __DIR__ . '/../fidry/cpu-core-counter', 'aliases' => array(), 'dev_requirement' => \false), 'illuminate/container' => array('pretty_version' => 'v10.48.12', 'version' => '10.48.12.0', 'reference' => 'ddc26273085fad3c471b2602ad820e0097ff7939', 'type' => 'library', 'install_path' => __DIR__ . '/../illuminate/container', 'aliases' => array(), 'dev_requirement' => \false), 'illuminate/contracts' => array('pretty_version' => 'v10.48.12', 'version' => '10.48.12.0', 'reference' => '8d7152c4a1f5d9cf7da3e8b71f23e4556f6138ac', 'type' => 'library', 'install_path' => __DIR__ . '/../illuminate/contracts', 'aliases' => array(), 'dev_requirement' => \false), 'nette/utils' => array('pretty_version' => 'v4.0.4', 'version' => '4.0.4.0', 'reference' => 'd3ad0aa3b9f934602cb3e3902ebccf10be34d218', 'type' => 'library', 'install_path' => __DIR__ . '/../nette/utils', 'aliases' => array(), 'dev_requirement' => \false), 'nikic/php-parser' => array('pretty_version' => 'v4.19.1', 'version' => '4.19.1.0', 'reference' => '4e1b88d21c69391150ace211e9eaf05810858d0b', 'type' => 'library', 'install_path' => __DIR__ . '/../nikic/php-parser', 'aliases' => array(), 'dev_requirement' => \false), 'ondram/ci-detector' => array('pretty_version' => '4.2.0', 'version' => '4.2.0.0', 'reference' => '8b0223b5ed235fd377c75fdd1bfcad05c0f168b8', 'type' => 'library', 'install_path' => __DIR__ . '/../ondram/ci-detector', 'aliases' => array(), 'dev_requirement' => \false), 'phpstan/phpdoc-parser' => array('pretty_version' => '1.29.1', 'version' => '1.29.1.0', 'reference' => 'fcaefacf2d5c417e928405b71b400d4ce10daaf4', 'type' => 'library', 'install_path' => __DIR__ . '/../phpstan/phpdoc-parser', 'aliases' => array(), 'dev_requirement' => \false), 'phpstan/phpstan' => array('dev_requirement' => \false, 'replaced' => array(0 => '^1.11')), 'psr/container' => array('pretty_version' => '2.0.2', 'version' => '2.0.2.0', 'reference' => 'c71ecc56dfe541dbd90c5360474fbc405f8d5963', 'type' => 'library', 'install_path' => __DIR__ . '/../psr/container', 'aliases' => array(), 'dev_requirement' => \false), 'psr/container-implementation' => array('dev_requirement' => \false, 'provided' => array(0 => '1.1|2.0')), 'psr/log' => array('pretty_version' => '3.0.0', 'version' => '3.0.0.0', 'reference' => 'fe5ea303b0887d5caefd3d431c3e61ad47037001', 'type' => 'library', 'install_path' => __DIR__ . '/../psr/log', 'aliases' => array(), 'dev_requirement' => \false), 'psr/log-implementation' => array('dev_requirement' => \false, 'provided' => array(0 => '1.0|2.0|3.0')), 'psr/simple-cache' => array('pretty_version' => '3.0.0', 'version' => '3.0.0.0', 'reference' => '764e0b3939f5ca87cb904f570ef9be2d78a07865', 'type' => 'library', 'install_path' => __DIR__ . '/../psr/simple-cache', 'aliases' => array(), 'dev_requirement' => \false), 'react/cache' => array('pretty_version' => 'v1.2.0', 'version' => '1.2.0.0', 'reference' => 'd47c472b64aa5608225f47965a484b75c7817d5b', 'type' => 'library', 'install_path' => __DIR__ . '/../react/cache', 'aliases' => array(), 'dev_requirement' => \false), 'react/child-process' => array('pretty_version' => 'v0.6.5', 'version' => '0.6.5.0', 'reference' => 'e71eb1aa55f057c7a4a0d08d06b0b0a484bead43', 'type' => 'library', 'install_path' => __DIR__ . '/../react/child-process', 'aliases' => array(), 'dev_requirement' => \false), 'react/dns' => array('pretty_version' => 'v1.12.0', 'version' => '1.12.0.0', 'reference' => 'c134600642fa615b46b41237ef243daa65bb64ec', 'type' => 'library', 'install_path' => __DIR__ . '/../react/dns', 'aliases' => array(), 'dev_requirement' => \false), 'react/event-loop' => array('pretty_version' => 'v1.5.0', 'version' => '1.5.0.0', 'reference' => 'bbe0bd8c51ffc05ee43f1729087ed3bdf7d53354', 'type' => 'library', 'install_path' => __DIR__ . '/../react/event-loop', 'aliases' => array(), 'dev_requirement' => \false), 'react/promise' => array('pretty_version' => 'v3.2.0', 'version' => '3.2.0.0', 'reference' => '8a164643313c71354582dc850b42b33fa12a4b63', 'type' => 'library', 'install_path' => __DIR__ . '/../react/promise', 'aliases' => array(), 'dev_requirement' => \false), 'react/socket' => array('pretty_version' => 'v1.15.0', 'version' => '1.15.0.0', 'reference' => '216d3aec0b87f04a40ca04f481e6af01bdd1d038', 'type' => 'library', 'install_path' => __DIR__ . '/../react/socket', 'aliases' => array(), 'dev_requirement' => \false), 'react/stream' => array('pretty_version' => 'v1.4.0', 'version' => '1.4.0.0', 'reference' => '1e5b0acb8fe55143b5b426817155190eb6f5b18d', 'type' => 'library', 'install_path' => __DIR__ . '/../react/stream', 'aliases' => array(), 'dev_requirement' => \false), 'rector/extension-installer' => array('pretty_version' => '0.11.2', 'version' => '0.11.2.0', 'reference' => '05544e9b195863b8571ae2a3b903cbec7fa062e0', 'type' => 'composer-plugin', 'install_path' => __DIR__ . '/../rector/extension-installer', 'aliases' => array(), 'dev_requirement' => \false), 'rector/rector' => array('dev_requirement' => \false, 'replaced' => array(0 => 'dev-main')), 'rector/rector-doctrine' => array('pretty_version' => 'dev-main', 'version' => 'dev-main', 'reference' => '6eb8de836a52701d15ab3fd020052a1843fad992', 'type' => 'rector-extension', 'install_path' => __DIR__ . '/../rector/rector-doctrine', 'aliases' => array(0 => '9999999-dev'), 'dev_requirement' => \false), 'rector/rector-downgrade-php' => array('pretty_version' => 'dev-main', 'version' => 'dev-main', 'reference' => 'efef745bb033afb891455bf13ed2f519fe70ef6e', 'type' => 'rector-extension', 'install_path' => __DIR__ . '/../rector/rector-downgrade-php', 'aliases' => array(0 => '9999999-dev'), 'dev_requirement' => \false), 'rector/rector-phpunit' => array('pretty_version' => 'dev-main', 'version' => 'dev-main', 'reference' => '6816002a8c3f7b9b5773f8c59d00bdf29956f86c', 'type' => 'rector-extension', 'install_path' => __DIR__ . '/../rector/rector-phpunit', 'aliases' => array(0 => '0.11.x-dev'), 'dev_requirement' => \false), 'rector/rector-src' => array('pretty_version' => 'dev-main', 'version' => 'dev-main', 'reference' => null, 'type' => 'library', 'install_path' => __DIR__ . '/../../', 'aliases' => array(), 'dev_requirement' => \false), 'rector/rector-symfony' => array('pretty_version' => 'dev-main', 'version' => 'dev-main', 'reference' => '9596a9185373995023b6dab5b3f95f14a2c6626f', 'type' => 'rector-extension', 'install_path' => __DIR__ . '/../rector/rector-symfony', 'aliases' => array(0 => '9999999-dev'), 'dev_requirement' => \false), 'sebastian/diff' => array('pretty_version' => '5.1.1', 'version' => '5.1.1.0', 'reference' => 'c41e007b4b62af48218231d6c2275e4c9b975b2e', 'type' => 'library', 'install_path' => __DIR__ . '/../sebastian/diff', 'aliases' => array(), 'dev_requirement' => \false), 'symfony/console' => array('pretty_version' => 'v6.4.8', 'version' => '6.4.8.0', 'reference' => 'be5854cee0e8c7b110f00d695d11debdfa1a2a91', 'type' => 'library', 'install_path' => __DIR__ . '/../symfony/console', 'aliases' => array(), 'dev_requirement' => \false), 'symfony/deprecation-contracts' => array('pretty_version' => 'v3.5.0', 'version' => '3.5.0.0', 'reference' => '0e0d29ce1f20deffb4ab1b016a7257c4f1e789a1', 'type' => 'library', 'install_path' => __DIR__ . '/../symfony/deprecation-contracts', 'aliases' => array(), 'dev_requirement' => \false), 'symfony/filesystem' => array('pretty_version' => 'v6.4.8', 'version' => '6.4.8.0', 'reference' => '4d37529150e7081c51b3c5d5718c55a04a9503f3', 'type' => 'library', 'install_path' => __DIR__ . '/../symfony/filesystem', 'aliases' => array(), 'dev_requirement' => \false), 'symfony/finder' => array('pretty_version' => 'v6.4.8', 'version' => '6.4.8.0', 'reference' => '3ef977a43883215d560a2cecb82ec8e62131471c', 'type' => 'library', 'install_path' => __DIR__ . '/../symfony/finder', 'aliases' => array(), 'dev_requirement' => \false), 'symfony/polyfill-ctype' => array('dev_requirement' => \false, 'replaced' => array(0 => '*')), 'symfony/polyfill-intl-grapheme' => array('dev_requirement' => \false, 'replaced' => array(0 => '*')), 'symfony/polyfill-mbstring' => array('pretty_version' => 'v1.29.0', 'version' => '1.29.0.0', 'reference' => '9773676c8a1bb1f8d4340a62efe641cf76eda7ec', 'type' => 'library', 'install_path' => __DIR__ . '/../symfony/polyfill-mbstring', 'aliases' => array(), 'dev_requirement' => \false), 'symfony/process' => array('pretty_version' => 'v6.4.8', 'version' => '6.4.8.0', 'reference' => '8d92dd79149f29e89ee0f480254db595f6a6a2c5', 'type' => 'library', 'install_path' => __DIR__ . '/../symfony/process', 'aliases' => array(), 'dev_requirement' => \false), 'symfony/service-contracts' => array('pretty_version' => 'v3.5.0', 'version' => '3.5.0.0', 'reference' => 'bd1d9e59a81d8fa4acdcea3f617c581f7475a80f', 'type' => 'library', 'install_path' => __DIR__ . '/../symfony/service-contracts', 'aliases' => array(), 'dev_requirement' => \false), 'symfony/string' => array('dev_requirement' => \false, 'replaced' => array(0 => '*')), 'symfony/yaml' => array('pretty_version' => 'v6.4.8', 'version' => '6.4.8.0', 'reference' => '52903de178d542850f6f341ba92995d3d63e60c9', 'type' => 'library', 'install_path' => __DIR__ . '/../symfony/yaml', 'aliases' => array(), 'dev_requirement' => \false), 'symplify/easy-parallel' => array('pretty_version' => '11.2.2', 'version' => '11.2.2.0', 'reference' => '8586c18bb8efb31cd192a4e5cc94ae7813f72ed9', 'type' => 'library', 'install_path' => __DIR__ . '/../symplify/easy-parallel', 'aliases' => array(), 'dev_requirement' => \false), 'symplify/rule-doc-generator-contracts' => array('pretty_version' => '11.2.0', 'version' => '11.2.0.0', 'reference' => '479cfcfd46047f80624aba931d9789e50475b5c6', 'type' => 'library', 'install_path' => __DIR__ . '/../symplify/rule-doc-generator-contracts', 'aliases' => array(), 'dev_requirement' => \false), 'webmozart/assert' => array('pretty_version' => '1.11.0', 'version' => '1.11.0.0', 'reference' => '11cb2199493b2f8a3b53e7f19068fc6aac760991', 'type' => 'library', 'install_path' => __DIR__ . '/../webmozart/assert', 'aliases' => array(), 'dev_requirement' => \false))); diff --git a/vendor/react/stream/CHANGELOG.md b/vendor/react/stream/CHANGELOG.md index b4e230710ce..639db65857b 100644 --- a/vendor/react/stream/CHANGELOG.md +++ b/vendor/react/stream/CHANGELOG.md @@ -1,5 +1,16 @@ # Changelog +## 1.4.0 (2024-06-11) + +* Feature: Improve PHP 8.4+ support by avoiding implicitly nullable type declarations. + (#179 by @clue) + +* Feature: Full PHP 8.3 compatibility. + (#172 by @clue) + +* Fix: Fix `drain` event of `ThroughStream` to handle potential race condition. + (#171 by @clue) + ## 1.3.0 (2023-06-16) * Feature: Full PHP 8.1 and PHP 8.2 compatibility. diff --git a/vendor/react/stream/README.md b/vendor/react/stream/README.md index 2bfcbbe8c28..9c0468a659f 100644 --- a/vendor/react/stream/README.md +++ b/vendor/react/stream/README.md @@ -1203,7 +1203,7 @@ This project follows [SemVer](https://semver.org/). This will install the latest supported version: ```bash -composer require react/stream:^1.3 +composer require react/stream:^1.4 ``` See also the [CHANGELOG](CHANGELOG.md) for details about version upgrades. diff --git a/vendor/react/stream/composer.json b/vendor/react/stream/composer.json index 48545049c41..92e1605ac84 100644 --- a/vendor/react/stream/composer.json +++ b/vendor/react/stream/composer.json @@ -40,7 +40,7 @@ "evenement\/evenement": "^3.0 || ^2.0 || ^1.0" }, "require-dev": { - "phpunit\/phpunit": "^9.5 || ^5.7 || ^4.8.35", + "phpunit\/phpunit": "^9.6 || ^5.7 || ^4.8.36", "clue\/stream-filter": "~1.2" }, "autoload": { diff --git a/vendor/react/stream/src/DuplexResourceStream.php b/vendor/react/stream/src/DuplexResourceStream.php index 6a09e17421c..f7d1acded9a 100644 --- a/vendor/react/stream/src/DuplexResourceStream.php +++ b/vendor/react/stream/src/DuplexResourceStream.php @@ -33,7 +33,13 @@ final class DuplexResourceStream extends EventEmitter implements DuplexStreamInt private $writable = \true; private $closing = \false; private $listening = \false; - public function __construct($stream, LoopInterface $loop = null, $readChunkSize = null, WritableStreamInterface $buffer = null) + /** + * @param resource $stream + * @param ?LoopInterface $loop + * @param ?int $readChunkSize + * @param ?WritableStreamInterface $buffer + */ + public function __construct($stream, $loop = null, $readChunkSize = null, $buffer = null) { if (!\is_resource($stream) || \get_resource_type($stream) !== "stream") { throw new InvalidArgumentException('First parameter must be a valid stream resource'); @@ -48,6 +54,14 @@ final class DuplexResourceStream extends EventEmitter implements DuplexStreamInt if ($buffer !== null && !$buffer instanceof WritableResourceStream && \stream_set_blocking($stream, \false) !== \true) { throw new \RuntimeException('Unable to set stream resource to non-blocking mode'); } + if ($loop !== null && !$loop instanceof LoopInterface) { + // manual type check to support legacy PHP < 7.1 + throw new \InvalidArgumentException('Argument #2 ($loop) expected null|React\\EventLoop\\LoopInterface'); + } + if ($buffer !== null && !$buffer instanceof WritableStreamInterface) { + // manual type check to support legacy PHP < 7.1 + throw new \InvalidArgumentException('Argument #4 ($buffer) expected null|React\\Stream\\WritableStreamInterface'); + } // Use unbuffered read operations on the underlying stream resource. // Reading chunks from the stream may otherwise leave unread bytes in // PHP's stream buffers which some event loop implementations do not diff --git a/vendor/react/stream/src/ReadableResourceStream.php b/vendor/react/stream/src/ReadableResourceStream.php index 724613b10c3..a68dffb1208 100644 --- a/vendor/react/stream/src/ReadableResourceStream.php +++ b/vendor/react/stream/src/ReadableResourceStream.php @@ -35,7 +35,12 @@ final class ReadableResourceStream extends EventEmitter implements ReadableStrea private $bufferSize; private $closed = \false; private $listening = \false; - public function __construct($stream, LoopInterface $loop = null, $readChunkSize = null) + /** + * @param resource $stream + * @param ?LoopInterface $loop + * @param ?int $readChunkSize + */ + public function __construct($stream, $loop = null, $readChunkSize = null) { if (!\is_resource($stream) || \get_resource_type($stream) !== "stream") { throw new InvalidArgumentException('First parameter must be a valid stream resource'); @@ -50,6 +55,10 @@ final class ReadableResourceStream extends EventEmitter implements ReadableStrea if (\stream_set_blocking($stream, \false) !== \true) { throw new \RuntimeException('Unable to set stream resource to non-blocking mode'); } + if ($loop !== null && !$loop instanceof LoopInterface) { + // manual type check to support legacy PHP < 7.1 + throw new \InvalidArgumentException('Argument #2 ($loop) expected null|React\\EventLoop\\LoopInterface'); + } // Use unbuffered read operations on the underlying stream resource. // Reading chunks from the stream may otherwise leave unread bytes in // PHP's stream buffers which some event loop implementations do not diff --git a/vendor/react/stream/src/ThroughStream.php b/vendor/react/stream/src/ThroughStream.php index 1dd91b58cb8..473ffaee9fc 100644 --- a/vendor/react/stream/src/ThroughStream.php +++ b/vendor/react/stream/src/ThroughStream.php @@ -89,15 +89,17 @@ final class ThroughStream extends EventEmitter implements DuplexStreamInterface } public function pause() { - $this->paused = \true; + // only allow pause if still readable, false otherwise + $this->paused = $this->readable; } public function resume() { + $this->paused = \false; + // emit drain event if previous write was paused (throttled) if ($this->drain) { $this->drain = \false; $this->emit('drain'); } - $this->paused = \false; } public function pipe(WritableStreamInterface $dest, array $options = array()) { @@ -126,11 +128,12 @@ final class ThroughStream extends EventEmitter implements DuplexStreamInterface } } $this->emit('data', array($data)); + // emit drain event on next resume if currently paused (throttled) if ($this->paused) { $this->drain = \true; - return \false; } - return \true; + // continue writing if still writable and not paused (throttled), false otherwise + return $this->writable && !$this->paused; } public function end($data = null) { @@ -146,7 +149,7 @@ final class ThroughStream extends EventEmitter implements DuplexStreamInterface } $this->readable = \false; $this->writable = \false; - $this->paused = \true; + $this->paused = \false; $this->drain = \false; $this->emit('end'); $this->close(); @@ -158,9 +161,9 @@ final class ThroughStream extends EventEmitter implements DuplexStreamInterface } $this->readable = \false; $this->writable = \false; - $this->closed = \true; - $this->paused = \true; + $this->paused = \false; $this->drain = \false; + $this->closed = \true; $this->callback = null; $this->emit('close'); $this->removeAllListeners(); diff --git a/vendor/react/stream/src/WritableResourceStream.php b/vendor/react/stream/src/WritableResourceStream.php index 7ee5b110e89..3f98d3a17d2 100644 --- a/vendor/react/stream/src/WritableResourceStream.php +++ b/vendor/react/stream/src/WritableResourceStream.php @@ -22,7 +22,13 @@ final class WritableResourceStream extends EventEmitter implements WritableStrea private $writable = \true; private $closed = \false; private $data = ''; - public function __construct($stream, LoopInterface $loop = null, $writeBufferSoftLimit = null, $writeChunkSize = null) + /** + * @param resource $stream + * @param ?LoopInterface $loop + * @param ?int $writeBufferSoftLimit + * @param ?int $writeChunkSize + */ + public function __construct($stream, $loop = null, $writeBufferSoftLimit = null, $writeChunkSize = null) { if (!\is_resource($stream) || \get_resource_type($stream) !== "stream") { throw new \InvalidArgumentException('First parameter must be a valid stream resource'); @@ -37,6 +43,10 @@ final class WritableResourceStream extends EventEmitter implements WritableStrea if (\stream_set_blocking($stream, \false) !== \true) { throw new \RuntimeException('Unable to set stream resource to non-blocking mode'); } + if ($loop !== null && !$loop instanceof LoopInterface) { + // manual type check to support legacy PHP < 7.1 + throw new \InvalidArgumentException('Argument #2 ($loop) expected null|React\\EventLoop\\LoopInterface'); + } $this->stream = $stream; $this->loop = $loop ?: Loop::get(); $this->softLimit = $writeBufferSoftLimit === null ? 65536 : (int) $writeBufferSoftLimit;