diff --git a/rules/CodingStyle/Application/UseImportsAdder.php b/rules/CodingStyle/Application/UseImportsAdder.php index 019e5bbae99..323c0a6de16 100644 --- a/rules/CodingStyle/Application/UseImportsAdder.php +++ b/rules/CodingStyle/Application/UseImportsAdder.php @@ -7,6 +7,7 @@ use RectorPrefix202407\Nette\Utils\Strings; use PhpParser\Node\Name; use PhpParser\Node\Stmt; use PhpParser\Node\Stmt\Declare_; +use PhpParser\Node\Stmt\GroupUse; use PhpParser\Node\Stmt\Namespace_; use PhpParser\Node\Stmt\Nop; use PhpParser\Node\Stmt\Use_; @@ -56,23 +57,28 @@ final class UseImportsAdder } // place after declare strict_types foreach ($stmts as $key => $stmt) { - if ($stmt instanceof Declare_) { - if (isset($stmts[$key + 1]) && $stmts[$key + 1] instanceof Use_) { - $nodesToAdd = $newUses; - } else { - // add extra space, if there are no new use imports to be added - $nodesToAdd = \array_merge([new Nop()], $newUses); - } - $this->mirrorUseComments($stmts, $newUses, $key + 1); - \array_splice($stmts, $key + 1, 0, $nodesToAdd); - $fileWithoutNamespace->stmts = $stmts; - $fileWithoutNamespace->stmts = \array_values($fileWithoutNamespace->stmts); - return [$fileWithoutNamespace]; + // maybe just added a space + if ($stmt instanceof Nop) { + continue; } + // when we found a non-declare, directly stop + if (!$stmt instanceof Declare_) { + break; + } + $nodesToAdd = \array_merge([new Nop()], $newUses); + $this->mirrorUseComments($stmts, $newUses, $key + 1); + // remove space before next use tweak + if (isset($stmts[$key + 1]) && ($stmts[$key + 1] instanceof Use_ || $stmts[$key + 1] instanceof GroupUse)) { + $stmts[$key + 1]->setAttribute(AttributeKey::ORIGINAL_NODE, null); + } + \array_splice($stmts, $key + 1, 0, $nodesToAdd); + $fileWithoutNamespace->stmts = $stmts; + $fileWithoutNamespace->stmts = \array_values($fileWithoutNamespace->stmts); + return [$fileWithoutNamespace]; } $this->mirrorUseComments($stmts, $newUses); // make use stmts first - $fileWithoutNamespace->stmts = \array_merge($newUses, $stmts); + $fileWithoutNamespace->stmts = \array_merge($newUses, $this->resolveInsertNop($fileWithoutNamespace), $stmts); $fileWithoutNamespace->stmts = \array_values($fileWithoutNamespace->stmts); return [$fileWithoutNamespace]; } @@ -97,9 +103,21 @@ final class UseImportsAdder return; } $this->mirrorUseComments($namespace->stmts, $newUses); - $namespace->stmts = \array_merge($newUses, $namespace->stmts); + $namespace->stmts = \array_merge($newUses, $this->resolveInsertNop($namespace), $namespace->stmts); $namespace->stmts = \array_values($namespace->stmts); } + /** + * @return Nop[] + * @param \Rector\PhpParser\Node\CustomNode\FileWithoutNamespace|\PhpParser\Node\Stmt\Namespace_ $namespace + */ + private function resolveInsertNop($namespace) : array + { + $currentStmt = $namespace->stmts[0] ?? null; + if (!$currentStmt instanceof Stmt || $currentStmt instanceof Use_ || $currentStmt instanceof GroupUse) { + return []; + } + return [new Nop()]; + } /** * @param Stmt[] $stmts * @param Use_[] $newUses diff --git a/src/Application/VersionResolver.php b/src/Application/VersionResolver.php index bddbfa70b8b..51d24f71c6a 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 = 'ac3d2f6bb311bfaddc484f2839119469a571b1a9'; + public const PACKAGE_VERSION = '7d6b6ed95f9c6c4731a0915f9624ec342548de65'; /** * @api * @var string */ - public const RELEASE_DATE = '2024-07-26 10:32:17'; + public const RELEASE_DATE = '2024-07-27 09:36:17'; /** * @var int */ diff --git a/vendor/composer/installed.json b/vendor/composer/installed.json index 419660ecf67..e9001dbadc7 100644 --- a/vendor/composer/installed.json +++ b/vendor/composer/installed.json @@ -512,17 +512,17 @@ }, { "name": "illuminate\/container", - "version": "v11.18.0", - "version_normalized": "11.18.0.0", + "version": "v11.18.1", + "version_normalized": "11.18.1.0", "source": { "type": "git", "url": "https:\/\/github.com\/illuminate\/container.git", - "reference": "c3c2713c66d120bf42865e831cfcef6ed9e10db2" + "reference": "122c62229b209678013c0833793d7cf94d14bbbd" }, "dist": { "type": "zip", - "url": "https:\/\/api.github.com\/repos\/illuminate\/container\/zipball\/c3c2713c66d120bf42865e831cfcef6ed9e10db2", - "reference": "c3c2713c66d120bf42865e831cfcef6ed9e10db2", + "url": "https:\/\/api.github.com\/repos\/illuminate\/container\/zipball\/122c62229b209678013c0833793d7cf94d14bbbd", + "reference": "122c62229b209678013c0833793d7cf94d14bbbd", "shasum": "" }, "require": { @@ -533,7 +533,7 @@ "provide": { "psr\/container-implementation": "1.1|2.0" }, - "time": "2024-07-18T15:50:24+00:00", + "time": "2024-07-26T06:12:27+00:00", "type": "library", "extra": { "branch-alias": { @@ -569,8 +569,8 @@ }, { "name": "illuminate\/contracts", - "version": "v11.18.0", - "version_normalized": "11.18.0.0", + "version": "v11.18.1", + "version_normalized": "11.18.1.0", "source": { "type": "git", "url": "https:\/\/github.com\/illuminate\/contracts.git", @@ -1466,34 +1466,34 @@ }, { "name": "react\/socket", - "version": "v1.15.0", - "version_normalized": "1.15.0.0", + "version": "v1.16.0", + "version_normalized": "1.16.0.0", "source": { "type": "git", "url": "https:\/\/github.com\/reactphp\/socket.git", - "reference": "216d3aec0b87f04a40ca04f481e6af01bdd1d038" + "reference": "23e4ff33ea3e160d2d1f59a0e6050e4b0fb0eac1" }, "dist": { "type": "zip", - "url": "https:\/\/api.github.com\/repos\/reactphp\/socket\/zipball\/216d3aec0b87f04a40ca04f481e6af01bdd1d038", - "reference": "216d3aec0b87f04a40ca04f481e6af01bdd1d038", + "url": "https:\/\/api.github.com\/repos\/reactphp\/socket\/zipball\/23e4ff33ea3e160d2d1f59a0e6050e4b0fb0eac1", + "reference": "23e4ff33ea3e160d2d1f59a0e6050e4b0fb0eac1", "shasum": "" }, "require": { "evenement\/evenement": "^3.0 || ^2.0 || ^1.0", "php": ">=5.3.0", - "react\/dns": "^1.11", + "react\/dns": "^1.13", "react\/event-loop": "^1.2", - "react\/promise": "^3 || ^2.6 || ^1.2.1", - "react\/stream": "^1.2" + "react\/promise": "^3.2 || ^2.6 || ^1.2.1", + "react\/stream": "^1.4" }, "require-dev": { "phpunit\/phpunit": "^9.6 || ^5.7 || ^4.8.36", - "react\/async": "^4 || ^3 || ^2", + "react\/async": "^4.3 || ^3.3 || ^2", "react\/promise-stream": "^1.4", - "react\/promise-timer": "^1.10" + "react\/promise-timer": "^1.11" }, - "time": "2023-12-15T11:02:10+00:00", + "time": "2024-07-26T10:38:09+00:00", "type": "library", "installation-source": "dist", "autoload": { @@ -1537,7 +1537,7 @@ ], "support": { "issues": "https:\/\/github.com\/reactphp\/socket\/issues", - "source": "https:\/\/github.com\/reactphp\/socket\/tree\/v1.15.0" + "source": "https:\/\/github.com\/reactphp\/socket\/tree\/v1.16.0" }, "funding": [ { @@ -2007,17 +2007,17 @@ }, { "name": "symfony\/console", - "version": "v6.4.9", - "version_normalized": "6.4.9.0", + "version": "v6.4.10", + "version_normalized": "6.4.10.0", "source": { "type": "git", "url": "https:\/\/github.com\/symfony\/console.git", - "reference": "6edb5363ec0c78ad4d48c5128ebf4d083d89d3a9" + "reference": "504974cbe43d05f83b201d6498c206f16fc0cdbc" }, "dist": { "type": "zip", - "url": "https:\/\/api.github.com\/repos\/symfony\/console\/zipball\/6edb5363ec0c78ad4d48c5128ebf4d083d89d3a9", - "reference": "6edb5363ec0c78ad4d48c5128ebf4d083d89d3a9", + "url": "https:\/\/api.github.com\/repos\/symfony\/console\/zipball\/504974cbe43d05f83b201d6498c206f16fc0cdbc", + "reference": "504974cbe43d05f83b201d6498c206f16fc0cdbc", "shasum": "" }, "require": { @@ -2050,7 +2050,7 @@ "symfony\/stopwatch": "^5.4|^6.0|^7.0", "symfony\/var-dumper": "^5.4|^6.0|^7.0" }, - "time": "2024-06-28T09:49:33+00:00", + "time": "2024-07-26T12:30:32+00:00", "type": "library", "extra": { "patches_applied": [ @@ -2089,7 +2089,7 @@ "terminal" ], "support": { - "source": "https:\/\/github.com\/symfony\/console\/tree\/v6.4.9" + "source": "https:\/\/github.com\/symfony\/console\/tree\/v6.4.10" }, "funding": [ { @@ -2248,17 +2248,17 @@ }, { "name": "symfony\/finder", - "version": "v6.4.8", - "version_normalized": "6.4.8.0", + "version": "v6.4.10", + "version_normalized": "6.4.10.0", "source": { "type": "git", "url": "https:\/\/github.com\/symfony\/finder.git", - "reference": "3ef977a43883215d560a2cecb82ec8e62131471c" + "reference": "af29198d87112bebdd397bd7735fbd115997824c" }, "dist": { "type": "zip", - "url": "https:\/\/api.github.com\/repos\/symfony\/finder\/zipball\/3ef977a43883215d560a2cecb82ec8e62131471c", - "reference": "3ef977a43883215d560a2cecb82ec8e62131471c", + "url": "https:\/\/api.github.com\/repos\/symfony\/finder\/zipball\/af29198d87112bebdd397bd7735fbd115997824c", + "reference": "af29198d87112bebdd397bd7735fbd115997824c", "shasum": "" }, "require": { @@ -2267,7 +2267,7 @@ "require-dev": { "symfony\/filesystem": "^6.0|^7.0" }, - "time": "2024-05-31T14:49:08+00:00", + "time": "2024-07-24T07:06:38+00:00", "type": "library", "installation-source": "dist", "autoload": { @@ -2295,7 +2295,7 @@ "description": "Finds files and directories via an intuitive fluent interface", "homepage": "https:\/\/symfony.com", "support": { - "source": "https:\/\/github.com\/symfony\/finder\/tree\/v6.4.8" + "source": "https:\/\/github.com\/symfony\/finder\/tree\/v6.4.10" }, "funding": [ { diff --git a/vendor/composer/installed.php b/vendor/composer/installed.php index c0b9b92c954..1809ff9ac5e 100644 --- a/vendor/composer/installed.php +++ b/vendor/composer/installed.php @@ -2,4 +2,4 @@ namespace RectorPrefix202407; -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.2.0', 'version' => '3.2.0.0', 'reference' => 'ea4ab6f9580a4fd221e0418f2c357cdd39102a90', 'type' => 'library', 'install_path' => __DIR__ . '/./pcre', 'aliases' => array(), 'dev_requirement' => \false), 'composer/semver' => array('pretty_version' => '3.4.2', 'version' => '3.4.2.0', 'reference' => 'c51258e759afdb17f1fd1fe83bc12baaef6309d6', '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' => 'v11.18.0', 'version' => '11.18.0.0', 'reference' => 'c3c2713c66d120bf42865e831cfcef6ed9e10db2', 'type' => 'library', 'install_path' => __DIR__ . '/../illuminate/container', 'aliases' => array(), 'dev_requirement' => \false), 'illuminate/contracts' => array('pretty_version' => 'v11.18.0', 'version' => '11.18.0.0', 'reference' => 'be935e9d9115a57be74d20176f43fa8a207029f3', '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.8')), '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.13.0', 'version' => '1.13.0.0', 'reference' => 'eb8ae001b5a455665c89c1df97f6fb682f8fb0f5', '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' => '3ba7adbca3491a977b81147d93eb78084ed8e454', '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' => 'c053b9795a81bb9fd5b8d59e05c7556f19267893', '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' => '887a20abd9394b296244ab1082b3cec02ac8498b', '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' => 'bff1daf9ef9fa9d0917607d2ad09a7cabd1ccb27', '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.9', 'version' => '6.4.9.0', 'reference' => '6edb5363ec0c78ad4d48c5128ebf4d083d89d3a9', '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.9', 'version' => '6.4.9.0', 'reference' => 'b51ef8059159330b74a4d52f68e671033c0fe463', '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.30.0', 'version' => '1.30.0.0', 'reference' => 'fd22ab50000ef01661e2a31d850ebaa297f8e03c', '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' => 'v7.1.1', 'version' => '7.1.1.0', 'reference' => 'fa34c77015aa6720469db7003567b9f772492bf2', '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.2.0', 'version' => '3.2.0.0', 'reference' => 'ea4ab6f9580a4fd221e0418f2c357cdd39102a90', 'type' => 'library', 'install_path' => __DIR__ . '/./pcre', 'aliases' => array(), 'dev_requirement' => \false), 'composer/semver' => array('pretty_version' => '3.4.2', 'version' => '3.4.2.0', 'reference' => 'c51258e759afdb17f1fd1fe83bc12baaef6309d6', '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' => 'v11.18.1', 'version' => '11.18.1.0', 'reference' => '122c62229b209678013c0833793d7cf94d14bbbd', 'type' => 'library', 'install_path' => __DIR__ . '/../illuminate/container', 'aliases' => array(), 'dev_requirement' => \false), 'illuminate/contracts' => array('pretty_version' => 'v11.18.1', 'version' => '11.18.1.0', 'reference' => 'be935e9d9115a57be74d20176f43fa8a207029f3', '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.8')), '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.13.0', 'version' => '1.13.0.0', 'reference' => 'eb8ae001b5a455665c89c1df97f6fb682f8fb0f5', '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.16.0', 'version' => '1.16.0.0', 'reference' => '23e4ff33ea3e160d2d1f59a0e6050e4b0fb0eac1', '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' => '3ba7adbca3491a977b81147d93eb78084ed8e454', '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' => 'c053b9795a81bb9fd5b8d59e05c7556f19267893', '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' => '887a20abd9394b296244ab1082b3cec02ac8498b', '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' => 'bff1daf9ef9fa9d0917607d2ad09a7cabd1ccb27', '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.10', 'version' => '6.4.10.0', 'reference' => '504974cbe43d05f83b201d6498c206f16fc0cdbc', '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.9', 'version' => '6.4.9.0', 'reference' => 'b51ef8059159330b74a4d52f68e671033c0fe463', 'type' => 'library', 'install_path' => __DIR__ . '/../symfony/filesystem', 'aliases' => array(), 'dev_requirement' => \false), 'symfony/finder' => array('pretty_version' => 'v6.4.10', 'version' => '6.4.10.0', 'reference' => 'af29198d87112bebdd397bd7735fbd115997824c', '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.30.0', 'version' => '1.30.0.0', 'reference' => 'fd22ab50000ef01661e2a31d850ebaa297f8e03c', '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' => 'v7.1.1', 'version' => '7.1.1.0', 'reference' => 'fa34c77015aa6720469db7003567b9f772492bf2', '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/illuminate/container/Container.php b/vendor/illuminate/container/Container.php index 58e0d2631fa..ae902a082f5 100755 --- a/vendor/illuminate/container/Container.php +++ b/vendor/illuminate/container/Container.php @@ -1159,8 +1159,11 @@ class Container implements ArrayAccess, ContainerContract protected function fireAfterResolvingAttributeCallbacks(array $attributes, $object) { foreach ($attributes as $attribute) { - if (\method_exists($instance = $attribute->newInstance(), 'after')) { - $instance->after($instance, $object, $this); + if (\is_a($attribute->getName(), ContextualAttribute::class, \true)) { + $instance = $attribute->newInstance(); + if (\method_exists($instance, 'after')) { + $instance->after($instance, $object, $this); + } } $callbacks = $this->getCallbacksForType($attribute->getName(), $object, $this->afterResolvingAttributeCallbacks); foreach ($callbacks as $callback) { diff --git a/vendor/react/socket/CHANGELOG.md b/vendor/react/socket/CHANGELOG.md index db178ca66ba..659560f5460 100644 --- a/vendor/react/socket/CHANGELOG.md +++ b/vendor/react/socket/CHANGELOG.md @@ -1,5 +1,10 @@ # Changelog +## 1.16.0 (2024-07-26) + +* Feature: Improve PHP 8.4+ support by avoiding implicitly nullable type declarations. + (#318 by @clue) + ## 1.15.0 (2023-12-15) * Feature: Full PHP 8.3 compatibility. diff --git a/vendor/react/socket/README.md b/vendor/react/socket/README.md index 18e3d9131d5..e77e6764591 100644 --- a/vendor/react/socket/README.md +++ b/vendor/react/socket/README.md @@ -1494,7 +1494,7 @@ This project follows [SemVer](https://semver.org/). This will install the latest supported version: ```bash -composer require react/socket:^1.15 +composer require react/socket:^1.16 ``` See also the [CHANGELOG](CHANGELOG.md) for details about version upgrades. diff --git a/vendor/react/socket/composer.json b/vendor/react/socket/composer.json index 1679ab7df87..07a5ef33d48 100644 --- a/vendor/react/socket/composer.json +++ b/vendor/react/socket/composer.json @@ -34,16 +34,16 @@ "require": { "php": ">=5.3.0", "evenement\/evenement": "^3.0 || ^2.0 || ^1.0", - "react\/dns": "^1.11", + "react\/dns": "^1.13", "react\/event-loop": "^1.2", - "react\/promise": "^3 || ^2.6 || ^1.2.1", - "react\/stream": "^1.2" + "react\/promise": "^3.2 || ^2.6 || ^1.2.1", + "react\/stream": "^1.4" }, "require-dev": { "phpunit\/phpunit": "^9.6 || ^5.7 || ^4.8.36", - "react\/async": "^4 || ^3 || ^2", + "react\/async": "^4.3 || ^3.3 || ^2", "react\/promise-stream": "^1.4", - "react\/promise-timer": "^1.10" + "react\/promise-timer": "^1.11" }, "autoload": { "psr-4": { diff --git a/vendor/react/socket/src/FdServer.php b/vendor/react/socket/src/FdServer.php index af3d1306866..4b5820baaf1 100644 --- a/vendor/react/socket/src/FdServer.php +++ b/vendor/react/socket/src/FdServer.php @@ -73,7 +73,7 @@ final class FdServer extends EventEmitter implements ServerInterface * @throws \InvalidArgumentException if the listening address is invalid * @throws \RuntimeException if listening on this address fails (already in use etc.) */ - public function __construct($fd, LoopInterface $loop = null) + public function __construct($fd, $loop = null) { if (\preg_match('#^php://fd/(\\d+)$#', $fd, $m)) { $fd = (int) $m[1]; @@ -81,6 +81,10 @@ final class FdServer extends EventEmitter implements ServerInterface if (!\is_int($fd) || $fd < 0 || $fd >= \PHP_INT_MAX) { throw new \InvalidArgumentException('Invalid FD number given (EINVAL)', \defined('SOCKET_EINVAL') ? \SOCKET_EINVAL : (\defined('PCNTL_EINVAL') ? \PCNTL_EINVAL : 22)); } + 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->loop = $loop ?: Loop::get(); $errno = 0; $errstr = ''; diff --git a/vendor/react/socket/src/HappyEyeBallsConnector.php b/vendor/react/socket/src/HappyEyeBallsConnector.php index 2160570abb3..7112e35aa08 100644 --- a/vendor/react/socket/src/HappyEyeBallsConnector.php +++ b/vendor/react/socket/src/HappyEyeBallsConnector.php @@ -11,15 +11,29 @@ final class HappyEyeBallsConnector implements ConnectorInterface private $loop; private $connector; private $resolver; - public function __construct(LoopInterface $loop = null, ConnectorInterface $connector = null, ResolverInterface $resolver = null) + /** + * @param ?LoopInterface $loop + * @param ConnectorInterface $connector + * @param ResolverInterface $resolver + */ + public function __construct($loop = null, $connector = null, $resolver = null) { // $connector and $resolver arguments are actually required, marked // optional for technical reasons only. Nullable $loop without default // requires PHP 7.1, null default is also supported in legacy PHP // versions, but required parameters are not allowed after arguments // with null default. Mark all parameters optional and check accordingly. - if ($connector === null || $resolver === null) { - throw new \InvalidArgumentException('Missing required $connector or $resolver argument'); + if ($loop !== null && !$loop instanceof LoopInterface) { + // manual type check to support legacy PHP < 7.1 + throw new \InvalidArgumentException('Argument #1 ($loop) expected null|React\\EventLoop\\LoopInterface'); + } + if (!$connector instanceof ConnectorInterface) { + // manual type check to support legacy PHP < 7.1 + throw new \InvalidArgumentException('Argument #2 ($connector) expected React\\Socket\\ConnectorInterface'); + } + if (!$resolver instanceof ResolverInterface) { + // manual type check to support legacy PHP < 7.1 + throw new \InvalidArgumentException('Argument #3 ($resolver) expected React\\Dns\\Resolver\\ResolverInterface'); } $this->loop = $loop ?: Loop::get(); $this->connector = $connector; diff --git a/vendor/react/socket/src/SecureConnector.php b/vendor/react/socket/src/SecureConnector.php index 8349db6539c..06f086e4846 100644 --- a/vendor/react/socket/src/SecureConnector.php +++ b/vendor/react/socket/src/SecureConnector.php @@ -13,8 +13,17 @@ final class SecureConnector implements ConnectorInterface private $connector; private $streamEncryption; private $context; - public function __construct(ConnectorInterface $connector, LoopInterface $loop = null, array $context = array()) + /** + * @param ConnectorInterface $connector + * @param ?LoopInterface $loop + * @param array $context + */ + public function __construct(ConnectorInterface $connector, $loop = null, array $context = array()) { + 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->connector = $connector; $this->streamEncryption = new StreamEncryption($loop ?: Loop::get(), \false); $this->context = $context; diff --git a/vendor/react/socket/src/SecureServer.php b/vendor/react/socket/src/SecureServer.php index d1948f9d4f4..37377a5e069 100644 --- a/vendor/react/socket/src/SecureServer.php +++ b/vendor/react/socket/src/SecureServer.php @@ -120,8 +120,12 @@ final class SecureServer extends EventEmitter implements ServerInterface * @see TcpServer * @link https://www.php.net/manual/en/context.ssl.php for TLS context options */ - public function __construct(ServerInterface $tcp, LoopInterface $loop = null, array $context = array()) + public function __construct(ServerInterface $tcp, $loop = null, array $context = array()) { + 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 (!\function_exists('stream_socket_enable_crypto')) { throw new \BadMethodCallException('Encryption not supported on your platform (HHVM < 3.8?)'); // @codeCoverageIgnore diff --git a/vendor/react/socket/src/Server.php b/vendor/react/socket/src/Server.php index 9520d82059d..26c5133d70d 100644 --- a/vendor/react/socket/src/Server.php +++ b/vendor/react/socket/src/Server.php @@ -41,14 +41,18 @@ final class Server extends EventEmitter implements ServerInterface * For BC reasons, you can also pass the TCP socket context options as a simple * array without wrapping this in another array under the `tcp` key. * - * @param string|int $uri - * @param LoopInterface $loop - * @param array $context + * @param string|int $uri + * @param ?LoopInterface $loop + * @param array $context * @deprecated 1.9.0 See `SocketServer` instead * @see SocketServer */ - public function __construct($uri, LoopInterface $loop = null, array $context = array()) + public function __construct($uri, $loop = null, array $context = array()) { + 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'); + } $loop = $loop ?: Loop::get(); // sanitize TCP context options if not properly wrapped if ($context && (!isset($context['tcp']) && !isset($context['tls']) && !isset($context['unix']))) { diff --git a/vendor/react/socket/src/SocketServer.php b/vendor/react/socket/src/SocketServer.php index 5b323805b2c..941d374771a 100644 --- a/vendor/react/socket/src/SocketServer.php +++ b/vendor/react/socket/src/SocketServer.php @@ -29,8 +29,12 @@ final class SocketServer extends EventEmitter implements ServerInterface * @throws \InvalidArgumentException if the listening address is invalid * @throws \RuntimeException if listening on this address fails (already in use etc.) */ - public function __construct($uri, array $context = array(), LoopInterface $loop = null) + public function __construct($uri, array $context = array(), $loop = null) { + if ($loop !== null && !$loop instanceof LoopInterface) { + // manual type check to support legacy PHP < 7.1 + throw new \InvalidArgumentException('Argument #3 ($loop) expected null|React\\EventLoop\\LoopInterface'); + } // apply default options if not explicitly given $context += array('tcp' => array(), 'tls' => array(), 'unix' => array()); $scheme = 'tcp'; diff --git a/vendor/react/socket/src/TcpConnector.php b/vendor/react/socket/src/TcpConnector.php index e3b02c4c7a9..16eb7b3ce2e 100644 --- a/vendor/react/socket/src/TcpConnector.php +++ b/vendor/react/socket/src/TcpConnector.php @@ -11,8 +11,16 @@ final class TcpConnector implements ConnectorInterface { private $loop; private $context; - public function __construct(LoopInterface $loop = null, array $context = array()) + /** + * @param ?LoopInterface $loop + * @param array $context + */ + public function __construct($loop = null, array $context = array()) { + if ($loop !== null && !$loop instanceof LoopInterface) { + // manual type check to support legacy PHP < 7.1 + throw new \InvalidArgumentException('Argument #1 ($loop) expected null|React\\EventLoop\\LoopInterface'); + } $this->loop = $loop ?: Loop::get(); $this->context = $context; } diff --git a/vendor/react/socket/src/TcpServer.php b/vendor/react/socket/src/TcpServer.php index 66fc83b3469..565b35665ec 100644 --- a/vendor/react/socket/src/TcpServer.php +++ b/vendor/react/socket/src/TcpServer.php @@ -126,8 +126,12 @@ final class TcpServer extends EventEmitter implements ServerInterface * @throws InvalidArgumentException if the listening address is invalid * @throws RuntimeException if listening on this address fails (already in use etc.) */ - public function __construct($uri, LoopInterface $loop = null, array $context = array()) + public function __construct($uri, $loop = null, array $context = array()) { + 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->loop = $loop ?: Loop::get(); // a single port has been given => assume localhost if ((string) (int) $uri === (string) $uri) { diff --git a/vendor/react/socket/src/TimeoutConnector.php b/vendor/react/socket/src/TimeoutConnector.php index 51cf5783bf6..ffbedd49800 100644 --- a/vendor/react/socket/src/TimeoutConnector.php +++ b/vendor/react/socket/src/TimeoutConnector.php @@ -10,8 +10,17 @@ final class TimeoutConnector implements ConnectorInterface private $connector; private $timeout; private $loop; - public function __construct(ConnectorInterface $connector, $timeout, LoopInterface $loop = null) + /** + * @param ConnectorInterface $connector + * @param float $timeout + * @param ?LoopInterface $loop + */ + public function __construct(ConnectorInterface $connector, $timeout, $loop = null) { + if ($loop !== null && !$loop instanceof LoopInterface) { + // manual type check to support legacy PHP < 7.1 + throw new \InvalidArgumentException('Argument #3 ($loop) expected null|React\\EventLoop\\LoopInterface'); + } $this->connector = $connector; $this->timeout = $timeout; $this->loop = $loop ?: Loop::get(); diff --git a/vendor/react/socket/src/UnixConnector.php b/vendor/react/socket/src/UnixConnector.php index 11e022526be..cbd09d66be7 100644 --- a/vendor/react/socket/src/UnixConnector.php +++ b/vendor/react/socket/src/UnixConnector.php @@ -16,8 +16,15 @@ use RuntimeException; final class UnixConnector implements ConnectorInterface { private $loop; - public function __construct(LoopInterface $loop = null) + /** + * @param ?LoopInterface $loop + */ + public function __construct($loop = null) { + if ($loop !== null && !$loop instanceof LoopInterface) { + // manual type check to support legacy PHP < 7.1 + throw new \InvalidArgumentException('Argument #1 ($loop) expected null|React\\EventLoop\\LoopInterface'); + } $this->loop = $loop ?: Loop::get(); } public function connect($path) diff --git a/vendor/react/socket/src/UnixServer.php b/vendor/react/socket/src/UnixServer.php index 20c59419399..50943670d77 100644 --- a/vendor/react/socket/src/UnixServer.php +++ b/vendor/react/socket/src/UnixServer.php @@ -48,8 +48,12 @@ final class UnixServer extends EventEmitter implements ServerInterface * @throws InvalidArgumentException if the listening address is invalid * @throws RuntimeException if listening on this address fails (already in use etc.) */ - public function __construct($path, LoopInterface $loop = null, array $context = array()) + public function __construct($path, $loop = null, array $context = array()) { + 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->loop = $loop ?: Loop::get(); if (\strpos($path, '://') === \false) { $path = 'unix://' . $path; diff --git a/vendor/symfony/console/Output/StreamOutput.php b/vendor/symfony/console/Output/StreamOutput.php index 791b2da967b..d9b7f3ecbd7 100644 --- a/vendor/symfony/console/Output/StreamOutput.php +++ b/vendor/symfony/console/Output/StreamOutput.php @@ -82,7 +82,7 @@ class StreamOutput extends Output protected function hasColorSupport() : bool { // Follow https://no-color.org/ - if (isset($_SERVER['NO_COLOR']) || \false !== \getenv('NO_COLOR')) { + if ('' !== ($_SERVER['NO_COLOR'] ?? \getenv('NO_COLOR') ?: '')) { return \false; } // Detect msysgit/mingw and assume this is a tty because detection